Skip to content
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

Incorrect utilization of WP_PLUGIN_DIR in CSF_Setup::constants #186

Open
rfair404 opened this issue Apr 1, 2024 · 0 comments
Open

Incorrect utilization of WP_PLUGIN_DIR in CSF_Setup::constants #186

rfair404 opened this issue Apr 1, 2024 · 0 comments

Comments

@rfair404
Copy link

rfair404 commented Apr 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant