Title: false positive
Last modified: October 10, 2021

---

# false positive

 *  Resolved [x0ff](https://wordpress.org/support/users/x0ff/)
 * (@x0ff)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/)
 * hi,
    Just to let you know that your plugin is show errors(AMP validation) on 
   all external pages. The errors start on update other plugin(nextscripts 4.3.23)
   any days ago. [https://ibb.co/Zhcskt6](https://ibb.co/Zhcskt6)
 * on nextscripts support answered me this:
    “Well, there is no way for us to fix
   this.
 * But the good news is – this is a “false positive”.
 * SNAP adds some Javascript code to the top “admin panel”. This code is loaded 
   only when you logged as an admin. Which means you real AMP visitors won’t get
   this script and this error. Your validator is not smart enough to see that and
   since you are ruining it as an admin, it reports an error.”
 * you can check the original msg :
    [https://wordpress.org/support/topic/amp-error-on-4-3-23/](https://wordpress.org/support/topic/amp-error-on-4-3-23/)
 * can you correct this “false positive”? Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/#post-14957565)
 * Hello [@x0ff](https://wordpress.org/support/users/x0ff/)
 * Thank you for the support topic, The AMP pages do not allow custom javascript
   being added so the AMP plugin’s validator removes them for you to create a valid
   AMP page.
 * We agree with Nextscript support, if they are not vital to function your site
   you can ignore them.
 * Unfortunately, it’s something we can’t correct within the AMP plugin, this has
   to be corrected in the plugins which are adding scripts, they need to add or 
   dequeue scripts conditionally by detecting if the current endpoint is AMP endpoint.
 * eg:
 *     ```
       if ( function_exists( 'is_amp_endpoint' ) && ! is_amp_endpoint() ) {
           // Enqueue scripts here.
       }
       ```
   
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/#post-14959541)
 * NextScripts could also fix the issue by adding the `data-ampdevmode` attribute
   to the scripts they add to the page when `is_amp_endpoint()` returns true. Read
   more at [https://weston.ruter.net/2019/09/24/integrating-with-amp-dev-mode-in-wordpress/](https://weston.ruter.net/2019/09/24/integrating-with-amp-dev-mode-in-wordpress/)
 *  Thread Starter [x0ff](https://wordpress.org/support/users/x0ff/)
 * (@x0ff)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/#post-14968244)
 * I will write to support so that they can make the corrections, thanks
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/#post-14980475)
 * Hello [@x0ff](https://wordpress.org/support/users/x0ff/)
 * Since the issue is not with AMP plugin I’ll mark this as resolved. Feel free 
   to open a [new support topic](https://wordpress.org/support/plugin/amp/#new-post)
   if you require any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘false positive’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [nextscripts](https://wordpress.org/support/topic-tag/nextscripts/)

 * 4 replies
 * 3 participants
 * Last reply from: [Milind More](https://wordpress.org/support/users/milindmore22/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/false-positive-19/#post-14980475)
 * Status: resolved