Accelerated-mobile-pages: Conflict with Photon

Created on 13 Feb 2017  路  8Comments  路  Source: ahmedkaludi/accelerated-mobile-pages

Since the most recent release of the AMP for WP plugin, Jetpack's Photon service seems to be enabled for all images on the site, even on non-AMP pages, and even if the module is not active.

I believe it's been reported in a few threads already:

Most helpful comment

All 8 comments

@MohammedKaludi @khaledMohammed000 Dev team, this is not a good. We need to learn from this.

Thank you @jeherve for handling the community and reporting this!!! BIG HUGS for you mate!

@jeherve There are many people in AMP who are having issues with Jetpack photon, because of the way it crops, with the ?w&h... I hope you understand what I mean. Alot of users are having issues with it, Is there a way we can disable the photon only for AMP users?

I would really appreciate your help on this!

Thanks again and appreciate your time.
Ahmed

There are many people in AMP who are having issues with Jetpack photon, because of the way it crops, with the ?w&h

Do you have a few examples? This might be something we could solve in Photon itself?

I can't know for sure without knowing more about the problem, but this PR might actually solve the problems for most Photon users:
https://github.com/Automattic/amp-wp/pull/480

It doesn't look like these changes have been released on WordPress.org yet, though. I will ask around to see when this will be released on WordPress.org. Until then, if you're able to reproduce those Photon issues on one of your sites, it might to see the latest version of the AMP plugin on GitHub, and see if that solves the issue for you.

Is there a way we can disable the photon only for AMP users?

Yes, that can be done, and it looks like you were on the right track with 74260b9a25d3a22f86338db76317b621e1abb9a7. However, that filter won't work like this; you would need to remove the Jetpack filter right before the function you use to output all images in your plugin, and then add it back right after you've called your function. You can check this post to find out more:
https://ethitter.com/2013/07/disable-jetpacks-photon-module-in-specific-situations/

It doesn't look like these changes have been released on WordPress.org yet, though. I will ask around to see when this will be released on WordPress.org.

It looks like this will need to be fixed before a new version is released on WordPress.org:
https://github.com/Automattic/amp-wp/issues/627

Hey @jeherve

I have finally managed to find this issue again. This happens when there is a featured image coming from the Photon.
So this issue only comes on time and then goes away after a refresh.

Please see the video: http://take.ms/rsvS6

Here is the error code from pastebin: http://pastebin.com/vZBFN0Wh

It only happens when the Jetpack photon is being used. Can you please give your thoughts?

I will appreciate the help.

Regards,
Ahmed

@ahmedkaludi Could you try again with the most recent version of the AMP plugin from GitHub? This may have been fixed in this PR:
https://github.com/Automattic/amp-wp/pull/480

@jeherve I believe it did. Closing this one

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seriou5 picture seriou5  路  5Comments

satriaenur picture satriaenur  路  4Comments

AlexeyKosov picture AlexeyKosov  路  7Comments

pegazee picture pegazee  路  7Comments

ghost picture ghost  路  4Comments