From 992184cf73d74f7cd147958ed4cb144faaa648f8 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Sat, 12 Jan 2019 06:40:16 +0000 Subject: [PATCH] Coding Standards: Upgrade WPCS to 1.2.1. This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues. Fixes #45956. git-svn-id: https://develop.svn.wordpress.org/trunk@44574 602fd350-edb4-49c9-b593-d223f7449a82 --- composer.json | 4 +- composer.lock | 50 +++++++------- phpcs.xml.dist | 6 -- src/wp-activate.php | 28 ++++---- src/wp-admin/custom-header.php | 32 ++++----- src/wp-admin/includes/class-wp-list-table.php | 2 +- .../class-wp-plugin-install-list-table.php | 4 +- .../includes/class-wp-posts-list-table.php | 66 +++++++++---------- src/wp-admin/includes/class-wp-screen.php | 4 +- .../includes/class-wp-users-list-table.php | 2 +- src/wp-admin/includes/meta-boxes.php | 2 +- src/wp-admin/includes/ms.php | 4 +- src/wp-admin/includes/plugin-install.php | 16 ++--- src/wp-admin/includes/post.php | 10 +-- src/wp-admin/nav-menus.php | 18 ++--- src/wp-admin/network/site-new.php | 12 ++-- src/wp-admin/options-permalink.php | 34 +++++----- src/wp-admin/user-edit.php | 16 ++--- src/wp-admin/users.php | 60 ++++++++--------- .../themes/twentyeleven/comments.php | 2 +- .../themes/twentyeleven/content-gallery.php | 16 ++--- .../themes/twentyfifteen/header.php | 10 +-- .../twentyfifteen/inc/template-tags.php | 2 +- .../themes/twentyfourteen/content-aside.php | 4 +- .../themes/twentyfourteen/content-audio.php | 4 +- .../themes/twentyfourteen/content-gallery.php | 4 +- .../themes/twentyfourteen/content-image.php | 4 +- .../themes/twentyfourteen/content-link.php | 4 +- .../themes/twentyfourteen/content-none.php | 4 +- .../themes/twentyfourteen/content-quote.php | 4 +- .../themes/twentyfourteen/content-video.php | 4 +- .../themes/twentyfourteen/content.php | 4 +- .../twentyfourteen/inc/template-tags.php | 16 ++--- .../template-parts/post/content-none.php | 2 +- .../themes/twentysixteen/header.php | 6 +- .../twentysixteen/inc/template-tags.php | 2 +- src/wp-content/themes/twentyten/loop.php | 4 +- .../themes/twentythirteen/content-none.php | 4 +- src/wp-includes/feed-atom-comments.php | 8 +-- src/wp-includes/feed-atom.php | 2 +- src/wp-includes/feed-rss2-comments.php | 4 +- .../widgets/class-wp-widget-archives.php | 2 +- .../widgets/class-wp-widget-text.php | 2 +- src/wp-login.php | 10 +-- src/wp-signup.php | 4 +- 45 files changed, 247 insertions(+), 255 deletions(-) diff --git a/composer.json b/composer.json index 3c9e021d66..526516f176 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ "issues": "https://core.trac.wordpress.org/" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "~0.4.4", - "wp-coding-standards/wpcs": "~1.0.0" + "dealerdirect/phpcodesniffer-composer-installer": "~0.5.0", + "wp-coding-standards/wpcs": "~1.2.0" }, "scripts": { "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source", diff --git a/composer.lock b/composer.lock index 291b5943eb..08c0f3dc01 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "525cadb533bc92cc922d79144b33b14a", + "content-hash": "c3625c9fc2ce3a44cad41a64f258bafd", "packages": [], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.4.4", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + "reference": "e749410375ff6fb7a040a68878c656c2e610b132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132", "shasum": "" }, "require": { "composer-plugin-api": "^1.0", "php": "^5.3|^7", - "squizlabs/php_codesniffer": "*" + "squizlabs/php_codesniffer": "^2|^3" }, "require-dev": { "composer/composer": "*", - "wimg/php-compatibility": "^8.0" - }, - "suggest": { - "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" }, "type": "composer-plugin", "extra": { @@ -49,13 +47,13 @@ "authors": [ { "name": "Franck Nijhof", - "email": "f.nijhof@dealerdirect.nl", - "homepage": "http://workingatdealerdirect.eu", - "role": "Developer" + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://workingatdealerdirect.eu", + "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -73,20 +71,20 @@ "stylecheck", "tests" ], - "time": "2017-12-06T16:27:17+00:00" + "time": "2018-10-26T13:21:45+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "628a481780561150481a9ec74709092b9759b3ec" + "reference": "379deb987e26c7cd103a7b387aea178baec96e48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", - "reference": "628a481780561150481a9ec74709092b9759b3ec", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", + "reference": "379deb987e26c7cd103a7b387aea178baec96e48", "shasum": "" }, "require": { @@ -124,20 +122,20 @@ "phpcs", "standards" ], - "time": "2018-07-26T23:47:18+00:00" + "time": "2018-12-19T23:57:18+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "1.0.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", - "reference": "539c6d74e6207daa22b7ea754d6f103e9abb2755" + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/539c6d74e6207daa22b7ea754d6f103e9abb2755", - "reference": "539c6d74e6207daa22b7ea754d6f103e9abb2755", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "shasum": "" }, "require": { @@ -145,7 +143,7 @@ "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" }, "require-dev": { - "phpcompatibility/php-compatibility": "*" + "phpcompatibility/php-compatibility": "^9.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." @@ -167,7 +165,7 @@ "standards", "wordpress" ], - "time": "2018-07-25T18:10:35+00:00" + "time": "2018-12-18T09:43:51+00:00" } ], "aliases": [], diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e157c03ac5..118bbdb5f3 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -5,12 +5,6 @@ - - - - - - diff --git a/src/wp-activate.php b/src/wp-activate.php index 5954140960..df82ae0b09 100644 --- a/src/wp-activate.php +++ b/src/wp-activate.php @@ -135,10 +135,10 @@ get_header( 'wp-activate' ); get_error_code(), $valid_error_codes ) ) { - $signup = $result->get_error_data(); - ?> + } else { + if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) { + $signup = $result->get_error_data(); + ?>

'; @@ -162,17 +162,17 @@ get_header( 'wp-activate' ); ); } echo '

'; - } elseif ( $result === null || is_wp_error( $result ) ) { - ?> + } elseif ( $result === null || is_wp_error( $result ) ) { + ?>

get_error_message(); ?>

+ } else { + $url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : ''; + $user = get_userdata( (int) $result['user_id'] ); + ?>

@@ -199,11 +199,11 @@ get_header( 'wp-activate' ); printf( __( 'Your account is now activated. Log in or go back to the homepage.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() ); ?>

- + ?>