Conversation
georgestephanis
left a comment
There was a problem hiding this comment.
First pass -- I know it's a work in progress but I figured I'd get a couple things flagged early.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Needs documentation for the filter.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Needs documentation for the filter.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Needs documentation for the filter.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Do we know why this method was here, if not in use? I hesitate to take it out of another plugin we release was somehow depending on it.
There was a problem hiding this comment.
This comment's not needed here any longer.
3rd-party/woocommerce.php
Outdated
There was a problem hiding this comment.
Wouldn't this be simpler to just use array_merge() instead?
3rd-party/woocommerce.php
Outdated
There was a problem hiding this comment.
This should return the result.
3rd-party/woocommerce.php
Outdated
There was a problem hiding this comment.
This should return the result.
3rd-party/woocommerce.php
Outdated
There was a problem hiding this comment.
This should return the result.
50b48f7 to
3fda084
Compare
georgestephanis
left a comment
There was a problem hiding this comment.
A couple random thoughts -- this is shaping up nicely, happy to see it moving forward!
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Should we maybe name the filter jetpack_sync_constants or the like? Whitelist doesn't seem hugely relevant -- as that's the nature of having a list we're filtering -- but including sync in the filter could probably help with clarity.
There was a problem hiding this comment.
Possibly not, as this is just matching the existing jetpack_options_whitelist naming pattern ... eh, was just a thought.
There was a problem hiding this comment.
Yeah, I originally did call those hooks jetpack_sync_*, but then decided to err on the side of consistency :-)
There was a problem hiding this comment.
For consistency, I think we should use jetpack_sync_* since that's what we use throughout the rest of the sync code base within Jetpack.
sync/class.jetpack-sync-defaults.php
Outdated
There was a problem hiding this comment.
Same naming concern as ^^
There was a problem hiding this comment.
Same as above. I would make this jetpack_sync_post_meta_whitelist.
There was a problem hiding this comment.
Alright. But just to be clear, we will still have the pre-exsiting filter called jetpack_options_whitelist. Should I go ahead and also create jetpack_sync_options_whitelist ?
There was a problem hiding this comment.
Optional, but it may be nice to add phpdoc function documentation to these functions -- explaining what list can be, etc. If someone wants to just add a single value, maybe we should have a test in add_to_whitelist or something that just casts the values to arrays before the array_merge() ?
There was a problem hiding this comment.
I'll make the function name clearer.
There was a problem hiding this comment.
Sometimes phpdocs and comments are necessary, but I'm a big fan of "self-documenting" code whenever possible.
There was a problem hiding this comment.
In usage, above seems to use the new values as the first param, but this seems to expect them as the second? It likely doesn't matter hugely, but may be nice to better sort. Or just have the other methods call array_merge() directly -- it's simple enough.
There was a problem hiding this comment.
Yeah, a single-lined function rarely makes sense :-P
c196ef6 to
9447d80
Compare
|
The general approach to this seems fine with me. I agree with @georgestephanis that the filters should be As a note, we'll likely need to whitelist this data on the WPCOM side too, but we can do that after this PR is in. Publicize and subscriptions seem to work fine and full sync seems to work fine. So, after the filters are updated, this LGTM. |
|
Running the phpunit test with the WOO flag I get the following test failures To run the tests do the following |
|
The tests pass now. |
|
Thanks for the help @enejb ! |
- Add WooCommerce constants - Add WooCommerce WordPress options - Add Post Metadata for WooCommerce Orders and Products - Refactor sync constants module to use filters
- Add jetpack_sync_options_whitelist but keep jetpack_options_whitelist for backwards compat
Since woo was initialising things before the default priority. We were not loading woo plugin just yet.
…d the fatal error.
663fdc3 to
33fe8db
Compare
|
@nabsul Just to confirm, this didn't get merged in in time for our code freeze for the March release, so it will be shipping in our April release instead. |
* 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
The main goal of this PR is to add support for WooCommerce specific data in the Jetpack Sync modules.
Changes proposed in this Pull Request:
Testing instructions:
Proposed changelog entry for your changes: