feedback: optimize cli_flush_cache js var
-
Hello. Thanks for the plugin. I discovered that your php and js code has a var
cli_flush_cache
that can be optimized. This will result in less HTML being sent to customers on every page.cli_flush_cache
is only in two files….class-cookie-law-info-public.php lines after 468===========
You setcli_flush_cache
to 1 or 2
And then always write out this var and its value as HTML script code on every response from the serverHowever….
cookie-law-info-public.js line 539=============
You test ifcli_flush_cache
is defined && ==1
do a function
else…
do plain reloadTherefore you write out this
cli_flush_cache=2
javascript in class-cookie-law-info-public.php line 504-506 when cli_flush_cache=2. This is unneeded. Because if you don’t write any js in every page’s HTML, then thecli_flush_cache
will be undefined. Therefore your code in cookie-law-info-public.js line 539 will correctly run the else clauseI could: remove_action(‘wp_head’,array($this,’other_plugin_clear_cache’));
But a reference to the currently instantiated class is not readily available, so I would need to write/run yet more code just toremove_action
- The topic ‘feedback: optimize cli_flush_cache js var’ is closed to new replies.