• Hi,

    When I click on any link in an email, I am always redirected to the homepage (and it’s keeping the query string).

    When it’s for validating an email, the email is validated before the redirection (I can see it OK in the backend).

    When it’s for managing the categories, I’m redirected on the homepage. I tried adding some die() in your code, and I can see that create_fake_page is called and that the $posts variable is correct.

    Do you have any other clues on what can trigger this?

    I have tried another theme (2017) and I have the same result.

    Thank you,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Devon Ostendorf

    (@devonostendorf)

    Hi Standish,

    Thanks for trying out Post Notif!

    I’m sorry to hear that you are having the redirect problems you describe. Since you’ve tried another (default) theme, with the same results, this makes me think it is likely an issue where Post Notif is clashing with another plugin you have installed. I’m guessing you have not installed another plugin explicitly for handling redirection so I’d suggest disabling all of your plugins, except for Post Notif, seeing if things work then, and then one-by-one, reactivating the others until Post Notif fails again.

    If you do go through this exercise, and are able to identify the plugin that is clashing with Post Notif, please do let me know what it is. I do not presently have the bandwidth to do a lot of investigation into the inner workings of other plugins but I will certainly take a quick look and see if I can suggest a workaround.

    The downside of the multitude of available plugins, providing all manner of functionality, is that, inevitably, there are clashes when certain combinations are installed side-by-side. ??

    Thanks,
    Devon

    Thread Starter Standish

    (@standish)

    Hi,

    I tried on a fresh 4.9.4 WordPress install, with no plugin.

    In the permalink, I have selected Common Settings/Post name.

    I use your plugin version 1.3.0.

    The validation email works, as the link validate my account, but I’m redirected on the homepage. I was able to validate my account, since I can see it in the backend (and I have received the Thanks for subscribing to the posts emails)

    But when I click on the manage pref url : /post_notif/manage_prefs/?email_addr=EMAIL&authcode=CODE, I’m also redirected on the homepage.

    Do you have any clues?

    I’ll continue looking for this.

    Thread Starter Standish

    (@standish)

    I was able to debug it and make it works.

    This is what I did:

    – I have created pages matching your fake url (ie: /post_notif/manage_prefs/)

    – I have edited to edit your plugin. In the file /public/class-post-notif-public.php, I have modified the create_fake_page method.

    In the $post variable you add in the “the_posts” filter, I have added those properties :

    $post->ID = -99;
    $post->post_author = 1;
    $post->post_date = current_time( ‘mysql’ );
    $post->post_date_gmt = current_time( ‘mysql’, 1 );
    $post->post_status = ‘publish’;
    $post->ping_status = ‘closed’;
    $post->post_name = ‘post-notif-‘.rand(0, 10000000);
    $post->filter = ‘raw’;

    And everything works.

    Plugin Author Devon Ostendorf

    (@devonostendorf)

    Hi Standish,

    I am sorry you had to jump through so many hoops to get Post Notif to work for you! However, I must say your solution is very interesting; thank you very much for sharing it. ?? I suspect it may well help others down the road.

    Thanks,
    Devon

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect to homepage’ is closed to new replies.