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

Remove noncompulsory plugin headers #5491

Merged
merged 2 commits into from
Oct 10, 2020
Merged

Conversation

pierlon
Copy link
Contributor

@pierlon pierlon commented Oct 9, 2020

Summary

Since we're not bundling our own translations, I think we can remove the "Domain Path" header. And as stated in the WP handbook:

The Domain Path header can be omitted if the plugin is in the official WordPress Plugin Directory.

Also it seems we can remove the "Text Domain" header. As stated by the handbook:

Since WordPress 4.6 the Text Domain header is optional because it must be the same as the plugin slug. There is no harm in including it, but it is not required.

This is confirmed by the following condition in Core:

        // If no text domain is defined fall back to the plugin slug.
	if ( ! $plugin_data['TextDomain'] ) {
		$plugin_slug = dirname( plugin_basename( $plugin_file ) );
		if ( '.' !== $plugin_slug && false === strpos( $plugin_slug, '/' ) ) {
			$plugin_data['TextDomain'] = $plugin_slug;
		}
	}

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • 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).

@pierlon pierlon added the WS:Core Work stream for Plugin core label Oct 9, 2020
@pierlon pierlon added this to the v2.0.5 milestone Oct 9, 2020
@pierlon pierlon self-assigned this Oct 9, 2020
@google-cla google-cla bot added the cla: yes Signed the Google CLA label Oct 9, 2020
@pierlon
Copy link
Contributor Author

pierlon commented Oct 9, 2020

I'm also wondering if there would be any harm in removing the Text Domain header. As stated by the handbook:

Since WordPress 4.6 the Text Domain header is optional because it must be the same as the plugin slug. There is no harm in including it, but it is not required.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2020

Plugin builds for 82eb5d0 are ready 🛎️!

@westonruter
Copy link
Member

I'm also wondering if there would be any harm in removing the Text Domain header.

Sure, let's remove it.

@westonruter westonruter requested a review from swissspidy October 9, 2020 20:43
@pierlon pierlon changed the title Remove the "Domain Path" plugin header Remove noncompulsory plugin headers Oct 9, 2020
@westonruter
Copy link
Member

Rebasing onto develop to fix build.

@westonruter westonruter force-pushed the remove-domain-path-header branch from 82aa380 to 82eb5d0 Compare October 10, 2020 18:56
@westonruter westonruter merged commit b37b1ee into develop Oct 10, 2020
@westonruter westonruter deleted the remove-domain-path-header branch October 10, 2020 19:25
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Oct 14, 2020
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. cla: yes Signed the Google CLA WS:Core Work stream for Plugin core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants