From 5463f2e0284ca8a634f75deee22db0c1bf1de984 Mon Sep 17 00:00:00 2001
From: Brad Jorsch
Date: Wed, 4 Jan 2023 14:59:42 -0500
Subject: [PATCH] PHPCS: Fix most auto-fixable sniffs coming in new WPCS
snapshot (#28176)
We're going to update the WordPress-Coding-Standards library from a
2022-02-07 snapshot to a 2023-01-04 snapshot, which brings in a number
of new sniffs. So first we need to fix the stuff the new sniffs will
complain about.
This PR updates for the following sniffs:
* Generic.WhiteSpace.IncrementDecrementSpacing.SpaceAfterIncrement
* Modernize.FunctionCalls.Dirname
* PSR12.Functions.ReturnTypeDeclaration.SpaceBeforeColon
* PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose
* Universal.Constants.UppercaseMagicConstants
* Universal.Operators.DisallowStandalonePostIncrementDecrement
Then it has to do a bit more cleanup on touched lines in some of the
excluded files. Yay tech debt.
---
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../a8c-mc-stats/src/class-a8c-mc-stats.php | 1 -
.../a8c-mc-stats/tests/php/test_Stats.php | 2 --
.../admin-ui/changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/admin-ui/package.json | 2 +-
.../admin-ui/src/class-admin-menu.php | 2 +-
.../admin-ui/tests/php/test_admin_menu.php | 1 -
.../assets/changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/assets/src/class-assets.php | 2 +-
.../backup/changelog/update-wpcs-pre-phpcbf | 5 +++
.../src/class-jetpack-backup-upgrades.php | 1 -
.../backup/src/class-jetpack-backup.php | 1 -
.../blocks/changelog/update-wpcs-pre-phpcbf | 5 +++
.../packages/blocks/tests/php/test-blocks.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../packages/changelogger/src/AddCommand.php | 2 +-
.../packages/changelogger/src/Application.php | 2 +-
.../src/Plugins/SemverVersioning.php | 8 ++---
.../src/Plugins/WordpressVersioning.php | 2 +-
.../changelogger/src/ValidateCommand.php | 2 +-
.../changelogger/src/php7/CommandLoader.php | 6 ++--
.../Constants/MasterUserConstantSniff.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../connection/src/class-error-handler.php | 6 ----
.../connection/src/class-heartbeat.php | 1 -
.../packages/connection/src/class-manager.php | 1 -
.../connection/src/class-package-version.php | 2 +-
.../connection/src/class-plugin-storage.php | 1 -
.../connection/src/class-rest-connector.php | 4 ---
.../packages/connection/src/class-secrets.php | 2 +-
.../connection/src/class-server-sandbox.php | 1 -
.../connection/src/class-tracking.php | 1 -
.../connection/src/class-webhooks.php | 1 -
.../tests/php/test_Error_Handler.php | 5 ---
.../tests/php/test_Manager_integration.php | 2 --
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../src/class-user-agent-info.php | 2 --
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../src/class-rest-endpoints.php | 1 -
.../jitm/changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/jitm/src/class-jitm.php | 2 +-
.../jitm/src/class-rest-api-endpoints.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../licensing/src/class-endpoints.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../my-jetpack/src/class-wpcom-products.php | 1 -
.../src/products/class-hybrid-product.php | 1 -
.../src/products/class-module-product.php | 1 -
.../my-jetpack/src/products/class-product.php | 1 -
.../my-jetpack/src/products/class-scan.php | 1 -
.../src/products/class-security.php | 1 -
.../tests/php/test-backup-product.php | 2 --
.../tests/php/test-hybrid-product.php | 2 --
.../tests/php/test-module-product.php | 2 --
.../php/test-product-multiple-filenames.php | 6 ----
.../tests/php/test-products-rest.php | 2 --
.../my-jetpack/tests/php/test-products.php | 1 -
.../tests/php/test-search-product.php | 1 -
.../tests/php/test-social-product.php | 2 --
.../tests/php/test-videopress-product.php | 1 -
.../tests/php/test-wpcom-products.php | 7 ----
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../src/class-password-checker.php | 4 +--
.../changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/publicize/package.json | 2 +-
.../publicize/src/class-publicize.php | 1 -
.../publicize/src/class-rest-controller.php | 1 -
.../tests/php/test-connections-post-field.php | 1 -
.../redirect/changelog/update-wpcs-pre-phpcbf | 5 +++
.../redirect/tests/php/test-redirect.php | 1 -
.../search/changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/search/src/class-helper.php | 2 +-
.../src/widgets/class-search-widget.php | 1 -
.../search/src/wpes/class-query-parser.php | 3 +-
.../search/tests/php/test-helpers.php | 1 -
.../search/tests/php/test-module-control.php | 1 -
.../search/tests/php/test-rest-controller.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/stats-admin/package.json | 2 +-
.../stats-admin/src/class-dashboard.php | 1 -
.../packages/stats-admin/src/class-main.php | 2 +-
.../stats-admin/src/class-rest-controller.php | 1 -
.../stats/changelog/update-wpcs-pre-phpcbf | 5 +++
.../packages/stats/src/class-wpcom-stats.php | 1 -
.../sync/changelog/update-wpcs-pre-phpcbf | 5 +++
projects/packages/sync/src/class-actions.php | 3 +-
.../packages/sync/src/class-functions.php | 1 -
projects/packages/sync/src/class-health.php | 3 +-
.../sync/src/class-package-version.php | 2 +-
projects/packages/sync/src/class-queue.php | 3 --
.../sync/src/class-rest-endpoints.php | 1 -
.../sync/src/modules/class-module.php | 2 +-
.../sync/src/modules/class-themes.php | 2 --
.../sync/src/modules/class-updates.php | 2 --
.../packages/sync/src/modules/class-users.php | 1 -
.../sync/tests/php/test-rest-endpoints.php | 2 --
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../videopress/src/class-admin-ui.php | 3 --
.../videopress/src/class-initializer.php | 1 -
.../videopress/src/tus/class-tus-client.php | 2 --
.../videopress/src/utility-functions.php | 2 +-
.../videopress/tests/php/test-uploader.php | 1 -
.../waf/changelog/update-wpcs-pre-phpcbf | 5 +++
.../packages/waf/src/class-waf-operators.php | 2 +-
.../packages/waf/src/class-waf-transforms.php | 4 +--
.../waf/tests/php/test-waf-operators.php | 2 +-
.../waf/tests/php/test-waf-transforms.php | 2 +-
.../features/optimizations/Optimizations.php | 1 -
.../optimizations/cloud-css/Cloud_CSS.php | 1 -
.../speed-score/Speed_Score_Request.php | 2 +-
.../boost/changelog/update-wpcs-pre-phpcbf | 5 +++
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../modules/class-idc-simulator.php | 1 -
.../modules/class-protect-helper.php | 6 +---
.../class-broken-token-connection-errors.php | 1 -
projects/plugins/jetpack/3rd-party/bitly.php | 1 -
.../admin-pages/class-jetpack-about-page.php | 1 -
.../admin-pages/class.jetpack-admin-page.php | 1 -
.../lib/class-jetpack-tweetstorm-helper.php | 8 ++---
.../lib/class.core-rest-api-endpoints.php | 2 --
.../lib/class.jetpack-password-checker.php | 2 +-
.../lib/class.jetpack-photon-image-sizes.php | 1 -
.../_inc/lib/class.media-extractor.php | 6 ++--
.../jetpack/_inc/lib/class.media-summary.php | 16 ++++-----
.../plugins/jetpack/_inc/lib/class.media.php | 2 +-
...lass.jetpack-core-api-module-endpoints.php | 1 -
...s-wpcom-rest-api-v2-endpoint-mailchimp.php | 1 -
...t-api-v2-endpoint-publicize-share-post.php | 1 -
.../post-fields-publicize-connections.php | 1 -
.../debugger/class-jetpack-cxn-test-base.php | 2 --
.../lib/debugger/class-jetpack-cxn-tests.php | 2 --
.../jetpack/_inc/lib/icalendar-reader.php | 10 +++---
.../jetpack/changelog/update-wpcs-pre-phpcbf | 5 +++
.../plugins/jetpack/class.jetpack-admin.php | 2 --
.../plugins/jetpack/class.jetpack-cli.php | 5 ++-
.../jetpack/class.jetpack-gutenberg.php | 1 -
.../class.jetpack-modules-list-table.php | 1 -
.../plugins/jetpack/class.jetpack-network.php | 2 --
projects/plugins/jetpack/class.jetpack.php | 7 +---
.../jetpack/class.json-api-endpoints.php | 5 ++-
projects/plugins/jetpack/class.photon.php | 2 --
.../jetpack/extensions/blocks/map/map.php | 2 +-
.../extensions/blocks/slideshow/slideshow.php | 2 +-
.../blocks/subscriptions/subscriptions.php | 2 +-
.../plugins/jetpack/functions.opengraph.php | 2 +-
....wpcom-json-api-list-comments-endpoint.php | 1 -
...ass.wpcom-json-api-list-posts-endpoint.php | 2 +-
...pcom-json-api-list-posts-v1-1-endpoint.php | 2 +-
...pcom-json-api-list-posts-v1-2-endpoint.php | 2 +-
.../class.wpcom-json-api-post-endpoint.php | 3 +-
...lass.wpcom-json-api-post-v1-1-endpoint.php | 2 +-
....wpcom-json-api-site-settings-endpoint.php | 3 --
.../class.jetpack-json-api-endpoint.php | 2 +-
...lass.jetpack-json-api-modules-endpoint.php | 1 -
...lass.jetpack-json-api-plugins-endpoint.php | 1 -
...class.jetpack-json-api-themes-endpoint.php | 1 -
...tpack-json-api-updates-status-endpoint.php | 1 -
.../modules/carousel/jetpack-carousel.php | 1 -
.../jetpack/modules/contact-form/admin.php | 4 +--
.../contact-form/grunion-contact-form.php | 13 ++++---
.../plugins/jetpack/modules/custom-css.php | 1 -
.../csstidy/class.csstidy-optimise.php | 2 +-
.../custom-css/csstidy/class.csstidy.php | 8 ++---
.../jetpack/modules/custom-css/custom-css.php | 2 --
.../modules/custom-post-types/comics.php | 4 +--
.../modules/custom-post-types/nova.php | 4 +--
.../modules/custom-post-types/portfolios.php | 2 +-
.../modules/custom-post-types/testimonial.php | 2 +-
.../class-jetpack-google-amp-analytics.php | 2 +-
.../class-admin-color-schemes.php | 1 -
.../admin-menu/class-jetpack-admin-menu.php | 4 +--
.../inline-help/class-inline-help.php | 1 -
.../masterbar/masterbar/class-masterbar.php | 1 -
projects/plugins/jetpack/modules/protect.php | 3 +-
.../modules/protect/blocked-login-page.php | 1 -
.../class.related-posts-customize.php | 1 -
.../related-posts/jetpack-related-posts.php | 2 --
.../modules/scan/class-admin-sidebar-link.php | 3 +-
.../jetpack/modules/sharedaddy/sharedaddy.php | 1 -
.../modules/sharedaddy/sharing-service.php | 3 +-
.../modules/sharedaddy/sharing-sources.php | 5 +--
.../jetpack/modules/shortcodes/gravatar.php | 2 +-
.../modules/shortcodes/untappd-menu.php | 2 +-
.../modules/sitemaps/sitemap-librarian.php | 2 +-
projects/plugins/jetpack/modules/stats.php | 3 --
.../jetpack/modules/subscriptions/views.php | 2 +-
.../modules/theme-tools/featured-content.php | 4 +--
.../modules/theme-tools/site-breadcrumbs.php | 2 +-
.../math/class-constrained-array-rounding.php | 2 +-
.../tiled-gallery/tiled-gallery-shape.php | 4 +--
.../tiled-gallery/tiled-gallery-square.php | 4 +--
.../videopress/class.videopress-player.php | 2 +-
.../jetpack/modules/videopress/shortcode.php | 2 +-
.../migrate-to-core/gallery-widget.php | 1 -
.../milestone/class-milestone-widget.php | 6 ++--
.../jetpack/modules/widgets/top-posts.php | 2 +-
...lass.jetpack-display-posts-widget-base.php | 4 +--
.../class.jetpack-display-posts-widget.php | 2 --
.../jetpack/modules/wordads/class-wordads.php | 1 -
.../php/class-wordads-sidebar-widget.php | 2 +-
.../test-class.jetpack-tweetstorm-helper.php | 2 --
.../lib/test_class.rest-api-endpoints.php | 3 --
.../test-class.subscribers-endpoint.php | 1 -
.../general/test-class.jetpack-gutenberg.php | 1 -
.../general/test-class.jetpack-network.php | 1 -
.../test_class.jetpack-xmlrpc-server.php | 1 -
.../tests/php/general/test_class.jetpack.php | 1 -
.../test-class.json-api-plugins-endpoints.php | 2 --
...t-class.json-api-update-post-endpoints.php | 1 -
...est-class.jetpack-google-amp-analytics.php | 2 +-
.../modules/shortcodes/test-class.flickr.php | 2 --
.../shortcodes/test-class.mixcloud.php | 1 -
.../modules/shortcodes/test-class.youtube.php | 1 -
.../widgets/test_wordpress-post-widget.php | 11 ------
.../php/sync/class.silent-upgrader-skin.php | 1 -
.../class.jetpack-sync-test-replicastore.php | 3 +-
.../sync/test-class.jetpack-sync-checksum.php | 11 ++----
.../php/sync/test_class.jetpack-sync-base.php | 1 -
.../test_class.jetpack-sync-callables.php | 5 ---
.../sync/test_class.jetpack-sync-comments.php | 2 --
...st_class.jetpack-sync-full-immediately.php | 5 +--
.../php/sync/test_class.jetpack-sync-full.php | 3 --
.../test_class.jetpack-sync-modules-stats.php | 1 -
.../sync/test_class.jetpack-sync-plugins.php | 1 -
.../sync/test_class.jetpack-sync-posts.php | 4 ---
.../sync/test_class.jetpack-sync-queue.php | 2 +-
.../sync/test_class.jetpack-sync-sender.php | 3 +-
.../sync/test_class.jetpack-sync-terms.php | 1 -
.../sync/test_class.jetpack-sync-themes.php | 2 --
.../sync/test_class.jetpack-sync-updates.php | 1 -
.../sync/test_class.jetpack-sync-users.php | 3 --
.../jetpack/tests/php/test-get-modules.php | 9 +++--
.../tests/php/uninstall/test_uninstall.php | 1 -
.../protect/changelog/update-wpcs-pre-phpcbf | 5 +++
.../protect/src/class-jetpack-protect.php | 1 -
.../plugins/protect/src/class-scan-status.php | 14 ++++----
.../tests/php/models/test-extension-model.php | 1 -
.../tests/php/models/test-threat-model.php | 1 -
.../protect/tests/php/test-scan-status.php | 3 --
.../plugins/protect/tests/php/test-status.php | 3 --
.../social/changelog/update-wpcs-pre-phpcbf | 5 +++
.../tests/php/test-class-jetpack-social.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../src/class-jetpack-starter-plugin.php | 1 -
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../plugins/super-cache/partials/easy.php | 2 +-
.../plugins/awaitingmoderation.php | 1 -
.../super-cache/plugins/badbehaviour.php | 1 -
.../plugins/dynamic-cache-test.php | 1 -
.../plugins/super-cache/plugins/wptouch.php | 1 -
...class.wp-super-cache-rest-get-settings.php | 2 +-
.../class.wp-super-cache-rest-test-cache.php | 2 +-
...ss.wp-super-cache-rest-update-settings.php | 4 +--
projects/plugins/super-cache/rest/load.php | 3 +-
.../plugins/super-cache/wp-cache-phase1.php | 4 +--
.../plugins/super-cache/wp-cache-phase2.php | 25 +++++++------
projects/plugins/super-cache/wp-cache.php | 36 ++++++++-----------
.../changelog/update-wpcs-pre-phpcbf | 5 +++
.../class.vaultpress-filesystem.php | 2 +-
.../vaultpress/class.vaultpress-hotfixes.php | 1 -
projects/plugins/vaultpress/cron-tasks.php | 2 +-
projects/plugins/vaultpress/vaultpress.php | 26 +++++++-------
projects/plugins/vaultpress/vp-scanner.php | 4 +--
264 files changed, 338 insertions(+), 456 deletions(-)
create mode 100644 projects/packages/a8c-mc-stats/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/admin-ui/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/assets/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/backup/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/blocks/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/changelogger/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/codesniffer/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/connection/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/device-detection/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/identity-crisis/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/jitm/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/licensing/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/my-jetpack/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/password-checker/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/publicize/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/redirect/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/search/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/stats-admin/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/stats/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/sync/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/videopress/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/packages/waf/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/boost/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/jetpack/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/protect/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/social/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/starter-plugin/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/super-cache/changelog/update-wpcs-pre-phpcbf
create mode 100644 projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf
diff --git a/projects/packages/a8c-mc-stats/changelog/update-wpcs-pre-phpcbf b/projects/packages/a8c-mc-stats/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/a8c-mc-stats/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/a8c-mc-stats/src/class-a8c-mc-stats.php b/projects/packages/a8c-mc-stats/src/class-a8c-mc-stats.php
index 88635fbb101bd..73a1fcf8349ea 100644
--- a/projects/packages/a8c-mc-stats/src/class-a8c-mc-stats.php
+++ b/projects/packages/a8c-mc-stats/src/class-a8c-mc-stats.php
@@ -100,7 +100,6 @@ public function get_stats_urls() {
}
return $urls;
-
}
/**
diff --git a/projects/packages/a8c-mc-stats/tests/php/test_Stats.php b/projects/packages/a8c-mc-stats/tests/php/test_Stats.php
index 98eac2975035c..af70015a49e36 100644
--- a/projects/packages/a8c-mc-stats/tests/php/test_Stats.php
+++ b/projects/packages/a8c-mc-stats/tests/php/test_Stats.php
@@ -53,7 +53,6 @@ public function test_add_get() {
$this->assertFalse( $stats->add( 'group2', 'test3' ) );
$this->assertFalse( $stats->add( true, 'test3' ) );
$this->assertFalse( $stats->add( array( 123 ), 'test3' ) );
-
}
/**
@@ -72,7 +71,6 @@ public function test_get_group_query_args() {
$this->assertCount( 1, $check );
$this->assertArrayHasKey( 'x_jetpack-group', $check );
$this->assertEquals( 'test,test2', $check['x_jetpack-group'] );
-
}
}
diff --git a/projects/packages/admin-ui/changelog/update-wpcs-pre-phpcbf b/projects/packages/admin-ui/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/admin-ui/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/admin-ui/package.json b/projects/packages/admin-ui/package.json
index 981cd7869823c..ad056670221d6 100644
--- a/projects/packages/admin-ui/package.json
+++ b/projects/packages/admin-ui/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-admin-ui",
- "version": "0.2.14",
+ "version": "0.2.15-alpha",
"description": "Generic Jetpack wp-admin UI elements",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/admin-ui/#readme",
"bugs": {
diff --git a/projects/packages/admin-ui/src/class-admin-menu.php b/projects/packages/admin-ui/src/class-admin-menu.php
index fb0d2326f7231..fb2403d67f160 100644
--- a/projects/packages/admin-ui/src/class-admin-menu.php
+++ b/projects/packages/admin-ui/src/class-admin-menu.php
@@ -13,7 +13,7 @@
*/
class Admin_Menu {
- const PACKAGE_VERSION = '0.2.14';
+ const PACKAGE_VERSION = '0.2.15-alpha';
/**
* Whether this class has been initialized
diff --git a/projects/packages/admin-ui/tests/php/test_admin_menu.php b/projects/packages/admin-ui/tests/php/test_admin_menu.php
index 7e5c6ec95834d..8bb577de77739 100644
--- a/projects/packages/admin-ui/tests/php/test_admin_menu.php
+++ b/projects/packages/admin-ui/tests/php/test_admin_menu.php
@@ -57,7 +57,6 @@ public function test_page_suffix_matches( $menu_slug ) {
$wp_suffix = add_submenu_page( 'jetpack', 'Test', 'Test', 'read', $menu_slug, '__return_null' );
$this->assertSame( $our_suffix, $wp_suffix );
-
}
/**
diff --git a/projects/packages/assets/changelog/update-wpcs-pre-phpcbf b/projects/packages/assets/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/assets/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/assets/src/class-assets.php b/projects/packages/assets/src/class-assets.php
index c4d7ee1f9eb3e..f78f3635f9036 100644
--- a/projects/packages/assets/src/class-assets.php
+++ b/projects/packages/assets/src/class-assets.php
@@ -278,7 +278,7 @@ public static function normalize_path( $path ) {
} elseif ( '..' === $pp[ $i ] ) {
array_splice( $pp, --$i, 2 );
} else {
- $i++;
+ ++$i;
}
}
$ret .= join( '/', $pp );
diff --git a/projects/packages/backup/changelog/update-wpcs-pre-phpcbf b/projects/packages/backup/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/backup/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/backup/src/class-jetpack-backup-upgrades.php b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
index d1a72a4ba6c2b..c3992011c13bb 100644
--- a/projects/packages/backup/src/class-jetpack-backup-upgrades.php
+++ b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
@@ -30,7 +30,6 @@ public static function upgrade() {
call_user_func( array( __CLASS__, $upgrade ) );
}
-
}
/**
diff --git a/projects/packages/backup/src/class-jetpack-backup.php b/projects/packages/backup/src/class-jetpack-backup.php
index b5e01ef8ae077..c4db7849a1c18 100644
--- a/projects/packages/backup/src/class-jetpack-backup.php
+++ b/projects/packages/backup/src/class-jetpack-backup.php
@@ -457,7 +457,6 @@ public static function get_site_current_purchases() {
return rest_ensure_response(
json_decode( $response['body'], true )
);
-
}
/**
diff --git a/projects/packages/blocks/changelog/update-wpcs-pre-phpcbf b/projects/packages/blocks/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/blocks/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/blocks/tests/php/test-blocks.php b/projects/packages/blocks/tests/php/test-blocks.php
index 60d26164924a4..abf4a97611800 100644
--- a/projects/packages/blocks/tests/php/test-blocks.php
+++ b/projects/packages/blocks/tests/php/test-blocks.php
@@ -319,7 +319,6 @@ public function test_jetpack_register_block_with_editor_style() {
} finally {
remove_filter( 'jetpack_is_standalone_block', '__return_false' );
}
-
}
/**
diff --git a/projects/packages/changelogger/changelog/update-wpcs-pre-phpcbf b/projects/packages/changelogger/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/changelogger/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/changelogger/src/AddCommand.php b/projects/packages/changelogger/src/AddCommand.php
index ba9418a5ad82a..b6512150a4177 100644
--- a/projects/packages/changelogger/src/AddCommand.php
+++ b/projects/packages/changelogger/src/AddCommand.php
@@ -195,7 +195,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
if ( file_exists( "$dir/$filename" ) && $input->getOption( 'filename-auto-suffix' ) ) {
$i = 2;
while ( file_exists( "$dir/$filename#$i" ) ) {
- $i++;
+ ++$i;
}
$output->writeln( "File \"$filename\" already exists. Creating \"$filename#$i\" instead.", OutputInterface::VERBOSITY_VERBOSE );
$filename = "$filename#$i";
diff --git a/projects/packages/changelogger/src/Application.php b/projects/packages/changelogger/src/Application.php
index 8862341f923a6..47fe0c2967ad2 100644
--- a/projects/packages/changelogger/src/Application.php
+++ b/projects/packages/changelogger/src/Application.php
@@ -18,7 +18,7 @@
*/
class Application extends SymfonyApplication {
- const VERSION = '3.3.0';
+ const VERSION = '3.3.1-alpha';
/**
* Constructor.
diff --git a/projects/packages/changelogger/src/Plugins/SemverVersioning.php b/projects/packages/changelogger/src/Plugins/SemverVersioning.php
index 06e50dfe78d79..5f24c03259bb9 100644
--- a/projects/packages/changelogger/src/Plugins/SemverVersioning.php
+++ b/projects/packages/changelogger/src/Plugins/SemverVersioning.php
@@ -160,16 +160,16 @@ public function nextVersion( $version, array $changes, array $extra = array() )
$out->writeln( 'Semver does not automatically move version 0.y.z to 1.0.0.>' );
$out->writeln( 'You will have to do that manually when you\'re ready for the first release.>' );
}
- $info['minor']++;
+ ++$info['minor'];
} else {
$info['minor'] = 0;
- $info['major']++;
+ ++$info['major'];
}
} elseif ( isset( $significances['minor'] ) ) {
$info['patch'] = 0;
- $info['minor']++;
+ ++$info['minor'];
} else {
- $info['patch']++;
+ ++$info['patch'];
}
return $this->normalizeVersion( $info );
diff --git a/projects/packages/changelogger/src/Plugins/WordpressVersioning.php b/projects/packages/changelogger/src/Plugins/WordpressVersioning.php
index 0da7cfb0f7921..47924ebc828ab 100644
--- a/projects/packages/changelogger/src/Plugins/WordpressVersioning.php
+++ b/projects/packages/changelogger/src/Plugins/WordpressVersioning.php
@@ -151,7 +151,7 @@ public function nextVersion( $version, array $changes, array $extra = array() )
);
if ( $this->input->getOption( 'point-release' ) ) {
- $info['point']++;
+ ++$info['point'];
} else {
$info['point'] = 0;
$info['major'] += 0.1;
diff --git a/projects/packages/changelogger/src/ValidateCommand.php b/projects/packages/changelogger/src/ValidateCommand.php
index d7aa6567a5c5f..02f8757f190b7 100644
--- a/projects/packages/changelogger/src/ValidateCommand.php
+++ b/projects/packages/changelogger/src/ValidateCommand.php
@@ -95,7 +95,7 @@ private function msg( $type, $file, $line, $msg ) {
$postfix = '>';
}
$this->output->writeln( $prefix . $msg . $postfix );
- $this->counts[ $type ]++;
+ ++$this->counts[ $type ];
}
/**
diff --git a/projects/packages/changelogger/src/php7/CommandLoader.php b/projects/packages/changelogger/src/php7/CommandLoader.php
index 12d29ae3efe44..50f96fec7101b 100644
--- a/projects/packages/changelogger/src/php7/CommandLoader.php
+++ b/projects/packages/changelogger/src/php7/CommandLoader.php
@@ -22,7 +22,7 @@ class CommandLoader extends CommandLoaderBase implements CommandLoaderInterface
* @param string $name Command name.
* @return bool
*/
- public function has( $name ) : bool {
+ public function has( $name ): bool {
return $this->doHas( $name );
}
@@ -33,7 +33,7 @@ public function has( $name ) : bool {
* @return Command
* @throws CommandNotFoundException If the command is not found.
*/
- public function get( $name ) : Command {
+ public function get( $name ): Command {
return $this->doGet( $name );
}
@@ -42,7 +42,7 @@ public function get( $name ) : Command {
*
* @return string[] All registered command names
*/
- public function getNames() : array {
+ public function getNames(): array {
return $this->doGetNames();
}
}
diff --git a/projects/packages/codesniffer/Jetpack/Sniffs/Constants/MasterUserConstantSniff.php b/projects/packages/codesniffer/Jetpack/Sniffs/Constants/MasterUserConstantSniff.php
index 4610ff6397e1e..670189f300fd4 100644
--- a/projects/packages/codesniffer/Jetpack/Sniffs/Constants/MasterUserConstantSniff.php
+++ b/projects/packages/codesniffer/Jetpack/Sniffs/Constants/MasterUserConstantSniff.php
@@ -40,7 +40,6 @@ public function process( File $phpcs_file, $stack_ptr ) {
'ShouldNotBeUsed'
);
}
-
}
}
diff --git a/projects/packages/codesniffer/changelog/update-wpcs-pre-phpcbf b/projects/packages/codesniffer/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/codesniffer/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/connection/changelog/update-wpcs-pre-phpcbf b/projects/packages/connection/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/connection/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/connection/src/class-error-handler.php b/projects/packages/connection/src/class-error-handler.php
index fab2a3ea1f697..76e360c834894 100644
--- a/projects/packages/connection/src/class-error-handler.php
+++ b/projects/packages/connection/src/class-error-handler.php
@@ -288,7 +288,6 @@ public function store_error( \WP_Error $error ) {
}
return false;
-
}
/**
@@ -326,7 +325,6 @@ public function wp_error_to_array( \WP_Error $error ) {
);
return $error_array;
-
}
/**
@@ -380,7 +378,6 @@ public function encrypt_data_to_wpcom( $data ) {
}
return $encrypted_data;
-
}
/**
@@ -401,7 +398,6 @@ public function get_user_id_from_token( $token ) {
}
return $user_id;
-
}
/**
@@ -566,7 +562,6 @@ public function verify_error( $error ) {
$verified_errors[ $error_code ][ $user_id ] = $error;
update_option( self::STORED_VERIFIED_ERRORS_OPTION, $verified_errors );
-
}
/**
@@ -612,7 +607,6 @@ public function verify_xml_rpc_error( \WP_REST_Request $request ) {
}
return new \WP_REST_Response( false, 200 );
-
}
/**
diff --git a/projects/packages/connection/src/class-heartbeat.php b/projects/packages/connection/src/class-heartbeat.php
index 9f1b0dbd7f722..83785d37b94ec 100644
--- a/projects/packages/connection/src/class-heartbeat.php
+++ b/projects/packages/connection/src/class-heartbeat.php
@@ -164,7 +164,6 @@ public static function generate_stats_array( $prefix = '' ) {
}
return $return;
-
}
/**
diff --git a/projects/packages/connection/src/class-manager.php b/projects/packages/connection/src/class-manager.php
index 43943886064d3..b40b665944233 100644
--- a/projects/packages/connection/src/class-manager.php
+++ b/projects/packages/connection/src/class-manager.php
@@ -1778,7 +1778,6 @@ public function verify_secrets( $action, $secret_1, $user_id ) {
* Should be changed to protected.
*/
public function handle_authorization() {
-
}
/**
diff --git a/projects/packages/connection/src/class-package-version.php b/projects/packages/connection/src/class-package-version.php
index 9d58beba53c8d..da2d74765f488 100644
--- a/projects/packages/connection/src/class-package-version.php
+++ b/projects/packages/connection/src/class-package-version.php
@@ -12,7 +12,7 @@
*/
class Package_Version {
- const PACKAGE_VERSION = '1.48.1';
+ const PACKAGE_VERSION = '1.48.2-alpha';
const PACKAGE_SLUG = 'connection';
diff --git a/projects/packages/connection/src/class-plugin-storage.php b/projects/packages/connection/src/class-plugin-storage.php
index a7c510d9a8284..db4f0b17a2576 100644
--- a/projects/packages/connection/src/class-plugin-storage.php
+++ b/projects/packages/connection/src/class-plugin-storage.php
@@ -180,7 +180,6 @@ public static function configure() {
}
self::$configured = true;
-
}
/**
diff --git a/projects/packages/connection/src/class-rest-connector.php b/projects/packages/connection/src/class-rest-connector.php
index daae3d0ce1a20..9c0a224623ccf 100644
--- a/projects/packages/connection/src/class-rest-connector.php
+++ b/projects/packages/connection/src/class-rest-connector.php
@@ -365,7 +365,6 @@ function ( &$data, $slug ) {
}
return array_values( $plugins );
-
}
/**
@@ -398,7 +397,6 @@ public static function connection_plugins_permission_check() {
}
return new WP_Error( 'invalid_user_permission_activate_plugins', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) );
-
}
/**
@@ -495,7 +493,6 @@ public static function get_user_connection_data( $rest_response = true ) {
}
return $response;
-
}
/**
@@ -513,7 +510,6 @@ public static function user_connection_data_permission_check() {
self::get_user_permissions_error_msg(),
array( 'status' => rest_authorization_required_code() )
);
-
}
/**
diff --git a/projects/packages/connection/src/class-secrets.php b/projects/packages/connection/src/class-secrets.php
index f91acb438bda1..1d41c4e4ba63a 100644
--- a/projects/packages/connection/src/class-secrets.php
+++ b/projects/packages/connection/src/class-secrets.php
@@ -40,7 +40,7 @@ private function secret_callable_method() {
$attempts = 1;
$secret_length = strlen( $secret );
while ( $secret_length < 32 && $attempts < 32 ) {
- $attempts++;
+ ++$attempts;
$secret .= wp_generate_password( 32, false );
$secret_length = strlen( $secret );
}
diff --git a/projects/packages/connection/src/class-server-sandbox.php b/projects/packages/connection/src/class-server-sandbox.php
index 2d45a0b6dba50..711480bbc92b3 100644
--- a/projects/packages/connection/src/class-server-sandbox.php
+++ b/projects/packages/connection/src/class-server-sandbox.php
@@ -146,7 +146,6 @@ private function get_new_signature( $url, $headers, $data, $method ) {
} else {
$this->log_new_signature_error( 'Empty Authorization Header' );
}
-
}
/**
diff --git a/projects/packages/connection/src/class-tracking.php b/projects/packages/connection/src/class-tracking.php
index ef1f07ebe4166..27a290a9e2847 100644
--- a/projects/packages/connection/src/class-tracking.php
+++ b/projects/packages/connection/src/class-tracking.php
@@ -316,6 +316,5 @@ public function tracks_get_identity( $user_id ) {
'_ut' => 'anon',
'_ui' => $anon_id,
);
-
}
}
diff --git a/projects/packages/connection/src/class-webhooks.php b/projects/packages/connection/src/class-webhooks.php
index d939c4db14971..244160471b271 100644
--- a/projects/packages/connection/src/class-webhooks.php
+++ b/projects/packages/connection/src/class-webhooks.php
@@ -93,7 +93,6 @@ public function controller( $force = false ) {
break;
// Class Jetpack::admin_page_load() still handles other cases.
}
-
}
/**
diff --git a/projects/packages/connection/tests/php/test_Error_Handler.php b/projects/packages/connection/tests/php/test_Error_Handler.php
index c5dc6a7b3a379..ba2b370b717f0 100644
--- a/projects/packages/connection/tests/php/test_Error_Handler.php
+++ b/projects/packages/connection/tests/php/test_Error_Handler.php
@@ -57,7 +57,6 @@ public function get_sample_error( $error_code, $user_id, $error_type = 'xmlrpc'
'An error was triggered',
compact( 'signature_details', 'error_type' )
);
-
}
/**
@@ -178,7 +177,6 @@ public function test_gate() {
$this->assertTrue( $this->error_handler->should_report_error( $error ) );
$this->assertFalse( $this->error_handler->should_report_error( $error2 ), 'second attempt to report the same error code should be stopped by the gate' );
$this->assertTrue( $this->error_handler->should_report_error( $error3 ) );
-
}
/**
@@ -208,7 +206,6 @@ public function test_max_five_errors_per_code() {
$this->assertArrayNotHasKey( '3', $stored_errors['unknown_user'], 'first inserted error must have been excluded' );
$this->assertArrayHasKey( '8', $stored_errors['unknown_user'], 'sixth inserted error must be present' );
-
}
/**
@@ -305,7 +302,6 @@ public function test_encryption() {
$this->assertIsString( $encrypted );
$this->assertEquals( 500, strlen( $encrypted ) );
-
}
/**
@@ -339,7 +335,6 @@ public function test_garbage_collector() {
$this->assertArrayNotHasKey( 'invalid_token', $errors );
$this->assertCount( 1, $errors['no_user_tokens'] );
-
}
/**
diff --git a/projects/packages/connection/tests/php/test_Manager_integration.php b/projects/packages/connection/tests/php/test_Manager_integration.php
index a2e72377f5953..4c35cc170b981 100644
--- a/projects/packages/connection/tests/php/test_Manager_integration.php
+++ b/projects/packages/connection/tests/php/test_Manager_integration.php
@@ -204,7 +204,6 @@ public function test_has_connected_user_and_has_connected_admin() {
$this->assertTrue( $this->manager->has_connected_user() );
$this->assertTrue( $this->manager->has_connected_admin() );
-
}
/**
@@ -242,7 +241,6 @@ public function test_is_connection_owner() {
wp_set_current_user( $other_user_id );
$this->assertFalse( $this->manager->is_connection_owner() );
-
}
/**
diff --git a/projects/packages/device-detection/changelog/update-wpcs-pre-phpcbf b/projects/packages/device-detection/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/device-detection/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/device-detection/src/class-user-agent-info.php b/projects/packages/device-detection/src/class-user-agent-info.php
index 7d18ac3c20cdb..98a4561e5223c 100644
--- a/projects/packages/device-detection/src/class-user-agent-info.php
+++ b/projects/packages/device-detection/src/class-user-agent-info.php
@@ -1360,7 +1360,6 @@ public static function get_blackbeberry_OS_version() {
} else {
return false;
}
-
}
/**
@@ -1423,7 +1422,6 @@ public static function detect_blackberry_browser_version() {
return false;
}
}
-
}
/**
diff --git a/projects/packages/identity-crisis/changelog/update-wpcs-pre-phpcbf b/projects/packages/identity-crisis/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/identity-crisis/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/identity-crisis/src/class-rest-endpoints.php b/projects/packages/identity-crisis/src/class-rest-endpoints.php
index 496f53facded1..d3197e467c599 100644
--- a/projects/packages/identity-crisis/src/class-rest-endpoints.php
+++ b/projects/packages/identity-crisis/src/class-rest-endpoints.php
@@ -62,7 +62,6 @@ public static function initialize_rest_api() {
),
)
);
-
}
/**
diff --git a/projects/packages/jitm/changelog/update-wpcs-pre-phpcbf b/projects/packages/jitm/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/jitm/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/jitm/src/class-jitm.php b/projects/packages/jitm/src/class-jitm.php
index 668454817c0bb..37934302ffc97 100644
--- a/projects/packages/jitm/src/class-jitm.php
+++ b/projects/packages/jitm/src/class-jitm.php
@@ -20,7 +20,7 @@
*/
class JITM {
- const PACKAGE_VERSION = '2.2.36';
+ const PACKAGE_VERSION = '2.2.37-alpha';
/**
* The configuration method that is called from the jetpack-config package.
diff --git a/projects/packages/jitm/src/class-rest-api-endpoints.php b/projects/packages/jitm/src/class-rest-api-endpoints.php
index 2fa3d2bf1b521..ce8338ea17fcc 100644
--- a/projects/packages/jitm/src/class-rest-api-endpoints.php
+++ b/projects/packages/jitm/src/class-rest-api-endpoints.php
@@ -39,7 +39,6 @@ public static function register_endpoints() {
'permission_callback' => __CLASS__ . '::delete_jitm_message_permission_callback',
)
);
-
}
/**
diff --git a/projects/packages/licensing/changelog/update-wpcs-pre-phpcbf b/projects/packages/licensing/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/licensing/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/licensing/src/class-endpoints.php b/projects/packages/licensing/src/class-endpoints.php
index 06a4ea21eb324..39e40d235a07c 100644
--- a/projects/packages/licensing/src/class-endpoints.php
+++ b/projects/packages/licensing/src/class-endpoints.php
@@ -182,7 +182,6 @@ public static function set_jetpack_license_key_permission_check() {
}
return new WP_Error( 'invalid_user_permission_set_jetpack_license_key', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
-
}
/**
diff --git a/projects/packages/my-jetpack/changelog/update-wpcs-pre-phpcbf b/projects/packages/my-jetpack/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/my-jetpack/src/class-wpcom-products.php b/projects/packages/my-jetpack/src/class-wpcom-products.php
index 81b4cab7a3769..e2bc8df836996 100644
--- a/projects/packages/my-jetpack/src/class-wpcom-products.php
+++ b/projects/packages/my-jetpack/src/class-wpcom-products.php
@@ -142,7 +142,6 @@ public static function get_products( $skip_cache = false ) {
self::update_cache( $products );
return $products;
-
}
/**
diff --git a/projects/packages/my-jetpack/src/products/class-hybrid-product.php b/projects/packages/my-jetpack/src/products/class-hybrid-product.php
index 9a6b714434afe..3b5d2758c48ed 100644
--- a/projects/packages/my-jetpack/src/products/class-hybrid-product.php
+++ b/projects/packages/my-jetpack/src/products/class-hybrid-product.php
@@ -127,7 +127,6 @@ public static function do_product_specific_activation( $product_activation ) {
}
return true;
-
}
}
diff --git a/projects/packages/my-jetpack/src/products/class-module-product.php b/projects/packages/my-jetpack/src/products/class-module-product.php
index e2cf58ef4805c..444f26b8117a0 100644
--- a/projects/packages/my-jetpack/src/products/class-module-product.php
+++ b/projects/packages/my-jetpack/src/products/class-module-product.php
@@ -116,7 +116,6 @@ public static function do_product_specific_activation( $plugin_activation ) {
}
return $module_activation;
-
}
/**
diff --git a/projects/packages/my-jetpack/src/products/class-product.php b/projects/packages/my-jetpack/src/products/class-product.php
index 5eaf745fe2eb9..4a7539bff1322 100644
--- a/projects/packages/my-jetpack/src/products/class-product.php
+++ b/projects/packages/my-jetpack/src/products/class-product.php
@@ -403,7 +403,6 @@ final public static function activate() {
$result = apply_filters( "my_jetpack_{$product_slug}_activation", $result );
return $result;
-
}
/**
diff --git a/projects/packages/my-jetpack/src/products/class-scan.php b/projects/packages/my-jetpack/src/products/class-scan.php
index 452b1644b8f2e..0ab5eae6d52e0 100644
--- a/projects/packages/my-jetpack/src/products/class-scan.php
+++ b/projects/packages/my-jetpack/src/products/class-scan.php
@@ -174,7 +174,6 @@ public static function do_product_specific_activation( $current_result ) {
}
return $product_activation;
-
}
/**
diff --git a/projects/packages/my-jetpack/src/products/class-security.php b/projects/packages/my-jetpack/src/products/class-security.php
index aa7fcd3f69ca4..9f8ef881ea3b3 100644
--- a/projects/packages/my-jetpack/src/products/class-security.php
+++ b/projects/packages/my-jetpack/src/products/class-security.php
@@ -149,7 +149,6 @@ public static function do_product_specific_activation( $current_result ) {
}
return $activation;
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-backup-product.php b/projects/packages/my-jetpack/tests/php/test-backup-product.php
index 51454b77ff5e7..ab5e17e305ccc 100644
--- a/projects/packages/my-jetpack/tests/php/test-backup-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-backup-product.php
@@ -47,7 +47,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
@@ -76,7 +75,6 @@ public function tear_down() {
WorDBless_Options::init()->clear_options();
WorDBless_Users::init()->clear_all_users();
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-hybrid-product.php b/projects/packages/my-jetpack/tests/php/test-hybrid-product.php
index c08e8f3ea4545..f17a4678ed757 100644
--- a/projects/packages/my-jetpack/tests/php/test-hybrid-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-hybrid-product.php
@@ -53,7 +53,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
@@ -82,7 +81,6 @@ public function tear_down() {
WorDBless_Options::init()->clear_options();
WorDBless_Users::init()->clear_all_users();
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-module-product.php b/projects/packages/my-jetpack/tests/php/test-module-product.php
index 47dbd45755b42..7545b300c29af 100644
--- a/projects/packages/my-jetpack/tests/php/test-module-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-module-product.php
@@ -63,7 +63,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
@@ -87,7 +86,6 @@ public function tear_down() {
WorDBless_Options::init()->clear_options();
WorDBless_Users::init()->clear_all_users();
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-product-multiple-filenames.php b/projects/packages/my-jetpack/tests/php/test-product-multiple-filenames.php
index b9f1f33517488..d0fe2f2fffeec 100644
--- a/projects/packages/my-jetpack/tests/php/test-product-multiple-filenames.php
+++ b/projects/packages/my-jetpack/tests/php/test-product-multiple-filenames.php
@@ -55,7 +55,6 @@ public function set_up() {
unlink( WP_PLUGIN_DIR . '/jetpack/jetpack.php' );
rmdir( WP_PLUGIN_DIR . '/jetpack' );
}
-
}
/**
@@ -72,7 +71,6 @@ public function install_mock_plugin( $dest_folder ) {
}
copy( __DIR__ . '/assets/backup-mock-plugin.txt', WP_PLUGIN_DIR . '/' . $dest_folder . '/jetpack-backup.php' );
-
}
/**
@@ -95,9 +93,7 @@ public function uninstall_mock_plugins() {
* @after
*/
public function tear_down() {
-
WorDBless_Options::init()->clear_options();
-
}
/**
@@ -146,7 +142,6 @@ public function test_installed_plugin_filename( $folder, $success = true ) {
$this->assertSame( $success, Backup::is_plugin_installed() );
$expected_file = $success ? $folder . '/jetpack-backup.php' : null;
$this->assertSame( $expected_file, Backup::get_installed_plugin_filename() );
-
}
/**
@@ -170,7 +165,6 @@ public function test_activate( $folder ) {
$this->assertTrue( Backup::is_plugin_active() );
$this->assertTrue( is_plugin_active( $filename ) );
-
}
}
diff --git a/projects/packages/my-jetpack/tests/php/test-products-rest.php b/projects/packages/my-jetpack/tests/php/test-products-rest.php
index 5e64f98f9ba55..282158e08c500 100644
--- a/projects/packages/my-jetpack/tests/php/test-products-rest.php
+++ b/projects/packages/my-jetpack/tests/php/test-products-rest.php
@@ -96,7 +96,6 @@ public function set_up() {
'role' => 'editor',
)
);
-
}
/**
@@ -125,7 +124,6 @@ public function tear_down() {
unset( $_SERVER['REQUEST_METHOD'] );
$_GET = array();
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-products.php b/projects/packages/my-jetpack/tests/php/test-products.php
index b8e13db544f8f..08657ca4d3bb5 100644
--- a/projects/packages/my-jetpack/tests/php/test-products.php
+++ b/projects/packages/my-jetpack/tests/php/test-products.php
@@ -25,7 +25,6 @@ public function set_up() {
if ( version_compare( phpversion(), '5.7', '<=' ) ) {
$this->markTestSkipped( 'avoid bug in PHP 5.6 that throws strict mode warnings for abstract static methods.' );
}
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-search-product.php b/projects/packages/my-jetpack/tests/php/test-search-product.php
index 7479b99a1c7e7..f5465d9c7adf1 100644
--- a/projects/packages/my-jetpack/tests/php/test-search-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-search-product.php
@@ -47,7 +47,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-social-product.php b/projects/packages/my-jetpack/tests/php/test-social-product.php
index 021dcf627514a..d7bf1a7ffda54 100644
--- a/projects/packages/my-jetpack/tests/php/test-social-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-social-product.php
@@ -47,7 +47,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
@@ -76,7 +75,6 @@ public function tear_down() {
WorDBless_Options::init()->clear_options();
WorDBless_Users::init()->clear_all_users();
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-videopress-product.php b/projects/packages/my-jetpack/tests/php/test-videopress-product.php
index 8274bb57368f4..90f6ec46945c0 100644
--- a/projects/packages/my-jetpack/tests/php/test-videopress-product.php
+++ b/projects/packages/my-jetpack/tests/php/test-videopress-product.php
@@ -47,7 +47,6 @@ public function set_up() {
)
);
wp_set_current_user( self::$user_id );
-
}
/**
diff --git a/projects/packages/my-jetpack/tests/php/test-wpcom-products.php b/projects/packages/my-jetpack/tests/php/test-wpcom-products.php
index 525db46a5d31c..a84e54d8c7e6d 100644
--- a/projects/packages/my-jetpack/tests/php/test-wpcom-products.php
+++ b/projects/packages/my-jetpack/tests/php/test-wpcom-products.php
@@ -41,7 +41,6 @@ public function set_up() {
Jetpack_Options::update_option( 'id', 123 );
Initializer::init();
Constants::set_constant( 'JETPACK__WPCOM_JSON_API_BASE', 'https://public-api.wordpress.com' );
-
}
/**
@@ -133,7 +132,6 @@ public function tear_down() {
unset( $_SERVER['REQUEST_METHOD'] );
$_GET = array();
-
}
/**
@@ -163,7 +161,6 @@ public function test_get_products() {
// tests that a second request will get from cache. If it tried to make the request, it would throw a Fatal error.
$products = Wpcom_Products::get_products();
$this->assertEquals( $this->get_mock_products_data(), $products );
-
}
/**
@@ -177,7 +174,6 @@ public function test_get_products_error() {
remove_filter( 'pre_http_request', array( $this, 'mock_error_response' ) );
$this->assertTrue( is_wp_error( $products ) );
-
}
/**
@@ -197,7 +193,6 @@ public function test_get_products_cache_if_error() {
remove_filter( 'pre_http_request', array( $this, 'mock_error_response' ) );
$this->assertEquals( $this->get_mock_products_data(), $products );
-
}
/**
@@ -219,7 +214,6 @@ public function test_get_product_price() {
);
$this->assertSame( $expected, $product_price );
-
}
/**
@@ -233,7 +227,6 @@ public function test_get_product_price_invalid() {
remove_filter( 'pre_http_request', array( $this, 'mock_success_response' ) );
$this->assertSame( array(), $product_price );
-
}
}
diff --git a/projects/packages/password-checker/changelog/update-wpcs-pre-phpcbf b/projects/packages/password-checker/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/password-checker/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/password-checker/src/class-password-checker.php b/projects/packages/password-checker/src/class-password-checker.php
index 374dc8933df6e..79c369c23094d 100644
--- a/projects/packages/password-checker/src/class-password-checker.php
+++ b/projects/packages/password-checker/src/class-password-checker.php
@@ -508,7 +508,7 @@ protected function get_charset_size( $password ) {
// Spaces.
if ( strpos( $password, ' ' ) ) {
- $size ++;
+ ++$size;
}
return $size;
@@ -556,7 +556,7 @@ protected function calculate_entropy_bits( $password ) {
$aidx = $this->get_char_index( $password[0] );
$length = strlen( $password );
- for ( $b = 1; $b < $length; $b ++ ) {
+ for ( $b = 1; $b < $length; $b++ ) {
$bidx = $this->get_char_index( $password[ $b ] );
// 27 = number of chars in the index (a-z,' ').
diff --git a/projects/packages/publicize/changelog/update-wpcs-pre-phpcbf b/projects/packages/publicize/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/publicize/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/publicize/package.json b/projects/packages/publicize/package.json
index 10646f63a38b6..d9bc73408a990 100644
--- a/projects/packages/publicize/package.json
+++ b/projects/packages/publicize/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize",
- "version": "0.19.0",
+ "version": "0.19.1-alpha",
"description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme",
"bugs": {
diff --git a/projects/packages/publicize/src/class-publicize.php b/projects/packages/publicize/src/class-publicize.php
index 0086d7cc801b1..72767b37e72cf 100644
--- a/projects/packages/publicize/src/class-publicize.php
+++ b/projects/packages/publicize/src/class-publicize.php
@@ -951,7 +951,6 @@ public function options_save_tumblr() {
$options = array( 'tumblr_base_hostname' => isset( $_POST['selected_id'] ) ? sanitize_text_field( wp_unslash( $_POST['selected_id'] ) ) : null );
$this->set_remote_publicize_options( $connection_name, $options );
-
}
/**
diff --git a/projects/packages/publicize/src/class-rest-controller.php b/projects/packages/publicize/src/class-rest-controller.php
index bd55e35810e07..136b46c8da5fc 100644
--- a/projects/packages/publicize/src/class-rest-controller.php
+++ b/projects/packages/publicize/src/class-rest-controller.php
@@ -31,7 +31,6 @@ class REST_Controller {
*/
public function __construct( $is_wpcom = false ) {
$this->is_wpcom = $is_wpcom;
-
}
/**
diff --git a/projects/packages/publicize/tests/php/test-connections-post-field.php b/projects/packages/publicize/tests/php/test-connections-post-field.php
index 71e51067fe915..2cd9df77ec9d6 100644
--- a/projects/packages/publicize/tests/php/test-connections-post-field.php
+++ b/projects/packages/publicize/tests/php/test-connections-post-field.php
@@ -156,7 +156,6 @@ public function set_up() {
'post_date_gmt' => '',
)
);
-
}
/**
diff --git a/projects/packages/redirect/changelog/update-wpcs-pre-phpcbf b/projects/packages/redirect/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/redirect/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/redirect/tests/php/test-redirect.php b/projects/packages/redirect/tests/php/test-redirect.php
index 6ae7461b9e938..4d4816a0fb9bd 100644
--- a/projects/packages/redirect/tests/php/test-redirect.php
+++ b/projects/packages/redirect/tests/php/test-redirect.php
@@ -92,7 +92,6 @@ public function test_get_url() {
$v = rawurlencode( 'key=value&key2=value2' );
$v_url = rawurlencode( 'https://wordpress.com/support' );
$this->assertEquals( 'https://jetpack.com/redirect/?url=' . $v_url . '&site=example.org&query=' . $v, $url );
-
}
}
diff --git a/projects/packages/search/changelog/update-wpcs-pre-phpcbf b/projects/packages/search/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/search/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/search/src/class-helper.php b/projects/packages/search/src/class-helper.php
index 78e819a28c459..aec5db4924fd6 100644
--- a/projects/packages/search/src/class-helper.php
+++ b/projects/packages/search/src/class-helper.php
@@ -520,7 +520,7 @@ public static function get_filter_properties_for_tracks( $filters ) {
$key = sprintf( 'widget_filter_type_%s', $filter['type'] );
if ( isset( $filters_properties[ $key ] ) ) {
- $filters_properties[ $key ] ++;
+ ++$filters_properties[ $key ];
} else {
$filters_properties[ $key ] = 1;
}
diff --git a/projects/packages/search/src/widgets/class-search-widget.php b/projects/packages/search/src/widgets/class-search-widget.php
index 7f37729b019a6..60f33e4d6a0f1 100644
--- a/projects/packages/search/src/widgets/class-search-widget.php
+++ b/projects/packages/search/src/widgets/class-search-widget.php
@@ -1115,7 +1115,6 @@ function ( $taxonomy ) {
);
}
);
-
}
}
diff --git a/projects/packages/search/src/wpes/class-query-parser.php b/projects/packages/search/src/wpes/class-query-parser.php
index 8bd3970ddc819..3b067df31b019 100644
--- a/projects/packages/search/src/wpes/class-query-parser.php
+++ b/projects/packages/search/src/wpes/class-query-parser.php
@@ -452,7 +452,6 @@ public function remaining_query( $args ) {
'should'
);
}
-
}
/*
@@ -691,7 +690,7 @@ protected function truncate_string( $string, $limit, $break = ' ' ) {
$broken = true;
break;
}
- $breakpoint--;
+ --$breakpoint;
}
// if we weren't able to find a break, need to chop mid-word
if ( ! $broken ) {
diff --git a/projects/packages/search/tests/php/test-helpers.php b/projects/packages/search/tests/php/test-helpers.php
index 56fbca9fedaee..9272e8c1b6426 100644
--- a/projects/packages/search/tests/php/test-helpers.php
+++ b/projects/packages/search/tests/php/test-helpers.php
@@ -300,7 +300,6 @@ public function test_is_active_widget( $number, $expected ) {
$widget_id = Helper::build_widget_id( $number );
$this->assertSame( $expected, Helper::is_active_widget( $widget_id ) );
-
}
/**
diff --git a/projects/packages/search/tests/php/test-module-control.php b/projects/packages/search/tests/php/test-module-control.php
index 512ccca52c521..de3fc4c25f041 100644
--- a/projects/packages/search/tests/php/test-module-control.php
+++ b/projects/packages/search/tests/php/test-module-control.php
@@ -98,7 +98,6 @@ public function test_activate_module_failed_connection_required() {
// Cannot activate search if site is not connected.
$this->assertEquals( 'connection_required', $err->get_error_code() );
$this->assertEquals( array(), get_option( 'jetpack_' . Module_Control::JETPACK_ACTIVE_MODULES_OPTION_KEY, array() ) );
-
}
/**
diff --git a/projects/packages/search/tests/php/test-rest-controller.php b/projects/packages/search/tests/php/test-rest-controller.php
index f4565d5fd925f..8052fb8c5a55d 100644
--- a/projects/packages/search/tests/php/test-rest-controller.php
+++ b/projects/packages/search/tests/php/test-rest-controller.php
@@ -52,7 +52,6 @@ public function set_up() {
add_action( 'rest_api_init', array( $this->rest_controller, 'register_rest_routes' ) );
do_action( 'rest_api_init' );
-
}
/**
diff --git a/projects/packages/stats-admin/changelog/update-wpcs-pre-phpcbf b/projects/packages/stats-admin/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/stats-admin/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/stats-admin/package.json b/projects/packages/stats-admin/package.json
index 504a0cc6bce15..4e5156e1b72a9 100644
--- a/projects/packages/stats-admin/package.json
+++ b/projects/packages/stats-admin/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-stats-admin",
- "version": "0.2.1",
+ "version": "0.2.2-alpha",
"description": "Stats Dashboard",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/stats-admin/#readme",
"bugs": {
diff --git a/projects/packages/stats-admin/src/class-dashboard.php b/projects/packages/stats-admin/src/class-dashboard.php
index 48bdf087c6c62..598f783749c73 100644
--- a/projects/packages/stats-admin/src/class-dashboard.php
+++ b/projects/packages/stats-admin/src/class-dashboard.php
@@ -146,7 +146,6 @@ public function load_admin_scripts() {
$this->get_config_data_js(),
'before'
);
-
}
/**
diff --git a/projects/packages/stats-admin/src/class-main.php b/projects/packages/stats-admin/src/class-main.php
index 68f7b4c808d3e..74c2089a81e81 100644
--- a/projects/packages/stats-admin/src/class-main.php
+++ b/projects/packages/stats-admin/src/class-main.php
@@ -18,7 +18,7 @@ class Main {
/**
* Stats version.
*/
- const VERSION = '0.2.1';
+ const VERSION = '0.2.2-alpha';
/**
* Singleton Main instance.
diff --git a/projects/packages/stats-admin/src/class-rest-controller.php b/projects/packages/stats-admin/src/class-rest-controller.php
index c5ced8c18c915..fc05c9312a802 100644
--- a/projects/packages/stats-admin/src/class-rest-controller.php
+++ b/projects/packages/stats-admin/src/class-rest-controller.php
@@ -204,7 +204,6 @@ public function get_stats_resource( $req ) {
default:
return $this->get_forbidden_error();
}
-
}
/**
diff --git a/projects/packages/stats/changelog/update-wpcs-pre-phpcbf b/projects/packages/stats/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/stats/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/stats/src/class-wpcom-stats.php b/projects/packages/stats/src/class-wpcom-stats.php
index 4a7f9a88875a0..70328cbc58dc2 100644
--- a/projects/packages/stats/src/class-wpcom-stats.php
+++ b/projects/packages/stats/src/class-wpcom-stats.php
@@ -73,7 +73,6 @@ public function get_stats_summary( $args = array() ) {
$this->resource = 'summary';
return $this->fetch_stats( $args );
-
}
/**
diff --git a/projects/packages/sync/changelog/update-wpcs-pre-phpcbf b/projects/packages/sync/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/sync/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/sync/src/class-actions.php b/projects/packages/sync/src/class-actions.php
index 5df50260558cd..c1711af331f07 100644
--- a/projects/packages/sync/src/class-actions.php
+++ b/projects/packages/sync/src/class-actions.php
@@ -370,7 +370,6 @@ public static function get_debug_details() {
$debug['debug_details']['sync_error_log'] = get_option( self::ERROR_LOG_PREFIX . 'sync', '' );
return $debug;
-
}
/**
@@ -705,7 +704,7 @@ public static function do_cron_sync_by_type( $type ) {
$result = 'full_sync' === $type ? self::$sender->do_full_sync() : self::$sender->do_sync();
// # of send actions performed.
- $executions ++;
+ ++$executions;
} while ( $result && ! is_wp_error( $result ) && ( $start_time + $time_limit ) > time() );
diff --git a/projects/packages/sync/src/class-functions.php b/projects/packages/sync/src/class-functions.php
index b007c69560e72..1a5d9c7dc9ccb 100644
--- a/projects/packages/sync/src/class-functions.php
+++ b/projects/packages/sync/src/class-functions.php
@@ -627,7 +627,6 @@ public static function json_wrap( &$any, $seen_nodes = array() ) {
}
return $any;
-
}
/**
diff --git a/projects/packages/sync/src/class-health.php b/projects/packages/sync/src/class-health.php
index ea3d7bd4cfd7c..2aa2465cbd43c 100644
--- a/projects/packages/sync/src/class-health.php
+++ b/projects/packages/sync/src/class-health.php
@@ -79,7 +79,7 @@ class Health {
* If sync is active, Health-related hooks will be initialized after plugins are loaded.
*/
public static function init() {
- add_action( 'jetpack_full_sync_end', array( __ClASS__, 'full_sync_end_update_status' ), 10, 2 );
+ add_action( 'jetpack_full_sync_end', array( __CLASS__, 'full_sync_end_update_status' ), 10, 2 );
}
/**
@@ -102,7 +102,6 @@ public static function get_status() {
default:
return self::STATUS_UNKNOWN;
}
-
}
/**
diff --git a/projects/packages/sync/src/class-package-version.php b/projects/packages/sync/src/class-package-version.php
index c1240300a6b3f..54ad2571cc830 100644
--- a/projects/packages/sync/src/class-package-version.php
+++ b/projects/packages/sync/src/class-package-version.php
@@ -12,7 +12,7 @@
*/
class Package_Version {
- const PACKAGE_VERSION = '1.46.0';
+ const PACKAGE_VERSION = '1.46.1-alpha';
const PACKAGE_SLUG = 'sync';
diff --git a/projects/packages/sync/src/class-queue.php b/projects/packages/sync/src/class-queue.php
index 78222a70cfe72..c6fdca1dd4d92 100644
--- a/projects/packages/sync/src/class-queue.php
+++ b/projects/packages/sync/src/class-queue.php
@@ -619,7 +619,6 @@ private function delete_checkout_id() {
$this->get_lock_option_name()
)
);
-
}
/**
@@ -679,7 +678,6 @@ private function fetch_items( $limit = null ) {
}
return $this->unserialize_values( $items );
-
}
/**
@@ -730,7 +728,6 @@ function ( $item ) {
);
return $items;
-
}
/**
diff --git a/projects/packages/sync/src/class-rest-endpoints.php b/projects/packages/sync/src/class-rest-endpoints.php
index 2a3bd33dba0ba..cd53dedb85eb3 100644
--- a/projects/packages/sync/src/class-rest-endpoints.php
+++ b/projects/packages/sync/src/class-rest-endpoints.php
@@ -327,7 +327,6 @@ public static function initialize_rest_api() {
'permission_callback' => __CLASS__ . '::verify_default_permissions',
)
);
-
}
/**
diff --git a/projects/packages/sync/src/modules/class-module.php b/projects/packages/sync/src/modules/class-module.php
index b69de80e1d00a..a50cdd5283859 100644
--- a/projects/packages/sync/src/modules/class-module.php
+++ b/projects/packages/sync/src/modules/class-module.php
@@ -270,7 +270,7 @@ protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_fie
$listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end );
$chunk_count += count( $chunked_ids );
- $page++;
+ ++$page;
// The $ids are ordered in descending order.
$previous_interval_end = end( $ids );
}
diff --git a/projects/packages/sync/src/modules/class-themes.php b/projects/packages/sync/src/modules/class-themes.php
index 4b594eda26108..5b90bfac6dadb 100644
--- a/projects/packages/sync/src/modules/class-themes.php
+++ b/projects/packages/sync/src/modules/class-themes.php
@@ -677,7 +677,6 @@ public function sync_remove_widgets_from_sidebar( $new_widgets, $old_widgets, $s
}
}
return $moved_to_inactive;
-
}
/**
@@ -715,7 +714,6 @@ public function sync_widgets_reordered( $new_widgets, $old_widgets, $sidebar ) {
*/
do_action( 'jetpack_widget_reordered', $sidebar, $sidebar_name );
}
-
}
/**
diff --git a/projects/packages/sync/src/modules/class-updates.php b/projects/packages/sync/src/modules/class-updates.php
index 8a2e8db30cf9e..5557bab4b3b23 100644
--- a/projects/packages/sync/src/modules/class-updates.php
+++ b/projects/packages/sync/src/modules/class-updates.php
@@ -107,7 +107,6 @@ public function init_listeners( $callable ) {
add_action( 'jetpack_sync_core_reinstalled_successfully', $callable );
add_action( 'jetpack_sync_core_autoupdated_successfully', $callable, 10, 2 );
add_action( 'jetpack_sync_core_updated_successfully', $callable, 10, 2 );
-
}
/**
@@ -352,7 +351,6 @@ public function sync_last_event() {
*/
do_action( "jetpack_{$transient}_change", $value );
}
-
}
/**
diff --git a/projects/packages/sync/src/modules/class-users.php b/projects/packages/sync/src/modules/class-users.php
index c53cfc5e5b831..6288654a8c240 100644
--- a/projects/packages/sync/src/modules/class-users.php
+++ b/projects/packages/sync/src/modules/class-users.php
@@ -433,7 +433,6 @@ public function user_register_handler( $user_id ) {
*/
do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) );
$this->clear_flags( $user_id );
-
}
/**
diff --git a/projects/packages/sync/tests/php/test-rest-endpoints.php b/projects/packages/sync/tests/php/test-rest-endpoints.php
index 923fd0d6a47c3..cc130ed5907cb 100644
--- a/projects/packages/sync/tests/php/test-rest-endpoints.php
+++ b/projects/packages/sync/tests/php/test-rest-endpoints.php
@@ -230,7 +230,6 @@ public function test_sync_unlock() {
$this->assertEquals( 200, $response->get_status() );
$this->assertFalse( get_option( 'jpsq_sync_checkout' ) );
-
}
/**
@@ -306,7 +305,6 @@ public function test_no_access_response( $endpoint, $method, $data = null ) {
$response = $this->server->dispatch( $request );
$this->assertEquals( 401, $response->get_status() );
-
}
}
diff --git a/projects/packages/videopress/changelog/update-wpcs-pre-phpcbf b/projects/packages/videopress/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/videopress/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/videopress/src/class-admin-ui.php b/projects/packages/videopress/src/class-admin-ui.php
index e0da317e26c61..de396e8662c12 100644
--- a/projects/packages/videopress/src/class-admin-ui.php
+++ b/projects/packages/videopress/src/class-admin-ui.php
@@ -50,7 +50,6 @@ public static function init() {
add_filter( 'get_edit_post_link', array( __CLASS__, 'edit_video_link' ), 10, 3 );
add_action( 'admin_init', array( __CLASS__, 'remove_jetpack_hooks' ) );
-
}
/**
@@ -302,7 +301,6 @@ public static function attachment_details_two_column_template() {
});
=' );
-
}
/**
diff --git a/projects/packages/videopress/src/tus/class-tus-client.php b/projects/packages/videopress/src/tus/class-tus-client.php
index f154292024d63..2cb6a07c32710 100644
--- a/projects/packages/videopress/src/tus/class-tus-client.php
+++ b/projects/packages/videopress/src/tus/class-tus-client.php
@@ -116,7 +116,6 @@ public function __construct( $key, $upload_token, $blog_id ) {
$this->api_url = sprintf( self::BASE_API_URL, (int) $blog_id );
$this->cache = new Transient_Store( $this->get_key() );
-
}
/**
@@ -696,7 +695,6 @@ protected function send_patch_request( $bytes, $offset ) {
}
return (int) wp_remote_retrieve_header( $response, 'upload-offset' );
-
}
/**
diff --git a/projects/packages/videopress/src/utility-functions.php b/projects/packages/videopress/src/utility-functions.php
index 8941cae539b79..45a56107f2c3f 100644
--- a/projects/packages/videopress/src/utility-functions.php
+++ b/projects/packages/videopress/src/utility-functions.php
@@ -188,7 +188,7 @@ function videopress_cleanup_media_library() {
// Force delete the attachment, because we don't want it appearing in the trash.
wp_delete_attachment( $post->ID, true );
- $cleaned++;
+ ++$cleaned;
}
}
}
diff --git a/projects/packages/videopress/tests/php/test-uploader.php b/projects/packages/videopress/tests/php/test-uploader.php
index 0228635c8eebb..d38421f52defa 100644
--- a/projects/packages/videopress/tests/php/test-uploader.php
+++ b/projects/packages/videopress/tests/php/test-uploader.php
@@ -95,7 +95,6 @@ protected function set_up() {
( new Tokens() )->update_user_token( $user_id, sprintf( '%s.%s.%d', 'key', 'private', $user_id ), false );
$this->valid_attachment_id = $this->create_upload_object( __DIR__ . '/assets/sample-video.mp4', 'video/mp4' );
-
}
/**
diff --git a/projects/packages/waf/changelog/update-wpcs-pre-phpcbf b/projects/packages/waf/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/packages/waf/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/packages/waf/src/class-waf-operators.php b/projects/packages/waf/src/class-waf-operators.php
index 503fe797c8843..4f111c79bcf0a 100644
--- a/projects/packages/waf/src/class-waf-operators.php
+++ b/projects/packages/waf/src/class-waf-operators.php
@@ -259,7 +259,7 @@ public function validate_byte_range( $input, $valid_range ) {
if ( ! $valid ) {
return $input[ $i ];
}
- $i++;
+ ++$i;
}
// if there weren't any invalid bytes, return false.
diff --git a/projects/packages/waf/src/class-waf-transforms.php b/projects/packages/waf/src/class-waf-transforms.php
index 969790f729923..4e161207e691e 100644
--- a/projects/packages/waf/src/class-waf-transforms.php
+++ b/projects/packages/waf/src/class-waf-transforms.php
@@ -172,7 +172,7 @@ public function normalize_path( $value ) {
// If this folder is a backreference, remove it unless we're already at the root.
if ( isset( $parts[ $i - 1 ] ) && ! in_array( $parts[ $i - 1 ], array( '', '..' ), true ) ) {
array_splice( $parts, $i - 1, 2 );
- $i--;
+ --$i;
continue 2;
}
break;
@@ -180,7 +180,7 @@ public function normalize_path( $value ) {
array_splice( $parts, $i, 1 );
continue 2;
}
- $i++;
+ ++$i;
}
return implode( '/', $parts );
diff --git a/projects/packages/waf/tests/php/test-waf-operators.php b/projects/packages/waf/tests/php/test-waf-operators.php
index 6f70a3b157507..ca421e179440e 100644
--- a/projects/packages/waf/tests/php/test-waf-operators.php
+++ b/projects/packages/waf/tests/php/test-waf-operators.php
@@ -46,7 +46,7 @@ public function testOperators( $ofn, ...$tests ) {
$this->o->$ofn( $input, $param ),
sprintf( 'Failed %s assertion #%d with input: %s ', $ofn, $n, $input )
);
- $n++;
+ ++$n;
}
}
diff --git a/projects/packages/waf/tests/php/test-waf-transforms.php b/projects/packages/waf/tests/php/test-waf-transforms.php
index e4493e7ceafd4..5dc6481f69a3b 100644
--- a/projects/packages/waf/tests/php/test-waf-transforms.php
+++ b/projects/packages/waf/tests/php/test-waf-transforms.php
@@ -40,7 +40,7 @@ public function testTransforms( $tfn, $tests ) {
$i = 1;
foreach ( $tests as $in => $out ) {
$this->assertSame( $out, $this->t->$tfn( $in ), "Failed #$i with input: $in" );
- $i++;
+ ++$i;
}
}
diff --git a/projects/plugins/boost/app/features/optimizations/Optimizations.php b/projects/plugins/boost/app/features/optimizations/Optimizations.php
index f82a9d308ac1c..23ba293d38758 100644
--- a/projects/plugins/boost/app/features/optimizations/Optimizations.php
+++ b/projects/plugins/boost/app/features/optimizations/Optimizations.php
@@ -93,7 +93,6 @@ public function register_endpoints( $feature ) {
if ( empty( $feature->get_endpoints() ) ) {
return false;
}
-
}
/**
diff --git a/projects/plugins/boost/app/features/optimizations/cloud-css/Cloud_CSS.php b/projects/plugins/boost/app/features/optimizations/cloud-css/Cloud_CSS.php
index 629eca33a1db7..a6c926bff8dfa 100644
--- a/projects/plugins/boost/app/features/optimizations/cloud-css/Cloud_CSS.php
+++ b/projects/plugins/boost/app/features/optimizations/cloud-css/Cloud_CSS.php
@@ -34,7 +34,6 @@ class Cloud_CSS implements Feature, Has_Endpoints {
public function __construct() {
$this->storage = new Critical_CSS_Storage();
$this->paths = new Source_Providers();
-
}
public function setup() {
add_action( 'wp', array( $this, 'display_critical_css' ) );
diff --git a/projects/plugins/boost/app/features/speed-score/Speed_Score_Request.php b/projects/plugins/boost/app/features/speed-score/Speed_Score_Request.php
index de5c79396380a..c725aa6a2df59 100644
--- a/projects/plugins/boost/app/features/speed-score/Speed_Score_Request.php
+++ b/projects/plugins/boost/app/features/speed-score/Speed_Score_Request.php
@@ -281,7 +281,7 @@ private function restart() {
}
$this->created = time();
- $this->retry_count++;
+ ++$this->retry_count;
$this->store();
return true;
diff --git a/projects/plugins/boost/changelog/update-wpcs-pre-phpcbf b/projects/plugins/boost/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/plugins/boost/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf b/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/plugins/debug-helper/modules/class-idc-simulator.php b/projects/plugins/debug-helper/modules/class-idc-simulator.php
index f42ee6d124d55..a548df9cd972b 100644
--- a/projects/plugins/debug-helper/modules/class-idc-simulator.php
+++ b/projects/plugins/debug-helper/modules/class-idc-simulator.php
@@ -452,7 +452,6 @@ public function display_notice() {
*/
public function display_sync_disabled_notice() {
echo 'Sync has been disabled by the Jetpack Debug Helper plugin\'s IDC Simulator module.
';
-
}
/**
diff --git a/projects/plugins/debug-helper/modules/class-protect-helper.php b/projects/plugins/debug-helper/modules/class-protect-helper.php
index f6a49c77b54f0..ba32b5596640b 100644
--- a/projects/plugins/debug-helper/modules/class-protect-helper.php
+++ b/projects/plugins/debug-helper/modules/class-protect-helper.php
@@ -51,7 +51,6 @@ public function __construct() {
add_filter( 'pre_http_request', array( $this, 'filter_status_fetch' ), 10, 3 );
}
}
-
}
/**
@@ -201,7 +200,6 @@ public function display_notice() {
*/
public function display_protect_overwritten_notice() {
echo 'Jetpack Protect Status is being overwritten by the Jetpack Debug Helper plugin.
';
-
}
/**
@@ -264,7 +262,6 @@ public function get_mock_response() {
}
return $response;
-
}
/**
@@ -431,11 +428,10 @@ public function get_vulnerabilities( $type, $how_many = 2 ) {
leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti.',
'fixed_in' => '3.14.2',
);
- $current_index ++;
+ ++$current_index;
}
return $vuls;
-
}
/**
diff --git a/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php b/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
index 526f167dd6936..a0c1235e12265 100644
--- a/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
+++ b/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
@@ -269,7 +269,6 @@ public function get_sample_error( $error_code, $user_id, $error_type = 'xmlrpc'
'An error was triggered',
compact( 'signature_details', 'error_type' )
);
-
}
/**
diff --git a/projects/plugins/jetpack/3rd-party/bitly.php b/projects/plugins/jetpack/3rd-party/bitly.php
index 4252099ba9952..93729ceae8ca9 100644
--- a/projects/plugins/jetpack/3rd-party/bitly.php
+++ b/projects/plugins/jetpack/3rd-party/bitly.php
@@ -29,5 +29,4 @@ function jetpack_bitly_og_tag() {
} elseif ( isset( $GLOBALS['posts'] ) && $GLOBALS['posts'][0]->ID > 0 ) {
printf( " \n", esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) ) );
}
-
}
diff --git a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-about-page.php b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-about-page.php
index 7f2e793bcf1b0..ccbc7d6b90a15 100644
--- a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-about-page.php
+++ b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-about-page.php
@@ -520,7 +520,6 @@ public function display_plugins() {
" === $token || 0 === strpos( $token, "<$tag " ) ) {
// A tag has just been opened.
- $opened++;
+ ++$opened;
// Set an empty value now, so we're keeping track of empty tags.
if ( ! isset( $values[ $tag ][ $opened ] ) ) {
$values[ $tag ][ $opened ] = '';
@@ -1459,7 +1459,7 @@ private static function extract_tag_content_from_html( $tags, $html ) {
if ( "$tag>" === $token ) {
// The tag has been closed.
- $closed++;
+ ++$closed;
continue;
}
diff --git a/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php b/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
index b5b8d818b1379..80a632fd0d780 100644
--- a/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
+++ b/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
@@ -1204,7 +1204,6 @@ public static function disconnect_site_permission_callback() {
REST_Connector::get_user_permissions_error_msg(),
array( 'status' => rest_authorization_required_code() )
);
-
}
/**
@@ -1224,7 +1223,6 @@ public static function connect_url_permission_callback() {
REST_Connector::get_user_permissions_error_msg(),
array( 'status' => rest_authorization_required_code() )
);
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php b/projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php
index 4887e588ea881..0c6468e79b1f1 100644
--- a/projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php
+++ b/projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php
@@ -490,7 +490,7 @@ protected function get_charset_size( $password ) {
// Spaces.
if ( strpos( $password, ' ' ) ) {
- $size++;
+ ++$size;
}
return $size;
diff --git a/projects/plugins/jetpack/_inc/lib/class.jetpack-photon-image-sizes.php b/projects/plugins/jetpack/_inc/lib/class.jetpack-photon-image-sizes.php
index 78d16161e2ec1..570d017e551e2 100644
--- a/projects/plugins/jetpack/_inc/lib/class.jetpack-photon-image-sizes.php
+++ b/projects/plugins/jetpack/_inc/lib/class.jetpack-photon-image-sizes.php
@@ -187,6 +187,5 @@ public function generate_sizes_meta() {
protected function resize( $size_data ) {
return $this->image->get_size( $size_data );
-
}
}
diff --git a/projects/plugins/jetpack/_inc/lib/class.media-extractor.php b/projects/plugins/jetpack/_inc/lib/class.media-extractor.php
index b5f5f3fd9c056..0eef590c27960 100644
--- a/projects/plugins/jetpack/_inc/lib/class.media-extractor.php
+++ b/projects/plugins/jetpack/_inc/lib/class.media-extractor.php
@@ -172,11 +172,11 @@ public static function extract_from_content( $content, $what_to_extract = self::
$attr = shortcode_parse_atts( $matches[3][ $key ] );
- $shortcode_total_count++;
+ ++$shortcode_total_count;
if ( ! isset( $shortcode_type_counts[ $shortcode_name ] ) ) {
$shortcode_type_counts[ $shortcode_name ] = 0;
}
- $shortcode_type_counts[ $shortcode_name ]++;
+ ++$shortcode_type_counts[ $shortcode_name ];
// Store (uniquely) presence of all shortcode regardless of whether it's a keeper (for those, get ID below)
// @todo Store number of occurrences?
@@ -427,7 +427,7 @@ private static function get_image_fields( $post, $args = array(), $extract_alt_t
$srcs = wp_list_pluck( $from_gallery, 'src' );
$image_list = array_merge( $image_list, $srcs );
}
- $image_booleans['gallery']++; // @todo This count isn't correct, will only every count 1
+ ++$image_booleans['gallery']; // @todo This count isn't correct, will only every count 1
}
// @todo Can we check width/height of these efficiently? Could maybe use query args at least, before we strip them out
diff --git a/projects/plugins/jetpack/_inc/lib/class.media-summary.php b/projects/plugins/jetpack/_inc/lib/class.media-summary.php
index b46bd87667c03..63af8c29bb498 100644
--- a/projects/plugins/jetpack/_inc/lib/class.media-summary.php
+++ b/projects/plugins/jetpack/_inc/lib/class.media-summary.php
@@ -139,7 +139,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
$return['secure']['video'] = $return['video'];
}
}
- $return['count']['video']++;
+ ++$return['count']['video'];
break;
case 'youtube':
if ( 0 === $return['count']['video'] ) {
@@ -149,7 +149,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
$return['secure']['video'] = self::https( $return['video'] );
$return['secure']['image'] = self::https( $return['image'] );
}
- $return['count']['video']++;
+ ++$return['count']['video'];
break;
case 'vimeo':
if ( 0 === $return['count']['video'] ) {
@@ -164,7 +164,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
$return['secure']['image'] = 'https://secure-a.vimeocdn.com' . $poster_url_parts['path'];
}
}
- $return['count']['video']++;
+ ++$return['count']['video'];
break;
}
}
@@ -199,7 +199,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
$return['secure']['image'] = self::https( $return['image'] );
}
}
- $return['count']['video']++;
+ ++$return['count']['video'];
}
}
}
@@ -216,7 +216,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
unset( $paragraphs[ $i ] );
continue;
}
- $number_of_paragraphs++;
+ ++$number_of_paragraphs;
}
$number_of_paragraphs = $number_of_paragraphs - $return['count']['video']; // subtract amount for videos.
@@ -235,7 +235,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
$return['images'] = $extract['image'];
foreach ( $return['images'] as $image ) {
$return['secure']['images'][] = array( 'url' => self::ssl_img( $image['url'] ) );
- $return['count']['image']++;
+ ++$return['count']['image'];
}
} elseif ( ! empty( $extract['has']['image'] ) ) {
// ... Or we try and select a single image that would make sense.
@@ -254,12 +254,12 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
unset( $paragraphs[ $i ] );
continue;
}
- $number_of_paragraphs++;
+ ++$number_of_paragraphs;
}
$return['image'] = $extract['image'][0]['url'];
$return['secure']['image'] = self::ssl_img( $return['image'] );
- $return['count']['image']++;
+ ++$return['count']['image'];
if ( $number_of_paragraphs <= 2 && 1 === count( $extract['image'] ) ) {
// If we have lots of text or images, let's not treat it as an image post, but return its first image.
diff --git a/projects/plugins/jetpack/_inc/lib/class.media.php b/projects/plugins/jetpack/_inc/lib/class.media.php
index ecbe10092558a..484cfe2574cc6 100644
--- a/projects/plugins/jetpack/_inc/lib/class.media.php
+++ b/projects/plugins/jetpack/_inc/lib/class.media.php
@@ -74,7 +74,7 @@ public static function generate_new_filename( $media_id, $new_filename ) {
$new_filename = "{$filename}.{$file_ext}";
$new_path = "{$current_file_dirname}/$new_filename";
- $number_suffix++;
+ ++$number_suffix;
} while ( file_exists( $new_path ) );
return $new_filename;
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php b/projects/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
index 913a931ddb51e..3774c6a233c4e 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
@@ -1034,7 +1034,6 @@ public function update_data( $request ) {
// There was an error because some options were updated but others were invalid or failed to update.
return new WP_Error( 'some_updated', esc_html( $error ), array( 'status' => 400 ) );
}
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php
index fb10ffab96666..0be83e8668c63 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php
@@ -26,7 +26,6 @@ public function __construct() {
$this->wpcom_is_wpcom_only_endpoint = true;
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-publicize-share-post.php b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-publicize-share-post.php
index 1d25f76c75087..073ec76eb3981 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-publicize-share-post.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-publicize-share-post.php
@@ -170,7 +170,6 @@ public function proxy_request( $post_id, $message, $skip_connection_ids ) {
'skipped_connections' => $skip_connection_ids,
)
);
-
}
}
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-fields/post-fields-publicize-connections.php b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-fields/post-fields-publicize-connections.php
index 412c57c6e353e..3644fe53bf3c7 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-fields/post-fields-publicize-connections.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-fields/post-fields-publicize-connections.php
@@ -190,7 +190,6 @@ public function permission_check( $post_id ) {
*/
public function get_permission_check( $post_array, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
return $this->permission_check( isset( $post_array['id'] ) ? $post_array['id'] : 0 );
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-test-base.php b/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-test-base.php
index 14b0665168468..1989f190bca00 100644
--- a/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-test-base.php
+++ b/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-test-base.php
@@ -215,7 +215,6 @@ public function pass( $type = 'all', $group = 'all' ) {
}
return true;
-
}
/**
@@ -471,7 +470,6 @@ public function output_results_for_core_async_site_health() {
}
return $result;
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php b/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php
index 39f0e2c7cfd90..8fbabdd64cb06 100644
--- a/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php
+++ b/projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php
@@ -776,7 +776,6 @@ protected function test__full_sync_health() {
);
}
-
}
/**
@@ -925,7 +924,6 @@ protected function test__sync_health() {
);
}
-
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/icalendar-reader.php b/projects/plugins/jetpack/_inc/lib/icalendar-reader.php
index c9f309913e67f..f1ce4618b9c10 100644
--- a/projects/plugins/jetpack/_inc/lib/icalendar-reader.php
+++ b/projects/plugins/jetpack/_inc/lib/icalendar-reader.php
@@ -369,7 +369,7 @@ protected function filter_past_and_recurring_events( $events ) {
$maybe = strtotime( $event['DTSTART'] );
while ( $maybe < $current ) {
$maybe = strtotime( '+ ' . ( $interval * $catchup ) . ' months', strtotime( $event['DTSTART'] ) );
- $catchup++;
+ ++$catchup;
}
$recurring_event_date_start = date( 'Ymd', strtotime( $event_date_desc . date( 'F Y', strtotime( '+ ' . ( $interval * ( $catchup - 1 ) ) . ' months', strtotime( $event['DTSTART'] ) ) ) ) ) . date( '\THis', strtotime( $event['DTSTART'] ) );
} else {
@@ -473,7 +473,7 @@ protected function filter_past_and_recurring_events( $events ) {
}
}
$upcoming[] = $event;
- $count_counter++;
+ ++$count_counter;
}
// Move forward one day.
@@ -521,7 +521,7 @@ protected function filter_past_and_recurring_events( $events ) {
}
}
$upcoming[] = $event;
- $count_counter++;
+ ++$count_counter;
}
}
@@ -612,11 +612,11 @@ public function parse( $url = '' ) {
case 'END':
switch ( $line ) {
case 'BEGIN:VTODO':
- $this->todo_count++;
+ ++$this->todo_count;
$type = 'VTODO';
break;
case 'BEGIN:VEVENT':
- $this->event_count++;
+ ++$this->event_count;
$type = 'VEVENT';
break;
case 'BEGIN:VCALENDAR':
diff --git a/projects/plugins/jetpack/changelog/update-wpcs-pre-phpcbf b/projects/plugins/jetpack/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..219d34a888cd2
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: other
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/plugins/jetpack/class.jetpack-admin.php b/projects/plugins/jetpack/class.jetpack-admin.php
index 24a9190c8c848..c06f937f19ca9 100644
--- a/projects/plugins/jetpack/class.jetpack-admin.php
+++ b/projects/plugins/jetpack/class.jetpack-admin.php
@@ -147,7 +147,6 @@ public static function additional_css_menu() {
$hook = add_theme_page( __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss-theme-enhancements-redirect', array( __CLASS__, 'theme_enhancements_redirect' ) );
add_action( "load-{$hook}", array( __CLASS__, 'theme_enhancements_redirect' ) );
}
-
}
/**
@@ -413,7 +412,6 @@ public static function is_module_available( $module ) {
}
return Jetpack_Plan::supports( $module['module'] );
-
}
/**
diff --git a/projects/plugins/jetpack/class.jetpack-cli.php b/projects/plugins/jetpack/class.jetpack-cli.php
index 91c81e4ecc33d..c488e3d4b178a 100644
--- a/projects/plugins/jetpack/class.jetpack-cli.php
+++ b/projects/plugins/jetpack/class.jetpack-cli.php
@@ -427,7 +427,7 @@ public function reset( $args, $assoc_args ) {
"{$site->domain}{$site->path}"
)
);
- $count_fixes++;
+ ++$count_fixes;
if ( ! $is_dry_run ) {
/*
* We could be deleting a lot of options rows at the same time.
@@ -493,7 +493,6 @@ private static function count_option( $option ) {
$option
)
);
-
}
/**
@@ -1073,7 +1072,7 @@ public function sync( $args, $assoc_args ) {
sleep( 15 );
}
}
- $i++;
+ ++$i;
} while ( $result && ! is_wp_error( $result ) );
// Reset sync settings to original.
diff --git a/projects/plugins/jetpack/class.jetpack-gutenberg.php b/projects/plugins/jetpack/class.jetpack-gutenberg.php
index b942c65b890f8..3089f1a0bbdf7 100644
--- a/projects/plugins/jetpack/class.jetpack-gutenberg.php
+++ b/projects/plugins/jetpack/class.jetpack-gutenberg.php
@@ -529,7 +529,6 @@ public static function load_styles_as_required( $type ) {
wp_enqueue_style( 'jetpack-block-' . $type, $view_style, array(), $style_version );
}
}
-
}
/**
diff --git a/projects/plugins/jetpack/class.jetpack-modules-list-table.php b/projects/plugins/jetpack/class.jetpack-modules-list-table.php
index 45a3b4a821c9e..54df72a516444 100644
--- a/projects/plugins/jetpack/class.jetpack-modules-list-table.php
+++ b/projects/plugins/jetpack/class.jetpack-modules-list-table.php
@@ -342,7 +342,6 @@ public function column_icon() {
prepare_items();
$network_sites_table->display();
echo '';
-
}
/**
diff --git a/projects/plugins/jetpack/class.jetpack.php b/projects/plugins/jetpack/class.jetpack.php
index 6e566d39c4a44..d55c511933a5d 100644
--- a/projects/plugins/jetpack/class.jetpack.php
+++ b/projects/plugins/jetpack/class.jetpack.php
@@ -905,7 +905,6 @@ public function configure() {
*/
add_action( 'jetpack_agreed_to_terms_of_service', array( new Plugin_Tracking(), 'init' ) );
}
-
}
/**
@@ -1012,7 +1011,6 @@ public function point_edit_comment_links_to_calypso( $url ) {
'path' => $query_args['amp;c'],
)
);
-
}
/**
@@ -1654,7 +1652,6 @@ public static function development_mode_trigger_text() {
}
return $notice;
-
}
/**
* Get Jetpack offline mode notice text and notice class.
@@ -2863,7 +2860,6 @@ public static function do_version_bump( $version, $old_version ) {
*/
public static function set_update_modal_display() {
self::state( 'display_update_modal', true );
-
}
/**
@@ -4363,7 +4359,6 @@ public static function build_stats_url( $args ) {
$a8c_mc_stats_instance = new Automattic\Jetpack\A8c_Mc_Stats();
return $a8c_mc_stats_instance->build_stats_url( $args );
-
}
/**
@@ -4624,7 +4619,7 @@ public function handle_unique_registrations_stats() {
}
// Increment number of times connected.
- $jetpack_unique_registrations ++;
+ ++$jetpack_unique_registrations;
Jetpack_Options::update_option( 'unique_registrations', $jetpack_unique_registrations );
}
diff --git a/projects/plugins/jetpack/class.json-api-endpoints.php b/projects/plugins/jetpack/class.json-api-endpoints.php
index df2825d08e1b4..29b445078b5d9 100644
--- a/projects/plugins/jetpack/class.json-api-endpoints.php
+++ b/projects/plugins/jetpack/class.json-api-endpoints.php
@@ -2224,7 +2224,7 @@ public function handle_media_creation_v1_1( $media_files, $media_urls, $media_at
$media_ids[ $i ] = $media_id;
}
- $i++;
+ ++$i;
}
$this->api->trap_wp_die( null );
unset( $_FILES['.api.media.item.'] );
@@ -2254,7 +2254,7 @@ public function handle_media_creation_v1_1( $media_files, $media_urls, $media_at
$media_ids[ $i ] = $media_id;
}
- $i++;
+ ++$i;
}
}
@@ -2322,7 +2322,6 @@ public function handle_media_creation_v1_1( $media_files, $media_urls, $media_at
'media_ids' => $media_ids,
'errors' => $errors,
);
-
}
/**
diff --git a/projects/plugins/jetpack/class.photon.php b/projects/plugins/jetpack/class.photon.php
index 446e88416c117..f9b54295b5300 100644
--- a/projects/plugins/jetpack/class.photon.php
+++ b/projects/plugins/jetpack/class.photon.php
@@ -1292,7 +1292,6 @@ public function should_rest_photon_image_downsize( $response, $endpoint_data, $r
$this->should_rest_photon_image_downsize_override( $request );
return $response;
-
}
/**
@@ -1339,7 +1338,6 @@ public function should_rest_photon_image_downsize_insert_attachment( WP_Post $at
}
$this->should_rest_photon_image_downsize_override( $request );
-
}
/**
diff --git a/projects/plugins/jetpack/extensions/blocks/map/map.php b/projects/plugins/jetpack/extensions/blocks/map/map.php
index 17a1fd3b40481..f6ce0365952cb 100644
--- a/projects/plugins/jetpack/extensions/blocks/map/map.php
+++ b/projects/plugins/jetpack/extensions/blocks/map/map.php
@@ -78,7 +78,7 @@ function load_assets( $attr, $content ) {
if ( ! isset( $map_block_counter[ $id ] ) ) {
$map_block_counter[ $id ] = 0;
}
- $map_block_counter[ $id ]++;
+ ++$map_block_counter[ $id ];
$iframe_url = add_query_arg(
array(
diff --git a/projects/plugins/jetpack/extensions/blocks/slideshow/slideshow.php b/projects/plugins/jetpack/extensions/blocks/slideshow/slideshow.php
index 67ce5ebc20ecc..a0d2fc6742001 100644
--- a/projects/plugins/jetpack/extensions/blocks/slideshow/slideshow.php
+++ b/projects/plugins/jetpack/extensions/blocks/slideshow/slideshow.php
@@ -57,7 +57,7 @@ function render_amp( $attr ) {
}
static $wp_block_jetpack_slideshow_id = 0;
- $wp_block_jetpack_slideshow_id++;
+ ++$wp_block_jetpack_slideshow_id;
$ids = $attr['ids'];
$autoplay = empty( $attr['autoplay'] ) ? false : true;
diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php b/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php
index 457ebb09b0925..281029c480875 100644
--- a/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php
+++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php
@@ -323,7 +323,7 @@ function render_block( $attributes, $content ) { // phpcs:ignore VariableAnalysi
}
// The block is using the Jetpack_Subscriptions_Widget backend, hence the need to increase the instance count.
- Jetpack_Subscriptions_Widget::$instance_count++;
+ ++Jetpack_Subscriptions_Widget::$instance_count;
$classes = get_element_class_names_from_attributes( $attributes );
$styles = get_element_styles_from_attributes( $attributes );
diff --git a/projects/plugins/jetpack/functions.opengraph.php b/projects/plugins/jetpack/functions.opengraph.php
index 0f0366a8b5d9f..64f71b01322eb 100644
--- a/projects/plugins/jetpack/functions.opengraph.php
+++ b/projects/plugins/jetpack/functions.opengraph.php
@@ -287,7 +287,7 @@ function jetpack_og_tags() {
$og_output .= apply_filters( 'jetpack_open_graph_output', $og_tag );
$og_output .= "\n";
}
- $secure_image_num++;
+ ++$secure_image_num;
}
}
}
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-comments-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-comments-endpoint.php
index b068798e5353c..3379eac8550b5 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-comments-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-comments-endpoint.php
@@ -89,7 +89,6 @@ public function display_element( $element, &$children_elements, $max_depth, $dep
unset( $children_elements[ $id ] );
}
-
}
}
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-endpoint.php
index de3ee8f9feff8..fd96aee3ea976 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-endpoint.php
@@ -344,7 +344,7 @@ public function callback( $path = '', $blog_id = 0 ) {
if ( $the_post && ! is_wp_error( $the_post ) ) {
$posts[] = $the_post;
} else {
- $excluded_count++;
+ ++$excluded_count;
}
}
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php
index 366afcf149159..2ef266d18b0c1 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php
@@ -413,7 +413,7 @@ public function callback( $path = '', $blog_id = 0 ) {
if ( $the_post && ! is_wp_error( $the_post ) ) {
$posts[] = $the_post;
} else {
- $excluded_count++;
+ ++$excluded_count;
}
}
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-2-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-2-endpoint.php
index b8fe3cad97572..b069f869d953f 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-2-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-posts-v1-2-endpoint.php
@@ -380,7 +380,7 @@ public function callback( $path = '', $blog_id = 0 ) {
if ( $the_post && ! is_wp_error( $the_post ) ) {
$posts[] = $the_post;
} else {
- $excluded_count++;
+ ++$excluded_count;
}
}
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-endpoint.php
index 5a2f3a44ff886..fbf569f917cb3 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-endpoint.php
@@ -567,7 +567,6 @@ public static function find_featured_media( &$post ) {
} else {
return (object) array();
}
-
}
/**
@@ -579,7 +578,7 @@ public function win8_gallery_shortcode( $attr ) {
global $post;
static $instance = 0;
- $instance++;
+ ++$instance;
// @todo - find out if this is a bug, intentionally unused, or can be removed.
$output = ''; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php
index 92ceb563c422d..552386f57a978 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php
@@ -381,7 +381,7 @@ public function win8_gallery_shortcode( $attr ) {
global $post;
static $instance = 0;
- $instance++;
+ ++$instance;
// @todo - find out if this is a bug, intentionally unused, or can be removed.
$output = ''; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php
index 31b3b5c59226a..54034b1c33680 100644
--- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php
@@ -188,7 +188,6 @@ public function callback( $path = '', $blog_id = 0 ) {
} else {
return new WP_Error( 'bad_request', 'An unsupported request method was used.' );
}
-
}
/**
@@ -501,7 +500,6 @@ public function get_settings_response() {
}
}
return $response;
-
}
/**
@@ -1090,7 +1088,6 @@ function ( &$value ) {
return array(
'updated' => $updated,
);
-
}
/**
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-endpoint.php
index ce53e85da381b..a6580a17e9b55 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-endpoint.php
@@ -153,7 +153,7 @@ protected function check_capability( $capability ) {
$passed = 0;
foreach ( $capabilities as $cap ) {
if ( current_user_can( $cap ) ) {
- $passed ++;
+ ++$passed;
} else {
$failed[] = $cap;
}
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php
index 2a9fdd1f65403..9bd2e743deb3e 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php
@@ -51,7 +51,6 @@ protected function result() {
}
return array( 'modules' => $modules );
-
}
/**
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php
index 4c1e1d765dce3..71d1eefa0de00 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php
@@ -99,7 +99,6 @@ protected function result() {
}
return array( 'plugins' => $plugins );
-
}
/**
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-themes-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-themes-endpoint.php
index a8f037e773374..c65668083edf2 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-themes-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-themes-endpoint.php
@@ -64,7 +64,6 @@ protected function result() {
}
return array( 'themes' => $themes );
-
}
/**
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-updates-status-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-updates-status-endpoint.php
index f8bb2c0671101..8107d53a0bc1f 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-updates-status-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-updates-status-endpoint.php
@@ -43,6 +43,5 @@ protected function result() {
$result['jp_version'] = JETPACK__VERSION;
return $result;
-
}
}
diff --git a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php
index dbd82db7226d2..e5a57abe110c9 100644
--- a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php
+++ b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php
@@ -1288,7 +1288,6 @@ public function register_settings() {
add_settings_field( 'carousel_display_comments', __( 'Comments', 'jetpack' ), array( $this, 'carousel_display_comments_callback' ), 'media', 'carousel_section' );
register_setting( 'media', 'carousel_display_comments', array( $this, 'carousel_display_comments_sanitize' ) );
-
}
/**
diff --git a/projects/plugins/jetpack/modules/contact-form/admin.php b/projects/plugins/jetpack/modules/contact-form/admin.php
index d31bcf2f3faec..01679152b8976 100644
--- a/projects/plugins/jetpack/modules/contact-form/admin.php
+++ b/projects/plugins/jetpack/modules/contact-form/admin.php
@@ -1087,7 +1087,7 @@ function grunion_delete_spam_feedbacks() {
foreach ( $spam_feedbacks as $feedback ) {
wp_delete_post( $feedback->ID, true );
- $deleted_feedbacks++;
+ ++$deleted_feedbacks;
}
wp_send_json(
@@ -1267,7 +1267,7 @@ public function export_to_gdrive() {
$sheet_data = array( $fields );
- for ( $i = 0; $i < $row_count; $i ++ ) {
+ for ( $i = 0; $i < $row_count; $i++ ) {
$current_row = array();
diff --git a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
index e541c4fb2d3b4..b05d1c957aab8 100644
--- a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
+++ b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
@@ -1881,7 +1881,7 @@ public function download_feedback_as_csv() {
/**
* Print rows to the output.
*/
- for ( $i = 0; $i < $row_count; $i ++ ) {
+ for ( $i = 0; $i < $row_count; $i++ ) {
$current_row = array();
@@ -2881,7 +2881,7 @@ public static function get_compiled_form( $feedback_id, $form ) {
self::escape_and_sanitize_field_value( $extra_fields[ $extra_field_keys[ $i ] ] )
);
- $i++;
+ ++$i;
}
}
}
@@ -2974,7 +2974,7 @@ public static function get_compiled_form_for_email( $feedback_id, $form ) {
self::escape_and_sanitize_field_value( $extra_fields[ $extra_field_keys[ $i ] ] )
);
- $i++;
+ ++$i;
}
}
}
@@ -3395,7 +3395,7 @@ public function process_submission() {
$value = $field->value;
$all_values[ $label ] = $value;
- $i++; // Increment prefix counter for the next field
+ ++$i; // Increment prefix counter for the next field
}
// For the "non-standard" fields, grab label and value
@@ -3410,7 +3410,7 @@ public function process_submission() {
}
$extra_values[ $label ] = $value;
- $i++; // Increment prefix counter for the next extra field
+ ++$i; // Increment prefix counter for the next extra field
}
if ( ! empty( $_REQUEST['is_block'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not changing the site.
@@ -4078,7 +4078,7 @@ public function __construct( $attributes, $content = null, $form = null ) {
$i = 0;
$max_tries = 99;
while ( isset( $form->fields[ $id ] ) ) {
- $i++;
+ ++$i;
$id = sanitize_title_with_dashes( 'g' . $form_id . '-' . $unescaped_label . '-' . $i );
if ( $i > $max_tries ) {
@@ -4307,7 +4307,6 @@ class='grunion-field-label{$type_class}" . ( $this->is_error() ? ' form-error' :
. esc_html( $label )
. ( $required ? '' . $required_field_text . '' : '' )
. "\n";
-
}
/**
diff --git a/projects/plugins/jetpack/modules/custom-css.php b/projects/plugins/jetpack/modules/custom-css.php
index 2d5a0095f735d..874477203206c 100644
--- a/projects/plugins/jetpack/modules/custom-css.php
+++ b/projects/plugins/jetpack/modules/custom-css.php
@@ -28,7 +28,6 @@ function jetpack_load_custom_css() {
function custom_css_loaded() {
Jetpack::enable_module_configurable( __FILE__ );
add_filter( 'jetpack_module_configuration_url_custom-css', 'jetpack_custom_css_configuration_url' );
-
}
/**
diff --git a/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy-optimise.php b/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy-optimise.php
index 5194f9d278860..e653db88edb17 100644
--- a/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy-optimise.php
+++ b/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy-optimise.php
@@ -910,7 +910,7 @@ public static function dissolve_short_font( $str_value ) {
$i = 1;
while ( isset( $str_value[ $i ] ) ) {
$return['font-family'] .= ',' . trim( $str_value[ $i ] );
- $i++;
+ ++$i;
}
// Fix for 100 and more font-size.
diff --git a/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy.php b/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy.php
index cd1c96f6d79bd..429c2309aad30 100644
--- a/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy.php
+++ b/projects/plugins/jetpack/modules/custom-css/csstidy/class.csstidy.php
@@ -465,7 +465,7 @@ public function _unicode( &$string, &$i ) { // phpcs:ignore PSR2.Methods.MethodD
if ( ctype_space( $string[ $i ] ) ) {
break;
}
- $i++;
+ ++$i;
}
if ( hexdec( $add ) > 47 && hexdec( $add ) < 58 || hexdec( $add ) > 64 && hexdec( $add ) < 91 || hexdec( $add ) > 96 && hexdec( $add ) < 123 ) {
@@ -478,7 +478,7 @@ public function _unicode( &$string, &$i ) { // phpcs:ignore PSR2.Methods.MethodD
if ( @ctype_xdigit( $string[ $i + 1 ] ) && ctype_space( $string[ $i ] )
&& ! $replaced || ! ctype_space( $string[ $i ] ) ) {
- $i--;
+ --$i;
}
if ( '\\' !== $add || ! $this->get_cfg( 'remove_bslash' ) || strpos( $this->tokens_list, $string[ $i + 1 ] ) !== false ) {
@@ -974,7 +974,7 @@ public function parse( $string ) {
case 'ic':
if ( '*' === $string[ $i ] && '/' === $string[ $i + 1 ] ) {
$this->status = array_pop( $this->from );
- $i++;
+ ++$i;
$this->_add_token( COMMENT, $cur_comment );
$cur_comment = '';
} else {
@@ -1089,7 +1089,7 @@ public function css_new_media_section( $media ) {
}
while ( isset( $this->css[ $media ] ) ) {
if ( is_numeric( $media ) ) {
- $media++;
+ ++$media;
} else {
$media .= ' ';
}
diff --git a/projects/plugins/jetpack/modules/custom-css/custom-css.php b/projects/plugins/jetpack/modules/custom-css/custom-css.php
index 578085d14acfc..f3c48f1e74c5d 100644
--- a/projects/plugins/jetpack/modules/custom-css/custom-css.php
+++ b/projects/plugins/jetpack/modules/custom-css/custom-css.php
@@ -44,7 +44,6 @@ public static function add_hooks() {
add_filter( 'editor_max_image_size', array( __CLASS__, 'editor_max_image_size' ), 10, 3 );
add_action( 'template_redirect', array( __CLASS__, 'set_content_width' ) );
add_action( 'admin_init', array( __CLASS__, 'set_content_width' ) );
-
}
/**
@@ -788,7 +787,6 @@ public static function customize_register( $wp_customize ) {
)
);
}
-
}
/**
diff --git a/projects/plugins/jetpack/modules/custom-post-types/comics.php b/projects/plugins/jetpack/modules/custom-post-types/comics.php
index 7357c52310e3a..2b2e1ed7cb4e0 100644
--- a/projects/plugins/jetpack/modules/custom-post-types/comics.php
+++ b/projects/plugins/jetpack/modules/custom-post-types/comics.php
@@ -161,7 +161,7 @@ public function bulk_edit() {
if ( current_user_can( $post_type_object->cap->publish_posts ) ) {
set_post_type( $post_id, $destination_post_type );
- $modified_count++;
+ ++$modified_count;
}
}
}
@@ -575,7 +575,7 @@ public function upload() {
array_push( $image_id_arr, $image_id );
}
- $i++;
+ ++$i;
}
if ( count( $image_id_arr ) === 0 ) {
diff --git a/projects/plugins/jetpack/modules/custom-post-types/nova.php b/projects/plugins/jetpack/modules/custom-post-types/nova.php
index 86217c6cf11ca..7ae41d9291b07 100644
--- a/projects/plugins/jetpack/modules/custom-post-types/nova.php
+++ b/projects/plugins/jetpack/modules/custom-post-types/nova.php
@@ -824,7 +824,6 @@ public function maybe_reorder_menu_items() {
);
wp_safe_redirect( $redirect );
exit;
-
}
/**
@@ -1058,7 +1057,7 @@ public function show_menu_titles_in_menu_item_list( $post ) {
$parent_count = 0;
$current_term = $term;
while ( $current_term->parent ) {
- $parent_count++;
+ ++$parent_count;
$current_term = get_term( $current_term->parent, self::MENU_TAX );
}
}
@@ -1440,7 +1439,6 @@ public function get_menu_item_menu_leaf( $post_id ) {
}
return get_term( $term_id, self::MENU_TAX );
-
}
/**
diff --git a/projects/plugins/jetpack/modules/custom-post-types/portfolios.php b/projects/plugins/jetpack/modules/custom-post-types/portfolios.php
index 2fc0432ccc125..c3c25b3bac787 100644
--- a/projects/plugins/jetpack/modules/custom-post-types/portfolios.php
+++ b/projects/plugins/jetpack/modules/custom-post-types/portfolios.php
@@ -930,7 +930,7 @@ private static function portfolio_shortcode_html( $atts ) {
?>
get_name() );
$event['ga_params'][ 'pr' . $i . 'qt' ] = absint( $item->get_quantity() );
- $i++;
+ ++$i;
}
}
diff --git a/projects/plugins/jetpack/modules/masterbar/admin-color-schemes/class-admin-color-schemes.php b/projects/plugins/jetpack/modules/masterbar/admin-color-schemes/class-admin-color-schemes.php
index 406197d1f746a..72a5b54a744eb 100644
--- a/projects/plugins/jetpack/modules/masterbar/admin-color-schemes/class-admin-color-schemes.php
+++ b/projects/plugins/jetpack/modules/masterbar/admin-color-schemes/class-admin-color-schemes.php
@@ -174,7 +174,6 @@ public function register_admin_color_schemes() {
'current' => '#4f3500',
)
);
-
}
/**
diff --git a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-jetpack-admin-menu.php b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-jetpack-admin-menu.php
index 7358d9e72c469..93d8a7e47aa2d 100644
--- a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-jetpack-admin-menu.php
+++ b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-jetpack-admin-menu.php
@@ -183,7 +183,7 @@ public function add_jetpack_menu() {
$position = 0;
global $submenu;
foreach ( $submenu['jetpack'] as $submenu_item ) {
- $position ++;
+ ++$position;
if ( __( 'Backup', 'jetpack' ) === $submenu_item[3] ) {
break;
}
@@ -287,7 +287,7 @@ public function add_wp_admin_menu() {
end( $menu );
$position = key( $menu );
- $this->add_admin_menu_separator( ++ $position );
+ $this->add_admin_menu_separator( ++$position );
add_menu_page( __( 'WP Admin', 'jetpack' ), __( 'WP Admin', 'jetpack' ), 'read', 'index.php', null, 'dashicons-wordpress-alt', $position );
}
}
diff --git a/projects/plugins/jetpack/modules/masterbar/inline-help/class-inline-help.php b/projects/plugins/jetpack/modules/masterbar/inline-help/class-inline-help.php
index 90f422f3c2268..38703a5969d7f 100644
--- a/projects/plugins/jetpack/modules/masterbar/inline-help/class-inline-help.php
+++ b/projects/plugins/jetpack/modules/masterbar/inline-help/class-inline-help.php
@@ -102,7 +102,6 @@ public function add_fab_icon() {
)
);
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
-
}
/**
diff --git a/projects/plugins/jetpack/modules/masterbar/masterbar/class-masterbar.php b/projects/plugins/jetpack/modules/masterbar/masterbar/class-masterbar.php
index 487c59fa0c8cf..f2abb59267fca 100644
--- a/projects/plugins/jetpack/modules/masterbar/masterbar/class-masterbar.php
+++ b/projects/plugins/jetpack/modules/masterbar/masterbar/class-masterbar.php
@@ -620,7 +620,6 @@ public function add_reader_submenu( $wp_admin_bar ) {
),
)
);
-
}
/**
diff --git a/projects/plugins/jetpack/modules/protect.php b/projects/plugins/jetpack/modules/protect.php
index e007300189215..90478af45b014 100644
--- a/projects/plugins/jetpack/modules/protect.php
+++ b/projects/plugins/jetpack/modules/protect.php
@@ -209,7 +209,6 @@ public function maybe_update_headers( $force = false ) {
if ( isset( $response['msg'] ) && $response['msg'] ) {
update_site_option( 'trusted_ip_header', json_decode( $response['msg'] ) );
}
-
}
/**
@@ -406,7 +405,7 @@ public function log_failed_attempt( $login_user = null ) {
if ( isset( $_COOKIE['jpp_math_pass'] ) ) {
$transient = $this->get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) );
- $transient--;
+ --$transient;
if ( ! $transient || $transient < 1 ) {
$this->delete_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) );
diff --git a/projects/plugins/jetpack/modules/protect/blocked-login-page.php b/projects/plugins/jetpack/modules/protect/blocked-login-page.php
index 7077898767ed3..78d143168387c 100644
--- a/projects/plugins/jetpack/modules/protect/blocked-login-page.php
+++ b/projects/plugins/jetpack/modules/protect/blocked-login-page.php
@@ -396,7 +396,6 @@ public function protect_die( $content, $title = null, $back_link = false, $recov
$content = '' . $content;
}
$this->display_page( $title, $content, $back_link, $recovery_form );
-
}
/**
diff --git a/projects/plugins/jetpack/modules/related-posts/class.related-posts-customize.php b/projects/plugins/jetpack/modules/related-posts/class.related-posts-customize.php
index b8d124e9d0902..4b0306a194654 100644
--- a/projects/plugins/jetpack/modules/related-posts/class.related-posts-customize.php
+++ b/projects/plugins/jetpack/modules/related-posts/class.related-posts-customize.php
@@ -110,7 +110,6 @@ public function customize_register( $wp_customize ) {
)
);
}
-
}
/**
diff --git a/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php b/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
index 06f498f74b64e..6d5fe903fa539 100644
--- a/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
+++ b/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
@@ -207,7 +207,6 @@ public function action_frontend_init() {
$this->action_frontend_init_page();
}
-
}
/**
@@ -1746,7 +1745,6 @@ protected function generate_related_post_context( $post_id ) {
* @param int $link_position - the link position.
*/
protected function log_click( $post_id, $to_post_id, $link_position ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
-
}
/**
diff --git a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
index a5922eca71971..523a3f0757224 100644
--- a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
+++ b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
@@ -80,7 +80,6 @@ public function maybe_add_admin_link() {
}
add_submenu_page( 'jetpack', $menu_label, esc_html( $menu_label ) . ' ', 'manage_options', esc_url( $url ), null, $this->get_link_offset() );
-
}
/**
@@ -102,7 +101,7 @@ private function get_link_offset() {
if ( 'jetpack_admin_page' !== $link[1] ) {
break;
}
- $offset++;
+ ++$offset;
}
return $offset;
diff --git a/projects/plugins/jetpack/modules/sharedaddy/sharedaddy.php b/projects/plugins/jetpack/modules/sharedaddy/sharedaddy.php
index daef460a57872..2dc8635f4df0e 100644
--- a/projects/plugins/jetpack/modules/sharedaddy/sharedaddy.php
+++ b/projects/plugins/jetpack/modules/sharedaddy/sharedaddy.php
@@ -408,7 +408,6 @@ function sharing_recaptcha_secret_key() {
}
return RECAPTCHA_SECRET_KEY;
-
}
/**
diff --git a/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php b/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php
index 4842a0f02d130..fcc36b5f58c0c 100644
--- a/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php
+++ b/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php
@@ -901,7 +901,6 @@ function sharing_add_header() {
wp_enqueue_style( 'sharedaddy', plugin_dir_url( __FILE__ ) . 'sharing.css', array(), JETPACK__VERSION );
wp_enqueue_style( 'social-logos' );
}
-
}
add_action( 'wp_head', 'sharing_add_header', 1 );
@@ -1182,7 +1181,7 @@ function sharing_display( $text = '', $echo = false ) {
$sharing_content .= '';
}
- $count ++;
+ ++$count;
}
// End of wrapper.
diff --git a/projects/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/projects/plugins/jetpack/modules/sharedaddy/sharing-sources.php
index d550ca65b8c05..c0887f053641f 100644
--- a/projects/plugins/jetpack/modules/sharedaddy/sharing-sources.php
+++ b/projects/plugins/jetpack/modules/sharedaddy/sharing-sources.php
@@ -1990,7 +1990,7 @@ public function __construct( $id, array $settings ) {
$this->icon = $new_icon;
$new_icon = esc_url_raw( wp_specialchars_decode( $this->icon, ENT_QUOTES ) );
}
- $i++;
+ ++$i;
}
}
@@ -2663,7 +2663,6 @@ public function get_display( $post ) {
} else {
return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Pocket', 'share to', 'jetpack' ), __( 'Click to share on Pocket', 'jetpack' ), 'share=pocket' );
}
-
}
/**
@@ -2716,7 +2715,6 @@ function jetpack_sharing_pocket_init() {
)
);
endif;
-
}
}
@@ -2928,7 +2926,6 @@ public function __construct( $id, array $settings ) {
} else {
$this->smart = false;
}
-
}
/**
diff --git a/projects/plugins/jetpack/modules/shortcodes/gravatar.php b/projects/plugins/jetpack/modules/shortcodes/gravatar.php
index ac93631dcf15e..29932deebe48e 100644
--- a/projects/plugins/jetpack/modules/shortcodes/gravatar.php
+++ b/projects/plugins/jetpack/modules/shortcodes/gravatar.php
@@ -163,7 +163,7 @@ function jetpack_gravatar_profile_shortcode( $atts ) {
';
- $untappd_menu++;
+ ++$untappd_menu;
return $html;
}
diff --git a/projects/plugins/jetpack/modules/sitemaps/sitemap-librarian.php b/projects/plugins/jetpack/modules/sitemaps/sitemap-librarian.php
index f24b6f0134cb5..b9ccb32a32ebf 100644
--- a/projects/plugins/jetpack/modules/sitemaps/sitemap-librarian.php
+++ b/projects/plugins/jetpack/modules/sitemaps/sitemap-librarian.php
@@ -167,7 +167,7 @@ public function delete_numbered_sitemap_rows_after( $position, $type ) {
$any_left = true;
while ( true === $any_left ) {
- $position++;
+ ++$position;
$name = jp_sitemap_filename( $type, $position );
$any_left = $this->delete_sitemap_data( $name, $type );
}
diff --git a/projects/plugins/jetpack/modules/stats.php b/projects/plugins/jetpack/modules/stats.php
index 138739f87f9e5..c46f99f23b5d0 100644
--- a/projects/plugins/jetpack/modules/stats.php
+++ b/projects/plugins/jetpack/modules/stats.php
@@ -143,7 +143,6 @@ function stats_map_meta_caps( $caps, $cap, $user_id ) {
function stats_template_redirect() {
_deprecated_function( __METHOD__, 'jetpack-11.5', 'Automattic\Jetpack\Stats\Main::template_redirect' );
Stats::template_redirect();
-
}
/**
@@ -168,7 +167,6 @@ function stats_build_view_data() {
function stats_footer() {
_deprecated_function( __METHOD__, 'jetpack-11.5', 'Automattic\Jetpack\Stats\Tracking_Pixel::add_to_footer' );
Stats_Tracking_Pixel::add_to_footer();
-
}
/**
@@ -415,7 +413,6 @@ function jetpack_admin_ui_stats_report_page_wrapper() {
} else {
stats_reports_page();
}
-
}
/**
diff --git a/projects/plugins/jetpack/modules/subscriptions/views.php b/projects/plugins/jetpack/modules/subscriptions/views.php
index 70eeacda3578d..02f7f28b1363c 100644
--- a/projects/plugins/jetpack/modules/subscriptions/views.php
+++ b/projects/plugins/jetpack/modules/subscriptions/views.php
@@ -133,7 +133,7 @@ public function widget( $args, $instance ) {
echo $before_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- self::$instance_count ++;
+ ++self::$instance_count;
self::render_widget_title( $args, $instance );
diff --git a/projects/plugins/jetpack/modules/theme-tools/featured-content.php b/projects/plugins/jetpack/modules/theme-tools/featured-content.php
index d6b17a10ba7a6..a2d906f54927f 100644
--- a/projects/plugins/jetpack/modules/theme-tools/featured-content.php
+++ b/projects/plugins/jetpack/modules/theme-tools/featured-content.php
@@ -495,10 +495,10 @@ public static function hide_the_featured_term( $terms, $id, $taxonomy ) {
* @return void
*/
public static function register_setting() {
- add_settings_field( 'featured-content', __( 'Featured Content', 'jetpack' ), array( __class__, 'render_form' ), 'reading' );
+ add_settings_field( 'featured-content', __( 'Featured Content', 'jetpack' ), array( __CLASS__, 'render_form' ), 'reading' );
// Register sanitization callback for the Customizer.
- register_setting( 'featured-content', 'featured-content', array( __class__, 'validate_settings' ) );
+ register_setting( 'featured-content', 'featured-content', array( __CLASS__, 'validate_settings' ) );
}
/**
diff --git a/projects/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php b/projects/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
index ce713ad1d45aa..89fb8510c9274 100644
--- a/projects/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
+++ b/projects/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
@@ -37,7 +37,7 @@ function jetpack_breadcrumbs() {
if ( $ancestors ) {
foreach ( $ancestors as $ancestor ) {
$breadcrumb .= '' . esc_html( get_the_title( $ancestor ) ) . '';
- $position++;
+ ++$position;
}
}
$breadcrumb .= '' . esc_html( get_the_title( $post_id ) ) . '';
diff --git a/projects/plugins/jetpack/modules/tiled-gallery/math/class-constrained-array-rounding.php b/projects/plugins/jetpack/modules/tiled-gallery/math/class-constrained-array-rounding.php
index 7aa7e8de9f424..c33ccd608a89c 100644
--- a/projects/plugins/jetpack/modules/tiled-gallery/math/class-constrained-array-rounding.php
+++ b/projects/plugins/jetpack/modules/tiled-gallery/math/class-constrained-array-rounding.php
@@ -76,7 +76,7 @@ private static function adjust_constrained_array( &$bound_array_int, $adjustment
$length = count( $bound_array_int );
for ( $i = $start; $i <= $end; $i++ ) {
- $bound_array_int[ $i % $length ]['floor']++;
+ ++$bound_array_int[ $i % $length ]['floor'];
}
usort( $bound_array_int, array( 'self', 'cmp_asc_index' ) );
diff --git a/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-shape.php b/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-shape.php
index 2294bd1a26b19..e7e1db76a0fd3 100644
--- a/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-shape.php
+++ b/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-shape.php
@@ -408,11 +408,11 @@ public function __construct( $images ) {
foreach ( $this->images as $image ) {
if ( $sum <= $approximate_column_ratio ) {
- $column_one_images++;
+ ++$column_one_images;
}
if ( $sum > $approximate_column_ratio && $sum <= 2 * $approximate_column_ratio ) {
- $column_two_images++;
+ ++$column_two_images;
}
$sum += $image->ratio;
}
diff --git a/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-square.php b/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-square.php
index 467f2747c68f0..89369f8a42d67 100644
--- a/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-square.php
+++ b/projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-square.php
@@ -50,8 +50,8 @@ private function compute_items() {
$item = new Jetpack_Tiled_Gallery_Square_Item( $image, $this->needs_attachment_link, $this->grayscale );
$row->images[] = $item;
- $c ++;
- $items_in_row++;
+ ++$c;
+ ++$items_in_row;
if ( $images_per_row === $items_in_row || $remainder + 1 === $c ) {
$rows[] = $row;
diff --git a/projects/plugins/jetpack/modules/videopress/class.videopress-player.php b/projects/plugins/jetpack/modules/videopress/class.videopress-player.php
index 451bf54cfd95a..25558b5ae58bf 100644
--- a/projects/plugins/jetpack/modules/videopress/class.videopress-player.php
+++ b/projects/plugins/jetpack/modules/videopress/class.videopress-player.php
@@ -60,7 +60,7 @@ public function __construct( $guid, $maxwidth = 0, $options = array() ) {
self::$shown[ $guid ] = 0;
}
- self::$shown[ $guid ]++;
+ ++self::$shown[ $guid ];
$this->video_container_id = 'v-' . $guid . '-' . self::$shown[ $guid ];
$this->video_id = $this->video_container_id . '-video';
diff --git a/projects/plugins/jetpack/modules/videopress/shortcode.php b/projects/plugins/jetpack/modules/videopress/shortcode.php
index 3f94d9e1c63f9..f15044101c964 100644
--- a/projects/plugins/jetpack/modules/videopress/shortcode.php
+++ b/projects/plugins/jetpack/modules/videopress/shortcode.php
@@ -129,7 +129,7 @@ public function shortcode_callback( $attr ) {
* If the width isn't an even number, reduce it by one (making it even).
*/
if ( 1 === ( $attr['width'] % 2 ) ) {
- $attr['width'] --;
+ --$attr['width'];
}
/**
diff --git a/projects/plugins/jetpack/modules/widgets/migrate-to-core/gallery-widget.php b/projects/plugins/jetpack/modules/widgets/migrate-to-core/gallery-widget.php
index f9f1fec148fc3..4f32b929b891c 100644
--- a/projects/plugins/jetpack/modules/widgets/migrate-to-core/gallery-widget.php
+++ b/projects/plugins/jetpack/modules/widgets/migrate-to-core/gallery-widget.php
@@ -220,6 +220,5 @@ function jetpack_migrate_gallery_widget_bump_stats( $bin, $group = 'widget-migra
$jetpack = Jetpack::init();
$jetpack->stat( $group, $bin );
}
-
}
add_action( 'widgets_init', 'jetpack_migrate_gallery_widget' );
diff --git a/projects/plugins/jetpack/modules/widgets/milestone/class-milestone-widget.php b/projects/plugins/jetpack/modules/widgets/milestone/class-milestone-widget.php
index a28e85f57f9e5..0b6b7878b5690 100644
--- a/projects/plugins/jetpack/modules/widgets/milestone/class-milestone-widget.php
+++ b/projects/plugins/jetpack/modules/widgets/milestone/class-milestone-widget.php
@@ -48,12 +48,12 @@ public function __construct() {
$widget
);
- add_action( 'wp_enqueue_scripts', array( __class__, 'enqueue_template' ) );
- add_action( 'admin_enqueue_scripts', array( __class__, 'enqueue_admin' ) );
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_template' ) );
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_admin' ) );
add_action( 'wp_footer', array( $this, 'localize_script' ) );
if ( is_active_widget( false, false, $this->id_base, true ) || is_active_widget( false, false, 'monster', true ) || is_customize_preview() ) {
- add_action( 'wp_head', array( __class__, 'styles_template' ) );
+ add_action( 'wp_head', array( __CLASS__, 'styles_template' ) );
}
}
diff --git a/projects/plugins/jetpack/modules/widgets/top-posts.php b/projects/plugins/jetpack/modules/widgets/top-posts.php
index 5bb23566c5873..0cead8b5b8790 100644
--- a/projects/plugins/jetpack/modules/widgets/top-posts.php
+++ b/projects/plugins/jetpack/modules/widgets/top-posts.php
@@ -789,7 +789,7 @@ public function get_posts( $post_ids, $count, $types = array( 'post', 'page' ) )
$post_type = $post->post_type;
$posts[] = compact( 'title', 'permalink', 'post_id', 'post_type' );
- $counter++;
+ ++$counter;
if ( $counter == $count ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
break; // only need to load and show x number of likes.
diff --git a/projects/plugins/jetpack/modules/widgets/wordpress-post-widget/class.jetpack-display-posts-widget-base.php b/projects/plugins/jetpack/modules/widgets/wordpress-post-widget/class.jetpack-display-posts-widget-base.php
index 0d9c3d67599aa..f5c25485ebba4 100644
--- a/projects/plugins/jetpack/modules/widgets/wordpress-post-widget/class.jetpack-display-posts-widget-base.php
+++ b/projects/plugins/jetpack/modules/widgets/wordpress-post-widget/class.jetpack-display-posts-widget-base.php
@@ -152,7 +152,7 @@ public function widget( $args, $instance ) {
*/
$number_of_posts = min( $instance['number_of_posts'], count( $posts_list ) );
- for ( $i = 0; $i < $number_of_posts; $i ++ ) {
+ for ( $i = 0; $i < $number_of_posts; $i++ ) {
$single_post = $posts_list[ $i ];
$post_title = ( $single_post['title'] ) ? $single_post['title'] : '( No Title )';
@@ -259,7 +259,7 @@ public function form( $instance ) {
";
}
-
}
add_cacheaction( 'cache_admin_page', 'wp_supercache_badbehaviour_admin' );
diff --git a/projects/plugins/super-cache/plugins/dynamic-cache-test.php b/projects/plugins/super-cache/plugins/dynamic-cache-test.php
index 9586b69f62bbb..6532b35ac1cd9 100644
--- a/projects/plugins/super-cache/plugins/dynamic-cache-test.php
+++ b/projects/plugins/super-cache/plugins/dynamic-cache-test.php
@@ -168,7 +168,6 @@ function dynamic_output_buffer_test( $cachedata = 0 ) {
} else { // called via the wpsc_cachedata filter. We only get here in cached pages in wp-cache-phase1.php.
return str_replace( DYNAMIC_OUTPUT_BUFFER_TAG, $text, $cachedata );
}
-
}
add_cacheaction( 'wpsc_cachedata', 'dynamic_output_buffer_test' );
diff --git a/projects/plugins/super-cache/plugins/wptouch.php b/projects/plugins/super-cache/plugins/wptouch.php
index 9f2209a621ad4..7c27116223558 100644
--- a/projects/plugins/super-cache/plugins/wptouch.php
+++ b/projects/plugins/super-cache/plugins/wptouch.php
@@ -81,7 +81,6 @@ function wp_super_cache_maybe_disable_wptouch( $t ) {
}
return false;
-
}
add_cacheaction( 'disable_mobile_check', 'wp_super_cache_maybe_disable_wptouch' );
diff --git a/projects/plugins/super-cache/rest/class.wp-super-cache-rest-get-settings.php b/projects/plugins/super-cache/rest/class.wp-super-cache-rest-get-settings.php
index af708f94618b8..ac53f8a6bf397 100644
--- a/projects/plugins/super-cache/rest/class.wp-super-cache-rest-get-settings.php
+++ b/projects/plugins/super-cache/rest/class.wp-super-cache-rest-get-settings.php
@@ -1,6 +1,6 @@
array(),
),
) );
-
}
/**
@@ -161,7 +160,7 @@ public static function delete_item_permissions_check( $request ) {
}
function wpsc_load_rest_api() {
- $wpsupercache_route = new WP_Super_Cache_Router;
+ $wpsupercache_route = new WP_Super_Cache_Router();
$wpsupercache_route->register_routes();
};
diff --git a/projects/plugins/super-cache/wp-cache-phase1.php b/projects/plugins/super-cache/wp-cache-phase1.php
index 987d41fd95503..cc165faced26e 100644
--- a/projects/plugins/super-cache/wp-cache-phase1.php
+++ b/projects/plugins/super-cache/wp-cache-phase1.php
@@ -7,8 +7,8 @@
// error_reporting(E_ERROR | E_PARSE); // uncomment to debug this file!
// directory where the configuration file lives.
if ( !defined( 'WPCACHECONFIGPATH' ) ) {
- define( 'WPCACHECONFIGPATH', WP_CONTENT_DIR );
-}
+ define( 'WPCACHECONFIGPATH', WP_CONTENT_DIR );
+}
if ( ! @include WPCACHECONFIGPATH . '/wp-cache-config.php' ) {
return false;
diff --git a/projects/plugins/super-cache/wp-cache-phase2.php b/projects/plugins/super-cache/wp-cache-phase2.php
index 85c6c34f61261..b79acc1edc9ba 100644
--- a/projects/plugins/super-cache/wp-cache-phase2.php
+++ b/projects/plugins/super-cache/wp-cache-phase2.php
@@ -620,21 +620,21 @@ function wp_cache_debug( $message, $level = 1 ) {
// If either of the debug or log globals aren't set, then we can stop
if ( ! isset( $wp_super_cache_debug )
- || ! isset( $wp_cache_debug_log ) ) {
+ || ! isset( $wp_cache_debug_log ) ) {
return false;
}
// If either the debug or log globals are false or empty, we can stop
if ( $wp_super_cache_debug == false
- || $wp_cache_debug_log == '' ) {
+ || $wp_cache_debug_log === '' ) {
return false;
}
// If the debug_ip has been set, but it doesn't match the ip of the requester
// then we can stop.
if ( isset( $wp_cache_debug_ip )
- && $wp_cache_debug_ip != ''
- && $wp_cache_debug_ip != $_SERVER['REMOTE_ADDR'] ) {
+ && $wp_cache_debug_ip !== ''
+ && ( ! isset( $_SERVER['REMOTE_ADDR'] ) || $wp_cache_debug_ip !== $_SERVER['REMOTE_ADDR'] ) ) {
return false;
}
@@ -1338,7 +1338,7 @@ function wp_cache_replace_line( $old, $new, $my_file ) {
if ( ! empty( $lines ) && is_array( $lines ) ) {
$loaded = true;
} else {
- $c++;
+ ++$c;
if ( $c > 100 ) {
if ( function_exists( 'set_transient' ) ) {
set_transient( 'wpsc_config_error', 'config_file_not_loaded', 10 );
@@ -1881,8 +1881,8 @@ function wp_super_cache_query_vars() {
// REST API
if ( ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
- ( defined( 'JSON_REQUEST' ) && JSON_REQUEST ) ||
- ( defined( 'WC_API_REQUEST' ) && WC_API_REQUEST )
+ ( defined( 'JSON_REQUEST' ) && JSON_REQUEST ) ||
+ ( defined( 'WC_API_REQUEST' ) && WC_API_REQUEST )
) {
$wp_super_cache_query['is_rest'] = 1;
}
@@ -2154,7 +2154,7 @@ function wp_cache_get_ob( &$buffer ) {
$wp_cache_meta = array();
/*
- Mode paranoic, check for closing tags
+ * Mode paranoic, check for closing tags
* we avoid caching incomplete files */
if ( $buffer == '' ) {
$new_cache = false;
@@ -2585,7 +2585,7 @@ function prune_super_cache( $directory, $force = false, $rename = false ) {
}
if ( ! $rename ) {
@rmdir( $entry );
- $log++;
+ ++$log;
if ( $force ) {
wp_cache_debug( "gc: deleted $entry, forced delete", 2 );
} else {
@@ -2607,11 +2607,11 @@ function prune_super_cache( $directory, $force = false, $rename = false ) {
if ( $oktodelete && ! $rename ) {
wp_cache_debug( "prune_super_cache: deleted $directory", 5 );
@unlink( $directory );
- $log++;
+ ++$log;
} elseif ( $oktodelete && $rename ) {
wp_cache_debug( "prune_super_cache: wp_cache_rebuild_or_delete( $directory )", 5 );
wp_cache_rebuild_or_delete( $directory );
- $log++;
+ ++$log;
} else {
wp_cache_debug( "prune_super_cache: did not delete file: $directory" );
}
@@ -2762,8 +2762,7 @@ function wp_cache_shutdown_callback() {
if ( ! isset( $response['Last-Modified'] ) ) {
$value = gmdate( 'D, d M Y H:i:s' ) . ' GMT';
- /*
- Dont send this the first time */
+ // Don't send this the first time
/* @header('Last-Modified: ' . $value); */
$wp_cache_meta['headers']['Last-Modified'] = "Last-Modified: $value";
}
diff --git a/projects/plugins/super-cache/wp-cache.php b/projects/plugins/super-cache/wp-cache.php
index e782b33a34bd6..3a7d6866c4499 100644
--- a/projects/plugins/super-cache/wp-cache.php
+++ b/projects/plugins/super-cache/wp-cache.php
@@ -48,9 +48,9 @@
function wpsc_init() {
global $wp_cache_config_file, $wp_cache_config_file_sample, $wpsc_advanced_cache_dist_filename, $wp_cache_check_wp_config, $wpsc_advanced_cache_filename, $wpsc_promo_links;
- if ( !defined( 'WPCACHECONFIGPATH' ) ) {
- define( 'WPCACHECONFIGPATH', WP_CONTENT_DIR );
- }
+ if ( ! defined( 'WPCACHECONFIGPATH' ) ) {
+ define( 'WPCACHECONFIGPATH', WP_CONTENT_DIR );
+ }
$wp_cache_config_file = WPCACHECONFIGPATH . '/wp-cache-config.php';
@@ -64,7 +64,7 @@ function wpsc_init() {
);
if ( !defined( 'WPCACHEHOME' ) ) {
- define( 'WPCACHEHOME', dirname( __FILE__ ) . '/' );
+ define( 'WPCACHEHOME', __DIR__ . '/' );
$wp_cache_config_file_sample = WPCACHEHOME . 'wp-cache-config-sample.php';
$wpsc_advanced_cache_dist_filename = WPCACHEHOME . 'advanced-cache.php';
} elseif ( realpath( WPCACHEHOME ) != realpath( __DIR__ ) ) {
@@ -142,7 +142,7 @@ function get_wpcachehome() {
if ( ! defined( 'WPCACHEHOME' ) ) {
if ( is_file( __DIR__ . '/wp-cache-config-sample.php' ) ) {
- define( 'WPCACHEHOME', trailingslashit( dirname( __FILE__ ) ) );
+ define( 'WPCACHEHOME', trailingslashit( __DIR__ ) );
} elseif ( is_file( __DIR__ . '/wp-super-cache/wp-cache-config-sample.php' ) ) {
define( 'WPCACHEHOME', __DIR__ . '/wp-super-cache/' );
} else {
@@ -483,7 +483,7 @@ function wp_cache_manager_error_checks() {
if ( false == function_exists( 'wpsc_deep_replace' ) ) {
$msg = __( 'Warning! You must set WP_CACHE and WPCACHEHOME in your wp-config.php for this plugin to work correctly:' ) . '
';
$msg .= "define( 'WP_CACHE', true );
";
- $msg .= "define( 'WPCACHEHOME', '" . dirname( __FILE__ ) . "/' );
";
+ $msg .= "define( 'WPCACHEHOME', '" . __DIR__ . "/' );
";
wp_die( $msg );
}
@@ -649,7 +649,6 @@ function wp_cache_manager_error_checks() {
}
return true;
-
}
add_filter( 'wp_super_cache_error_checking', 'wp_cache_manager_error_checks' );
@@ -1380,7 +1379,6 @@ function wpsc_restore_settings() {
'restore',
compact( 'admin_url' )
);
-
}
function comment_form_lockdown_message() {
@@ -1494,7 +1492,6 @@ function wpsc_lockdown() {
'lockdown',
compact( 'cached_direct_pages', 'cache_enabled', 'super_cache_enabled', 'admin_url', 'wp_lock_down' )
);
-
}
function RecursiveFolderDelete ( $folderPath ) { // from http://www.php.net/manual/en/function.rmdir.php
@@ -1593,7 +1590,6 @@ function wp_cache_time_update() {
wp_schedule_event( strtotime( $cache_scheduled_time ), $cache_schedule_interval, 'wp_cache_gc' );
}
}
-
}
function wp_cache_sanitize_value($text, & $array) {
@@ -1633,7 +1629,6 @@ function wpsc_edit_rejected_ua() {
'rejected_user_agents',
compact( 'cache_rejected_user_agent', 'admin_url' )
);
-
}
function wp_cache_update_rejected_pages() {
@@ -1698,7 +1693,6 @@ function wp_cache_update_rejected_strings() {
$text = wp_cache_sanitize_value( str_replace( '\\\\', '\\', $_REQUEST['wp_rejected_uri'] ), $cache_rejected_uri );
wp_cache_replace_line('^ *\$cache_rejected_uri', "\$cache_rejected_uri = $text;", $wp_cache_config_file);
}
-
}
function wp_cache_update_accepted_strings() {
@@ -2154,10 +2148,10 @@ function wp_cache_verify_config_file() {
return false;
}
copy($wp_cache_config_file_sample, $wp_cache_config_file);
- $dir = str_replace( str_replace( '\\', '/', WP_CONTENT_DIR ), '', str_replace( '\\', '/', dirname(__FILE__) ) );
- if( is_file( dirname(__FILE__) . '/wp-cache-config-sample.php' ) ) {
+ $dir = str_replace( str_replace( '\\', '/', WP_CONTENT_DIR ), '', str_replace( '\\', '/', __DIR__ ) );
+ if ( is_file( __DIR__ . '/wp-cache-config-sample.php' ) ) {
wp_cache_replace_line('define\(\ \'WPCACHEHOME', "\tdefine( 'WPCACHEHOME', WP_CONTENT_DIR . \"{$dir}/\" );", $wp_cache_config_file);
- } elseif( is_file( dirname(__FILE__) . '/wp-super-cache/wp-cache-config-sample.php' ) ) {
+ } elseif ( is_file( __DIR__ . '/wp-super-cache/wp-cache-config-sample.php' ) ) {
wp_cache_replace_line('define\(\ \'WPCACHEHOME', "\tdefine( 'WPCACHEHOME', WP_CONTENT_DIR . \"{$dir}/wp-super-cache/\" );", $wp_cache_config_file);
}
$new = true;
@@ -2185,7 +2179,7 @@ function wp_cache_create_advanced_cache() {
die('Cannot locate wp-config.php');
}
- $line = 'define( \'WPCACHEHOME\', \'' . dirname( __FILE__ ) . '/\' );';
+ $line = 'define( \'WPCACHEHOME\', \'' . __DIR__ . '/\' );';
if ( ! apply_filters( 'wpsc_enable_wp_config_edit', true ) ) {
echo '' . __( 'Warning', 'wp-super-cache' ) . "! " . sprintf( __( 'Not allowed to edit %s per configuration.', 'wp-super-cache' ), $global_config_file ) . "
";
@@ -2465,9 +2459,9 @@ function wp_cache_files() {
}
if ( $cache_max_time > 0 && $age > $cache_max_time ) {
- $expired++;
+ ++$expired;
} else {
- $count++;
+ ++$count;
}
$wp_cache_fsize += $fsize;
}
@@ -2536,7 +2530,7 @@ function wp_cache_files() {
$bg = $flip ? 'style="background: #EAEAEA;"' : '';
echo "$c | {$directory} | {$d[ 'files' ]} | {$age} | 'wpsupercache', 'action' => 'deletesupercache', 'uri' => base64_encode( $directory ) ) ), 'wp-cache' ) . "#listfiles'>X |
\n";
$flip = !$flip;
- $c++;
+ ++$c;
}
echo "";
}
@@ -2684,7 +2678,6 @@ function wp_cache_clean_cache( $file_prefix, $all = false ) {
wp_cache_clean_legacy_files( $blog_cache_dir, $file_prefix );
wp_cache_clean_legacy_files( $cache_path, $file_prefix );
-
}
function wpsc_delete_post_cache( $id ) {
@@ -3287,7 +3280,7 @@ function wp_cron_preload_cache() {
wp_remote_get( $url, array('timeout' => 60, 'blocking' => true ) );
wp_cache_debug( "wp_cron_preload_cache: fetched $url", 5 );
sleep( 1 );
- $count++;
+ ++$count;
}
if ( $wp_cache_preload_email_me && ( $wp_cache_preload_email_volume == 'medium' || $wp_cache_preload_email_volume == 'many' ) )
wp_mail( get_option( 'admin_email' ), sprintf( __( '[%1$s] %2$d posts refreshed', 'wp-super-cache' ), home_url(), ($c+100) ), __( "Refreshed the following posts:", 'wp-super-cache' ) . "\n$msg" );
@@ -3643,7 +3636,6 @@ function wpsc_set_default_gc( $force = false ) {
}
return true;
-
}
function add_mod_rewrite_rules() {
diff --git a/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf b/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf
new file mode 100644
index 0000000000000..8ae821ee1a3df
--- /dev/null
+++ b/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
+
+
diff --git a/projects/plugins/vaultpress/class.vaultpress-filesystem.php b/projects/plugins/vaultpress/class.vaultpress-filesystem.php
index f6de5a4a3b9cd..bbaa9edfeda89 100644
--- a/projects/plugins/vaultpress/class.vaultpress-filesystem.php
+++ b/projects/plugins/vaultpress/class.vaultpress-filesystem.php
@@ -173,7 +173,7 @@ function ls( $what, $md5=false, $sha1=false, $limit=null, $offset=null, $full_li
foreach ( (array)$this->scan_dir( $path ) as $i ) {
if ( !$full_list && !$this->should_backup_file( $i ) )
continue;
- $current++;
+ ++$current;
if ( $offset >= $current )
continue;
if ( $limit && $limit < $current )
diff --git a/projects/plugins/vaultpress/class.vaultpress-hotfixes.php b/projects/plugins/vaultpress/class.vaultpress-hotfixes.php
index dc900aa987c9c..8eb387ccfdccc 100644
--- a/projects/plugins/vaultpress/class.vaultpress-hotfixes.php
+++ b/projects/plugins/vaultpress/class.vaultpress-hotfixes.php
@@ -27,7 +27,6 @@ function __construct() {
$this->protect_youtube_embeds();
}
}
-
}
function protect_rest_type_juggling( $replace, $server, $request ) {
diff --git a/projects/plugins/vaultpress/cron-tasks.php b/projects/plugins/vaultpress/cron-tasks.php
index 63ac2bd0744b2..84140135f3edc 100644
--- a/projects/plugins/vaultpress/cron-tasks.php
+++ b/projects/plugins/vaultpress/cron-tasks.php
@@ -2,7 +2,7 @@
// don't call the file directly
defined( 'ABSPATH' ) or die();
-include_once dirname( __FILE__ ) . '/vp-scanner.php';
+require_once __DIR__ . '/vp-scanner.php';
if ( !function_exists( 'apply_filters_ref_array' ) ) :
diff --git a/projects/plugins/vaultpress/vaultpress.php b/projects/plugins/vaultpress/vaultpress.php
index 9653b3067725c..e6d0bf8d39f5d 100644
--- a/projects/plugins/vaultpress/vaultpress.php
+++ b/projects/plugins/vaultpress/vaultpress.php
@@ -476,7 +476,7 @@ function connect_notice() {
}
}
- // show message after activation
+ // show message after activation
function activated_notice() {
if ( 'network' == $this->get_option( 'activated' ) ) {
$message = sprintf(
@@ -1461,7 +1461,7 @@ function request_firewall_update( $external_services = false ) {
$retry = 2;
$protocol = 'https';
do {
- $retry--;
+ --$retry;
$args['sslverify'] = 'https' == $protocol ? true : false;
$r = wp_remote_get( $url=sprintf( "%s://%s/%s?cidr_ranges=1", $protocol, $hostname, $path ), $args );
if ( 200 == wp_remote_retrieve_response_code( $r ) ) {
@@ -1769,8 +1769,8 @@ function parse_request( $wp ) {
}
if ( !isset( $bdb ) ) {
- require_once( dirname( __FILE__ ) . '/class.vaultpress-database.php' );
- require_once( dirname( __FILE__ ) . '/class.vaultpress-filesystem.php' );
+ require_once __DIR__ . '/class.vaultpress-database.php';
+ require_once __DIR__ . '/class.vaultpress-filesystem.php';
$bdb = new VaultPress_Database();
$bfs = new VaultPress_Filesystem();
@@ -2216,7 +2216,7 @@ function contact_service( $action, $args = array() ) {
$hostname = $this->get_option( 'hostname' );
if ( !class_exists( 'VaultPress_IXR_SSL_Client' ) )
- require_once( dirname( __FILE__ ) . '/class.vaultpress-ixr-ssl-client.php' );
+ require_once __DIR__ . '/class.vaultpress-ixr-ssl-client.php';
$useragent = 'VaultPress/' . $this->plugin_version . '; ' . $this->site_url();
$client = new VaultPress_IXR_SSL_Client( $hostname, '/xmlrpc.php', 80, $timeout, $useragent );
@@ -2577,7 +2577,7 @@ function add_ping( $type, $data, $hook=null ) {
foreach ( $data as $val ) {
if ( in_array( $data, $vaultpress_pings[$type] ) )
continue;
- $vaultpress_pings['count']++;
+ ++$vaultpress_pings['count'];
$vaultpress_pings[$type][]=$val;
}
return;
@@ -2588,13 +2588,13 @@ function add_ping( $type, $data, $hook=null ) {
$vaultpress_pings[$type][$subtype] = array();
if ( in_array( $data, $vaultpress_pings[$type][$subtype] ) )
return;
- $vaultpress_pings['count']++;
+ ++$vaultpress_pings['count'];
$vaultpress_pings[$type][$subtype][] = $data;
return;
default:
if ( in_array( $data, $vaultpress_pings[$type] ) )
return;
- $vaultpress_pings['count']++;
+ ++$vaultpress_pings['count'];
$vaultpress_pings[$type][] = $data;
return;
}
@@ -2628,7 +2628,7 @@ function do_pings() {
$ping_attempts = 0;
do {
- $ping_attempts++;
+ ++$ping_attempts;
$rval = $this->contact_service( 'ping', array( 'args' => $vaultpress_pings ) );
if ( $rval || $ping_attempts >= 3 )
break;
@@ -2663,7 +2663,7 @@ function resolve_content_dir() {
return ABSPATH . 'wp-content' . DIRECTORY_SEPARATOR;
}
// Run with a solid assumption: WP_CONTENT_DIR/vaultpress/vaultpress.php
- return dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
+ return dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
}
function resolve_upload_path() {
@@ -3037,12 +3037,12 @@ function register_via_jetpack( $already_purchased = false ) {
}
// only load hotfixes if it's not a VP request
-require_once( dirname( __FILE__ ) . '/class.vaultpress-hotfixes.php' );
+require_once __DIR__ . '/class.vaultpress-hotfixes.php';
$hotfixes = new VaultPress_Hotfixes();
// Add a helper method to WP CLI for auto-registerion via Jetpack
if ( defined( 'WP_CLI' ) && WP_CLI ) {
- require_once( dirname( __FILE__ ) . '/class.vaultpress-cli.php' );
+ require_once __DIR__ . '/class.vaultpress-cli.php';
}
-include_once( dirname( __FILE__ ) . '/cron-tasks.php' );
+require_once __DIR__ . '/cron-tasks.php';
diff --git a/projects/plugins/vaultpress/vp-scanner.php b/projects/plugins/vaultpress/vp-scanner.php
index d99e3ae2b39f0..3f914bba843f9 100644
--- a/projects/plugins/vaultpress/vp-scanner.php
+++ b/projects/plugins/vaultpress/vp-scanner.php
@@ -35,7 +35,7 @@ function _scan_files( $path, &$files, $offset, $limit, &$last_dir ) {
if ( '.' == $entry || '..' == $entry )
continue;
- $_offset++;
+ ++$_offset;
$full_entry = $path . DIRECTORY_SEPARATOR . $entry;
$next_item = ltrim( str_replace( $path, '', $last_dir ), DIRECTORY_SEPARATOR );
$next = preg_split( '#(?