-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Bug] TextDomainMismatch
if checking a plugin via path
#774
Comments
TextDomainMismatch
if checking a plugin via path
Another issue: Due to the fact that my path happens to begin with |
I‘d suggest moving your folder to a different location. That just asks for trouble. If a plugin is in wp-content/plugins we expect to jusf pass the slug. But nested plugins are not really a scenario we support in Plugin Check nor in the plugin directory. Have you tried moving it to wp-content/plugins directly? That would be the best solution. This way we can also actuvate the plugin during runtime checks. Have you tried moving it to a tmp folder? Alternatively, have you tried |
That's a chicken-and-egg problem. I already have the development version of my plugin under the ...I have just both your other suggestions. In all of them, I'm getting errors with the text domain. This is my script now: {
"npx wp-env run cli wp plugin install plugin-check --activate",
"npx wp-env run cli mv wp-content/plugins/my-plugin/my-plugin my-plugin",
"npx wp-env run cli wp plugin check ./my-plugin"
} The errors:
Same with a tmp folder:
...so there is definitely something I'm missing. I found the |
...OMG I think I have it! Passing the {
"plugin:check": [
"composer scoped:create",
"npx wp-env run cli wp plugin install plugin-check --activate",
"SLUG=$(basename \"$(pwd)\"); npx wp-env run cli wp plugin check wp-content/plugins/$SLUG/$SLUG --slug=$SLUG"
],
} This works because in my setup I
I found the elegant trick with |
AFAIR, relative path is not supported. Full absolute path is expected.
|
@ernilambar you guys are just too quick for me |
I just tested this statement. It doesn't work with absolute paths: {
"plugin:check": [
"composer scoped:create",
"npx wp-env run cli wp plugin install plugin-check --activate",
"SLUG=$(basename \"$(pwd)\"); npx wp-env run cli wp plugin check /var/www/html/wp-content/plugins/$SLUG/$SLUG"
],
} The expected text domain becomes the full path: |
Hmm. Makes sense. That support for path was implemented keeping in mind that plugin will be outside of the WordPress setup, somewhere in the same server. |
It also doesn't work if the plugin is in /tmp/my-plugin. Outside of WP. I would consider this a bug, after all 🐛 |
I tried |
Yes! With the This won't work:
|
Yes, the best approach is to enforce language checks by giving the slug. Anyway, I think we should check that command, as it should run with slug as |
Agreed, this is a bug. |
Expected behavior
When running
wp plugin check path/to/my-plugin
, the checked text domain should bemy-plugin
Actual behavior
When running
wp plugin check path/to/my-plugin
, the checked text domain actually is the full path:wp plugin check path/to/my-plugin
Context
After the explanation in #773 that a local zip file is not supported yet, I now tried to check my plugin via path:
./my-plugin/my-plugin
The plugin check works this time, except for one issue: The expected text domain contains the full path
wp-content/plugins/my-plugin/my-plugin
instead of simplymy-plugin
, which produces a lot ofWordPress.WP.I18n.TextDomainMismatch
errors.The text was updated successfully, but these errors were encountered: