Title: Plugin includes JavaScript on all admin pages
Last modified: August 21, 2016

---

# Plugin includes JavaScript on all admin pages

 *  [matchalabs](https://wordpress.org/support/users/matchalabs/)
 * (@matchalabs)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-includes-javascript-on-all-admin-pages/)
 * Hi,
 * I only have minimal knowledge of this plugin as I’m fixing a support item for
   our own plugin (Meta Slider). I’ve installed the plugin, signed up to Active 
   Campaign and entered the API details into the plugin (I have not set up any forms
   in Active Campaign)
 * I’ve spotted a couple of things:
 * 1. There is a syntax error in the JavaScript which is output to all admin pages
   somewhere. I think this is probably related to this ticket: [http://wordpress.org/support/topic/ajax-not-working-7?replies=7](http://wordpress.org/support/topic/ajax-not-working-7?replies=7)
 * You can see the error in the Console (using Chrome Developer Tools).
 * 2. The JavaScript is included on all admin pages. Please could you update the
   plugin so the JavaScript is only output on the necessary pages? I think this 
   should do it:
 * Open activecampaign.php. Find line 563. Add just below:
 *     ```
       global $pagenow;
   
       	// Only run in post/page creation and edit screens
       	if (!in_array($pagenow, array('post.php', 'page.php', 'post-new.php', 'post-edit.php'))) {
       		return;
       	}
       ```
   
 * For the benefit of our customer (who I’m about to link here), here is a screenshot
   of how it should look: [http://screencast.com/t/yzHPXcaqj3](http://screencast.com/t/yzHPXcaqj3)
 * Regards,
    Tom
 * [http://wordpress.org/plugins/activecampaign-subscription-forms/](http://wordpress.org/plugins/activecampaign-subscription-forms/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [activecampaign](https://wordpress.org/support/users/activecampaign/)
 * (@activecampaign)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-includes-javascript-on-all-admin-pages/#post-4539652)
 * Hi Tom,
 * Thanks for the feedback. We’ve just implemented #2, as this is a great idea (
   and good catch). For #1, I am not seeing any errors currently. I’d love to get
   a screenshot (or exact error text) so we can look into it further.

Viewing 1 replies (of 1 total)

The topic ‘Plugin includes JavaScript on all admin pages’ is closed to new replies.

 * ![](https://ps.w.org/activecampaign-subscription-forms/assets/icon-256x256.png?
   rev=2314630)
 * [ActiveCampaign - The autonomous marketing platform](https://wordpress.org/plugins/activecampaign-subscription-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/activecampaign-subscription-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/activecampaign-subscription-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/activecampaign-subscription-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/activecampaign-subscription-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/activecampaign-subscription-forms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [activecampaign](https://wordpress.org/support/users/activecampaign/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-includes-javascript-on-all-admin-pages/#post-4539652)
 * Status: not resolved