• Hey Jacob,

    I’m trying to activate your plugin on one of my websites, but the activation fails with a fatal error.

    Activating the WP debug log shows the below:

    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 login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /var/www/www.abcde.com/wp-includes/functions.php on line 3622

    This error gets repeated multiple times.

    Deactivating most of the plugins did not give any better results.

    Any thoughts on what might be causing this?

    Thanks!
    Matt

    https://www.ads-software.com/plugins/jm-breaking-news/

Viewing 1 replies (of 1 total)
  • Plugin Author Jacob Martella

    (@arenapigskin)

    Hey Matt,

    This is an odd error. Never had this one pop up. In the jm-breaking-news.php file, try moving wp_enqueue_style('jm_breaking_news_admin_styles', plugin_dir_url(__FILE__) . 'css/breaking-news-admin-style.css'); into the jm_breaking_news_admin_scripts function and delete the function it was in previously. I’m thinking the admin_print_styles hook is causing the issue. Let me know how it goes.

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin could not be activated because it triggered a fatal error.’ is closed to new replies.