WordPress.org

Ready to get started?Download WordPress

Forums

Error Notification
Error Notification doesn't version .js file (3 posts)

  1. archon810
    Member
    Posted 1 year ago #

    Error notification doesn't append the version of the plugin to the .js file include, which for us with CDNs or enforcing browser caching means an old copy will be served upon an upgrade for a potentially long time.

    Take a look at http://www.androidpolice.com/2013/06/21/new-game-gameloft-releases-gangstar-vegas-their-most-gta-like-gta-clone-yet-for-6-99/, for example. All other plugins version their .js files by appending ?ver=N.NN, whereas yours doesn't. From what I can tell, the problem is you're not passing the version here: wp_register_script('error_notification_script', plugins_url('/error_notification.js', __FILE__), null, null, true);

    http://wordpress.org/extend/plugins/error-notification/

  2. tasko
    Member
    Plugin Author

    Posted 1 year ago #

    I changed:
    wp_register_script('error_notification_script', plugins_url('/error_notification.js', __FILE__), null, null, true);

    to:

    wp_register_script('error_notification_script', plugins_url('/error_notification.js', __FILE__), array('jquery'), null, true);

    It should fix that problem;

  3. archon810
    Member
    Posted 1 year ago #

    I don't see why that would fix the problem. All you changed was adding a prerequisite but didn't touch the version parameter.

    This is still not versioned:
    <script type='text/javascript' src='http://cdn.androidpolice.com/wp-content/plugins/error-notification/error_notification.js'></script>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.