• Resolved Davood Denavi

    (@binarywc)


    Line 162 of redirects.php needs to be changed to:

    $post_id = (int) $wpdb->get_var( $wpdb->prepare('SELECT post_id FROM '.$wpdb->prefix.'bie_redirects WHERE blogger_permalink = CONCAT(2, %s)', $path_without_slash) );

    else the redirects feature coughs up five errors, three of which refer to line 170 of redirect.php when really as mentioned above the problem is on line 162.

    Thought you should know.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author pipdig

    (@pipdig)

    Hi @binarywc, thanks for getting in touch about this.

    I’m happy to update this line if needed, however I’m not sure why it would need to concatenate “2” into the permalink.

    I’m not seeing any errors relating to this at our end. What is the error message displayed in your logs? Also, which version of PHP?

    Thanks!

    Thread Starter Davood Denavi

    (@binarywc)

    As I described we were getting errors saying that there was a problem with line 170….
    For some reason the SQL is not pulling the full permalink and the first two is being excluded.

    Unfortunately, I can not get the errors for at least a few days since it is not my site and I was helping the person who’s site it is over a zoom conference so I do not have access. I am not sure what version of PHP the server was on either. I do know it was hosted on BlueHost so I’d imagine 7.3 since to my knowledge they are good about keeping their php versions recent and secure. I can get you this info next time I work with the person but it may not be a until next week.

    I can tell you that the leading 2 was being cut off of the results in the SQL query you run.

    My advice would be to test it in multiple environments and look closely at the code with the redirect option enabled.

    • This reply was modified 4 years, 8 months ago by Davood Denavi.
    Thread Starter Davood Denavi

    (@binarywc)

    I’ll also add that the problem could actually be that you need to use $path instead of $path_without_slash on lines 162 and/or 170, but I did not have a chance to test this I thought of it later.

    $path = parse_url($url, PHP_URL_PATH);
    $path_without_slash = substr($path, 1);
    Plugin Author pipdig

    (@pipdig)

    Hi @binarywc,

    As I described we were getting errors saying that there was a problem with line 170….

    It will help if we can check the error message itself. Are you seeing it on screen or only in the error log file on the server?

    I’ll also add that the problem could actually be that you need to use $path instead of $path_without_slash

    I don’t think this will be the cause of the issue since the paths are stored without slashes in the database.

    [redacted]

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @pipdig I’ve deleted your offer to login to your user’s site and/or hosting. While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    Thankfully are other ways to get information you need:

    You get the idea.

    We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.

    When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves. That’s how we get the next generation of developers.

    Thread Starter Davood Denavi

    (@binarywc)

    Maybe you have not encountered any issues with this before because there are not many people using the feature. I promise you the error exists. The two errors that referenced line 170 actually do not matter as they were warnings and would have been ignored if the sql query was not cutting off the leading two.

    I have been working with wordpress for over ten years. I would suggest you do some thorough testing of your code because the SQL query is not working.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    *Reads*

    @pipdig I have archived your reply and your account will remain on moderation watch.

    It was explained to you not to ask for back end access, do not attempt to walk around that by offering off forum contact. Help your user here. This isn’t hard to understand and you do get it.

    If you feel this is a step too far then please consider contacting the plugins tea, (you have their email address) and ask them to close your plugins on this site. You are not forced to host code on this site. But if you do, you have to comply with the forum guidelines.

    Plugin Author pipdig

    (@pipdig)

    @jdembowski, I think Davood is a paying customer so I am trying to help him as best we can. This seems to comply with Steve Stern’s comment above, apologies if that is not the case. I was also aware that we should not provide support for the paid versions of plugins on the community forum, so I was signposting to our private support site to avoid that.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    @binarywc Please let me know if you require any help with this issue. If so, you can send any info via Steve Stern’s steps listed above.

    Thread Starter Davood Denavi

    (@binarywc)

    @pipdig As I said a few days ago, I do not have access to the site or server I worked with the original user who had the issue over a screen share. As I have suggested earlier I would suggest you do some thorough testing. I know of two other people who received the same error and asked me to make the update for them because they were not comfortable editing code.

    Also, I am not a paying customer neither are any of the three users that I am aware of who had the issue.

    I am sorry but there is no further information I can provide about any of the three users I am aware of that had this issue and were able to fix it using my fix from my original post.

    Plugin Author pipdig

    (@pipdig)

    @binarywc I am still unable to replicate any errors after testing on several sites with different hosting environments. So it is very strange. Would you be able to send an example url/path which was not redirecting before you made the changes to the redirect.php file? This will help me to see why the concatenation might be required, as currently I don’t see the purpose of it.

    Thread Starter Davood Denavi

    (@binarywc)

    @pipdig I have not spoken to any of the users who I was helping again. It is quite hard for me to believe you can not duplicate it when I have helped three users to fix the problem on three different hosting environments. In each case, I have told them to feel free to contact me directly if they run updates and it breaks again.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Redirects not working in latest version’ is closed to new replies.