Support » Plugin: Google Analytics Dashboard Plugin for WordPress by Analytify » PHP Notice: wp_enqueue_script was called incorrectly

  • Resolved stevemullen

    (@stevemullen)


    I am investigating plugins on my site that are not loading scripts and styles correctly. wp-analytify-pro is active on this site.

    My problem is that WP is generating a php warning because code (plugins, themes…) are not loading scripts and styles correctly, but the warning is not indicating the offending code:
    [12-Apr-2019 12:57:45 UTC] PHP Notice: wp_register_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/redacted/public_html/wp-includes/functions.php on line 4667

    This plugin appears to call wp_enqueue_script directly in a handful of files. This is not supported and generates PHP warnings. Here is instance I found:

    wp-analytify-pro/views/old/front/world-map-stats.php
    ln 40 – wp_enqueue_script is called directly.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.