Synchronize SAL code as of May 2017.#7142
Conversation
Minimal integration so far, so that we can spread changes out over time... Merges r132833-wpcom.
As part of our ongoing work to separate rendering of data from core logic, this patch moves most logic from the posts endpoint into a SAL_Post wrapper class that can generate the important data for our API. Merges r133001-wpcom.
…ons to SAL Merges r133073-wpcom.
In addition, we now pass the token into the SAL instead of just the blog_id and user_id, so that we can check token scope etc. Merges r133304-wpcom.
Merges r133305-wpcom.
…d attempt) In addition, we now pass the token into the SAL instead of just the blog_id and user_id, so that we can check token scope etc. First attempt blew up due to missing files which are now checked in. Merges r133309-wpcom.
Merges r133787-wpcom.
…by slug By not specifying `post_type`, we were limiting slug search to posts. Page lookup by slug may have worked previously by consequence of our page path lookup, but not if trying to find a page by its slug when the page is nested as a child (where path would include parent's slug too). This behavior includes any whitelisted post type as a candidate for being included in the results of `get_posts`. See: https://[private link] Merges r134338-wpcom.
Terms accounts for all public taxonomies, not only categories or tags, as existed previously. See: https://[private link] Merges r134355-wpcom.
Summary: Daily Post (https://[private link]) recently added extra custom post types. The REST API reports 'unknown_post' if the post type does not match one of the whitelisted ones, currently 'post', 'page', 'revision'. There was previously a workaround in place for Freshly Pressed to allow it to use CPTs. This patch adds similar support for Daily Post. Test Plan: Visit Daily Post feed: http://[private link] The majority of posts do not currently load. Apply the patch and visit the Daily Post feed again. All posts should load correctly, including those with a custom post type. Reviewers: hbakkalbasi Reviewed By: hbakkalbasi Differential Revision: https://[private link] Merges r135090-wpcom.
…OM sites Merges r135659-wpcom.
…s://[private link] Merges r135822-wpcom.
props @artpi, who handled development. Summary: This is an implementation of instant wordads activation endpoint It should enable enrolling any business site directly to wordads Test Plan: - Create a new empty business site - Use endpoint - Verify that site now has wordads Check that id does not work for any site that does not have business plan, jogged out user, etc. Reviewers: egille, rralian Subscribers: derekspringer, scruffian Differential Revision: https://[private link] Merges r136724-wpcom.
This is a value that determines if Headstart considers the site to be "fresh" or not, meaning if it has modified content since the last run of Headstart. This can be used t o determine if Headstart could run again. It's not actually a site option (though we'll pretend it is here), but is derived from the blog stickers on the site. Merges r137127-wpcom.
Closes D2058 Part of T473 Enables sites with business plan to save custom meta title formats for Front page, Posts, Pages, Categories and Tags, and Archives. Only allowed chips can be used for defining the custom format. Additionally, custom formats can only be defined for types listed above. Here is an example of a valid title format for Post: "%site_name% | %post_title%" Props to @vindl for doing the work on this revision Merges r138148-wpcom.
Merges r138384-wpcom.
… post type Merges r138391-wpcom.
Add 'podcasting_archive' to the options array in the get site info endpoint. This contains the post category, if any, that is used for podcast feed items for a site. See also: Automattic/wp-calypso#8109 Code review: https://[private link] Merges r142507-wpcom.
Add a new option field for Front Page Meta Descripton in order to support grandfathering for non-business users that have already set seo_meta_description option. Merges r143116-wpcom.
Since we now want to offer domains to users without a functional site, we want to allow users with this type of site to purchase a domains with out a plan. See https://[private link] Differential revision: D3869 Merges r148702-wpcom.
Introduces Jetpack SEO functions to SAL in order to prepare for refactoring commit. Merges r148894-wpcom.
Splitting this out in a separate commit in order to avoid mid-deply fatals. Ref: https://[private link] Merges r149785-wpcom.
Summary: Add is_automated_transfer option to identify those sites for extra logic Test Plan: Open dev console Go to /me/sites Inspect `options` Response should properly mark sites Reviewers: lamosty, helpingcat, rralian Reviewed By: lamosty Subscribers: aduthie7 Differential Revision: https://[private link] Merges r150257-wpcom.
Conflicts: sal/class.json-api-site-base.php
Merges r134925-wpcom.
…ow endpoints Merges r136686-wpcom.
Merges r136688-wpcom.
Phabricator patch D1933 Merges r136740-wpcom.
also, update checksum to include options Merges r137290-wpcom.
…on option consistently The Jetpack Site Icon module was deprecated in 3.6.1. The transition logic deactivates the module for most sites, so the jetpack_site_icon_url function usually does not pass the existence check for most Jetpack sites. In any case, we plan toward moving to treating Site Icon as the canonical source of site's icon. The changes herein check for this option, falling back to the Jetpack-defined icon option if unset. This improves consistency between Jetpack shadow sites and the remote site. In my case, /me/sites (shadow site) will show the icon property for my Jetpack site, whereas /sites/%s does not (because the module is not active on the site). Eventually the goal is to move get_icon to the SAL base site class, dropping Blavatar as a dependency for WordPress.com sites. Differential Revision: https://[private link] Merges r148273-wpcom.
|
From what I can tell, my only commit was to add |
Also made sure that the methods are only defined in the final class implementation.
sal/class.json-api-site-base.php
Outdated
| require_once dirname( __FILE__ ) . '/class.json-api-date.php'; | ||
| require_once dirname( __FILE__ ) . '/class.json-api-post-base.php'; | ||
|
|
||
| require_once dirname( __FILE__ ) . '/class.json-api-date.php'; |
There was a problem hiding this comment.
Why are we including these twice?
sal/class.json-api-site-base.php
Outdated
| return $wp_version; | ||
| } | ||
|
|
||
| protected function is_a8c_publication( $post_id ) { |
There was a problem hiding this comment.
this should be split into a WPCOM method and Jetpack method, I assume is_post_freshly_pressed and is_dailypost_blog are WPCOM-only methods and you can remove those checks.
in WPCOM_JSON_API_Site_Misc (trait.json-api-site-wpcom.php):
protected function is_a8c_publication( $post_id ) {
return is_post_freshly_pressed( $post_id ) || is_dailypost_blog( $this->blog_id );
}In class Jetpack_Site:
protected function is_a8c_publication( $post_id ) {
return false;
}There was a problem hiding this comment.
And don't forget to leave behind:
abstract function is_a8c_publication( $post_id );so that our subclasses are forced to conform to the interface definition.
|
Thanks for taking a look @gravityrail ! I have made the changes, the counterpart is D5525. |
|
This is blocking #7026 because the synced code relies on SAL's To test
Thank you! |
dereksmart
left a comment
There was a problem hiding this comment.
Changes look good and it seems to test well.
* Changelog: first pass at a changelog for 5.0 * Changelog: delete 4.9 testing list. * Changelog: update minimum WP version to match ver. in jetpack.php Fixes #7158 * Changelog: add #6051 * Changelog: add #6753 * Changelog: add #6928 * Changelog: add #6964 * Changelog: add #7014 * Changelog: add #7057 * Changelog: add #7060 * Changelog: add #7068 * Changelog: add #7070 * Changelog: add #7072 * Changelog: add #7071 * Changelog: add release date and post shortlink. * Changelog: add #7094 * Changelog: add #7100 * Changelog: add #7108 * Changelog: add #7113 * Changelog: add #7123 * Changelog: add #7135 * Changelog: add #7143 * Changelog: add #7151 * Changelog: add #6996 * Changelog: add #7105 * Changelog: add #7132 * Changelog: add #7166 * Changelog: fix typo in 4.9 changelog. * Changelog: remove older releases' changelogs. @see p1HpG7-42e-p2 * Changelog: add #7090 * Changelog: add #7095 * Changelog: add #7112 * Changelog: add #7115 * Changelog: add #7122 * Changelog: add #7137 * Changelog: add #7138 * Changelog: add #7140 * Changelog: add #7154 * Changelog: add ##7155 * Changelog: add #7163 * Changelog: add #7167 * Changelog: add #7171 * Changelog: add #7180 * Changelog: add #7181 * Changelog: add #7183 * Changelog: add #7184 * Changelog: add #7189 * Changelog: add #7191 * Changelog: add #7193 * Changelog: add #7198 * Changelog: add #7200 * Changelog: add #7209 * Changelog: add #7212 * Testing list: add instructions for #7115 * Changelog: add #7188 * Changelog: add #7205 * Changelog: add #7225 * Changelog: add #6872 * Changelog: add #7107 * Changelog: add #7118 * Changelog: add #7142 * Changelog: add #7170 * Changelog: add #7210 * Changelog: add #7218 * Changelog: add #7232 * Changelog: add #7211 * Changelog: add #7213 * Changelog: add #7229 * Changelog: add #7230 * Changelog: add #7214 * Draft changelog for 5.0 * Changelog updates: 2nd pass at a clearer changelog. - Fix typos. - Use consistent tense and tone across all changelog. - Remove unclear items. * Changelog: add #7026 * Changelog: add #7058 * Changelog: add #7125 * Changelog: add #7249 * Changelog: add #7185 * add mentions of image widget migration * Changelog: add info about new output for CLI command. * Changelog: add WP version number matching the new Image Widget.
cc @gravityrail @ebinnion please take a look at your changes and see if there's something wrong.