Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(admin-setting): optimize loading of options #2491

Closed
DevinWalker opened this issue Dec 8, 2017 · 1 comment
Closed

perf(admin-setting): optimize loading of options #2491

DevinWalker opened this issue Dec 8, 2017 · 1 comment
Assignees

Comments

@DevinWalker
Copy link
Member

Issue Overview

If you run the following SQL query:

SELECT * FROM wp_options WHERE option_name LIKE '%give_%' AND autoload='yes'

… Then you will find that there is certain data that we are storing in option table that has autoload set to true. This means that it will load on each page even we do not need it:

image_1

The get_option() function internally caches all autoload options, so Give options will load only the first time.

The Issue with Autoload

  • It adds unwanted weight for first the get all options query.

  • We are storing all core settings in a serialize array. So every time we have to get all core setting even if we only need:

    • Page related setting

    • Currency related setting

    • Email setting

    • Advance setting etc.

Solution

To resolve above issue we can do following:

  • Stop setting autoload to true for all core options.

  • Group similar settings into their own groups. For example:

    • Currency settings

    • Page settings

    • Payment gateway setting ( per payment gateway )

    • Email setting

To achieve this we have to do following this:

  1. Develop a Core setting upgrade routine:
    This will restore setting according to their setting_page[section][tab][setting_name1], setting_page[section][tab][setting_name2], etc.

  2. Update admin core render and save logic with backward compatibility:

image_2

  1. Update give_get_option to get setting by each section, tab or all with backward compatibility

Related Links:

@ravinderk
Copy link
Collaborator

Slack Chat Summary

Participants: @DevinWalker Ravinder Kumar
Topic: Scope of this issue
Result: Set autoload to no for most of Give settings.

DevinWalker pushed a commit that referenced this issue Jul 17, 2018
perf(admin-setting): optimize loading of options #2491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants