Skip to content

Enforce .php file extension if approved #2292

@GaryJones

Description

@GaryJones

Is your feature request related to a problem?

(Follow-up to #2164)

There may be some assumptions in WordPress core, standards packages for WP, or elsewhere, that PHP files used for WP core, plugins and themes will always have a three-letter file extension (.php). But, it's possible for servers to treat other extensions (.php3, myphp, etc.) also as PHP. A plugin that uses, .php3 file extensions, for instance, may not work (and may render secrets in plain text) so for compatibility reasons, it should be agreed and checkable that only .php extensions are used for PHP files.

As this is not a (handbook) rule, this would need a post on Make to decide whether that rule should be added or not. But if approved, this would need a check in WPCS to enforce.

Describe the solution you'd like

Check that a filename for a PHP file has a .php extension.

Additional context (optional)

If agreed, I would also suggest adding a note to https://make.wordpress.org/hosting/handbook/server-environment/ to confirm to server hosts about which file extensions are needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions