You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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.
Update admin core render and save logic with backward compatibility:
Update give_get_option to get setting by each section, tab or all with backward compatibility
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:
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:
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.Update admin core render and save logic with backward compatibility:
give_get_option
to get setting by each section, tab or all with backward compatibilityRelated Links:
The text was updated successfully, but these errors were encountered: