PHP Notice in Contact Widget

With wp-config.php set as

define(‘WP_DEBUG’, 1);

define(‘WP_DEBUG_LOG’, 1);

define(‘WP_DEBUG_DISPLAY’, 1);

The Contact Widget shows this PHP notice:

Notice: wp_enqueue_script was called incorrectly. 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.

A quick backtrace shows:

Array

(

[0] => Array

(

[file] => wp-includes/functions.wp-scripts.php

[line] => 130

[function] => _doing_it_wrong

[args] => Array

(

[0] => wp_enqueue_script

[1] => Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.

[2] => 3.3

)

)

[1] => Array

(

[file] => wp-content/plugins/contact-form/contact-form.php

[line] => 30

[ in wp-includes/functions.php on line 2960

The problem is in

wp-content/plugins/contact-form/contact-form.php line 30:

wp_enqueue_script(“jquery”:wink:;

It should be called from within other wp_* calls, not directly. See http://plugins.trac.wordpress.org/changeset/655287 for an example, and also http://stackoverflow.com/questions/11336578/wp-debug-errors-with-wp-enqueue

  • aecnu
    • WP Unicorn

    Greetings bhubbard,

    Thank you for bringing this item to our attention and indeed though just a notice I will seek advice form the reigning authority the lead developer regarding this notice and see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Mike
    • New Recruit

    Hiya, we haven’t heard from you in a while so I just wanted to check in and see how things are going here?

    If you still need some assistance then by all means just reopen the thread or create another one for any new and related issues.

    Cheers.

    Mike

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.