Support » Plugin: EWWW Image Optimizer » Bug in AMP support

  • Resolved jorenvh

    (@jorenvh)


    Hi

    I v4.8.1 of the plugin sits a small bug related to AMP support.

    In the function ewww_image_optimizer_resize_detection_script() this function is called: ewww_image_optimizer_is_amp. Throwing the following notice:

    Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the ‘parse_query’ hook was called. This function will always return ‘false’ before the ‘parse_query’ hook is called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in wp-includes/functions.php on line 4773

    Seems like the function is called to early in the process.

    Joren

    • This topic was modified 1 month, 2 weeks ago by  jorenvh.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    Hmm, that’s strange as it seemed to work, but I’ll check it out and make sure we get rid of that notice. Just for reference, which AMP plugin are you using?

    I’m using https://amp-wp.org/ on version 0.7.2, a little bit behind as we need to plan some time to do a major rewrite in order to support their 1.x release.
    We will be upgrading that plugin in September according to project planning.

    Plugin Author nosilver4u

    (@nosilver4u)

    I’m unable to find any problems in any of the places we call is_amp_endpoint. In every case is_amp_endpoint is run either on the hooks wp_head or wp_enqueue_scripts, which both come after the parse_query hook.
    Further, I verified that the resize detection script IS suppressed on AMP pages, which confirms the function call is successful.
    The only thing I can think of is that perhaps there is a glitch in older versions of that AMP plugin, but if you’re able to find any additional information, do let me know.

    Thank you for investigating, I will just ignore it for now as it’s just a notice and not an exception. Maybe we can keep this ticket open and I can provide you with an update as soon as I found the issue or when I was able to upgrade the AMP plugin?

    Plugin Author nosilver4u

    (@nosilver4u)

    That would be fine, if I don’t hear back within a month I’ll mark it as resolved, but I believe wp.org will leave the thread open to updates for up to 2 months still.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.