diff --git a/http-concat b/http-concat index 73dbe08af0..3a892c9e49 160000 --- a/http-concat +++ b/http-concat @@ -1 +1 @@ -Subproject commit 73dbe08af00a92b91977d5eb9fb0d92b5f5c0909 +Subproject commit 3a892c9e497a63f9772c809b070d2425b7e08b4b diff --git a/integrations/block-data-api.php b/integrations/block-data-api.php index 458a78c431..e1fdae23e3 100644 --- a/integrations/block-data-api.php +++ b/integrations/block-data-api.php @@ -55,9 +55,4 @@ public function load(): void { } } ); } - - /** - * Configure `Block Data API` for VIP Platform. - */ - public function configure(): void {} } diff --git a/integrations/integration.php b/integrations/integration.php index 4316521f46..5c6e9dcdbe 100644 --- a/integrations/integration.php +++ b/integrations/integration.php @@ -170,11 +170,13 @@ abstract public function load(): void; /** * Configure the integration for VIP platform. - * + * * If we want to implement functionality only if the integration is enabled via VIP * then we will use this function. - * + * + * By default, the implementation of this function will be empty. + * * @private */ - abstract public function configure(): void; + public function configure(): void {} } diff --git a/integrations/vip-governance.php b/integrations/vip-governance.php index de9bdce570..d1bbd54a66 100644 --- a/integrations/vip-governance.php +++ b/integrations/vip-governance.php @@ -55,9 +55,4 @@ public function load(): void { } } ); } - - /** - * Configure `VIP Governance` for VIP Platform. - */ - public function configure(): void {} } diff --git a/package-lock.json b/package-lock.json index 125a472440..a5a8a3de0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5415,13 +5415,13 @@ } }, "node_modules/@wordpress/api-fetch": { - "version": "6.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.39.0.tgz", - "integrity": "sha512-G1OeBoIvyTsGieK2CIpZOJGh0rm5mf4rkT/LDlq633iXT5Hy9eo/DrSiWVSK6eUOahwWzHNG3kijRi0dEAl9kA==", + "version": "6.40.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.40.0.tgz", + "integrity": "sha512-sNk6vZW02ldci1EpNIjmm61323x/0n2Ra/cDHuehZf8avOH/OV0zF0dXxttT8M9Fncz+XZDSIHopm76dU3Phug==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.42.0", - "@wordpress/url": "^3.43.0" + "@wordpress/i18n": "^4.43.0", + "@wordpress/url": "^3.44.0" }, "engines": { "node": ">=12" @@ -5507,9 +5507,9 @@ } }, "node_modules/@wordpress/env": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.8.0.tgz", - "integrity": "sha512-GUo0bSdmrnxF/l9zIYXNeri+fZ76nxJguAKHhL+L6lS0mGBuj+WkbyJ4Ss/OnawnjZUgiLDGk/xO2zZmwcYnig==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.9.0.tgz", + "integrity": "sha512-f3W1OMcUubZVC4OH9MTG2XE2OWwZH3Y2pKgrXSXP7rUiiCCIknotbUKtq7vF9uoUOB+f5kF2zGRRCJBu7n8PYg==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -5727,9 +5727,9 @@ } }, "node_modules/@wordpress/hooks": { - "version": "3.42.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.42.0.tgz", - "integrity": "sha512-GUePaweJgINbOyeWDG1p0ffxKZXZIOJdkdSCG8oWoAohJPOYe8WeYl/nAsECiUjbIuVletQe1RoTGrNdNkFTdg==", + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.43.0.tgz", + "integrity": "sha512-SHSiyFUEsggihl0pDvY1l72q+fHMDyFHtIR3GCt0uV2ifctvoa/PIYdVwrxpGQaGdNEV25XCZ4kNldqJmfTddw==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -5738,12 +5738,12 @@ } }, "node_modules/@wordpress/i18n": { - "version": "4.42.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.42.0.tgz", - "integrity": "sha512-6cEcsVk9EX0c2azz0h1aAZqGjts+VrGMHzMB22GBIhsiz/TWAqkMapt1QF1YbsJ4/VR2CHnKlONjhHNtsHn8Ew==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.43.0.tgz", + "integrity": "sha512-XHU/vGgI+pgjJU9WzWDHke1u948z8i3OPpKUNdxc/gMcTkKaKM4D8DW1+VMSQHyU6pneP8+ph7EF+1RIehP3lQ==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.42.0", + "@wordpress/hooks": "^3.43.0", "gettext-parser": "^1.3.1", "memize": "^2.1.0", "sprintf-js": "^1.1.1", @@ -5802,9 +5802,9 @@ } }, "node_modules/@wordpress/url": { - "version": "3.43.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.43.0.tgz", - "integrity": "sha512-4Mh7qqP33+RpT90Opsv2qJqqn8Imonofv8IC5P+qnS9gAnozB5req/XF0VqIp1PMzPaylO1Yd8jX2YvtD+GX/Q==", + "version": "3.44.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.44.0.tgz", + "integrity": "sha512-QNtTPFg/cGHTJLOvOtQCvCgn5quFQgJml8A88I05o4dyUH/tc92rb8LNXi0qcVz/z4JPrx2g3+Ki8heYellP4A==", "dependencies": { "@babel/runtime": "^7.16.0", "remove-accents": "^0.5.0" @@ -20471,9 +20471,9 @@ } }, "node_modules/react-select": { - "version": "5.7.5", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.5.tgz", - "integrity": "sha512-jgYZa2xgKP0DVn5GZk7tZwbRx7kaVz1VqU41S8z1KWmshRDhlrpKS0w80aS1RaK5bVIXpttgSou7XCjWw1ncKA==", + "version": "5.7.7", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.7.tgz", + "integrity": "sha512-HhashZZJDRlfF/AKj0a0Lnfs3sRdw/46VJIRd8IbB9/Ovr74+ZIwkAdSBjSPXsFMG+u72c5xShqwLSKIJllzqw==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", diff --git a/prometheus-collectors/class-potential-multi-dataset-queries-collector.php b/prometheus-collectors/class-potential-multi-dataset-queries-collector.php index 5ce2bc172d..dee8e78bac 100644 --- a/prometheus-collectors/class-potential-multi-dataset-queries-collector.php +++ b/prometheus-collectors/class-potential-multi-dataset-queries-collector.php @@ -4,6 +4,7 @@ use Prometheus\Counter; use Prometheus\RegistryInterface; +use function Automattic\VIP\Logstash\log2logstash; class Potential_Multi_Dataset_Queries_Collector implements CollectorInterface { private Counter $potential_multi_dataset_queries_collector; @@ -49,6 +50,27 @@ public function sql_query_log( $query ): void { $blog_ids_count >= 3 ? '3+' : (string) $blog_ids_count, ] ); + + if ( ! function_exists( '\Automattic\VIP\Logstash\log2logstash' ) ) { + return; + } + + $backtrace = function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 4, false ) : []; // phpcs:ignore + \Automattic\VIP\Logstash\log2logstash( + [ + 'severity' => 'debug', + 'feature' => 'potential_multi_dataset_queries', + 'message' => 'Potential multi dataset query detected', + 'extra' => [ + 'uri' => isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( $_SERVER['REQUEST_URI'] ) : '', + 'http_method' => isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( $_SERVER['REQUEST_METHOD'] ) : '', + 'backtrace' => $backtrace, + 'last_global_table' => $last_global_table, + 'last_blog_table' => $last_blog_table, + 'blog_ids_count' => $blog_ids_count, + ], + ] + ); } } diff --git a/qm-plugins/qm-object-cache/html/class-qm-output-html-object-cache-group-stats.php b/qm-plugins/qm-object-cache/html/class-qm-output-html-object-cache-group-stats.php index 6566d50d73..bb5bd96443 100644 --- a/qm-plugins/qm-object-cache/html/class-qm-output-html-object-cache-group-stats.php +++ b/qm-plugins/qm-object-cache/html/class-qm-output-html-object-cache-group-stats.php @@ -89,9 +89,9 @@ public function output() { echo ''; $this->output_after_section(); } - - $this->after_non_tabular_output(); } + + $this->after_non_tabular_output(); } /** diff --git a/search/search-dev-tools/package-lock.json b/search/search-dev-tools/package-lock.json index aad5c30758..87ab322aa5 100644 --- a/search/search-dev-tools/package-lock.json +++ b/search/search-dev-tools/package-lock.json @@ -9052,9 +9052,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -9620,9 +9620,9 @@ "dev": true }, "node_modules/preact": { - "version": "10.18.0", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.0.tgz", - "integrity": "sha512-O4dGFmErPd3RNVDvXmCbOW6hetnve6vYtjx5qf51mCUmBS96s66MrNQkEII5UThDGoNF7953ptA+aNupiDxVeg==", + "version": "10.18.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.1.tgz", + "integrity": "sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -10302,9 +10302,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.68.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", - "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.0.tgz", + "integrity": "sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", diff --git a/tests/integrations/test-vip-block-data-api.php b/tests/integrations/test-vip-block-data-api.php index 5d32c50489..a417791298 100644 --- a/tests/integrations/test-vip-block-data-api.php +++ b/tests/integrations/test-vip-block-data-api.php @@ -22,7 +22,7 @@ public function test__load_call_returns_inactive_because_no_block_data_api_plugi $this->assertFalse( $block_data_api_integration->is_active() ); } - public function test__if_is_loaded_gives_back_true_when_loaded(): void { + public function test__if_is_loaded_gives_back_false_when_not_loaded(): void { $block_data_api_integration = new BlockDataApiIntegration( $this->slug ); $this->assertFalse( $block_data_api_integration->is_loaded() ); diff --git a/tests/integrations/test-vip-governance.php b/tests/integrations/test-vip-governance.php index ab1754ef63..e4669f3eed 100644 --- a/tests/integrations/test-vip-governance.php +++ b/tests/integrations/test-vip-governance.php @@ -22,7 +22,7 @@ public function test__load_call_returns_inactive_because_no_governance_plugin_lo $this->assertFalse( $vip_governance_integration->is_active() ); } - public function test__if_is_loaded_gives_back_true_when_loaded(): void { + public function test__if_is_loaded_gives_back_false_when_not_loaded(): void { $vip_governance_integration = new VipGovernanceIntegration( $this->slug ); $this->assertFalse( $vip_governance_integration->is_loaded() ); diff --git a/vip-helpers/vip-permastructs.php b/vip-helpers/vip-permastructs.php index c84b794a63..c8dcf26dc2 100644 --- a/vip-helpers/vip-permastructs.php +++ b/vip-helpers/vip-permastructs.php @@ -46,7 +46,7 @@ function wpcom_vip_load_category_base( $new_category_base ) { // For empty category base, remove the '/category/' from the base, but include the parent category if it's a child if ( '' === $new_category_base ) { add_filter( 'category_link', function ( $link, $term_id ) { - return '/' . get_category_parents( $term_id, false, '/', true ); + return home_url( '/' . get_category_parents( $term_id, false, '/', true ) ); }, 9, 2 ); } } diff --git a/vip-integrations.php b/vip-integrations.php index 0767948588..9549897878 100644 --- a/vip-integrations.php +++ b/vip-integrations.php @@ -12,27 +12,21 @@ namespace Automattic\VIP\Integrations; +// @codeCoverageIgnoreStart -- the actual code here is tested individually in the unit tests. defined( 'ABSPATH' ) || die(); -// @codeCoverageIgnoreStart - the actual code here is tested individually in the unit tests. - require_once __DIR__ . '/integrations/integration.php'; require_once __DIR__ . '/integrations/integrations.php'; require_once __DIR__ . '/integrations/enums.php'; require_once __DIR__ . '/integrations/integration-vip-config.php'; require_once __DIR__ . '/integrations/block-data-api.php'; require_once __DIR__ . '/integrations/parsely.php'; +require_once __DIR__ . '/integrations/vip-governance.php'; // Register VIP integrations here. IntegrationsSingleton::instance()->register( new BlockDataApiIntegration( 'block-data-api' ) ); IntegrationsSingleton::instance()->register( new ParselyIntegration( 'parsely' ) ); - -// ToDo: Remove this after the initial deployment of the VIP Governance integration. -if ( file_exists( __DIR__ . '/integrations/vip-governance.php' ) ) { - require_once __DIR__ . '/integrations/vip-governance.php'; - IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) ); -} - +IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) ); // @codeCoverageIgnoreEnd /**