Support » Plugin: AMP » Ask url problem before using this plugin

  • Resolved ady0651

    (@ady0651)


    Hello dear want to ask.

    Previously I used another AMP plugin with the url suffix /amp/

    And because currently the theme I use has better AMP support, I want to replace it in this official AMP plugin.

    If I switch to the official AMP plugin, will there be 404 on the previous page or post?

    Because in the previous plugin the back url ends in /amp/ while the official AMP ends in ?Amp.

    Or now there is a solution to keep the url /amp/ in the official AMP plugin

    I ask before migrating to this plugin, so that there is no decrease in traffic or unexpected errors.

    Please answer.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    I’m currently working on adding the ability to use /amp/ across all URLs on the site: https://github.com/ampproject/amp-wp/pull/5558

    This will be part of the 2.1 release.

    If you’re willing to test a pre-release version of the plugin, you can try the production build amp.zip linked to from here: https://github.com/ampproject/amp-wp/pull/5558#issuecomment-725867606

    Thread Starter ady0651

    (@ady0651)

    Ok that’s very good. Oh yes I have another question.

    In the upcoming AMP plugins that you tell me about.

    I am trying to understand it and there are 4 url ​​structures attached.

    So the question is, why is a definition written ?Amp=1 recommendation.

    do I keep the / amp / switch to the recommendation ?amp=1 ?

    Because when I got it down I saw that the url could switch all / amp / so that 404 doesn’t happen.

    How do you think about it? thx.

    Plugin Author Weston Ruter

    (@westonruter)

    If you are starting out from scratch then ?amp=1 is recommended because such URLs will continue to work even when the AMP plugin is deactivated.

    Since you previously had /amp/ then you can choose the path suffix instead.

    Nevertheless, even if you go ahead with ?amp=1 you’ll find that it won’t result in 404s: the plugin will automatically redirect to ?amp=1 when a 404 occurs.

    Thread Starter ady0651

    (@ady0651)

    Sir, please recommend me still confused.

    If I follow the recommendation ?Amp=1, will it not affect the google SERP that has been indexed?

    If it works that means I have to stick to the url /amp/.

    If it doesn’t matter, of course I will follow the recommendation ?Amp=1 right?

    Because it is a good step in the future related to development, it is feared that nothing will happen if I continue to follow url /amp/.

    Thread Starter ady0651

    (@ady0651)

    oh yes sir

    In this official AMP plugin, use 1200px image to make it valid.

    What is the solution when I use this plugin because most of the images are 1024px and 900px and some even 750px.

    Because in the AMP plugin that I use, there are no problems with the Google search console.

    Is this also a solution without changing all images to 1200px? thx for his help. I am waiting for the next answer.

    Plugin Author Weston Ruter

    (@westonruter)

    If the structure of the AMP URL changes, you may see then AMP results disappear from search results for a few days until they get re-indexed. That’s the only known issue with changing the structure of AMP URLs.

    Please open a new support topic regarding images, as that is unrelated to the URL structure.

    Thread Starter ady0651

    (@ady0651)

    ok thx for the answer maybe it’s better to use url / amp / first.

    I will open the topic again and close this topic.

    voodoochill

    (@voodoochill)

    If the structure of the AMP URL changes, you may see then AMP results disappear from search results for a few days until they get re-indexed.

    I am still seeing some incoming links with /amp/ from previous plugin after many months, ie it has not been dropped as expected after deactivating that plugin.

    I would like to use this new official plugin and going forward it seems to make sense to use the ?amp=1 URL instead of the old /amp as this seems to now be standard.

    So do you (or anyone) know how I would htaccess redirect all the old url/amp to the new ?amp=1

    Thanks

    Plugin Author Weston Ruter

    (@westonruter)

    @voodoochill I suggest trying the new paired URL structures

    If you try the pre-release production build of the plugin linked to above: https://github.com/ampproject/amp-wp/pull/5558#issuecomment-725867606

    When that is active, you’ll be able to decide between /amp/ and ?amp=1 via the new Paired URL Structure section on the AMP settings screen. If you decide to go with ?amp=1 then the plugin will automatically redirect /amp/ to ?amp=1 and there is no need for any .htaccess redirect.

    mbandqs

    (@mbandqs)

    I tried to setup with the production build but it is giving me error
    Uncaught Error: Call to a member function using_permalinks() on null in PairedRouting.php:567.

    I too need home page & custom post to render with /amp/ and not ?amp. Is there any hack for now unless new plugin is out?

    Plugin Support James Osborne

    (@jamesosborne)

    @mbandqs If you’d like to open a new support topic we’d be happy to assist with your case individually.

    Please include all relevant information to your support topic, including your Site Health Information if relevant. You can share using this form after opening a support topic.

    Plugin Author Weston Ruter

    (@westonruter)

    I tried to setup with the production build but it is giving me error
    Uncaught Error: Call to a member function using_permalinks() on null in PairedRouting.php:567.

    @mbandqs While opening a new support topic would be best, while waiting for it to be opened, can you provide more details on how you triggered this error? I am not seeing that issue. I can switch to the path suffix structure and save without an error:

    If I turn off pretty permalinks in the General > Settings screen, the non-query var options are disabled as expected:

    @westonruter below is more details

    PHP Fatal error: Uncaught Error: Call to a member function using_permalinks() on null in sitename\\\\htdocs\\wp-content\\plugins\\amp\\src\\PairedRouting.php:567\nStack trace:\n#0 sitename\htdocs\\wp-includes\\class-wp-hook.php(286): AmpProject\\AmpWP\\PairedRouting->filter_default_options(Array, Array)\n#1 sitename\htdocs\\wp-includes\\plugin.php(208): WP_Hook->apply_filters(Array, Array)\n#2 sitename\htdocs\\wp-content\\plugins\\amp\\includes\\options\\class-amp-options-manager.php(166): apply_filters(‘amp_default_opt…’, Array, Array)\n#3 sitename\\\\htdocs\\wp-content\\plugins\\amp\\includes\\options\\class-amp-options-manager.php(299): AMP_Options_Manager::get_options()\n#4 sitename\\\\htdocs\\wp-content\\plugins\\amp\\includes\\amp-helper-functions.php(301): AMP_Options_Manager::get_option(‘theme_support’)\n#5 sitename\\\\htdocs\\wp-content\\plugins\\amp\\src\\PairedRout in sitename\\htdocs\\wp-content\\plugins\\amp\\src\\PairedRouting.php on line 567

    Plugin Author Weston Ruter

    (@westonruter)

    For readability:

    PHP Fatal error: Uncaught Error: Call to a member function using_permalinks() on null in sitename\htdocs\wp-content\plugins\amp\src\PairedRouting.php:567
    Stack trace:
    #0 sitename\htdocs\wp-includes\class-wp-hook.php(286): AmpProject\AmpWP\PairedRouting->filter_default_options(Array, Array)
    #1 sitename\htdocs\wp-includes\plugin.php(208): WP_Hook->apply_filters(Array, Array)
    #2 sitename\htdocs\wp-content\plugins\amp\includes\options\class-amp-options-manager.php(166): apply_filters(‘amp_default_opt…’, Array, Array)
    #3 sitename\htdocs\wp-content\plugins\amp\includes\options\class-amp-options-manager.php(299): AMP_Options_Manager::get_options()
    #4 sitename\htdocs\wp-content\plugins\amp\includes\amp-helper-functions.php(301): AMP_Options_Manager::get_option(‘theme_support’)
    #5 sitename\htdocs\wp-content\plugins\amp\src\PairedRout in sitename\htdocs\wp-content\plugins\amp\src\PairedRouting.php on line 567

    @mbandqs where is this showing up for you? Does the error happen on the frontend or on the settings screen?

    Plugin Author Weston Ruter

    (@westonruter)

    For whatever reason, the $wp_rewrite variable is not defined when that code is running on your site. That doesn’t really make sense since this variable is defined by WordPress extremely early in the execution. Nevertheless, I’ve just pushed up a change to the pull request which eliminates reliance on checking $wp_rewrite->using_permalinks() in favor of just looking at the permalink_structure option, which is what that method is ultimately doing anyway.

    Please test the latest production build ZIP linked to in this pull request comment (as seen in the screenshot below): https://github.com/ampproject/amp-wp/pull/5558#issuecomment-725867606

    Upon installation, this will show up as having the version 2.1.0-alpha-20210118T043558Z-4abbb9b.

    • This reply was modified 4 months, 4 weeks ago by Weston Ruter.
    • This reply was modified 4 months, 4 weeks ago by Weston Ruter.
Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.