Support » Plugin: AMP » Jetpack Subscribe to Blog WIdget not Working

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

    (@westonruter)

    On the non-test site, the XHR request for the form submission is returning an HTML page, rather than JSON. You can see this in DevTools. At the footer I can also see a comment:

    This site is optimized with the WP Rich Snippets version 1.4.8 by https://wprichsnippets.com

    My guess is that WP Rich Snippets may be interfering with Jetpack’s subscription functionality. This comment does not appear on the test site.

    • This reply was modified 2 years, 9 months ago by Weston Ruter.
    Thread Starter Akki

    (@luckyankit)

    Hi, I tried after disabling the plugin, it’s still the same. Please help me in resolving this.

    Plugin Author Weston Ruter

    (@westonruter)

    Does the subscription form work when the AMP plugin is deactivated?

    Thread Starter Akki

    (@luckyankit)

    Yes it works

    Plugin Author Weston Ruter

    (@westonruter)

    Also try deactivating other plugins individually to narrow down what is going on.

    Ultimately, this would be a bug report not for the the AMP plugin but rather Jetpack.

    It appears this logic in Jetpack is not running on your site:

    https://github.com/Automattic/jetpack/blob/e67bea661ea10a2396bf6efd3a484e9c274a1e2a/modules/subscriptions.php#L77-L79

    I see also that you are running LiteSpeed Cache, which may actually be the source of the problem.

    Thread Starter Akki

    (@luckyankit)

    Found out, it was a regex redirect in Yoast SEO premium which was stopping the submission. Removed the redirect and now it is working.

    But now the issue is, when someone submits the email, it redirects the user to the homepage, the submission works fine but the redirection part is odd. I should report this to Jetpack?

    This behaviour is the same on the test site too which doesn’t have any redirects as it is using Yoast free version.

    • This reply was modified 2 years, 9 months ago by Akki.
    Plugin Author Weston Ruter

    (@westonruter)

    But now the issue is, when someone submits the email, it redirects the user to the homepage, the submission works fine but the redirection part is odd. I should report this to Jetpack?

    I think this is actually a bug in the AMP plugin. On a non-AMP page on my site, I can see a subscription form has:

    <form action="#" method="post" accept-charset="utf-8" id="subscribe-blog-blog_subscription-2">

    But on the AMP version, the action attribute is getting erroneously populated with the homepage URL as opposed to the current URL, so it appears as:

    <form method="post" accept-charset="utf-8" id="subscribe-blog-blog_subscription-2" action-xhr="//weston.ruter.net?_wp_amp_action_xhr_converted=1#" target="_top">

    This is not correct.

    Nevertheless, Jetpack really shouldn’t be redirecting those requests in the first place, and it should be using Ajax to show the success message. I actually made a workaround plugin that implements this: https://gist.github.com/westonruter/3b61ffcfbc1b528b1135ac7cc065eaa2

    • This reply was modified 2 years, 9 months ago by Weston Ruter.
    Plugin Author Weston Ruter

    (@westonruter)

    I’ve created a fix for the AMP plugin. Please test the patch in this pull request: https://github.com/ampproject/amp-wp/pull/4003

    Thread Starter Akki

    (@luckyankit)

    Wow thanks for providing the plugin, it works great.

    Although can you please tell me if the plugin had not been there, how do I pull this patch in the plugin?

    Plugin Author Weston Ruter

    (@westonruter)

    You can look at the changes here and apply them to your copy of the file: https://github.com/ampproject/amp-wp/pull/4003/files

    Or you could download the file from the pull request and overwrite it entirely.

    Or I could make a plugin build ZIP that you could replace your entire plugin with. But that is excessive here.

    Thread Starter Akki

    (@luckyankit)

    Yes, I have these ideas already in mind, but I wanted to know if there is something else like where you enter the full URL and the changes get merged in the plugin or theme itself.

    I searched in past a lot if there is any plugin which may pull the changes from GitHub and push it to WordPress plugin or theme files, but couldn’t find any. Just leaving this idea here for anyone to pick up 🙂

    Litespeed has this feature already which works for their plugin only in debug mode.

    Plugin Author Weston Ruter

    (@westonruter)

    We are working on ways to make it easier to test pre-releases. See https://github.com/ampproject/amp-wp/issues/2084

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Jetpack Subscribe to Blog WIdget not Working’ is closed to new replies.