diff --git a/plugins/optimization-detective/.wordpress-org/banner-1544x500.png b/plugins/optimization-detective/.wordpress-org/banner-1544x500.png new file mode 100644 index 000000000..e1dadc6c3 Binary files /dev/null and b/plugins/optimization-detective/.wordpress-org/banner-1544x500.png differ diff --git a/plugins/optimization-detective/.wordpress-org/banner-772x250.png b/plugins/optimization-detective/.wordpress-org/banner-772x250.png new file mode 100644 index 000000000..4403d68d4 Binary files /dev/null and b/plugins/optimization-detective/.wordpress-org/banner-772x250.png differ diff --git a/plugins/optimization-detective/.wordpress-org/icon-128x128.png b/plugins/optimization-detective/.wordpress-org/icon-128x128.png new file mode 100644 index 000000000..0ebef0621 Binary files /dev/null and b/plugins/optimization-detective/.wordpress-org/icon-128x128.png differ diff --git a/plugins/optimization-detective/.wordpress-org/icon-256x256.png b/plugins/optimization-detective/.wordpress-org/icon-256x256.png new file mode 100644 index 000000000..7f47fbb07 Binary files /dev/null and b/plugins/optimization-detective/.wordpress-org/icon-256x256.png differ diff --git a/plugins/optimization-detective/.wordpress-org/icon.svg b/plugins/optimization-detective/.wordpress-org/icon.svg new file mode 100644 index 000000000..3860eb67c --- /dev/null +++ b/plugins/optimization-detective/.wordpress-org/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/optimization-detective/helper.php b/plugins/optimization-detective/helper.php new file mode 100644 index 000000000..589baaf2e --- /dev/null +++ b/plugins/optimization-detective/helper.php @@ -0,0 +1,22 @@ +' . "\n"; +} diff --git a/plugins/optimization-detective/hooks.php b/plugins/optimization-detective/hooks.php index 829dcc4ac..6b6feb924 100644 --- a/plugins/optimization-detective/hooks.php +++ b/plugins/optimization-detective/hooks.php @@ -13,3 +13,4 @@ add_filter( 'template_include', 'od_buffer_output', PHP_INT_MAX ); OD_URL_Metrics_Post_Type::add_hooks(); add_action( 'wp', 'od_maybe_add_template_output_buffer_filter' ); +add_action( 'wp_head', 'od_render_generator_meta_tag' ); diff --git a/plugins/optimization-detective/load.php b/plugins/optimization-detective/load.php index 8615f6064..809d6b230 100644 --- a/plugins/optimization-detective/load.php +++ b/plugins/optimization-detective/load.php @@ -2,7 +2,7 @@ /** * Plugin Name: Optimization Detective * Plugin URI: https://github.com/WordPress/performance/issues/869 - * Description: Improves accuracy of optimizing the loading of the LCP image by leveraging client-side detection with real user metrics. Also enables output buffering of template rendering which can be filtered. + * Description: Uses real user metrics to improve heuristics WordPress applies on the frontend to improve image loading priority. * Requires at least: 6.3 * Requires PHP: 7.0 * Version: 0.1.0 @@ -27,6 +27,8 @@ define( 'OPTIMIZATION_DETECTIVE_VERSION', '0.1.0' ); +require_once __DIR__ . '/helper.php'; + // Core infrastructure classes. require_once __DIR__ . '/class-od-data-validation-exception.php'; require_once __DIR__ . '/class-od-url-metric.php'; diff --git a/plugins/optimization-detective/readme.txt b/plugins/optimization-detective/readme.txt index a4ddcd87b..32f34d3b4 100644 --- a/plugins/optimization-detective/readme.txt +++ b/plugins/optimization-detective/readme.txt @@ -9,11 +9,11 @@ License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, images -Improves accuracy of optimizing the loading of the LCP image by leveraging client-side detection with real user metrics. +Uses real user metrics to improve heuristics WordPress applies on the frontend to improve image loading priority. == Description == -Improves accuracy of optimizing the loading of the LCP image by leveraging client-side detection with real user metrics. For more information, see the [overview issue](https://github.com/WordPress/performance/issues/869) on GitHub. +This plugin uses real user metrics to improve heuristics WordPress applies on the frontend to improve image loading priority For more information, see the [overview issue](https://github.com/WordPress/performance/issues/869) on GitHub. == Installation == @@ -45,6 +45,8 @@ To report a security issue, please visit the [WordPress HackerOne](https://hacke Contributions are always welcome! Learn more about how to get involved in the [Core Performance Team Handbook](https://make.wordpress.org/performance/handbook/get-involved/). +The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plugins/optimization-detective) is located in the [WordPress/performance](https://github.com/WordPress/performance) repo on GitHub. + == Changelog == = 0.1.0 = diff --git a/tests/plugins/optimization-detective/helper-tests.php b/tests/plugins/optimization-detective/helper-tests.php new file mode 100644 index 000000000..b84d9d33b --- /dev/null +++ b/tests/plugins/optimization-detective/helper-tests.php @@ -0,0 +1,21 @@ +assertStringStartsWith( 'assertStringContainsString( 'generator', $tag ); + $this->assertStringContainsString( 'Optimization Detective ' . OPTIMIZATION_DETECTIVE_VERSION, $tag ); + } +} diff --git a/tests/plugins/optimization-detective/hooks-tests.php b/tests/plugins/optimization-detective/hooks-tests.php index 95b20bea0..f19541e8b 100644 --- a/tests/plugins/optimization-detective/hooks-tests.php +++ b/tests/plugins/optimization-detective/hooks-tests.php @@ -25,5 +25,6 @@ public function test_hooks_added() { ) ) ); + $this->assertEquals( 10, has_action( 'wp_head', 'od_render_generator_meta_tag' ) ); } }