Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Interesting! Can you please tell me what AMP plugin are you using?

    Also can you please elaborate on what you are trying to achieve, and in what way WP 404 Auto Redirect to Similar Post fail to do so?

    Thanks!

    Regards.

    Thread Starter gabiflo

    (@gabiflo)

    I use WP AMP by teamdev-ltd https://codecanyon.net/item/wp-amp-accelerated-mobile-pages-for-wordpress-and-woocommerce/16278608?s_rank=1.
    When i delete a woocommerce product your plugin work fine (redirect to simillar product) with normal pages but amp pages return 404 error

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay thanks. Can you please share with me one of your AMP page link example? You can hide you domain if you want.

    Regards.

    Thread Starter gabiflo

    (@gabiflo)

    AMP page link example
    domain/amp
    domain/shop/product-cat/product/amp

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay, so you have a product: domain.com/shop/product-cat/my-product/amp.
    If you delete it and try to reach the same URL, a 404 is displayed?

    Have you tried to reach the same URL, without /amp? Does it still return a 404?

    I’ll try to dig in the said plugin. Maybe it triggers a custom 404 behavior.

    Regards.

    Thread Starter gabiflo

    (@gabiflo)

    if i delete domain.com/shop/product-cat/my-product/amp and try to reach the same url is returned 404
    If i try to reach same url without /amp it return a simillar product page

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay! Thanks for the report!

    I already took a look to the WP AMP Plugin, and in fact it process some special behavior for 404, using one of the hook I use.

    This is probably a hook priority problem.

    I’ll install it and try to find a fix ASAP ??

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay I found the problem. They are using the template_redirect action just like me, in order to process a specific 404 page template.

    You can fix WP 404 Auto Redirect to Similar Post, by doing this:

    In the file:

    
    plugins/wp-404-auto-redirect-to-similar-post/wp-404-auto-redirect-similar-post.php

    Line: 224.

    Find:

    
    add_action('template_redirect', 'wp404arsp_init', 999);

    Replace to:

    
    add_action('template_redirect', 'wp404arsp_init', 0);

    It will now work ??

    The problem is that some others plugins have the opposite problem: They create fake pages using that hook (which isn’t a good practice). It requires my plugin to change priority to 999 (just like right now).

    So I’ll have to find a solution to make it work in all cases. Maybe I’ll add a setting field in the administration in order to let the admin choose it’s priority depending on his plugins.

    Regards.

    Thread Starter gabiflo

    (@gabiflo)

    Thanks, it works.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘amp pages’ is closed to new replies.