diff --git a/__tests__/e2e/package-lock.json b/__tests__/e2e/package-lock.json index 509c4c0068..d6535090bf 100644 --- a/__tests__/e2e/package-lock.json +++ b/__tests__/e2e/package-lock.json @@ -13,7 +13,7 @@ "@playwright/test": "^1.39.0", "asana-phrase": "^0.0.8", "eslint": "^8.51.0", - "eslint-plugin-playwright": "^0.18.0", + "eslint-plugin-playwright": "^0.19.0", "playwright": "^1.39.0", "typescript": "^5.2.2" } @@ -42,15 +42,15 @@ } }, "node_modules/@automattic/eslint-plugin-wpvip": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-0.9.0.tgz", - "integrity": "sha512-wP0qu/Buu8Vmd1bN0OIw3iUzYaqQNd3IoL4gUqmuTqkMzzA69agwhT0vrDSIY2IbN4fXlzp2eGyoKrwO+/8gSQ==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-0.9.1.tgz", + "integrity": "sha512-yLouh3GVNsWaw3Rd21Iko3o1gUkMh/76CM6ZhFRMRgT5iZtSrx8ycHzuZjI0a2UhSew34kpBr7gJE1y1qTMTDA==", "dev": true, "dependencies": { "@babel/eslint-parser": "7.23.3", "@rushstack/eslint-patch": "1.6.0", - "@typescript-eslint/eslint-plugin": "6.12.0", - "@typescript-eslint/parser": "6.12.0", + "@typescript-eslint/eslint-plugin": "6.13.1", + "@typescript-eslint/parser": "6.13.1", "eslint-config-prettier": "8.7.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "2.29.0", @@ -657,12 +657,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.0.tgz", - "integrity": "sha512-PdW+kn4eV99iP5gxWNSDQCbhMaDVej+RXL5xr6t04nbKLCBwYtA046t7ofoczHOm8u6c+45hpDKQVZqtqwkeQg==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", "dev": true, "dependencies": { - "playwright": "1.40.0" + "playwright": "1.40.1" }, "bin": { "playwright": "cli.js" @@ -696,16 +696,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.12.0.tgz", - "integrity": "sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz", + "integrity": "sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/type-utils": "6.12.0", - "@typescript-eslint/utils": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/type-utils": "6.13.1", + "@typescript-eslint/utils": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -764,15 +764,15 @@ "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz", - "integrity": "sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", + "integrity": "sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4" }, "engines": { @@ -792,13 +792,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.12.0.tgz", - "integrity": "sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz", + "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0" + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -809,13 +809,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.12.0.tgz", - "integrity": "sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz", + "integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/utils": "6.13.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -836,9 +836,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.12.0.tgz", - "integrity": "sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz", + "integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -849,13 +849,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.12.0.tgz", - "integrity": "sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz", + "integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -909,17 +909,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.12.0.tgz", - "integrity": "sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", + "integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", "semver": "^7.5.4" }, "engines": { @@ -967,12 +967,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.12.0.tgz", - "integrity": "sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", + "integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", + "@typescript-eslint/types": "6.13.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2175,9 +2175,9 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.18.0.tgz", - "integrity": "sha512-VLvKOAaDvRTonUeI3J8plXIJQuReXjbjrgDGoNwsiydwdqk3lt+mbzgsBcxJscMJDHc9XgnLVo0nWTiaYHLGYQ==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.19.0.tgz", + "integrity": "sha512-/pk5oDxusdPnsPNo16o7kWk4Pq8e0Jw7vM0xI/G4wDHhYw1ImQpclB3fQGbjKAO1eauGRLWtJAq5l1Xq3oF16A==", "dev": true, "dependencies": { "globals": "^13.23.0" @@ -3895,12 +3895,12 @@ } }, "node_modules/playwright": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.0.tgz", - "integrity": "sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", "dev": true, "dependencies": { - "playwright-core": "1.40.0" + "playwright-core": "1.40.1" }, "bin": { "playwright": "cli.js" @@ -3913,9 +3913,9 @@ } }, "node_modules/playwright-core": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.0.tgz", - "integrity": "sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/__tests__/e2e/package.json b/__tests__/e2e/package.json index 2b7ffd8698..e27d45ee46 100644 --- a/__tests__/e2e/package.json +++ b/__tests__/e2e/package.json @@ -16,7 +16,7 @@ "@playwright/test": "^1.39.0", "asana-phrase": "^0.0.8", "eslint": "^8.51.0", - "eslint-plugin-playwright": "^0.18.0", + "eslint-plugin-playwright": "^0.19.0", "playwright": "^1.39.0", "typescript": "^5.2.2" } diff --git a/composer.json b/composer.json index 2789936bef..ef27a85c65 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "require-dev": { - "phpunit/phpunit": "9.6.13", + "phpunit/phpunit": "9.6.15", "automattic/vipwpcs": "3.0.0", "phpcompatibility/phpcompatibility-wp": "2.1.4", "erusev/parsedown": "1.7.4", "dms/phpunit-arraysubset-asserts": "0.5.0", "yoast/phpunit-polyfills": "2.0.0", "johnpbloch/wordpress-core": "6.4.1", - "wp-phpunit/wp-phpunit": "6.3.1", + "wp-phpunit/wp-phpunit": "6.4.1", "wp-cli/wp-cli": "2.9.0" }, "config": { diff --git a/composer.lock b/composer.lock index 40d91cb317..304e2f4bd0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b9904a18908e368eaea31306f807b54b", + "content-hash": "fcb388fad371b5e31ffc2f40fe302290", "packages": [], "packages-dev": [ { @@ -1258,16 +1258,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "9.6.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", "shasum": "" }, "require": { @@ -1341,7 +1341,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" }, "funding": [ { @@ -1357,7 +1357,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2023-12-01T16:55:19+00:00" }, { "name": "sebastian/cli-parser", @@ -2653,16 +2653,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -2691,7 +2691,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -2699,7 +2699,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -2953,16 +2953,16 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.3.1", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "4797791a311c41d213027333e4fcc48073f77df0" + "reference": "7b0f58b0c33ba2569a4de74761c10c629298e7ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/4797791a311c41d213027333e4fcc48073f77df0", - "reference": "4797791a311c41d213027333e4fcc48073f77df0", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/7b0f58b0c33ba2569a4de74761c10c629298e7ce", + "reference": "7b0f58b0c33ba2569a4de74761c10c629298e7ce", "shasum": "" }, "type": "library", @@ -2997,7 +2997,7 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2023-08-09T01:26:57+00:00" + "time": "2023-11-28T00:32:39+00:00" }, { "name": "yoast/phpunit-polyfills", diff --git a/search/includes/classes/class-health.php b/search/includes/classes/class-health.php index bf8eb5c150..d00c2ac26c 100644 --- a/search/includes/classes/class-health.php +++ b/search/includes/classes/class-health.php @@ -181,6 +181,11 @@ public function get_index_entity_count_from_elastic_search( array $query_args, \ // Since the user indexable is global, we want to include ALL in count. unset( $query->query_vars['blog_id'] ); } + + // An improperly formatted ES args filter can break the `wp vip-search health validate-counts` CLI. + remove_all_filters( 'ep_formatted_args' ); + remove_all_filters( 'ep_post_formatted_args' ); + $formatted_args = $indexable->format_args( $query->query_vars, $query ); // Get exact total count since Elasticsearch default stops at 10,000. diff --git a/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php b/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php index 0ea40e7539..a16ff95fae 100644 --- a/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php +++ b/tests/vip-jetpack/connection-pilot/test-class-jetpack-connection-pilot.php @@ -88,15 +88,23 @@ public function test__should_back_off( ?int $backoff_factor, DateTime $dt, bool } public function get_test_data__update_backoff_factor() { - return [ - 'null' => [ null, 1 ], - 'zero' => [ 0, 1 ], - 'one_hour' => [ 1, 2 ], - 'two_hours' => [ 2, 4 ], - 'three_days' => [ 72, 144 ], - 'max' => [ 168, 168 ], - 'over_max' => [ 2000, 168 ], - ]; + $connection_pilot = Connection_Pilot::instance(); + $increments = $connection_pilot::BACKOFF_INCREMENTS; + $max_increment = $connection_pilot::MAX_BACKOFF_FACTOR; + + $test_data = []; + foreach ( $increments as $key => $increment ) { + if ( isset( $increments[ $key + 1 ] ) ) { + $test_data[ 'increment_' . $key ] = [ $increment, $increments[ $key + 1 ] ]; + } + } + + $test_data['null'] = [ null, $increments[0] ]; + $test_data['zero'] = [ 0, $increments[0] ]; + $test_data['max'] = [ $max_increment, $max_increment ]; + $test_data['over_max'] = [ $max_increment + 1000, $max_increment ]; + + return $test_data; } public function get_test_data__update_heartbeat() { diff --git a/vip-helpers/vip-roles.php b/vip-helpers/vip-roles.php index 0b42a3dd65..911245dad9 100644 --- a/vip-helpers/vip-roles.php +++ b/vip-helpers/vip-roles.php @@ -30,6 +30,10 @@ function wpcom_vip_get_role_caps( $role ) { * @param array $capabilities Key/value array of capabilities for the role */ function wpcom_vip_add_role( $role, $name, $capabilities ) { + if ( ! is_array( $capabilities ) ) { + $capabilities = array(); + } + if ( array_is_list( $capabilities ) && ! array_filter( $capabilities, 'is_bool' ) ) { $capabilities = array_flip( $capabilities ); $capabilities = array_map( '__return_true', $capabilities ); diff --git a/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php b/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php index 32adef4c53..6693ec8891 100644 --- a/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php +++ b/vip-jetpack/connection-pilot/class-jetpack-connection-pilot.php @@ -30,7 +30,13 @@ class Connection_Pilot { /** * Maximum number of hours that the system will wait to try to reconnect. */ - const MAX_BACKOFF_FACTOR = 7 * 24; + const MAX_BACKOFF_FACTOR = 7 * 24 * 3; + + /** + * The number of hours between (failed) connection attempts. + * Starts at a 1 hour delay, ends at the max. + */ + const BACKOFF_INCREMENTS = [ 1, 12, 24, 48, 96, self::MAX_BACKOFF_FACTOR ]; /** * The healtcheck option's current data. @@ -202,12 +208,18 @@ private function should_back_off(): bool { * @return void */ private function update_backoff_factor(): void { - $backoff_factor = isset( $this->last_heartbeat['backoff_factor'] ) ? (int) $this->last_heartbeat['backoff_factor'] : 0; - - // Start at 1 hour, then double the backoff factor each time. - $backoff_factor = $backoff_factor <= 0 ? 1 : $backoff_factor * 2; + $current_backoff_factor = isset( $this->last_heartbeat['backoff_factor'] ) ? (int) $this->last_heartbeat['backoff_factor'] : 0; + + $new_backoff_factor = self::MAX_BACKOFF_FACTOR; + foreach ( self::BACKOFF_INCREMENTS as $increment ) { + // Pick the next increment in the list. + if ( $increment > $current_backoff_factor ) { + $new_backoff_factor = $increment; + break; + } + } - $this->update_heartbeat( min( $backoff_factor, self::MAX_BACKOFF_FACTOR ) ); + $this->update_heartbeat( min( $new_backoff_factor, self::MAX_BACKOFF_FACTOR ) ); } /** @@ -235,11 +247,8 @@ private function update_heartbeat( int $backoff_factor = 0 ): void { * @return bool True if the connection pilot should run. */ public static function should_run_connection_pilot(): bool { - if ( defined( 'VIP_JETPACK_AUTO_MANAGE_CONNECTION' ) ) { - return VIP_JETPACK_AUTO_MANAGE_CONNECTION; - } - - return apply_filters( 'vip_jetpack_connection_pilot_should_run', false ); + $default = defined( 'VIP_JETPACK_AUTO_MANAGE_CONNECTION' ) ? VIP_JETPACK_AUTO_MANAGE_CONNECTION : false; + return apply_filters( 'vip_jetpack_connection_pilot_should_run', $default ); } /** diff --git a/vip-parsely/vip-parsely.php b/vip-parsely/vip-parsely.php index 8a8097cae4..1615e68356 100644 --- a/vip-parsely/vip-parsely.php +++ b/vip-parsely/vip-parsely.php @@ -25,6 +25,7 @@ const WP_PARSELY_RECOMMENDED_WIDGET_BASE_ID = 'parsely_recommended_widget'; // Telemetry is enabled by default on non-production sites. +add_filter( 'wp_parsely_enable_wpadmin_telemetry', '__return_true' ); if ( apply_filters( 'wp_parsely_enable_telemetry_backend', true ) ) { require __DIR__ . '/Telemetry/class-telemetry.php'; require __DIR__ . '/Telemetry/class-telemetry-system.php'; diff --git a/vip-support/class-vip-support-user.php b/vip-support/class-vip-support-user.php index bb1ff23df7..b5a9a9c49b 100644 --- a/vip-support/class-vip-support-user.php +++ b/vip-support/class-vip-support-user.php @@ -1055,7 +1055,7 @@ public static function remove( $user_id, $by = 'email' ) { // Never remove the machine user. if ( ( defined( 'WPCOM_VIP_MACHINE_USER_LOGIN' ) && \WPCOM_VIP_MACHINE_USER_LOGIN === $user->user_login ) || - ( defined( 'WPCOM_VIP_MACHINE_USER_EMAIL' ) && \WPCOM_VIP_MACHINE_USER_LOGIN === $user->user_email ) + ( defined( 'WPCOM_VIP_MACHINE_USER_EMAIL' ) && \WPCOM_VIP_MACHINE_USER_EMAIL === $user->user_email ) ) { return new WP_Error( 'not-removing-machine-user', 'WPCOM VIP machine user cannot be removed!' ); } diff --git a/wp-parsely b/wp-parsely index bdeb28899d..f33ffea5ac 160000 --- a/wp-parsely +++ b/wp-parsely @@ -1 +1 @@ -Subproject commit bdeb28899d16abc1bb03385db89117db97dcf6b8 +Subproject commit f33ffea5aca944f183bed3995cdea8c0e099dfce diff --git a/wp-parsely.php b/wp-parsely.php index 0af656b37f..1aa83881bc 100644 --- a/wp-parsely.php +++ b/wp-parsely.php @@ -21,6 +21,7 @@ * The default version is the first entry in the SUPPORTED_VERSIONS list. */ const SUPPORTED_VERSIONS = [ + '3.12', '3.11', '3.10', '3.9',