Media: Remove obsolete Flash fallback message from MediaElement l10n strings - #12727
Media: Remove obsolete Flash fallback message from MediaElement l10n strings#12727irozum wants to merge 2 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR removes an obsolete Flash fallback localization string from the MediaElement.js mejsL10n object registered in wp_default_scripts(), and adds a PHPUnit test to ensure the string is no longer present in the inline script data for mediaelement-core.
Changes:
- Removed the
mejs.install-flashlocalized string from themejsL10n['strings']array inwp_default_scripts(). - Added a PHPUnit test asserting the
mejs.install-flashkey is absent while other MediaElement strings remain present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/wp-includes/script-loader.php |
Removes the obsolete Flash-related MediaElement localization string from the inline mejsL10n data. |
tests/phpunit/tests/dependencies/scripts.php |
Adds a regression test to ensure mejs.install-flash is not included in the localized inline script for mediaelement-core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| $inline_script = implode( '', (array) $wp_scripts->get_data( 'mediaelement-core', 'before' ) ); | ||
|
|
||
| $this->assertStringNotContainsString( 'mejs.install-flash', $inline_script ); | ||
| $this->assertStringContainsString( 'mejs.play', $inline_script ); |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| * | ||
| * @covers ::wp_default_scripts | ||
| */ | ||
| public function test_mediaelement_l10n_does_not_include_flash_message() { |
There was a problem hiding this comment.
IMO, we don't need to add a test for this.
Removes the obsolete
mejs.install-flashlocalized string from the MediaElement.jsmejsL10nobject registered inwp_default_scripts(). This message told users to install/enable Adobe Flash Player, but Adobe ended support for Flash Player on December 31, 2020 and WordPress's MediaElement configuration never produces the SWF-based renderer that would trigger this message, so it can never actually be shown to a visitor. Removing it drops dead translated content from every page that enqueuesmediaelement-core.Added a PHPUnit test (
Tests_Dependencies_Scripts::test_mediaelement_l10n_does_not_include_flash_message) asserting the inlinemejsL10nscript data registered formediaelement-coreno longer includes themejs.install-flashkey, while confirming sibling strings such asmejs.playare still present.Trac ticket: https://core.trac.wordpress.org/ticket/65737
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Implementation, tests, and PR description. Reviewed by Igor Rozum.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.