Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation error source attribution for script translations and wp_editor() #6670

Merged
merged 14 commits into from
Nov 10, 2021

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Oct 29, 2021

Summary

Given a site in Transitional mode, with the and the bbPress plugin active there being an “Interesting Stuff” forum created, as well as an “Enqueue Foo” plugin active that does the following:

<?php
/**
 * Plugin Name: Enqueue Foo
 */

add_action(
	'wp_enqueue_scripts',
	function () {
		wp_register_script( 'bar', plugin_dir_url( __FILE__ ) . 'bar.js', [], false, true );
		wp_set_script_translations( 'bar', 'bar' );

		wp_enqueue_script( 'foo', plugin_dir_url( __FILE__ ) . 'foo.js', [ 'bar' ], false, true );
		wp_set_script_translations( 'foo', 'foo' );
	}
);

Attempting to validate a singular forum page at /forums/forum/interesting-stuff/amp/ results in the following difference with this PR:

Before After
image image

Instead of scripts being unexpectedly attributed to wp-includes:

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@westonruter westonruter added this to the v2.2 milestone Oct 29, 2021
@westonruter westonruter force-pushed the improve/error-attribution branch 3 times, most recently from f751842 to 17d6f3d Compare November 1, 2021 23:03
@westonruter westonruter marked this pull request as ready for review November 1, 2021 23:09
@westonruter
Copy link
Member Author

Note any E2E test failures do not seem related to changes on this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2021

Plugin builds for 9434454 are ready 🛎️!

@westonruter
Copy link
Member Author

Rebasing against develop since no one else has pushed commits onto this branch.

@dhaval-parekh
Copy link
Collaborator

Changes in PR looks good to me 👍

@westonruter westonruter force-pushed the improve/error-attribution branch from 89e2aa6 to 9434454 Compare November 10, 2021 19:18
@westonruter westonruter merged commit fddfd0b into develop Nov 10, 2021
@westonruter westonruter deleted the improve/error-attribution branch November 10, 2021 19:25
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Site scanner Inconsistencies. Script translations lack source attribution
2 participants