Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • pufferfish101007
    Participant

    Hi,

    When using Announcer, I get an error that jQuery is not defined. This is because the jquery script has the defer attribute, but the announcer script does not (so the announcer script runs before jquery is registered).

    This can be fixed by changing line 26 of announcer/includes/display.php to

    php
    wp_enqueue_script( 'announcer-js', ANCR_URL . 'public/js/script.js', array( 'jquery' ), ANCR_VERSION, array( 'strategy' => 'defer' ) );
    

    but this change will be overwritten when the plugin is updated.

    I assume that the jquery script being deferred is caused by another plugin but I’m not certain which one.

    Is there any chance that the announcer script can be deferred, or an option be made available to defer it? Or any other solution that also fixes the problem is very acceptable.

    Aakash
    Keymaster

    Hi there,

    Thanks for using Announcer plugin. I have not seen this issue in our tests. jQuery is loaded as a dependent for announcer. In out test site, jquery is not added with the “defer” attribute. It is possible that the defer attribute is added by some other performance optimizer plugin on your end. Can you please check and confirm this?

    Thanks,
    Aakash

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

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms