WPIntell

Source evidence

defer javascript loading

Datafeedr Comparison Sets · support · 2024-12-02T16:56:00+00:00

complaintsentiment
mediumseverity
0.92relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 19 rows with source links

10.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

17 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
agile_pixel unresolved
I would like to propose deferring the loading of the compset.js to the footer if that’s possible? wp_enqueue_script(‘dfrcs_compsets’, DFRCS_URL . ‘js/compsets.js’, array(‘jquery’), DFRCS_VERSION, true); It’s single line change in actions.php, this would help with performance and is a best practice for loading javascript. If moving to the footer is not possible, perhaps deferring the javascript instead? Or if it’s not for everyone having it as an option in the CMS Hi You can add the following code to a custom plugin to load the compsets.js file either in the footer or use defer (or both… it’s up to you). add_action( 'wp_enqueue_scripts', 'modify_dfrcs_compsets_script', 10000000 ); // Priority must be higher than the original enqueue function. function modify_dfrcs_compsets_script() { // Dequeue the original script wp_dequeue_script( 'dfrcs_compsets' ); // Re-enqueue the script in the footer wp_enqueue_script( 'dfrcs_compsets', DFRCS_URL . 'js/compsets.js', array( 'jquery' ), DFRCS_VERSION, true // Set to true to load in the footer ); } Here’s how to add a custom plugin to your site: https://datafeedrapi.helpscoutdocs.com/article/32-creating-your-own-custom-plugin Hope this helps!

Comments

2 shown
agile_pixel 2024-12-02T16:57:00+00:00

Or if it’s not for everyone having it as an option in the CMS

datafeedr 2024-12-03T02:31:00+00:00

Hi You can add the following code to a custom plugin to load the compsets.js file either in the footer or use defer (or both… it’s up to you). add_action( 'wp_enqueue_scripts', 'modify_dfrcs_compsets_script', 10000000 ); // Priority must be higher than the original enqueue function. function modify_dfrcs_compsets_script() { // Dequeue the original script wp_dequeue_script( 'dfrcs_compsets' ); // Re-enqueue the script in the footer wp_enqueue_script( 'dfrcs_compsets', DFRCS_URL . 'js/compsets.js', array( 'jquery' ), DFRCS_VERSION, true // Set to true to load in the footer ); } Here’s how to add a custom plugin to your site: https://datafeedrapi.helpscoutdocs.com/article/32-creating-your-own-custom-plugin Hope this helps!