Add Jetpack sync module to sync WP Super Cache constants and global variables#6482
Add Jetpack sync module to sync WP Super Cache constants and global variables#6482
Conversation
|
I've created a pull request so that I can share my progress with teammates. This is a work in progress and is not meant/ready for review. |
sync/class.jetpack-sync-actions.php
Outdated
|
|
||
| static function initialize_wp_super_cache() { | ||
| //WPCACHEHOME looks like a reasonable constant to test for the plugin's presence as per https://github.com/Automattic/wp-super-cache/blob/master/wp-cache.php | ||
| if ( false === defined( 'WPCACHEHOME' ) ) { |
There was a problem hiding this comment.
Hey @donnchawp - Since we need to check in Jetpack if WP Super Cache is active, we need to find an option, constant, etc. to check against. Is there one that you'd recommend to test against?
There was a problem hiding this comment.
WPCACHEHOME should be good to use, but if you want to double check, use $wp_super_cache_debug too - it should be set to 0 or 1 and is in the sample config file so it's defined even if the user hasn't configured the plugin yet.
There was a problem hiding this comment.
we could use function_exists too
|
Should some of the WP Super Cache stuff be in the |
| protected $post; | ||
| protected $callable_module; | ||
| protected $full_sync; | ||
| static $woo_enabled; |
There was a problem hiding this comment.
probably do not need this any more.
There was a problem hiding this comment.
Thanks, Enej. Removed.
There was a problem hiding this comment.
"wp-super-cache" could use simple quotes
There was a problem hiding this comment.
We could add something similar to this test: https://github.com/Automattic/jetpack/blob/master/tests/php/sync/test_class.jetpack-sync-options.php#L65
76a69dc to
f073c7c
Compare
tests/php/bootstrap.php
Outdated
There was a problem hiding this comment.
Lets do a if function exists here in case some one runs it with the plugin installed.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
We missed the 4.7 boat lets update it to 4.8
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
We missed the 4.7 boat lets update it to 4.8
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
We missed the 4.7 boat lets update it to 4.8
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
We missed the 4.7 boat lets update it to 4.8
sync/class.jetpack-sync-defaults.php
Outdated
sync/class.jetpack-sync-actions.php
Outdated
There was a problem hiding this comment.
Lets remove this comment. Since we are not using WPCACHEHOME constant any more.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
we don't seem to be using these anymore :)
tests/php/bootstrap.php
Outdated
There was a problem hiding this comment.
"1" could be written as '1' to match coding standards
tests/php/bootstrap.php
Outdated
…enabled() instead of if WPCACHEHOME is defined in case the latter is left behind by a config file.
…listing mechanism for WP Super Cache Module Updated "default" whitelisting mechanism to ensure filters (which add values to whitelisted array) are only run once when getters are called so that they don't repeatedly add the same values if getters are called again. Using mechanism to add values to constant and callable whitelists to sync WP Super Cache data.
…on before defining it
a645f85 to
4c97aaa
Compare
* Readme: remove old release and add skeleton for 4.8. * Changelog: add #6572 * Changelog: add #6567 * Changelog: add #6542 * Changelog: add #6527 * Changelog: add #6508 * Changelog: add #6478 * Changelog: add #6477 * Changelog: add #6249 * Update stable version and remove old version from readme. * Changelog: add 4.7.1 to changelog. * Readme: add new contributor. * Sync: update docblock @SInCE version. Related: #6053 * Changelog: add release post. * changelog: add #6053 * Changelog: add #6413 * Changelog: add #6482 * Changelog: add #6584 * Changelog add #6603 * Changelog: add #6606 * Changelog: add #6611 * Changelog: add #6635 * Changelog: add #6639 * Changelog: add #6684 * Changelog: add #6710 * Changelog: add #6711 * Changelog: add #5461 * Testing list: update Settings UI feedback prompt. Props @MichaelArestad * Changelog: add #6789 * Changelog: add #6778 * Changelog: add #6777 * Changelog: add #6775 * Changelog: add #6755 * Changelog: add #6731 * Changelog: add #6721 * Changelog: add #6705 * Changelog: add #6702 * Changelog: add #6671 * Changelog: add #6637 * Changelog: add #6582 * Changelog: add #6566 * Changelog: add #6555 * Changelog: add #6529 * Changelog: add #6344 * Changelog: add #5763 * Changelog: add #5503 * Changelog: update #6637 changelog. @see 40e115c#commitcomment-21523982 * Changelog: add #6699 * Changelog: add #6632 * Changelog: add #6769 * Changelog: add #6707 * Changelog: add #6590
Changes proposed in this Pull Request:
Testing instructions:
Proposed changelog entry for your changes:
This change syncs constants and globals used by WP Super Cache. You can now whitelist additional callables for sync by adding them to the whitelist via the jetpack_sync_callable_whitelist filter.