soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Improve oxygen database engine #770

Open wpsumo opened 4 years ago

wpsumo commented 4 years ago

Describe the feature you'd like to see included in Oxygen.

First highlighted in the facebook group: https://www.facebook.com/groups/1626639680763454/permalink/2610664982360914/

name value
ct_svg_sets 3832156
oxygen_vsb_google_fonts_cache 105620
ct_components_classes 71856
ba1f1516b00620c8623a210b3b31e0ce 40383
8a78337039f1394407a7861036cb4b43 39947
-- --

What are the use cases for this feature? Consider improve the Oxygen database engine by optimising size and settings for auto_load.

Generally you only want to make an index if the number of autoload = no options greatly outweigh the autoload = yes options.

As a rule of thumb if 60-80% of the option_name keys are autoload = no values then an index is a good idea.

In my case using oxygen: 61.7% Usually are between 20-40% on non Oxygen builder websites.

I highly recommend Oxygen users to utilise Redis object cache and if you feel comfortable adding a MySQL index do so, until this is solved and optimised. But even then WP Admin and post edit feels slow when using ACF PRO (loading local json no DB) and Oxygens ACF integration which has some php notices which may affect performance.

The wp_options table can be very bloated due to all the settings placed there by themes and plugins. I clean up WordPress options tables quite often for my clients on Codeable to help speed up the wp-admin dashboard area. If you use a plugin that stores a lot of transient or session data in the options table then there are two ways to speed this up: using object cache and adding a MySQL index. The object cache solution will put your options table in a daemon like Redis or Memcached so the values can be fetched from RAM. The other solution is adding an index to the wp_options table so that finding the relevant options takes less time (a MySQL index is similar to an index in a large book).

_Source: https://guides.wp-bullet.com/add-mysql-index-wordpress-wp_options-table/_

Other relevant performance tickets:

755

18

761

wpsumo commented 4 years ago

@Spellhammer FYI

ghost commented 4 years ago

I'm disappointed that this issue is still unresolved after the better part of a year. The autoload size of ct_svg_sets is outrageous. It single-handedly causes a total autoload of 10MB or more for Oxygen sites that have a bunch of icon sets added.

I really, really hope this issue has been neglected because of a major overhaul to the entire builder that is launching sooner rather than later, perhaps as Oxygen 4.0. General builder load times are abysmal and the entire WP admin area feels very slow with Oxygen installed.

(I love Oxygen, but these really need to be sorted)

wpsumo commented 4 years ago

@Spellhammer I assume users can change certain tables to auto_load "no" without any issues? But sorting this in the core is a better solution and maybe try to compress the code storage in the options rows in general.

There is several of rows from oxygen I think all is loaded as everywhere auto_load "yes" do all these tables really needed everywhere and to load everywhere as auto_load "yes"?

Oxygen is as @BrynWithin Saying slowing down wp admin and and edit post. It's a huge difference from having oxygen plugins enabled or disabled. Fixing all bugs and php errors and improver things like the database storage would be a nice thing to see soon.

The autoload size of ct_svg_sets is outrageous

Indeed over 0.5kb in most of the cases if you have more than one pack. of course users could merge packages into only used icons or clean all packs but it's not convinient if it's already uploaded. Maybe disable and enable UI in the icons pack withih oxygen would be helpful as well.

KittenCodes commented 3 years ago

As of v3.7 Beta 1, ct_svg_sets is no longer auto-loaded: https://oxygenbuilder.com/2021/01/22/oxygen-3-7-beta-1-now-available/.

wpsumo commented 3 years ago

As of v3.7 Beta 1, ct_svg_sets is no longer auto-loaded: https://oxygenbuilder.com/2021/01/22/oxygen-3-7-beta-1-now-available/.

@KittenCodes As I understand it this is only for new installs? What prevent you from fixing this in existing installs?

ghost commented 3 years ago

As of v3.7 Beta 1, ct_svg_sets is no longer auto-loaded: https://oxygenbuilder.com/2021/01/22/oxygen-3-7-beta-1-now-available/.

@KittenCodes As I understand it this is only for new installs? What prevent you from fixing this in existing installs?

I just checked and the site I upgraded to this new beta does not autoload ct_svg_sets. So it is retroactive for any site that updates to the latest version of Oxygen.

wpsumo commented 3 years ago

@BrynWithin I agree it's not even relevant to do it for new installs only. I don't even beleive it's hard to do it on exsisting ones? I can do it manually sure and just use a sandbox site as a reference to see which they swapped to no to. But I think this should be fixed in the core and not be limited to new installs only. It's a less pleasing new fix.

ghost commented 3 years ago

@BrynWithin I agree it's not even relevant to do it for new installs only. I don't even beleive it's hard to do it on exsisting ones? I can do it manually sure and just use a sandbox site as a reference to see which they swapped to no to. But I think this should be fixed in the core and not be limited to new installs only. It's a less pleasing new fix.

I don't think I follow your comment. Yes, it only takes a minute to manually fix the issue currently, but this HAS been updated into the core Oxygen plugin. Users with existing sites don't need to do anything. Once the update is released, all sites will stop autoloading the SVG sets. It is not limited to new installations, hence my comment above. That was an existing installation that I updated.

wpsumo commented 3 years ago

@BrynWithin I agree with you. My answer was more towards oxygen. Sure we can do it manually, but it defines the point of the improvement, and only offering new installs the fix doesn't make sense. At least an answer why they don't implement this on existing installs. Did they face issues? What issues?

Do you say the auto_load is sorted on existing installs? I have not tested just read the changelog. Which database tables did they change to no? Only the svg table? As there is several that could be tweaked and changed to no.

ghost commented 3 years ago

@BrynWithin I agree with you. My answer was more towards oxygen. Sure we can do it manually, but it defines the point of the improvement, and only offering new installs the fix doesn't make sense. At least an answer why they don't implement this on existing installs. Did they face issues? What issues?

Do you say the auto_load is sorted on existing installs? I have not tested just read the changelog. Which database tables did they change to no? Only the svg table? As there is several that could be tweaked and changed to no.

Hold up. Are you saying that Oxygen must fix the autoload issue on sites that don't perform an Oxygen update? How is that possible?

The autoload fix makes no distinction between existing and new Oxygen sites. All that matters is that Oxygen is version 3.7 or later. You don't have to manually fix anything if you'd prefer to just hold out for the update.

It would be a lot of work to figure out if anything else has switched from autoloading. The only two that matter are SVG sets and the Google Fonts cache. The latter is still autoloading in 3.7b1, even with Google Fonts disabled.

wpsumo commented 3 years ago

Hold up. Are you saying that Oxygen must fix the autoload issue on sites that don't perform an Oxygen update? How is that possible?

No no. I meant that I read the changelog. And the changelog states this change is only for new installs. Meaning new fresh installs not updates. That is how I understood the changelog, but I might be wrong.

Fix: New Oxygen installs will no longer auto-load unnecessary Oxygen related options

So you misunderstood me and I never tested only read the changelog. So the rest was just if it doesn't apply to updates only new installs meaning it doesn't alter the table if its plugin update just new creations meaning new installs. Then we would have to manually look at a fresh install and see what tables are set to no and then do the same manually. Which is easy, but we shouldn't alter this ourselves.

But if you say the changes applies on plugin update then we are fine. As I said I understood "new oxygen installs" as limited only to new installs not applying the changes to existing and once you update the plugin.

ghost commented 3 years ago

Hold up. Are you saying that Oxygen must fix the autoload issue on sites that don't perform an Oxygen update? How is that possible?

No no. I meant that I read the changelog. And the changelog states this change is only for new installs. Meaning new fresh installs not updates. That is how I understood the changelog, but I might be wrong.

Fix: New Oxygen installs will no longer auto-load unnecessary Oxygen related options

So you misunderstood me and I never tested only read the changelog. So the rest was just if it doesn't apply to updates only new installs meaning it doesn't alter the table if its plugin update just new creations meaning new installs. Then we would have to manually look at a fresh install and see what tables are set to no and then do the same manually. Which is easy, but we shouldn't alter this ourselves.

But if you say the changes applies on plugin update then we are fine. As I said I understood "new oxygen installs" as limited only to new installs not applying the changes to existing and once you update the plugin.

Yeah, no stress. It does fix the SVG sets autoload for any site that is on 3.7.

wpsumo commented 3 years ago

Thanks for the confirmation as you have tested. The changelog was confusing me but never had time to check the beta version. You said they still set auto load to yes on oxygen_vsb_google_fonts_cache even if it's disabled. @KittenCodes Why did you decide to not set it as yes. And what is the reasoning behind all table rows new settings as you went through all of them.

wpsumo commented 2 years ago

@KittenCodes All svg icons is not set to "no" see below as this are the biggest auto_loads from Oxygen and majority of them is set to "yes", why is the specific sets not set to no?

We can not delete the two default icon sets, only the one we manually uploaded. Today I mainly use inline svg in code block as svg icons via the builder add the extra divs and IDs and classes when it's not needed. Sometimes we need div but then we can just wrap it. Or we have a code block which wrap the inline svg anyhow.

    ct_svg_sets Array ...   4214886 no  oxygen
    ct_svg_sets_font-awesome-5-light 0  <?xml version= ...  1200103 yes oxygen (35.29%)
    ct_svg_sets_flags-v0.5 0    <?xml version= ...  812115  yes oxygen (44.44%)
    ct_svg_sets_Font Awesome 0  <?xml version= ...  579449  yes oxygen (46.15%)
    ct_svg_sets_icon-v0.5 0 <?xml version= ...  577153  yes oxygen (46.15%)
    ct_svg_sets_icons-v1 0  <?xml version= ...  466138  yes oxygen (48%)
    ct_svg_sets_bootstrap-icons 0   <?xml version= ...  395027  yes oxygen (41.38%)
    ct_svg_sets_Linearicons 0   <?xml version= ...  184660  yes oxygen (48%)
KittenCodes commented 2 years ago

@wpsumo

All svg icons is not set to "no" see below as this are the biggest auto_loads from Oxygen and majority of them is set to "yes", why is the specific sets not set to no?

Is this on a clean site running v3.7+ or an older site that's been updated?

wpsumo commented 2 years ago

@KittenCodes This is on an older site that has been updated. Which options should be set to "no" as there is plenty of "yes" in auto_load from oxygen.

KittenCodes commented 2 years ago

@wpsumo

On a clean install, the only ct_* options I can see that have autoload set to yes are:

ct_global_settings ct_last_installed_default_data ct_style_folders ct_style_sets

There are then a number of Oxygen options that are set to yes as well: _transient_oxygen_vsb_source_color_lookup_table oxygen_aos_classes oxygen_license_key oxygen_license_updated oxygen_options_autoload oxygen_private_key oxygen_rewrite_rules_updated oxygen_vsb_access_role_author oxygen_vsb_access_role_contributor oxygen_vsb_access_role_editor oxygen_vsb_access_role_subscriber oxygen_vsb_block_category_label oxygen_vsb_comments_list_templates oxygen_vsb_css_cache_generated_2_2 oxygen_vsb_css_files_state oxygen_vsb_disable_embeds oxygen_vsb_disable_emojis oxygen_vsb_disable_google_fonts oxygen_vsb_disable_jquery_migrate oxygen_vsb_easy_posts_templates oxygen_vsb_enable_3rdp_designsets oxygen_vsb_enable_connection oxygen_vsb_enable_default_designsets oxygen_vsb_enable_google_fonts_cache oxygen_vsb_enable_ie_layout_improvements oxygen_vsb_enable_selector_detector oxygen_vsb_enable_signature_frontend_errors oxygen_vsb_enable_signature_validation oxygen_vsb_full_page_block_category_label oxygen_vsb_global_colors oxygen_vsb_google_maps_api_key oxygen_vsb_history_limit oxygen_vsb_ignore_post_type_page oxygen_vsb_ignore_post_type_post oxygen_vsb_ignore_post_type_user_request oxygen_vsb_ignore_post_type_wp_block oxygen_vsb_ignore_post_type_wp_template oxygen_vsb_last_save_time oxygen_vsb_latest_typekit_fonts oxygen_vsb_options_role_access_advanced_tab oxygen_vsb_options_role_access_disable_classes oxygen_vsb_options_role_access_disable_ids oxygen_vsb_options_role_access_drag_n_drop oxygen_vsb_options_role_access_enable_elements oxygen_vsb_options_role_access_enabled_elements oxygen_vsb_options_users_access_advanced_tab oxygen_vsb_options_users_access_disable_classes oxygen_vsb_options_users_access_disable_ids oxygen_vsb_options_users_access_drag_n_drop oxygen_vsb_options_users_access_enable_elements oxygen_vsb_options_users_access_enabled_elements oxygen_vsb_options_users_access_list oxygen_vsb_presets_updated_3_3 oxygen_vsb_presets_updated_3_4 oxygen_vsb_preview_dropdown_exclude_non_public oxygen_vsb_preview_dropdown_limit oxygen_vsb_show_all_acf_fields oxygen_vsb_universal_css_cache oxygen_vsb_universal_css_cache_success oxygen_vsb_universal_css_latest_version oxygen_vsb_universal_css_url oxygen_vsb_update_3_6 oxygen_vsb_update_3_7 oxygen_vsb_use_css_for_google_fonts oxygen-vsb-activated

I hope this helps!

Pino4 commented 2 years ago

So oxygen_vsb_element_presets can be set to autoload = no ?

KittenCodes commented 2 years ago

@Pino4 Yes, that's correct.

massimoghm commented 2 years ago

For unlucky people that came here.

Fresh installation autoload wp_options (with Gutenberg and WooCommerce add-on):

ct_ ct_global_settings ct_style_sets ct_style_folders ct_last_installed_default_data

oxygen_ oxygen_vsb_ignore_post_type_oxy_user_library oxygen_vsb_site_screenshot oxygen_vsb_screenshot_generate_url oxygen_vsb_connection_access_key oxygen_rewrite_rules_updated oxygen_vsb_disable_emojis oxygen_vsb_disable_jquery_migrate oxygen_vsb_disable_embeds oxygen_vsb_use_css_for_google_fonts oxygen_vsb_universal_css_cache oxygen_aos_classes oxygen_vsb_universal_css_cache_success oxygen_vsb_universal_css_url oxygen_vsb_last_save_time oxygen_vsb_universal_css_latest_version oxygen_vsb_presets_updated_3_3 oxygen_vsb_element_presets oxygen_license_key oxygen_license_updated oxygen_vsb_css_cache_generated_2_2 oxygen_options_autoload oxygen_vsb_update_3_7 oxygen_vsb_global_colors oxygen_vsb_history_limit oxygen_vsb_preview_dropdown_limit oxygen_vsb_preview_dropdown_exclude_non_public oxygen_vsb_enable_selector_detector oxygen_vsb_enable_default_designsets oxygen_vsb_enable_3rdp_designsets oxygen_vsb_enable_connection oxygen_vsb_google_maps_api_key oxygen_vsb_show_all_acf_fields oxygen_vsb_enable_google_fonts_cache oxygen_vsb_enable_ie_layout_improvements oxygen_vsb_enable_signature_validation oxygen_vsb_enable_signature_frontend_errors oxygen_vsb_disable_google_fonts oxygen_vsb_block_category_label oxygen_vsb_full_page_block_category_label oxygen_vsb_options_users_access_list oxygen_vsb_options_users_access_enable_elements oxygen_vsb_options_users_access_advanced_tab oxygen_vsb_options_users_access_drag_n_drop oxygen_vsb_options_users_access_enabled_elements oxygen_vsb_options_users_access_disable_classes oxygen_vsb_options_users_access_disable_ids oxygen_vsb_options_role_access_enable_elements oxygen_vsb_options_role_access_advanced_tab oxygen_vsb_options_role_access_drag_n_drop oxygen_vsb_options_role_access_enabled_elements oxygen_vsb_options_role_access_disable_classes oxygen_vsb_options_role_access_disable_ids oxygen_vsb_access_role_editor oxygen_vsb_access_role_author oxygen_vsb_access_role_contributor oxygen_vsb_access_role_subscriber oxygen_vsb_ignore_post_type_post oxygen_vsb_ignore_post_type_page oxygen_vsb_ignore_post_type_user_request oxygen_vsb_ignore_post_type_wp_block oxygen_vsb_ignore_post_type_wp_template oxygen_vsb_ignore_post_type_wp_template_part oxygen_vsb_ignore_post_type_wp_global_styles oxygen_vsb_ignore_post_type_wp_navigation oxygen-vsb-activated _transient_oxygen_vsb_source_color_lookup_table oxygen_vsb_update_3_6 oxygen_private_key oxygen_vsb_css_files_state

massimoghm commented 2 years ago

@Pino4 Yes, that's correct.

no, I've checked in a fresh install. Or maybe this is another error?

wpsumo commented 2 years ago

@KittenCodes Would make sense to list the ones that should have autoload set to no. But preferably fix on existing installs and not just solve the issue for new installs of 3.7.

wpsumo commented 2 years ago

@KittenCodes Can you revert back regarding above and maybe correctly fix all this in existing installs?

wpsumo commented 2 years ago

@Spellhammer Maybe you could follow up on this thread as only new installations have what you define to be fixed. Would be good to know which you need to have auto_load according to you and then we can set the rest to no. Would be good for the documentation to have it specified here.

Spellhammer commented 2 years ago

@wpsumo The only list I can find of fields marked as safe for not auto-loading is:

ct_components_classes ct_custom_selectors ct_style_sheets ct_svg_sets oxygen_vsb_google_fonts_cache oxygen_vsb_element_presets

There may be more that you can set to not auto load safely.

nicomorganmedia commented 11 months ago

My wp-options overhead was huge so i am grateful for this discussion to enable me to switch some of these off!