Skip to content

Add Jetpack sync module to sync WP Super Cache constants and global variables#6482

Merged
gititon merged 23 commits intomasterfrom
jpop-issues-119
Mar 10, 2017
Merged

Add Jetpack sync module to sync WP Super Cache constants and global variables#6482
gititon merged 23 commits intomasterfrom
jpop-issues-119

Conversation

@gititon
Copy link
Copy Markdown
Contributor

@gititon gititon commented Feb 22, 2017

Changes proposed in this Pull Request:

  • Adds Jetpack Sync module for syncing WP Super Cache globals and constants

Testing instructions:

  • Tests have been added to the test suite for the new sync module. Additionally, you can test manually by installing WP Super Cache, changing values, and confirming that the changes values are reflected on WordPress.com.

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.

@gititon
Copy link
Copy Markdown
Contributor Author

gititon commented Feb 22, 2017

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.

@ebinnion ebinnion assigned ebinnion and gititon and unassigned ebinnion and gititon Feb 23, 2017

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' ) ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use function_exists too

@georgestephanis
Copy link
Copy Markdown
Contributor

Should some of the WP Super Cache stuff be in the 3rd-party directory instead?

protected $post;
protected $callable_module;
protected $full_sync;
static $woo_enabled;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably do not need this any more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Enej. Removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"wp-super-cache" could use simple quotes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gititon gititon force-pushed the jpop-issues-119 branch 2 times, most recently from 76a69dc to f073c7c Compare March 8, 2017 20:32
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do a if function exists here in case some one runs it with the plugin installed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We missed the 4.7 boat lets update it to 4.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We missed the 4.7 boat lets update it to 4.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We missed the 4.7 boat lets update it to 4.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We missed the 4.7 boat lets update it to 4.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove this comment. Since we are not using WPCACHEHOME constant any more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't seem to be using these anymore :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"1" could be written as '1' to match coding standards

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same :)

gititon added 14 commits March 10, 2017 09:56
…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.
Copy link
Copy Markdown
Contributor

@lezama lezama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👍

@gititon gititon changed the title Jetpack Sync: First pass at WP Super Cache integration. Add Jetpack sync module to sync WP Super Cache constants and global variables Mar 10, 2017
@gititon gititon merged commit a773fe3 into master Mar 10, 2017
@gititon gititon deleted the jpop-issues-119 branch March 10, 2017 21:36
jeherve added a commit that referenced this pull request Mar 28, 2017
samhotchkiss pushed a commit that referenced this pull request Mar 29, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants