WordPress.org

Ready to get started?Download WordPress

Forums

WordPress File Monitor
[plugin wordpress-file-monitor][Bug+fix] Errors caused by opendir/excluded paths (1 post)

  1. jrf
    Member
    Posted 2 years ago #

    Hi,

    Thanks for this amazing plugin! Very happy to have found it.

    I installed the plugin and excluded a number of paths, such as webalizer and logdir paths, however I kept getting monitor emails about a file in the logdir being changed (the php errorlog) and the error in the php errorlog then showed it was an opendir() error caused by WP File Monitor trying to open the webalizer directory.

    I think I've isolated the problem line and would suggest you make the following change:

    Line 304:
    if (($dh = opendir($current_dir)) && $scanPath == true) {
    Change to:
    if ($scanPath == true && ($dh = opendir($current_dir))) {

    PHP reads the if line from left to right, i.e. even if a path is excluded through $scanPath, in the original line, PHP will still try to open the dir before breaking out of the if, causing the error messages. Changing the order solves that.

    I'm using WP 3.3.1 with WP File Monitor 2.3.3.

    On a side-note: I'm using the plugin in a multi-site environment, but only activated on the primary site. Seems to work, though the website name mentioned in the emails is often inconsistent. Might have something to do with the last blog I was logged into. Anyways, not something which really bothers me, so I haven't looked for a fix.

    Hope this helps ;-)

    Smile,
    Juliette

    http://wordpress.org/extend/plugins/wordpress-file-monitor/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic