Optimisation suggestion of Plugin Organiser
-
Hello,
I am a huge fan of Plugin Organiser: have been using it for over 5 years and it’s brilliant!
I am an optimisation fanatic. Plugin Organiser which saves my page dozens of database query is unfortunately now responsible for a full 25% (source: New Relic) of all my database transactions! And it’s now the slowest query on all my pages.
The crazy thing is that it’s always the same query called on each page:SELECT disabled_plugins, disabled_mobile_plugins, disabled_groups, disabled_mobile_groups FROM wp_tpf_po_plugins WHERE post_type=? AND post_id=?
(Source: Query Monitor)
This query retrieves 54,000 rows and lasts 0.01s (my slowest query).My suggestion: could it not be possible to add this query to an object cache if one is detected (I use Redis).
Here for instance is how I implemented object cache in my code (I’m nowhere as good a programmer as you are – just a thought to explore):
$cachekey="ememberlevel".$photo_user_id; $membership_level = wp_cache_get( $cachekey ); if ( false === $membership_level ) { $membership_level = $wpdb->get_var("Select membership_level From wp_tpf_wp_eMember_members_tbl Where user_name = '".$user_name."'"); wp_cache_set( $cachekey, $membership_lavel,'',86400); }
In advance thanks for your consideration and your outstanding work on the plugin.
- The topic ‘Optimisation suggestion of Plugin Organiser’ is closed to new replies.