Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ For WordPress and PHP version requirements, please refer to the [CONTRIBUTING.md

The feature plugins which are currently highlighted by this plugin are:

Plugin | Slug | Experimental | Links
--------------------------------|---------------------------|--------------|-------------
[Embed Optimizer][5] | `embed-optimizer` | No | [Source][13], [Issues][21], [PRs][29]
[Enhanced Responsive Images][6] | `auto-sizes` | No | [Source][14], [Issues][22], [PRs][30]
[Image Placeholders][1] | `dominant-color-images` | No | [Source][9], [Issues][17], [PRs][25]
[Image Prioritizer][7] | `image-prioritizer` | No | [Source][15], [Issues][23], [PRs][31]
[Instant Back/Forward][41] | `nocache-bfcache` | No | [Source][42], [Issues][43], [PRs][44]
[Modern Image Formats][2] | `webp-uploads` | No | [Source][10], [Issues][18], [PRs][26]
[Optimization Detective][33] | `optimization-detective` | No | [Source][34], [Issues][35], [PRs][36]
[Performant Translations][3] | `performant-translations` | No | [Source][11], [Issues][19], [PRs][27]
[Speculative Loading][4] | `speculation-rules` | No | [Source][12], [Issues][20], [PRs][28]
[View Transitions][37] | `view-transitions` | Yes | [Source][38], [Issues][39], [PRs][40]
[Web Worker Offloading][8] | `web-worker-offloading` | Yes | [Source][16], [Issues][24], [PRs][32]
Plugin | Slug | Experimental | Links
--------------------------------|---------------------------|------------------------|-------------
[Embed Optimizer][5] | `embed-optimizer` | No | [Source][13], [Issues][21], [PRs][29]
[Enhanced Responsive Images][6] | `auto-sizes` | No | [Source][14], [Issues][22], [PRs][30]
[Image Placeholders][1] | `dominant-color-images` | No | [Source][9], [Issues][17], [PRs][25]
[Image Prioritizer][7] | `image-prioritizer` | No | [Source][15], [Issues][23], [PRs][31]
[Instant Back/Forward][41] | `nocache-bfcache` | No | [Source][42], [Issues][43], [PRs][44]
[Modern Image Formats][2] | `webp-uploads` | No | [Source][10], [Issues][18], [PRs][26]
[Optimization Detective][33] | `optimization-detective` | No | [Source][34], [Issues][35], [PRs][36]
[Performant Translations][3] | `performant-translations` | No | [Source][11], [Issues][19], [PRs][27]
[Speculative Loading][4] | `speculation-rules` | No | [Source][12], [Issues][20], [PRs][28]
[View Transitions][37] | `view-transitions` | Yes | [Source][38], [Issues][39], [PRs][40]
[Web Worker Offloading][8] | `web-worker-offloading` | Yes ([sunsetting][45]) | [Source][16], [Issues][24], [PRs][32]

[1]: https://wordpress.org/plugins/dominant-color-images/
[2]: https://wordpress.org/plugins/webp-uploads/
Expand Down Expand Up @@ -73,4 +73,6 @@ Plugin | Slug | Experimental | Lin
[40]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+View%20Transitions%22
[44]: https://github.com/westonruter/nocache-bfcache/pulls

[45]: https://github.com/WordPress/performance/issues/2284

Note that the plugin names sometimes diverge from the plugin slugs due to scope changes. For example, a plugin's purpose may change as some of its features are merged into WordPress core.
4 changes: 0 additions & 4 deletions plugins/performance-lab/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function perflab_get_standalone_plugin_data(): array {
'constant' => 'VIEW_TRANSITIONS_VERSION',
'experimental' => true,
),
'web-worker-offloading' => array(
'constant' => 'WEB_WORKER_OFFLOADING_VERSION',
'experimental' => true,
),
'webp-uploads' => array(
'constant' => 'WEBP_UPLOADS_VERSION',
),
Expand Down
1 change: 0 additions & 1 deletion plugins/performance-lab/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ The feature plugins which are currently featured by this plugin are:
* [Performant Translations](https://wordpress.org/plugins/performant-translations/)
* [Speculative Loading](https://wordpress.org/plugins/speculation-rules/)
* [View Transitions](https://wordpress.org/plugins/view-transitions/) _(experimental)_
* [Web Worker Offloading](https://wordpress.org/plugins/web-worker-offloading/) _(experimental)_

These plugins can also be installed separately from installing Performance Lab, but having the Performance Lab plugin also active will ensure you find out about new performance features as they are developed.

Expand Down
30 changes: 30 additions & 0 deletions plugins/web-worker-offloading/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,33 @@ function plwwo_render_generator_meta_tag(): void {
// Use the plugin slug as it is immutable.
echo '<meta name="generator" content="web-worker-offloading ' . esc_attr( WEB_WORKER_OFFLOADING_VERSION ) . '">' . "\n";
}

/**
* Displays a sunset warning notice for the plugin in the plugin row meta.
*
* @since n.e.x.t
* @access private
*
* @param string $plugin_file Path to the plugin file relative to the plugins directory.
*/
function plwwo_render_sunset_notice( string $plugin_file ): void {
if ( 'web-worker-offloading/load.php' !== $plugin_file ) {
return;
}

$message = sprintf(
/* translators: 1: GitHub issue URL. 2: Support forum URL. */
__( 'The Web Worker Offloading plugin is proposed for being sunset. Please refer to the <a href="%1$s" target="_blank" rel="noopener">GitHub issue</a> for more information. If you have metrics showing how this plugin specifically improved your Interaction to Next Paint (INP), please share them in the <a href="%2$s" target="_blank" rel="noopener">support forum</a> as this could provide a reason to keep the plugin.', 'web-worker-offloading' ),
esc_url( 'https://github.com/WordPress/performance/issues/2284' ),
esc_url( 'https://wordpress.org/support/plugin/web-worker-offloading/' )
);
?>
<div class="notice inline notice-warning notice-alt">
<p>
<?php
echo wp_kses_post( $message );
?>
</p>
</div>
<?php
}
1 change: 1 addition & 0 deletions plugins/web-worker-offloading/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
add_filter( 'script_loader_tag', 'plwwo_update_script_type', 10, 2 );
add_filter( 'wp_inline_script_attributes', 'plwwo_filter_inline_script_attributes' );
add_action( 'wp_head', 'plwwo_render_generator_meta_tag' );
add_action( 'after_plugin_row_meta', 'plwwo_render_sunset_notice' );
// @codeCoverageIgnoreEnd
29 changes: 29 additions & 0 deletions plugins/web-worker-offloading/tests/test-web-worker-offloading.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,33 @@ public function test_plwwo_load_third_party_integrations(): void {
$this->assertFalse( function_exists( 'plwwo_rank_math_configure' ) );
$this->assertFalse( function_exists( 'plwwo_woocommerce_configure' ) );
}

/**
* Test the sunset notice hook.
*
* @covers ::plwwo_render_sunset_notice
*/
public function test_plwwo_render_sunset_notice_hook(): void {
$this->assertEquals( 10, has_action( 'after_plugin_row_meta', 'plwwo_render_sunset_notice' ) );
}

/**
* Test rendering the sunset notice.
*
* @covers ::plwwo_render_sunset_notice
*/
public function test_plwwo_render_sunset_notice_rendering(): void {
$plugin_file = 'web-worker-offloading/load.php';

$output = get_echo( 'plwwo_render_sunset_notice', array( $plugin_file ) );

$this->assertStringContainsString( 'notice-warning', $output );
$this->assertStringContainsString( 'The Web Worker Offloading plugin is proposed for being sunset.', $output );
$this->assertStringContainsString( 'Interaction to Next Paint (INP)', $output );
$this->assertStringContainsString( 'https://wordpress.org/support/plugin/web-worker-offloading/', $output );

// Test with different plugin file.
$output = get_echo( 'plwwo_render_sunset_notice', array( 'other-plugin/load.php' ) );
$this->assertEmpty( $output );
}
}
Loading