Skip to content

Incorrect utilization of WP_PLUGIN_DIR in CSF_Setup::constantsΒ #186

@rfair404

Description

@rfair404

The code that "detects" if the framework has been included in a plugin, or a theme doesn't properly detect the plugin path when WP's real path is different from the CONTENT_DIR_URL. Plugins should not use WP_PLUGIN_DIR.

At very minimum, the framework should provide a filter, which would allow a developer to over-ride this logic, or better, find a suitable manner of detecting if the file resides within a theme or a plug-in (and getting it's path) without simply comparing the path of the file to the plugins path.

a solution more like:

$plugin_dir     = str_replace( '//', '/', wp_normalize_path( plugin_dir_path( dirname( dirname( self::$file ) ) ) ) );

would be better suited.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions