Support » Plugin: Ezoic » Compatibility with the official AMP plugin

  • Weston Ruter


    Hi. I’m an engineer working on the official AMP plugin. We’ve had various reports of your plugin not being compatible, which you state on your site as well.

    However, I’m curious why it can’t be compatible?

    From looking at your plugin’s codebase, it seems rooted in how output buffering is performed. You’re currently staring output buffering at plugins_loaded and then manually stopping the output buffer at shutdown. I think compatibility could be improved in two ways:

    1. Start output buffering at template_redirect. The AMP plugin opens its output buffer at the minimum priority (PHP_INT_MIN), so if you start at priority 0 then that will be compatible. Starting output buffering at plugins_loaded seems excessively early.
    2. Instead of gathering the output buffer at shutdown, simply provide a callback function in the call to ob_start(). This callback function then is passed the entire buffer at shutdown automatically, ensuring that it runs before other output buffers are closed.

    You can refer to the AMP plugin’s codebase to see how we’re doing this. We are compatible with various caching plugins that do output buffering, including W3 Total Cache, WP Rocket, and WP Super Cache, etc. If you adjust how you do output buffering, then your plugin could have much better compatibility as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ezoic


    Hello Weston! Thank you for reaching out – we would love to make our plugins fully compatible!

    We do have an internal task to work on making our plugin compatible with your AMP plugin, but it hasn’t been tackled yet (we put in the warning in the mean time). Your suggestions look great and we will definitely look into implementing them and hope to get a solution released soon.

    Thread Starter Weston Ruter


    Thank you. We’ve had quite a few support topics opened regarding compatibility problems between AMP and Ezoic, so I’m looking forward to this being resolved!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility with the official AMP plugin’ is closed to new replies.