Plugin running request on every admin load
-
Hey guys,
I’ve been running through and handling some optimization on a few sites, and noticed that the current R+L plugin runs the get_pallet_types request on every admin_init (which also fires on the front-end during ajax calls) which can impact performance for end users. By either caching that call or changing those settings fields to only be registered on the individual settings page, it can speed that up and reduce the number of API calls made using that method. Below is an example (added to line 595 in woocommerce-shipping-rlc.php – at the beginning of the
wc_rlc_settings_init
function):global $pagenow; if ( ! ( $_GET['page'] == 'wc-rlc-settings' || $pagenow == 'options.php' ) ) { return; }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Plugin running request on every admin load’ is closed to new replies.