• I’ve been using RMWR with a site I’m building on a local XAMPP installation that is current. The previous version of RMWR works great, and I love its flexibility. In fact, I was preparing to enter a 5 review when I noticed an error at the top of my screen. I had just updated from version 0.1 (?) to version 2.0. When I deactivated RMWR 2.0, the error message went away. This behavior is repeatable.

    My site is using the Twenty Sixteen WordPress theme.

    Here’s the message: Notice: wp_enqueue_style 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.0.) in C:\xampp\htdocs\wp\wp-includes\functions.php on line 3996

    The plugin still works, but unfortunately the error message is an obvious deal breaker. All my site plugins are current. My browser is Firefox, which is up to date.

    Any ideas? Would it be possible for me to receive the old version so that I could reinstall it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author George Gkouvousis

    (@gkouvousisg)

    Thanks for the issue report. Its fixed now, please update to 2.1 and let me know if this fix worked for you.

    Plugin Author George Gkouvousis

    (@gkouvousisg)

    Alternatively, change line 19 of index.php (within plugin’s folder) to:

    wp_enqueue_style( ‘readmorestyle’, plugins_url( ‘/style.css’, __FILE__) );

    and save your changes. It should work just fine.

    Thread Starter reraymond

    (@reraymond)

    I’m sorry to report that this did not seem to correct the problem in my case–same error code is being thrown. I updated the plugin, and checked out line 19 in the plugin’s index.php file, and your (modified) code was there. Again, if I deactivate the plugin, the error code disappears.

    As I’ve researched this, I discovered that the generation and display of PHP debugging error messages is typically benign (informational, only), and does not affect the program operation, proper. Because I really like the plugin, I decided to disable the display of PHP error messages, by adding the following code to my wp-config.php file:

    /*enable the debugging log, but DISABLE writing error codes to the HTML (do not display them)*/
    define(‘WP_DEBUG_LOG’, true);
    define( ‘WP_DEBUG_DISPLAY’, false );

    Now, I’m back to using the plugin and not dealing with having the error codes appear at the top of my screen. Bottom line: in my case, the plugin is still a bit “broken”, but it’s essentially a non-issue as long as I remember to place that little code snippet in the wp-config.php file.

    Thanks again for a great plugin.

    Richard Raymond

    Plugin Author George Gkouvousis

    (@gkouvousisg)

    I understand. Actually, there are no issues from our end, even on our demo. No warnings at all and also, this is not reported by other users.
    Not really sure why you need debug on, on a live website, but this is all about your business.

    Hi gkouvousisg,

    I also had the same issue as the OP. I took a quick look at your code and was able to identify the following problem:

    This line is being called incorrectly:

    wp_enqueue_style( 'readmorestyle', plugins_url( '/style.css', __FILE__) );

    I have removed that line and updated the bottom of your index.php to this:

    function load_style() {
    	wp_enqueue_style( 'readmorestyle', plugins_url( '/style.css', __FILE__) );
    }
    
    /* header actions */
    add_action('wp_head', 'read_javascript');
    add_action('init', 'read_register_shortcodes');
    add_action('wp_enqueue_scripts', 'load_style');

    This will resolve the issue.

    • This reply was modified 8 years, 9 months ago by Diamons.
    • This reply was modified 8 years, 9 months ago by Diamons.
    Plugin Author George Gkouvousis

    (@gkouvousisg)

    Thats true. Since I prefer having users not involved in coding stuff, i’ve escalated this for a quick update, instead of guiding them here. But anyway, thanks for spending time on this. Next update wont affect your backend with such a notification.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Version 2.0 is throwing an error message’ is closed to new replies.