facebook-for-woocommerce icon indicating copy to clipboard operation
facebook-for-woocommerce copied to clipboard

Assets performance suggestions + DB query optimisations

Open Camilo517 opened this issue 4 years ago • 3 comments

Loading in the header of all administration pages. It should load in the footer using "defer" and only when necessary /wp-content/plugins/facebook-for-woocommerce/assets/js/admin/google-product-category-fields.js /wp-content/plugins/facebook-for-woocommerce/assets/js/facebook-infobanner.min.js?ver=2.4.1

It loads in all the administration pages, and it is not minified /wp-content/plugins/facebook-for-woocommerce/assets/css/facebook-infobanner.css?ver=2.4.1

Duplicate queries and they are made outside the administration page /wp-admin/admin.php?page=wc-facebook

SELECT option_value FROM cr6wPeGq_options WHERE option_name = 'wc_facebook_background_handle_virtual_products_variations_complete' LIMIT 1

SELECT option_value FROM cr6wPeGq_options WHERE option_name = 'wc_facebook_enable_debug_mode' LIMIT 1

Camilo517 avatar May 12 '21 12:05 Camilo517

Thanks for the suggestions @Camilo517 !

It looks like you're reporting two issues - it's helpful for us if each issue is reported separately. Please also include details of what how the issue affects your store. This helps us understand the severity and prioritise fixes.

haszari avatar May 12 '21 20:05 haszari

Yeah, WP admin asset management is a real dumpster :fire: Because frontend gets measured by 10 different tools and SEO penalties, everybody's worried about what they load. But in WP admin it's apparently OK to load 100 "irrelevant to current screen" scripts and stylesheets.

https://developer.wordpress.org/reference/functions/get_current_screen/ is your enqueue conditional friend, everyone.

lkraav avatar May 13 '21 12:05 lkraav

@budzanowski Please

Camilo517 avatar Nov 11 '21 08:11 Camilo517

Duplicate queries and they are made outside the administration page /wp-admin/admin.php?page=wc-facebook

SELECT option_value FROM cr6wPeGq_options WHERE option_name = 'wc_facebook_background_handle_virtual_products_variations_complete' LIMIT 1

SELECT option_value FROM cr6wPeGq_options WHERE option_name = 'wc_facebook_enable_debug_mode' LIMIT 1

These are related to async job functionality, they would run outside of the FB admin screen. I decided not to address this topic on this issue ticket.

PR #2331 addresses the issue with admin/google-product-category-fields.js. As for the infobanner asset, we'll wait until we audit the WC_Facebookcommerce_Info_Banner class. See #1981

Thanks.

rawdreeg avatar Oct 19 '22 16:10 rawdreeg