• Hi, my name is Harut and I’m a developer from popupmaker.com.

    We currently have a problem with your plugin, which affects the proper functioning of our wordpress plugin.

    Who can I contact to discuss some technical aspects and get information how to resolve this conflict?
    I already read your technical documentation and did not find the right solution for our case.

    Please contact me as soon as you can.
    [ Signature and email deleted ]

    • This topic was modified 4 years, 6 months ago by Jan Dembowski.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Alberto Medina

    (@albertomedina)

    Please explain the details of your problem, and provide a related URL of your site experiencing the problem.

    Plugin Author Pascal Birchler

    (@swissspidy)

    Depending on the issue you are facing making Popup Maker AMP-compatible, you might also want to open an issue on https://github.com/ampproject/amp-wp

    Thread Starter Harout Mardirossian

    (@harout)

    Hi again. In short, we provide our clients with marketing tools and popups that can be used both in WordPress and on any other website by adding our embed code.
    The embed code popup maker generates is a custom <script> tag with a Javascript code inside which can be placed anywhere on the web page and optimized so as not to affect page performance.

    We constantly receive feedback from our users that our popups do not open on their WordPress websites.

    We found that the AMP plugin removes popup makers’ embed code from WordPress pages.

    It’s not a good practice every time ask a customer to check errors in AMP plugin, find our embed code and set them ‘Kept’, because on average there are 1200-1500 errors that your plugin detects in WordPress, and searching our embed code is kind a hard thing.

    I want to ask you a solution on how to avoid your plugins’ filtering, to keep our service functioning.

    [ Signature and email deleted ]

    • This reply was modified 4 years, 6 months ago by Jan Dembowski.
    Plugin Author Pascal Birchler

    (@swissspidy)

    > The embed code popup maker generates is a custom <script> tag with a Javascript code inside which can be placed anywhere on the web page and optimized so as not to affect page performance.

    @harout The AMP specification does not allow custom Javascript. That’s why the AMP plugin removes offending markup like the <script> tag from your plugin. You can learn more about how AMP works at https://amp.dev/about/how-amp-works/.

    There are a few routes that you could take to make your plugin AMP compatible:

    1. Provide an AMP-compatible embed code for AMP pages (i.e. if is_amp_endpoint() returns true), for example using <amp-iframe> or <amp-script> (https://amp.dev/documentation/guides-and-tutorials/develop/custom-javascript/) instead of <script>.
    2. Do not output any custom JavaScript on AMP pages
    3. For development environments (if amp_is_dev_mode() returns true), you could also use AMP Dev Mode (https://weston.ruter.net/2019/09/24/integrating-with-amp-dev-mode-in-wordpress/).

    Thread Starter Harout Mardirossian

    (@harout)

    So you do not allow any custom scripts in web pages.

    I have a few questions:
    Q1: So if I use wp_enqueue_scripts and add my JS code as a file, will the AMP detect and remove it anyway?
    Q2: Do you have a attribute that will be ignored by the script?

    Using your custom tags is not a solution for us. Today’s problem is with your plugin, tomorrow it may be with the different one and we can’t use everyone’s custom tags or code in our plugin. Our plugin will become a huge mess of solutions.

    Plugin Author Pascal Birchler

    (@swissspidy)

    > So if I use wp_enqueue_scripts and add my JS code as a file, will the AMP detect and remove it anyway?

    Yes. The AMP plugin will remove any <script> tags, regardless of how you add/enqueue your JavaScript.

    > Do you have an attribute that will be ignored by the script?

    No*.

    If you’re not currently considering adding AMP support, I recommend doing something like this:

    function myplugin_enqueue_scripts() {
      if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
        return;
      }
    
      wp_enqueue_script(...);
    }

    This way your users won’t get errors on AMP pages when using your plugin.

    However, you would also want to update your documentation accordingly, and mention that it currently does not work with AMP.

    * (except for AMP Dev Mode, but that only works for development environments)

    Thread Starter Harout Mardirossian

    (@harout)

    Okay, thank you very much for your time. Thanks for the help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Conflict with your plugin’ is closed to new replies.