Only set the WP_CACHE constant if it is not found in the wp-config.php file. Previously it would overwrite define( 'WP_CACHE', false );. If this constant has been set in the wp-config.php file the Cache Enabler plugin should not overwrite it because this would have been explicitly set. A notice is still given to inform caching is disabled.
Only remove the WP_CACHE constant if it was added by Cache Enabler. Previously it would always remove the WP_CACHE constant if it was defined as true. If this constant was not set in the wp-config.php file by Cache Enabler then we should not remove it.
Fix Cache_Enabler_Disk::_file_path() issue that was introduced in version 1.4.0 when I changed the Cache_Enabler_Disk::_file_path() to use get_site_url() (PR #96). This caused the WordPress default domain redirect to not occur if the cached page already existed (e.g. https://example.com would not redirect to https://www.example.com after https://www.example.com was cached). This occurred because Cache_Enabler_Disk::_file_path() was able to find the cached page through get_site_url() and then deliver it (by PHP). Instead, get_site_url() should only be used when a $path parameter is provided, like when clearing the cache by URL.
Add cache bypass method for the WP_CACHE constant. By default WordPress core will define WP_CACHE as false (in the wp-includes/default-constants.php file), so checking defined( 'WP_CACHE' ) will always return true (meaning all ! defined( 'WP_CACHE' ) checks are unnecessary and have been removed). Cache will now be bypassed if define('WP_CACHE', false); is set, either by the WordPress core or in the wp-config.php file. This allows Cache Enabler to honor the WP_CACHE constant and is also helpful in the event caching needs to be disabled in certain environments (e.g. development).
Fix advanced cache settings issue that occurred in version 1.4.0 by adding a temporary clean in Cache_Enabler::on_ce_update() to delete incorrect file(s).
Add nonce names back that were removed in PR #96. Keep the names for now (instead of the default) but use better naming convention in the future.
Add translation descriptions for translators to improve the internationalization process and help expand the localization.
Update
Cache_Enabler::_set_wp_cache()
:Only set the
WP_CACHE
constant if it is not found in thewp-config.php
file. Previously it would overwritedefine( 'WP_CACHE', false );
. If this constant has been set in thewp-config.php
file the Cache Enabler plugin should not overwrite it because this would have been explicitly set. A notice is still given to inform caching is disabled.Only remove the
WP_CACHE
constant if it was added by Cache Enabler. Previously it would always remove theWP_CACHE
constant if it was defined astrue
. If this constant was not set in thewp-config.php
file by Cache Enabler then we should not remove it.Fix
Cache_Enabler_Disk::_file_path()
issue that was introduced in version 1.4.0 when I changed theCache_Enabler_Disk::_file_path()
to useget_site_url()
(PR #96). This caused the WordPress default domain redirect to not occur if the cached page already existed (e.g.https://example.com
would not redirect tohttps://www.example.com
afterhttps://www.example.com
was cached). This occurred becauseCache_Enabler_Disk::_file_path()
was able to find the cached page throughget_site_url()
and then deliver it (by PHP). Instead,get_site_url()
should only be used when a$path
parameter is provided, like when clearing the cache by URL.Add cache bypass method for the
WP_CACHE
constant. By default WordPress core will defineWP_CACHE
asfalse
(in thewp-includes/default-constants.php
file), so checkingdefined( 'WP_CACHE' )
will always returntrue
(meaning all! defined( 'WP_CACHE' )
checks are unnecessary and have been removed). Cache will now be bypassed ifdefine('WP_CACHE', false);
is set, either by the WordPress core or in thewp-config.php
file. This allows Cache Enabler to honor theWP_CACHE
constant and is also helpful in the event caching needs to be disabled in certain environments (e.g. development).Fix advanced cache settings issue that occurred in version 1.4.0 by adding a temporary clean in
Cache_Enabler::on_ce_update()
to delete incorrect file(s).Add nonce names back that were removed in PR #96. Keep the names for now (instead of the default) but use better naming convention in the future.
Add translation descriptions for translators to improve the internationalization process and help expand the localization.