Hey Fgerneth,
Thanks for reporting this! I’ve notified the developer.
Thanks,
Gerroald
Hi fgerneth,
I actually use this method myself in my own multi-sites without issue. Can I please ask you to make sure you’ve set both WP_CONTENT_URL and WP_CONTENT_DIR in your wp-config.php?
Hi Chris,
yes they are both set:
define('WP_CONTENT_DIR', ABSPATH . 'assets');
define('WP_CONTENT_URL', 'http://domain.dev/assets');
Hi fgerneth,
You’re setting these in wp-config.php, correct? In this case ABSPATH would be pointing to a directory in your WordPress main file. That might be right but it looks like you might have moved it out of there (something like how https://github.com/markjaquith/WordPress-Skeleton is setup). Can you please confirm which is the case?
Hi Chris,
let me provide some more debug information for you.
In the wp-config.php we have defined these additional constants regarding the plugin directory:
define('WP_PLUGIN_DIR', ABSPATH . 'modules');
define('WP_PLUGIN_URL', 'http://domain.dev/modules');
define('PLUGINDIR', 'modules');
Using a debugger, the value of the variables in a certain line of the init.php file are:
Line 15: $content_dir: {wordpress_root}/assets
Line 16: $dir: {wordpress_root}/modules/better-wp-security/lib/icon-fonts
Line 21: $url: http://domain.dev/{site_path}/modules/better-wp-security/lib/icon-fonts
Line 37: $url: https://domain.dev/{site_path}/modules/better-wp-security/lib/icon-fonts
Apparently, the path to the modules (former plugins) directory, should not contain the {site_path} sub-directory in the URL.
If you need any further information, I’ll do my best to provide these as well. Unfortunately, I can’t provide access to the site directly.
That helps thanks. This is a library common to all iThemes plugins and themes so it isn’t specific to just ITSEC (or we would use plugins_dir). That said, let me see if I can’t break this down.
Mind emailing me at chrisw [at] themes [dot] com directly?
Hi Chris,
please let me know if you have received my email. Had some troubles sending it.
Thanks
This still seems to be a problem on V4.6.4 . There’s a code path which leaves $url unset in lib/icon-fonts/init.php .
Specifically if the plugin is symlinked at all then the manual checks for path matching don’t work. (See here). I’ve rectified this by adding the following line near the top of the function, immediately after setting “abspath”:
$url = plugins_url( '', __FILE__ );
This provides a default of whatever WordPress thinks the URL should be, but still leaves the custom tinkering in place.