the orphang_indicator_options function is called multiple times for both Admin Panel and normal page frontend. This causes the plugins to generate an array of options many times. As this array consists of post types, taxonomies and installed plugins it takes around 140ms of a load time of the webpage. With this cache this value is reduced to 1ms.
This is the load time reported by Code Profiler Pro before changes:
This is the load time reported after the changes:
Probably what would be good here is to refresh the cache after new plugin is installed, new taxonomy or post type is created. Or we could add a button to flush it on the options page itself.
the
orphang_indicator_options
function is called multiple times for both Admin Panel and normal page frontend. This causes the plugins to generate an array of options many times. As this array consists of post types, taxonomies and installed plugins it takes around 140ms of a load time of the webpage. With this cache this value is reduced to 1ms.This is the load time reported by Code Profiler Pro before changes:
This is the load time reported after the changes:
Probably what would be good here is to refresh the cache after new plugin is installed, new taxonomy or post type is created. Or we could add a button to flush it on the options page itself.