{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/172352452","pull_request_review_id":101355268,"id":172352452,"diff_hunk":"@@ -1503,23 +1507,23 @@ public static function get_active_plan() {\n \t\t);\n \n \t\tif ( in_array( $plan['product_slug'], $business_plans ) ) {\n-\t\t\t$plan['supports'] = array(\n-\t\t\t\t'videopress',\n-\t\t\t\t'akismet',\n-\t\t\t\t'vaultpress',\n-\t\t\t\t'seo-tools',\n-\t\t\t\t'google-analytics',\n-\t\t\t\t'wordads',\n-\t\t\t\t'search',\n-\t\t\t);","path":"class.jetpack.php","position":62,"original_position":62,"commit_id":"ff8fce084b28f9e6d9bd0da5a5593abb73f03671","original_commit_id":"19051896c1949a44dc8ddf7adc4bea314c343684","user":{"login":"gravityrail","id":51896,"avatar_url":"https://avatars0.githubusercontent.com/u/51896?v=4","gravatar_id":"","url":"https://api.github.com/users/gravityrail","html_url":"https://github.com/gravityrail","followers_url":"https://api.github.com/users/gravityrail/followers","following_url":"https://api.github.com/users/gravityrail/following{/other_user}","gists_url":"https://api.github.com/users/gravityrail/gists{/gist_id}","starred_url":"https://api.github.com/users/gravityrail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravityrail/subscriptions","organizations_url":"https://api.github.com/users/gravityrail/orgs","repos_url":"https://api.github.com/users/gravityrail/repos","events_url":"https://api.github.com/users/gravityrail/events{/privacy}","received_events_url":"https://api.github.com/users/gravityrail/received_events","type":"User","site_admin":false},"body":"As above - yes ;)","created_at":"2018-03-05T22:34:20Z","updated_at":"2018-03-05T22:34:20Z","html_url":"https://github.com/Automattic/jetpack/pull/8983#discussion_r172352452","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/8983","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/172352452"},"html":{"href":"https://github.com/Automattic/jetpack/pull/8983#discussion_r172352452"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/8983"}},"in_reply_to_id":172346271},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/8983","id":172996083,"html_url":"https://github.com/Automattic/jetpack/pull/8983","diff_url":"https://github.com/Automattic/jetpack/pull/8983.diff","patch_url":"https://github.com/Automattic/jetpack/pull/8983.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/8983","number":8983,"state":"open","locked":false,"title":"Prevent module activation when plan doesn't support them","user":{"login":"gravityrail","id":51896,"avatar_url":"https://avatars0.githubusercontent.com/u/51896?v=4","gravatar_id":"","url":"https://api.github.com/users/gravityrail","html_url":"https://github.com/gravityrail","followers_url":"https://api.github.com/users/gravityrail/followers","following_url":"https://api.github.com/users/gravityrail/following{/other_user}","gists_url":"https://api.github.com/users/gravityrail/gists{/gist_id}","starred_url":"https://api.github.com/users/gravityrail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravityrail/subscriptions","organizations_url":"https://api.github.com/users/gravityrail/orgs","repos_url":"https://api.github.com/users/gravityrail/repos","events_url":"https://api.github.com/users/gravityrail/events{/privacy}","received_events_url":"https://api.github.com/users/gravityrail/received_events","type":"User","site_admin":false},"body":"Fixes #7867\r\n\r\nSome plans support different modules. This change declares plan support in the module header, and checks for that support when rendering the \"active plan\" information.\r\n\r\nThis allows us to easily render inactive rows in the `jetpack_modules` page and elsewhere, so that users know which modules are truly available.\r\n\r\nThis change also adds some basic checking in WP-cli and elsewhere for whether plan activation was successful.\r\n\r\n#### Changes proposed in this Pull Request:\r\n\r\n* Declare modules with a `Plan: business, premium, personal` (default is `free`) attribute\r\n* Render full list of supported modules and plugins (in the case of vaultpress/akismet) in the `Jetpack::get_active_plan()` response\r\n* Render rows as inactive in the `jetpack_modules` list if they are not supported by the current plan\r\n\r\nThe goal is NOT to prevent users from being able to hack the code to enable modules they shouldn't (since that is impossible anyway) but to help users understand what features their plan supports, and prevent them from accidentally enabling features that it doesn't.\r\n\r\n#### Further work:\r\n\r\n* Allow users to click to upgrade to a supporting plan from within the `jetpack_modules` page.\r\n\r\n#### Testing instructions:\r\n\r\n* On a site with a free plan:\r\n  * Go to `/wp-admin/admin.php?page=jetpack_modules`\r\n  * Ads, Data Backups, Google Analytics, SEO Tools, Search and VideoPress should be greyed out. Only Data Backups should be clickable, with a `Configure` link.\r\n  * Go to `/settings/traffic/{site_domain}` in Calypso\r\n    * Attempt to enable SEO tools using the `Enable` link next to `SEO Tools module is disabled in Jetpack.`\r\n    * You should see a message `There was a problem saving your changes. Please try again.` (TODO: a better error message - in the network response you will see the actual error is `{error: \"not_supported\", message: \"The requested Jetpack module is not supported by your plan.\"}`)\r\n* On a site with a Premium plan\r\n  * VideoPress should become available\r\n* On a site with a Professional plan\r\n  * SEO Tools, Google Analytics and Search should become available\r\n\r\n<!-- Add the following only if this is meant to be in changelog -->\r\n\r\n#### Proposed changelog entry for your changes:\r\n\r\n* Show correct `available` status in Jetpack modules list\r\n* Return error in wp-cli if activating a module that is unsupported by your plan\r\n\r\n","created_at":"2018-03-05T21:48:17Z","updated_at":"2018-03-05T22:34:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1eeb32320c0c7aef4919f145cb2bc3a4e7c3aa33","assignee":{"login":"gravityrail","id":51896,"avatar_url":"https://avatars0.githubusercontent.com/u/51896?v=4","gravatar_id":"","url":"https://api.github.com/users/gravityrail","html_url":"https://github.com/gravityrail","followers_url":"https://api.github.com/users/gravityrail/followers","following_url":"https://api.github.com/users/gravityrail/following{/other_user}","gists_url":"https://api.github.com/users/gravityrail/gists{/gist_id}","starred_url":"https://api.github.com/users/gravityrail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravityrail/subscriptions","organizations_url":"https://api.github.com/users/gravityrail/orgs","repos_url":"https://api.github.com/users/gravityrail/repos","events_url":"https://api.github.com/users/gravityrail/events{/privacy}","received_events_url":"https://api.github.com/users/gravityrail/received_events","type":"User","site_admin":false},"assignees":[{"login":"gravityrail","id":51896,"avatar_url":"https://avatars0.githubusercontent.com/u/51896?v=4","gravatar_id":"","url":"https://api.github.com/users/gravityrail","html_url":"https://github.com/gravityrail","followers_url":"https://api.github.com/users/gravityrail/followers","following_url":"https://api.github.com/users/gravityrail/following{/other_user}","gists_url":"https://api.github.com/users/gravityrail/gists{/gist_id}","starred_url":"https://api.github.com/users/gravityrail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravityrail/subscriptions","organizations_url":"https://api.github.com/users/gravityrail/orgs","repos_url":"https://api.github.com/users/gravityrail/repos","events_url":"https://api.github.com/users/gravityrail/events{/privacy}","received_events_url":"https://api.github.com/users/gravityrail/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[{"name":"Jetpack","id":2149533,"slug":"jetpack","description":"The Jetpack team, who has merge access for Jetpack","privacy":"closed","url":"https://api.github.com/teams/2149533","members_url":"https://api.github.com/teams/2149533/members{/member}","repositories_url":"https://api.github.com/teams/2149533/repos","permission":"pull"}],"labels":[{"id":377383130,"url":"https://api.github.com/repos/Automattic/jetpack/labels/Admin%20Page","name":"Admin Page","color":"006b75","default":false},{"id":824137528,"url":"https://api.github.com/repos/Automattic/jetpack/labels/FixTheFlows","name":"FixTheFlows","color":"00be28","default":false},{"id":824641062,"url":"https://api.github.com/repos/Automattic/jetpack/labels/Plans","name":"Plans","color":"006b75","default":false},{"id":199076921,"url":"https://api.github.com/repos/Automattic/jetpack/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":{"url":"https://api.github.com/repos/Automattic/jetpack/milestones/98","html_url":"https://github.com/Automattic/jetpack/milestone/98","labels_url":"https://api.github.com/repos/Automattic/jetpack/milestones/98/labels","id":3139976,"number":98,"title":"6.0","description":null,"creator":{"login":"gibrown","id":820871,"avatar_url":"https://avatars2.githubusercontent.com/u/820871?v=4","gravatar_id":"","url":"https://api.github.com/users/gibrown","html_url":"https://github.com/gibrown","followers_url":"https://api.github.com/users/gibrown/followers","following_url":"https://api.github.com/users/gibrown/following{/other_user}","gists_url":"https://api.github.com/users/gibrown/gists{/gist_id}","starred_url":"https://api.github.com/users/gibrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibrown/subscriptions","organizations_url":"https://api.github.com/users/gibrown/orgs","repos_url":"https://api.github.com/users/gibrown/repos","events_url":"https://api.github.com/users/gibrown/events{/privacy}","received_events_url":"https://api.github.com/users/gibrown/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":0,"state":"open","created_at":"2018-02-23T19:53:36Z","updated_at":"2018-03-05T21:48:35Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/8983/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/8983/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/8983/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/ff8fce084b28f9e6d9bd0da5a5593abb73f03671","head":{"label":"Automattic:fix/disable-seo-tools-module-list","ref":"fix/disable-seo-tools-module-list","sha":"ff8fce084b28f9e6d9bd0da5a5593abb73f03671","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-03-05T14:29:12Z","pushed_at":"2018-03-05T22:08:56Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":207468,"stargazers_count":758,"watchers_count":758,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":1049,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":491,"open_issues":1049,"watchers":758,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"5dbbe57e4ce629cc53dbd681fa38499e99f18c3f","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-03-05T14:29:12Z","pushed_at":"2018-03-05T22:08:56Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":207468,"stargazers_count":758,"watchers_count":758,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":1049,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":491,"open_issues":1049,"watchers":758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/8983"},"html":{"href":"https://github.com/Automattic/jetpack/pull/8983"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/8983"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/8983/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/8983/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/8983/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/ff8fce084b28f9e6d9bd0da5a5593abb73f03671"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gravityrail"}}