Skip to content

Incorrect utilization of WP_PLUGIN_DIR in CSF_Setup::constants #186

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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