WordPress.org

Forums

Social Articles
[resolved] Avoid loading scripts on non-articles pages? (5 posts)

  1. Bike
    Member
    Posted 1 year ago #

    Hi, I checked a theme with BP and Social Articles switched on on GT Metrix and noticed that on every page at least 5 SA javascripts are loaded and likely a lot of other scripts/css as well.

    wp-content/plugins/social-articles/assets/css/stylesheet.css?ver=20130108
    wp-content/plugins/social-articles/assets/js/advanced.js?ver=3.9
    wp-content/plugins/social-articles/assets/js/ajaxupload.js?ver=3.9
    wp-content/plugins/social-articles/assets/js/jquery.tmpl.min.js?ver=3.9
    wp-content/plugins/social-articles/assets/js/social-articles.js?ver=3.9
    wp-content/plugins/social-articles/assets/js/wysihtml5-0.3.0.min.js?ver=3.9

    (this was on a search result page!)

    Is there a way to prevent this? The scripts should only load on actual SA pages, not on every page load, saving load times and increasing speed.

    Thanks!

    https://wordpress.org/plugins/social-articles/

  2. Broobe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi! I will add the validation to enqueue the scripts only in Social Articles pages.
    Thanks for the suggestion!
    Best Regards,
    Miguel.

  3. Bike
    Member
    Posted 11 months ago #

    Gracias Miguel, looking forward to an updated version.
    I have it currently disabled due to the 110kb+ extra page load on every page of the site.

    See also the examples on http://codex.wordpress.org/Function_Reference/wp_enqueue_script (there might be other ways as well).

    Gracias y saludos,
    Bike

  4. Broobe
    Member
    Plugin Author

    Posted 11 months ago #

    Hi! The next version should be ready in a couple of weeks! Sorry for the big delay...

    Saludos! ;)

  5. Broobe
    Member
    Plugin Author

    Posted 8 months ago #

    Done! ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Social Articles
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.