Support » Plugin: Centrora WordPress Security™ » Relative paths for abnormal file structure & multisite

  • Resolved scottnath


    Hi osexcel,

    We’ve created a script which allows us to have a second plugin directory for some various business reasons. Because of that the paths/urls which plugins use matter. We tend to see that these paths matter for multi-site setups as well.

    When we tried to use OSE Firewall™ in our second plugin directory we found that the paths it created broke our setup. We also found a bug where you used “$filename” when you should have used “$langfile” on line 14.

    I made changes to the main plugin file. I fixed the bug and made all the require() paths relative instead. Please let me know if these are changes you could incorporate.

    I have put my changes into a GIST file here:


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author osexcel


    Thanks Scott, issue fixed in version 1.5.1. 😉



    Hi osexcel,

    Sorry, that didn’t fix it.

    There are two issues that need to be addressed. Path and URL

    To fix the path issue:

    In ose_wordpress_firewall.php, line 11 reads:

    define('OSEFWDIR', WP_PLUGIN_DIR.DS.dirname( plugin_basename( __FILE__ ) ) );

    It should read:

    define('OSEFWDIR', plugin_dir_path(__FILE__) );


    To fix the URL issue:

    1) Remove line #7 from define.php:

    define('OSEFWURL',rtrim(site_url(), '/') . '/wp-content/plugins/ose-firewall');

    and place it in ose_wordpress_firewall.php like this:


    2) Change line #36 in osewphelper.php to this:

    $this->osefwurl = OSEFWURL;



    These changes are needed even if someone isn’t using a second plugin folder or multisite. You have hard-coded the name of the wp-content folder into your code, yet a user might have a different file structure set up by changing the default content folder. See this article:

    Hope this helps and that these changes can be implemented.


    Plugin Author osexcel


    Thanks Scott, implemented the codes and updated to 1.5.3, thank you for your suggestions, please try version 1.5.3 and see how it goes.

    However, for the OSEFWURL, it should be


    and not


    Otherwise the images and css will not work. 😉



    Thanks for the fix. Totally works in our multi-plugin configuration. Thanks for the update!


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Relative paths for abnormal file structure & multisite’ is closed to new replies.