• Resolved jetxpert

    (@jetxpert)


    Hi there,

    Your plugin is loading scripts and styles on website pages that don’t require The Events Calendar.

    For example, our homepage does not have anything close to needing The Event Calendar yet it’s loading the following files:

    /wp-content/plugins/the-events-calendar/vendor/jquery-placeholder/jquery.placeholder.min.js

    File Size: 2.1 KB

    /wp-content/plugins/the-events-calendar/common/src/resources/css/common-skeleton.min.css

    File Size: 25.9 KB

    /wp-content/plugins/the-events-calendar/common/src/resources/css/tooltip.min.css

    File Size: 1.6 KB

    /wp-content/plugins/the-events-calendar/src/resources/css/admin-menu.min.css

    File Size: .3 KB

    Please update your plugin to fix the above. Until then, would appreciate a php snippet that will dequeue assets (css and js files) on website pages that don’t use The Events Calendar.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jetxpert

    (@jetxpert)

    Useful Tip:

    We need a snippet similar this one, but for The Events Calendar.

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Hi @jetxpert,

    We were taking a look at the problem here on this other topic.

    https://www.ads-software.com/support/topic/loads-on-every-page-slows-website/

    This is a duplicate of that correct?

    As I told you on the other thread for the file jquery-placeholder we do not enqueue on all pages, tho because of the order of actions we are the first plugin registering it so when someone else includes jquery-placeholder the file included is ours. It can even be your theme doing it.

    The files common-skeleton.min.css and tooltip.min.css were an oversight by the development team and are indeed being included on every page.

    I’ve already created a Pull Request for a solution for that problem, but it might be too late for the release we are going to put out next week since we need to do testing on that modification before it goes out.

    https://github.com/moderntribe/tribe-common/pull/1445

    As per the last file, admin-menu that one is only enqueued everywhere due to the WordPress admin menu if you are logged out that should not happen.

    Only the last one is intentionally being included on all pages, sorry to see that you think it’s bloatware, it definitely not intentional.

    Best Regards,

    Thread Starter jetxpert

    (@jetxpert)

    Hi @bordoni,

    Thanks for the detailed reply. Much appreciated.

    Previous topic was opened as “unique” because de-queuing the placeholder js file was impacting our website and needed a “focused” reply. In any case, will avoid submitting topics that appear duplicated.

    The term “bloatware” was used because your plugin loads files (software) on pages that do not use (nor depend on) your plugin. Your fix will take care of this.

    If you don’t mind, can you ask your developers to come up with a snippet similar to the one provided above? Would be a nice tool to have and ascertain all unnecessary files are either not loaded or are dequeued.

    Looking forward to your update.

    Thank you!

    Thread Starter jetxpert

    (@jetxpert)

    Good News:

    I believe we found the snippet we were looking for.

    Click here: https://gist.github.com/samkent/b98bd3c9b28426b8461bc1417adf7b5d

    Can you confirm it works at your end – or update it if necessary? (using a development or test website)

    Thank you!

    Thread Starter jetxpert

    (@jetxpert)

    Update:

    We confirmed the GitHub snippet provided above gets the job done. It works!

    We added the following CSS and JS files to the above script for a complete clean-up (i.e., dequeue all scripts and styles on pages where calendar or events are not used).

    Under “Calendar Styles”:

    wp_dequeue_style('tribe-events-admin-menu');

    Note: Admin Menu (back-end) not impacted by the above. File deleted at the front-end without impacting back-end style.

    Under “Calendar Scripts”:

    wp_dequeue_script('jquery-placeholder');

    Note: For those who need to know, in order to use the above snippet, please download and install the plugin, Code Snippets. Run the snippet as “Run snippet everywhere.” (you will see this option in the back-end after you install the plugin)

    Must admit, GitHub rocks (and its contributors).

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Scripts and Styles Loading on Every Page (Bloatware)’ is closed to new replies.