• Resolved crewstyle

    (@crewstyle)


    Hi there,

    There is a bug in the framework/extensions-manager.php which breaks my website.
    Here is the stack:

    Warning: is_readable(): open_basedir restriction in effect. File(/config.php) is not within the allowed path(s): (...) in in .../plugins/blocksy-companion/framework/extensions-manager.php (line 464)

    In some cases, the $filepath variable is NULL. Same case on line 448 with the $path variable.

    Could you please fix it?

    Thanks a lot
    Achraf

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Creative Themes

    (@creativethemeshq)

    Hi @crewstyle,

    From the limited logs that you provided, it seems that you have an unusual structure in your wp-content/plugins directory.
    Can you please provide more details on that?

    Also, if you could output the contents of the BLOCKSY_PATH constant and provide here the full path of it, it’d help us to debug this problem.

    The logic that the extensions-manager follows, is to look in every directory from BLOCKSY_PATH . 'framework/extensions' and look for the config.php file. When found, it’ll be loaded.
    It seems like your folder structure prevents this process in some way.

    Looking forward to your reply so that we can get this fixed!

    Thread Starter crewstyle

    (@crewstyle)

    Hi 👋

    I’m sorry I didn’t see your response and I’m still facing this issue.
    To add some more details, I use Blocksy in a multisite WP configuration, with subdomains. And I try to access to extensions tab.

    Here is the output of the BLOCKSY_PATH constant:
    /home/(...)/web/statics/plugins/blocksy-companion/

    My website uses GetOlympus framework to work. Which means:
    – the webroot folder is web/
    – the wp-content folder’s name is statics
    – and all the default WP constants are defined thanks to the framework

    It seems BLOCKSY_PATH has a good value.
    If you need some more details, tell me.

    Right now, from the file blocksy-companion/framework/extensions-manager.php, my fix is to change (line 448):
    if (is_readable($path . '/readme.php')) {
    Into:
    if (!is_null($path) && is_readable($path . '/readme.php')) {

    And (line 464):
    if (is_readable($file_path . '/config.php')) {
    Into:
    if (!is_null($file_path) && is_readable($file_path . '/config.php')) {

    Can you check please?

    Thanks
    Achraf

    Plugin Author Creative Themes

    (@creativethemeshq)

    Hi Achraf,

    Thanks a lot for the research that you’ve done.

    If BLOCKSY_PATH has a good value, then, most likely, the read_installed_extensions() method gets a null from somewhere. Can you please post here the output of glob($single_path . '/*', GLOB_ONLYDIR) from this method? We will see which of the returned values cause the issue with trying to read the config.php file of the extension.

    I’m thinking there is a small miss (like an empty directory or an unusual file) in your filesystem that is breaking the extensions discovery mechanism that we use.

    If you could dig a little deeper in this direction and post your findings, that would be great.
    Of course we can just blindly add the is_null() check, this is not hard, but first we want to understand the situation that we are dealing with.

    Also, besides that, could you please reach out at hq at creativethemes dot com? We have a small proposal for a potential colaboration between us.

    Thanks and looking forward to hear from you soon.

    Thread Starter crewstyle

    (@crewstyle)

    Hi team,

    Here is the output of the $all_extensions var:

    
    array(5) {
      [0]=>
      string(109) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/cookies-consent"
      [1]=>
      string(114) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/newsletter-subscribe"
      [2]=>
      string(109) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/product-reviews"
      [3]=>
      string(102) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/trending"
      [4]=>
      string(101) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/widgets"
    }
    

    By the way, I’ll send you a mail today.

    Bye 🙂

    Plugin Author Creative Themes

    (@creativethemeshq)

    @crewstyle thanks for the reply. That one has a good value too… Very strange…

    Is the Olympus framework that you mentioned public? How can we test it on our end?
    Or, if you could do a minimal setup in LocalWP and send us over an export of the setup with reproduction, we’ll take care of the fix from the Companion side.

    Waiting for your reply and thanks again for your messages!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘php function is_readable bug’ is closed to new replies.