Tagged: enfold optimisation, table optimisation, wp_options
-
AuthorPosts
-
November 15, 2023 at 12:07 pm #1425673
Hi guys,
I now have the full superspeedy pack from WP Intense which includes a lot of database modifications.They also encourage you to set as many non-essential WP_Options with Autoload YES to Autoload NO to speed up all uncached actions on a site.
https://www.wpintense.com/knowledgebase/managing-your-wp_options-table/I have had to do an extensive review of transients generated by plugins and also items that auto load. The speed difference from optimising wp_options in the backend and front end on large sites is massive.
I want to apply this same method to Enfold theme itself.
If you run the following SQL command you can see Enfold typically has over 100 – 150 autoloaded functions.
select left(option_name,15) option_name, count( * ) total from wp_options where autoload = 'yes' group by left(option_name,15) order by total desc limit 100;
(Note you need to change wp_ to your database prefix if it isnt wp_)
You can also then run:
SELECT * FROM wp_options where option_name like 'av_alb_usage_av%'; SELECT * FROM wp_options where option_name like 'av_alb_usage_av%' and autoload = 'yes';
and
DELETE FROM
or
UPDATEav_alb_usage_av has over 100 options:
av_alb_usage_av_blog
av_alb_usage_av_button
av_alb_usage_av_button_big
av_alb_usage_av_buttonrow
av_alb_usage_av_buttonrow_item
av_alb_usage_av_catalogue
av_alb_usage_av_catalogue_item
av_alb_usage_av_cell
av_alb_usage_av_cell_four_fifth
av_alb_usage_av_cell_one_fifth
av_alb_usage_av_cell_one_fourth
av_alb_usage_av_cell_one_full
av_alb_usage_av_cell_one_half
av_alb_usage_av_cell_one_third
av_alb_usage_av_cell_three_fifth
av_alb_usage_av_cell_three_fourth
av_alb_usage_av_cell_two_fifth
av_alb_usage_av_cell_two_third
av_alb_usage_av_codeblock
av_alb_usage_av_comments_list
av_alb_usage_av_contact
av_alb_usage_av_contact_field
av_alb_usage_av_content_slide
av_alb_usage_av_content_slider
av_alb_usage_av_countdown
av_alb_usage_av_feature_image_slider
av_alb_usage_av_font_icon
av_alb_usage_av_four_fifth
av_alb_usage_av_fullscreen
av_alb_usage_av_fullscreen_slide
av_alb_usage_av_gallery
av_alb_usage_av_gmap_location
av_alb_usage_av_google_map
av_alb_usage_av_heading
av_alb_usage_av_headline_rotator
av_alb_usage_av_horizontal_gallery
av_alb_usage_av_hr
av_alb_usage_av_icon_box
av_alb_usage_av_icongrid
av_alb_usage_av_icongrid_item
av_alb_usage_av_iconlist
av_alb_usage_av_iconlist_item
av_alb_usage_av_image
av_alb_usage_av_image_hotspot
av_alb_usage_av_image_spot
av_alb_usage_av_layerslider
av_alb_usage_av_layout_row
av_alb_usage_av_magazine
av_alb_usage_av_mailchimp
av_alb_usage_av_mailchimp_field
av_alb_usage_av_masonry_entries
av_alb_usage_av_masonry_gallery
av_alb_usage_av_metadata_item
av_alb_usage_av_notification
av_alb_usage_av_one_fifth
av_alb_usage_av_one_fourth
av_alb_usage_av_one_full
av_alb_usage_av_one_half
av_alb_usage_av_one_third
av_alb_usage_av_partner
av_alb_usage_av_partner_logo
av_alb_usage_av_player
av_alb_usage_av_playlist_element
av_alb_usage_av_portfolio
av_alb_usage_av_post_metadata
av_alb_usage_av_postcontent
av_alb_usage_av_postslider
av_alb_usage_av_product_button
av_alb_usage_av_product_info
av_alb_usage_av_product_meta
av_alb_usage_av_product_price
av_alb_usage_av_progress
av_alb_usage_av_progress_bar
av_alb_usage_av_promobox
av_alb_usage_av_rotator_item
av_alb_usage_av_row
av_alb_usage_av_section
av_alb_usage_av_sidebar
av_alb_usage_av_slide
av_alb_usage_av_slide_accordion
av_alb_usage_av_slide_full
av_alb_usage_av_slideshow
av_alb_usage_av_slideshow_accordion
av_alb_usage_av_slideshow_full
av_alb_usage_av_social_share
av_alb_usage_av_submenu
av_alb_usage_av_submenu_item
av_alb_usage_av_tab
av_alb_usage_av_tab_container
av_alb_usage_av_tab_section
av_alb_usage_av_tab_sub_section
av_alb_usage_av_table
av_alb_usage_av_team_icon
av_alb_usage_av_team_member
av_alb_usage_av_testimonial_single
av_alb_usage_av_testimonials
av_alb_usage_av_textblock
av_alb_usage_av_three_fifth
av_alb_usage_av_three_fourth
av_alb_usage_av_timeline
av_alb_usage_av_timeline_item
av_alb_usage_av_toggle
av_alb_usage_av_toggle_container
av_alb_usage_av_two_fifth
av_alb_usage_av_two_third
av_alb_usage_av_video
av_alb_usage_avia_sc_searchand there are also other autoloaded options from the theme including:
avia_stylesheet
avia_gutenberg_
avia_options_th
widget_avia-ins
avia_woocommercPlus others possibly in your installation vs mine.
Would it be possible to review these options and make it so those that only run in the back end of wordpress are set to Autoload = NO
Would it also be possible to provide a list of those that can safely be set to NO? I can then run an SQL command to set them to NO:Like this:
update wp_options set autoload = 'no' where option_name like 'av_alb_usage_av_animated_numbers%' and autoload = 'yes';
Transients Review
SELECT
option_name
ASname
,option_value
ASvalue
FROM LkxroSS_options
WHEREoption_name
LIKE ‘%transient_%’
ORDER BYoption_name
Anything Enfold auto generates that shouldnt be autoloaded?
- This topic was modified 1 year, 1 month ago by thinkjarvis.
- This topic was modified 1 year, 1 month ago by thinkjarvis.
November 18, 2023 at 5:43 pm #1425932Hey Thomas,
I reviewed the /managing-your-wp_options-table/ page that you linked to and at the bottom it says:You can set the autoload value to anything other than ‘yes’ and they will not be autoloaded, but still be available if a plugin really does need them. You can use ‘no’ but if you use ‘wpi’ or some other value it lets you revert your changes if you need to.
This option is safe, because the options will remain in your database and be available for the relevant plugin, they just won’t be autoloaded on every page.so as I understand what they are writing is that changing autoload to ‘wpi’ is safe and doesn’t affect the element except that it doesn’t autoload, when I check with ChatGPT it says:
In WordPress, options are typically autoloaded by default for better performance, as it reduces the number of database queries required to load commonly used data.
and it offers the following function to add to your child theme functions.php to change the autoload instead of a database query:
update_option('av_alb_usage_av_catalogue', '', 'wpi');
, for the catalog element. when I tested on my site the database showed that the autoload was changed and the element seemed to work correctly on the frontend and backend.
WordPress’s update_option function doesn’t support wildcard patterns like ‘av_alb_usage_av_%’ in the option_name, so if you want to change multiple options you would need to specify the individual option names when using update_option, or you could try this to prevent the autoloading for multiple options:global $wpdb; $options_to_disable_autoload = $wpdb->get_results(" SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'av_alb_usage_av_%' "); if ($options_to_disable_autoload) { foreach ($options_to_disable_autoload as $option) { update_option($option->option_name, '', 'wpi'); } }
you could also use this for plugins with multiple options, I would recommend testing this on a staging site first as thoroughly testing would be the only way to determine how your site will behave.
Best regards,
MikeNovember 20, 2023 at 10:52 am #1426045Hi Mike,
Thank you for this.
I expect I can turn all of the options to NO or WPI without an issue.The WPI – is just a way to revert those options if something goes wrong because anything other than YES is equal to NO. So by setting them to WPI I can run a query to replace WPI with NO or YES but I cannot do that if I go straight to NO.
Sorry I think you have misunderstood.
I am asking if Enfold can update the way that WP_Options Autoloaded features are managed.
As a stop gap. I am capable of manually changing these values but what I was hoping is that we can alter the queries here so that:1. We already have an option to only load the CSS and JS of used components in the Enfold performance panel BUT it looks like those options are still set to Autoload= YES even if they are not used. Is it possible to add some logic to change the value from YES to NO and back again depending on if the components are used?
2. A review of the other autoloaded functions that Enfold createsBy doing this it will speed up WP-Admin and the front end of the site as less autoloads means less data required per pageload. This will improve the TTFB scores for uncached queries and speed up page caching because less data is autoloaded.
Let me know your thoughts.
November 20, 2023 at 12:22 pm #1426056I have set all options to NO and all seems fine – HOWEVER any newly generated settings are still coming in as YES.
I’ll now keep an eye on things to see which ones appear back as YES again – These should be OK.
November 20, 2023 at 12:29 pm #1426058Hi,
Thanks for the further information, this sounds like a feature request that the Dev Team will need to review, the Dev Team has opened a new Github Feature Request for users to place requests and follow them as the Dev Team reviews them.
Please post your request there instead of here in the support threads as the Dev Team doesn’t always check here.
Thank you for your patience and understanding.Best regards,
MikeNovember 20, 2023 at 12:43 pm #1426062No problem,
I have set all generated functions to WPI / NO and the site is still stable so looking promising.
I will say that some of the items generated are extremely small for the most part so the impact for some of them is minimal.
But some of them are quite large.
I’ll report back on this. Will see which ones get removed and re-added with YES over time.
I wasnt expecting support to provide an instant response or result with this – It is a big job so dont worry!
- This reply was modified 1 year, 1 month ago by thinkjarvis.
- This reply was modified 1 year, 1 month ago by thinkjarvis.
November 20, 2023 at 6:34 pm #1426092Hi,
Ok, we will leave this thread open, but I recommend that you create a new Github Feature Request for it as one has not been created so it’s not on the list.
Thank you for your patience and for using Enfold.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.