Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author lilaeamedia

    (@lilaeamedia)

    The actual line of code in question ( from the WordPress core file wp-admin/includes/plugin.php ) is shown below:

    $plugins_dir = @ opendir( $plugin_root);

    The opendir command is prefixed with the ‘@’ symbol which tells PHP to suppress error output if the command fails.

    The get_plugins() function is being used in this context to determine if the plugin exists. By passing the plugin handle ( directory ) to this function, it leverages the suppression of the error in the opendir command to allow for a “test” for the path in question. WordPress either returns an array containing the plugin if it exists or an empty array if it does not.

    The larger question is whether an error is thrown and program flow is interrupted. There is always a better way to do things, but in this case I think your utility is manufacturing problems where there are none, because the PHP debug notice is being suppressed by the WordPress code.

    Plugin Author lilaeamedia

    (@lilaeamedia)

    Another user reported the same condition so I went ahead and recoded these lines.

    The 2.1.2 release addresses this issue.

    Thread Starter derekakelly

    (@derekakelly)

    Thank you very much for your prompt support.

    I have also made the developer of Query Monitor aware of the issue

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘failed to open dir: No such file or directory’ is closed to new replies.