• Resolved iku28105

    (@iku28105)


    Hi Support,

    It seems that 404page (v3.3) is conflict with GeoTargeting Pro (v2.2.1). With GeoTargeting Pro activated, the 404 page doesn’t show up – /

    All of my plugins, theme, and wordpress are latest.

    Please advise!

    Thanks
    Anna

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Damian

    (@timersys)

    Hi @petersplugins ,
    I’m the author of that plugin. For what I see on my tests the problem happens when we use the function url_to_postid()

    If that wp function it’s executed your plugin stops working. If you wish you can write me to support (at) geotargetingwp.com and I could provide a copy of the plugin

    Plugin Contributor Peter Raschendorfer

    (@petersplugins)

    Hi @timersys,

    sorry for the delay. The flu…

    Thank you for your initiative and many thanks for the offer. Maybe this is not necessary.
    I think I can imagine the problem. The url_to_postid() surely returns 0 because there is no post with that URL in case of a 404.

    I’m pretty sure, your plugins checks is_404() before you try to get the ID by url_to_postid(). But is_404() is false after my plugin loads the page. In most cases that’s the best solution to not affect the further processing. But in case of your plugin this may be different.

    If I guess right activating the option “Force 404 error after loading page” should solve the problem. This sets is_404() to true after loading the page. Would you please do me a favor and test this? If that does not work then I like to come back to your offer.

    Thanks again,
    Peter

    Hi Peter,
    I’m using that function inside posts_where filter, so it’s returning false for is_404() and checking Force 404 error after loading page don’t make any difference.

    And yes the post_id returned it’s 0 and I take that in consideration. Still the 404 page is not showing.

    Plugin Contributor Peter Raschendorfer

    (@petersplugins)

    OK, sent you an email.

    Plugin Contributor Peter Raschendorfer

    (@petersplugins)

    @timersys

    Hi Damian,

    seems to be a general WP issue and not a problem of my plugin. Using url_to_postid() in posts_where filter breaks WP in case of an 404.

    Latest WP version, Twenty Seventeen Theme, no active plugins.

    Added the following code snippet:

    add_filter( 'posts_where', 'gt_test' );
    
    function gt_test( $where ) {
      $id = url_to_postid( ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" );
    	return $where;
    }

    Result: blank page in case of trying to access a non existing URL.

    Can you conform this?

    Peter

    I can confirm yes.
    I will remove that part from my filter anyway, as I′ve been checking and I don’t think is strictly necessary. So you don’t have to worry about my plugin anymore.

    Plugin Contributor Peter Raschendorfer

    (@petersplugins)

    Not an 404page issue, marked as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘404 conflict with GeoTargeting Pro’ is closed to new replies.