WordPress.org

Ready to get started?Download WordPress

Forums

Simple Google Analytics
wp_enqueue_script was called incorrectly (4 posts)

  1. Sam_a
    Member
    Posted 2 years ago #

    Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in […]/wp-includes/functions.php on line 3589

    when viewing the site with analytics code added in "Footer".

    Actions->__construct()  …/simple_google_analytics.php:23
    Actions->addAll()       …/Actions.class.php:33
    Actions->addJS()        …/Actions.class.php:39
    wp_enqueue_script()     …/Actions.class.php:49
    _doing_it_wrong()       …/functions.wp-scripts.php:130
    trigger_error ()        …/functions.php:3589

    http://wordpress.org/extend/plugins/simple-google-analytics/

  2. Daedalon
    Member
    Posted 2 years ago #

    Good to know. Hope this gets fixed. These sort of issues can cause problems for example for the Use Google Libraries plugin, which is a good plugin for user experience (speed) optimization and thus SEO.

  3. styledev
    Member
    Posted 1 year ago #

    @plugin author: To fix please change line 39 in Actions.class.php from:

    $this->addJS();

    to

    add_action( 'wp_enqueue_scripts', array( &$this, 'addJS' ) );

  4. MattV
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic