Skip to content

Single file plugin text domain check yields mixed and incorrect expected strings #745

Open
@ironprogrammer

Description

@ironprogrammer

For a single file plugin with a text domain set, the WordPress.WP.I18n.TextDomainMismatch check relies on a plugin directory slug (non-existent in this context) and shows different results between the UI and CLI. It has been suggested that this check be bypassed for single-file plugins (hat tip @ernilambar).

To test this, I added the hello-dolly text domain to the hello.php plugin that ships with WP core (required to avoid an error with the WordPress.WP.I18n.MissingArgDomain check):

__( 'Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly' ),

Running PCP, the admin shows
Mismatched text domain. Expected 'plugins' but got 'hello-dolly'.
whereas the CLI returns
Mismatched text domain. Expected 'hello.php' but got 'hello-dolly'.

Originally reported at #713 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions