{"action":"created","comment":{"url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/comments/125765599","pull_request_review_id":48187055,"id":125765599,"diff_hunk":"@@ -1,35 +1,76 @@\n <?php\n-// Only in Test and Live Environments...\n-if ( in_array( $_ENV['PANTHEON_ENVIRONMENT'], Array('test', 'live') ) ) {\n-\t//\n-\t// Disable Core Updates EVERYWHERE (use git upstream)\n-\t//\n-\tfunction _pantheon_disable_wp_updates() {\n-\t\tinclude ABSPATH . WPINC . '/version.php';\n-\t\treturn (object) array(\n-\t\t\t'updates' => array(),\n-\t\t\t'version_checked' => $wp_version,\n-\t\t\t'last_checked' => time(),\n-\t\t);\n+// Disable WordPress ato updates\n+if( ! defined('WP_AUTO_UPDATE_CORE')) {\n+\tdefine( 'WP_AUTO_UPDATE_CORE', false );\n+}\n+remove_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );\n+\n+// Remove WordPress core update nag\n+add_action('admin_menu','_pantheon_hide_update_nag');\n+function _pantheon_hide_update_nag() {\n+\tremove_action( 'admin_notices', 'update_nag', 3 );\n+}\n+\n+// Get the latest WordPress version\n+function _pantheon_get_latest_wordpress_version() {\n+\t$core_updates = get_core_updates( array('dismissed' => false) );\n+\n+\tif( ! is_array($core_updates) || empty($core_updates) || ! property_exists($core_updates[0], 'current' ) ){\n+\t\treturn null;\n \t}\n \n-\tadd_filter( 'pre_site_transient_update_core', '_pantheon_disable_wp_updates' );\n+\treturn $core_updates[0]->current;\n+}\n \n-\t//\n-\t// Disable Plugin Updates\n-\t//\n-\tadd_action('admin_menu','_pantheon_hide_admin_notices');\n-\tfunction _pantheon_hide_admin_notices() {\n-\t\tremove_action( 'admin_notices', 'update_nag', 3 );\n+// Compare the current WordPress version to the latest available\n+function _pantheon_wordpress_update_available() {\n+\t$latest_wp_version = _pantheon_get_latest_wordpress_version();\n+\n+\tif( null === latest_wp_version ){\n+\t\treturn false;\n+\t}\n+\n+\t// include an unmodified $wp_version\n+\tinclude( ABSPATH . WPINC . '/version.php' );\n+\t\n+\t// Return true if our version is not the latest\n+\treturn $latest_wp_version > $wp_version;","path":"wp-content/mu-plugins/pantheon/pantheon-updates.php","position":56,"original_position":56,"commit_id":"ae8967cfde40ba8d3d785123d63d1dd2b9eeafd5","original_commit_id":"ae8967cfde40ba8d3d785123d63d1dd2b9eeafd5","user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars1.githubusercontent.com/u/134745?v=3","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"body":"Need to use `version_compare()` here since `version_compare('3.11', '3.8', '>') !== ( '3.11' > '3.8' )`.","created_at":"2017-07-05T21:45:52Z","updated_at":"2017-07-05T21:49:56Z","html_url":"https://github.com/pantheon-systems/WordPress/pull/126#discussion_r125765599","pull_request_url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126","_links":{"self":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/comments/125765599"},"html":{"href":"https://github.com/pantheon-systems/WordPress/pull/126#discussion_r125765599"},"pull_request":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126"}}},"pull_request":{"url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126","id":129061048,"html_url":"https://github.com/pantheon-systems/WordPress/pull/126","diff_url":"https://github.com/pantheon-systems/WordPress/pull/126.diff","patch_url":"https://github.com/pantheon-systems/WordPress/pull/126.patch","issue_url":"https://api.github.com/repos/pantheon-systems/WordPress/issues/126","number":126,"state":"open","locked":false,"title":"Replace WordPress update nag with our own","user":{"login":"ataylorme","id":2133004,"avatar_url":"https://avatars1.githubusercontent.com/u/2133004?v=3","gravatar_id":"","url":"https://api.github.com/users/ataylorme","html_url":"https://github.com/ataylorme","followers_url":"https://api.github.com/users/ataylorme/followers","following_url":"https://api.github.com/users/ataylorme/following{/other_user}","gists_url":"https://api.github.com/users/ataylorme/gists{/gist_id}","starred_url":"https://api.github.com/users/ataylorme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataylorme/subscriptions","organizations_url":"https://api.github.com/users/ataylorme/orgs","repos_url":"https://api.github.com/users/ataylorme/repos","events_url":"https://api.github.com/users/ataylorme/events{/privacy}","received_events_url":"https://api.github.com/users/ataylorme/received_events","type":"User","site_admin":false},"body":"I refactored our mu-plugin. Previously it stopped WordPress from running version checks.\r\n\r\nI allowed WordPress to run version checks then use the result to determine if we should display our own nag message, removing the default.\r\n\r\nThe previous logic also only stopped WordPress updates on test and live. The new nag message applies to all environments.\r\n\r\nIt looks like this:\r\n![pantheon-update-nag](https://user-images.githubusercontent.com/2133004/27886033-f0efb25a-619f-11e7-800f-6c15f2142678.png)","created_at":"2017-07-05T21:40:01Z","updated_at":"2017-07-05T21:49:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08ca0895105389910185fa0c55762a7256d8d9cd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126/commits","review_comments_url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126/comments","review_comment_url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pantheon-systems/WordPress/issues/126/comments","statuses_url":"https://api.github.com/repos/pantheon-systems/WordPress/statuses/ae8967cfde40ba8d3d785123d63d1dd2b9eeafd5","head":{"label":"ataylorme:issue-125-replace-update-nag","ref":"issue-125-replace-update-nag","sha":"ae8967cfde40ba8d3d785123d63d1dd2b9eeafd5","user":{"login":"ataylorme","id":2133004,"avatar_url":"https://avatars1.githubusercontent.com/u/2133004?v=3","gravatar_id":"","url":"https://api.github.com/users/ataylorme","html_url":"https://github.com/ataylorme","followers_url":"https://api.github.com/users/ataylorme/followers","following_url":"https://api.github.com/users/ataylorme/following{/other_user}","gists_url":"https://api.github.com/users/ataylorme/gists{/gist_id}","starred_url":"https://api.github.com/users/ataylorme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataylorme/subscriptions","organizations_url":"https://api.github.com/users/ataylorme/orgs","repos_url":"https://api.github.com/users/ataylorme/repos","events_url":"https://api.github.com/users/ataylorme/events{/privacy}","received_events_url":"https://api.github.com/users/ataylorme/received_events","type":"User","site_admin":false},"repo":{"id":93219784,"name":"WordPress","full_name":"ataylorme/WordPress","owner":{"login":"ataylorme","id":2133004,"avatar_url":"https://avatars1.githubusercontent.com/u/2133004?v=3","gravatar_id":"","url":"https://api.github.com/users/ataylorme","html_url":"https://github.com/ataylorme","followers_url":"https://api.github.com/users/ataylorme/followers","following_url":"https://api.github.com/users/ataylorme/following{/other_user}","gists_url":"https://api.github.com/users/ataylorme/gists{/gist_id}","starred_url":"https://api.github.com/users/ataylorme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataylorme/subscriptions","organizations_url":"https://api.github.com/users/ataylorme/orgs","repos_url":"https://api.github.com/users/ataylorme/repos","events_url":"https://api.github.com/users/ataylorme/events{/privacy}","received_events_url":"https://api.github.com/users/ataylorme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ataylorme/WordPress","description":"WordPress upstream for the Pantheon website platform. Includes a platform integration plugins and a pre-configured wp-config.php.","fork":true,"url":"https://api.github.com/repos/ataylorme/WordPress","forks_url":"https://api.github.com/repos/ataylorme/WordPress/forks","keys_url":"https://api.github.com/repos/ataylorme/WordPress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ataylorme/WordPress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ataylorme/WordPress/teams","hooks_url":"https://api.github.com/repos/ataylorme/WordPress/hooks","issue_events_url":"https://api.github.com/repos/ataylorme/WordPress/issues/events{/number}","events_url":"https://api.github.com/repos/ataylorme/WordPress/events","assignees_url":"https://api.github.com/repos/ataylorme/WordPress/assignees{/user}","branches_url":"https://api.github.com/repos/ataylorme/WordPress/branches{/branch}","tags_url":"https://api.github.com/repos/ataylorme/WordPress/tags","blobs_url":"https://api.github.com/repos/ataylorme/WordPress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ataylorme/WordPress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ataylorme/WordPress/git/refs{/sha}","trees_url":"https://api.github.com/repos/ataylorme/WordPress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ataylorme/WordPress/statuses/{sha}","languages_url":"https://api.github.com/repos/ataylorme/WordPress/languages","stargazers_url":"https://api.github.com/repos/ataylorme/WordPress/stargazers","contributors_url":"https://api.github.com/repos/ataylorme/WordPress/contributors","subscribers_url":"https://api.github.com/repos/ataylorme/WordPress/subscribers","subscription_url":"https://api.github.com/repos/ataylorme/WordPress/subscription","commits_url":"https://api.github.com/repos/ataylorme/WordPress/commits{/sha}","git_commits_url":"https://api.github.com/repos/ataylorme/WordPress/git/commits{/sha}","comments_url":"https://api.github.com/repos/ataylorme/WordPress/comments{/number}","issue_comment_url":"https://api.github.com/repos/ataylorme/WordPress/issues/comments{/number}","contents_url":"https://api.github.com/repos/ataylorme/WordPress/contents/{+path}","compare_url":"https://api.github.com/repos/ataylorme/WordPress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ataylorme/WordPress/merges","archive_url":"https://api.github.com/repos/ataylorme/WordPress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ataylorme/WordPress/downloads","issues_url":"https://api.github.com/repos/ataylorme/WordPress/issues{/number}","pulls_url":"https://api.github.com/repos/ataylorme/WordPress/pulls{/number}","milestones_url":"https://api.github.com/repos/ataylorme/WordPress/milestones{/number}","notifications_url":"https://api.github.com/repos/ataylorme/WordPress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ataylorme/WordPress/labels{/name}","releases_url":"https://api.github.com/repos/ataylorme/WordPress/releases{/id}","deployments_url":"https://api.github.com/repos/ataylorme/WordPress/deployments","created_at":"2017-06-03T03:05:29Z","updated_at":"2017-06-03T03:05:36Z","pushed_at":"2017-07-05T21:38:41Z","git_url":"git://github.com/ataylorme/WordPress.git","ssh_url":"git@github.com:ataylorme/WordPress.git","clone_url":"https://github.com/ataylorme/WordPress.git","svn_url":"https://github.com/ataylorme/WordPress","homepage":null,"size":128487,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pantheon-systems:master","ref":"master","sha":"f6582d67d2e44f83f33a303529a481ee58efead9","user":{"login":"pantheon-systems","id":513357,"avatar_url":"https://avatars2.githubusercontent.com/u/513357?v=3","gravatar_id":"","url":"https://api.github.com/users/pantheon-systems","html_url":"https://github.com/pantheon-systems","followers_url":"https://api.github.com/users/pantheon-systems/followers","following_url":"https://api.github.com/users/pantheon-systems/following{/other_user}","gists_url":"https://api.github.com/users/pantheon-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/pantheon-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantheon-systems/subscriptions","organizations_url":"https://api.github.com/users/pantheon-systems/orgs","repos_url":"https://api.github.com/users/pantheon-systems/repos","events_url":"https://api.github.com/users/pantheon-systems/events{/privacy}","received_events_url":"https://api.github.com/users/pantheon-systems/received_events","type":"Organization","site_admin":false},"repo":{"id":17910877,"name":"WordPress","full_name":"pantheon-systems/WordPress","owner":{"login":"pantheon-systems","id":513357,"avatar_url":"https://avatars2.githubusercontent.com/u/513357?v=3","gravatar_id":"","url":"https://api.github.com/users/pantheon-systems","html_url":"https://github.com/pantheon-systems","followers_url":"https://api.github.com/users/pantheon-systems/followers","following_url":"https://api.github.com/users/pantheon-systems/following{/other_user}","gists_url":"https://api.github.com/users/pantheon-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/pantheon-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantheon-systems/subscriptions","organizations_url":"https://api.github.com/users/pantheon-systems/orgs","repos_url":"https://api.github.com/users/pantheon-systems/repos","events_url":"https://api.github.com/users/pantheon-systems/events{/privacy}","received_events_url":"https://api.github.com/users/pantheon-systems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pantheon-systems/WordPress","description":"WordPress upstream for the Pantheon website platform. Includes a platform integration plugins and a pre-configured wp-config.php.","fork":false,"url":"https://api.github.com/repos/pantheon-systems/WordPress","forks_url":"https://api.github.com/repos/pantheon-systems/WordPress/forks","keys_url":"https://api.github.com/repos/pantheon-systems/WordPress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pantheon-systems/WordPress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pantheon-systems/WordPress/teams","hooks_url":"https://api.github.com/repos/pantheon-systems/WordPress/hooks","issue_events_url":"https://api.github.com/repos/pantheon-systems/WordPress/issues/events{/number}","events_url":"https://api.github.com/repos/pantheon-systems/WordPress/events","assignees_url":"https://api.github.com/repos/pantheon-systems/WordPress/assignees{/user}","branches_url":"https://api.github.com/repos/pantheon-systems/WordPress/branches{/branch}","tags_url":"https://api.github.com/repos/pantheon-systems/WordPress/tags","blobs_url":"https://api.github.com/repos/pantheon-systems/WordPress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pantheon-systems/WordPress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pantheon-systems/WordPress/git/refs{/sha}","trees_url":"https://api.github.com/repos/pantheon-systems/WordPress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pantheon-systems/WordPress/statuses/{sha}","languages_url":"https://api.github.com/repos/pantheon-systems/WordPress/languages","stargazers_url":"https://api.github.com/repos/pantheon-systems/WordPress/stargazers","contributors_url":"https://api.github.com/repos/pantheon-systems/WordPress/contributors","subscribers_url":"https://api.github.com/repos/pantheon-systems/WordPress/subscribers","subscription_url":"https://api.github.com/repos/pantheon-systems/WordPress/subscription","commits_url":"https://api.github.com/repos/pantheon-systems/WordPress/commits{/sha}","git_commits_url":"https://api.github.com/repos/pantheon-systems/WordPress/git/commits{/sha}","comments_url":"https://api.github.com/repos/pantheon-systems/WordPress/comments{/number}","issue_comment_url":"https://api.github.com/repos/pantheon-systems/WordPress/issues/comments{/number}","contents_url":"https://api.github.com/repos/pantheon-systems/WordPress/contents/{+path}","compare_url":"https://api.github.com/repos/pantheon-systems/WordPress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pantheon-systems/WordPress/merges","archive_url":"https://api.github.com/repos/pantheon-systems/WordPress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pantheon-systems/WordPress/downloads","issues_url":"https://api.github.com/repos/pantheon-systems/WordPress/issues{/number}","pulls_url":"https://api.github.com/repos/pantheon-systems/WordPress/pulls{/number}","milestones_url":"https://api.github.com/repos/pantheon-systems/WordPress/milestones{/number}","notifications_url":"https://api.github.com/repos/pantheon-systems/WordPress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pantheon-systems/WordPress/labels{/name}","releases_url":"https://api.github.com/repos/pantheon-systems/WordPress/releases{/id}","deployments_url":"https://api.github.com/repos/pantheon-systems/WordPress/deployments","created_at":"2014-03-19T16:04:19Z","updated_at":"2017-07-05T10:09:10Z","pushed_at":"2017-07-05T21:40:02Z","git_url":"git://github.com/pantheon-systems/WordPress.git","ssh_url":"git@github.com:pantheon-systems/WordPress.git","clone_url":"https://github.com/pantheon-systems/WordPress.git","svn_url":"https://github.com/pantheon-systems/WordPress","homepage":null,"size":129637,"stargazers_count":58,"watchers_count":58,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":14,"forks":68,"open_issues":14,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126"},"html":{"href":"https://github.com/pantheon-systems/WordPress/pull/126"},"issue":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/issues/126"},"comments":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/issues/126/comments"},"review_comments":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126/comments"},"review_comment":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/pulls/126/commits"},"statuses":{"href":"https://api.github.com/repos/pantheon-systems/WordPress/statuses/ae8967cfde40ba8d3d785123d63d1dd2b9eeafd5"}}}}
{"actor":{"display_login":"westonruter"}}