#5358
new
enhancement
Warn on plugin upload if text domain and plugin slug don't match
|
|
|
|
---|---|---|---|
|
|
|
|
|
|
|
|
|
Description
The text domain must match the
slug of the plugin. If your plugin is a single file called
my-plugin.php or it is contained in a folder called
my-plugin the domain name must be
my-plugin . If your plugin is hosted on wordpress.org it must be the slug portion of your plugin URL (
wordpress.org/plugins/<slug> ).
Change History (7)
#1
@
4 years ago
#2
@
4 years ago
The 'easy' part of that is checking if the text domain is properly declared in the header.
The hard part is that a number of people ... don't. At least not on submission.
#3
@
4 years ago
Probably because it's no longer required as of WordPress 4.6
- Plugin Name: Cookie Notice and Consent Banner - Version: 1.6.1 - Text Domain: cncb ERROR: Your plugin slug is cookie-notice-and-consent-banner, but your Text Domain is set as cncb. As the "Requires at least" is at least 4.6, you could remove the Text Domain tag, but you still need to modify the text domain in all your source files. Make sure it is equal to your plugin slug.
#4
@
4 years ago
#5
follow-up:
↓ 6
@
4 years ago
It's worth noting that Plugin authors do not know their plugin slug prior to being approved in the plugin directory, and the plugin slug can be changed/updated/etc by the plugins team prior to approval.
Perhaps this is something that needs to be spelt out in the approval email? "Here's what you need to do, to play nicely with WordPress.org & Translations"
#6
in reply to: ↑ 5
@
4 years ago
They kind of do, but yeah. It's on the FAQ on that page (I know, no one reads)
By adding a check on plugin upload if text domain and plugin slug don't match, with a link to the handbook article above, we can hopefully reduce the confusion a bit.