WordPress.org

Ready to get started?Download WordPress

Forums

WordPress File Monitor Plus
[resolved] Just updated to latest version and plugin not working (8 posts)

  1. jupiter23
    Member
    Posted 2 years ago #

    I get this error when I scan for file changes

    http://i45.tinypic.com/oiglrd.jpg

    Also it doesnt even work, hmm

    This happened after I updated the plugin just hours ago

    Text of error in photo:

    "Warning: file_put_contents(/home/simply/public_html/wp-content/plugins/wordpress-file-monitor-plus/data/.sc_wpfmp_scan_data) [function.file-put-contents]: failed to open stream: Permission denied in /home/simply/public_html/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.class.php on line 566"

    Extra notes: I also noticed that this file doesnt exist: .sc_wpfmp_scan_data

  2. jupiter23
    Member
    Posted 2 years ago #

    EDIT: Problem solved, we changed the Data folder to 777 then ran a scan and it created the other files. Then we changed the Data folder to 775.

    Plugin is working fine now, although it is safe to keep the Data folder to 775 right?

    Cheers

  3. Scott Cariss
    Member
    Plugin Author

    Posted 2 years ago #

    What happens is that when you update the plugin WordPress removes all the plugin files and re-add's files from the download.

    The download doesn't contain the data files as these should be made on the first scan.

    If you have an existing alert while upgrading what happens is that alert is still flagged but the alert data has been wiped and you get a blank popup with no way to clear the alert.

    What you have to do is what for a file change for the alerts to start working again.

    As for file/folder permissions. the data folder should be set to 755 and the files inside set to 644.

  4. HomeyG
    Member
    Posted 2 years ago #

    I cannot get the plugin to work now.

    I have installed it on a half dozen sites and it was great, but now when I try to install on other sites it is impossible.

    I have tried everything, I've changed permissions on the uploads folder to 777, I've even created the WPFMP_DATA folder and files manually, and I've tried copying them from other working sites. Nothing works.

    I've tried removing all other plugins, renaming the htaccess, going back to the default theme etc... nothing works.

    The plugin will not create the folders/files in the uploads folder when it is installed/activated, regardless of permissions placed on the uploads folder.

    Warning: mkdir() [function.mkdir]: Permission denied in /home/Cpanel_Account/public_html/site.com/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.settings.class.php on line 106

    Warning: copy(/WPFMP_DATA//.htaccess) [function.copy]: failed to open stream: No such file or directory in /home/Cpanel_Account/public_html/site.com/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.settings.class.php on line 641

    Warning: copy(/WPFMP_DATA//.sc_wpfmp_admin_alert_content) [function.copy]: failed to open stream: No such file or directory in /home/Cpanel_Account/public_html/site.com/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.settings.class.php on line 641

    Warning: copy(/WPFMP_DATA//.sc_wpfmp_scan_data) [function.copy]: failed to open stream: No such file or directory in /home/Cpanel_Account/public_html/site.com/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.settings.class.php on line 641

    Warning: Cannot modify header information - headers already sent by (output started at /home/Cpanel_Account/public_html/site.com/wp-content/plugins/wordpress-file-monitor-plus/classes/wpfmp.settings.class.php:106) in /home/Cpanel_Account/public_html/site.com/wp-includes/pluggable.php on line 881

  5. Scott Cariss
    Member
    Plugin Author

    Posted 2 years ago #

    @HomeyG

    It looks like the plugin isn't setting the defines correctly.

    E.G. /WPFMP_DATA//.sc_wpfmp_admin_alert_content is not a correct path...

    This is how the defines are setup:

    define( 'SC_WPFMP_PLUGIN_FILE', __FILE__ );
    define( 'SC_WPFMP_PLUGIN_FOLDER', dirname( SC_WPFMP_PLUGIN_FILE ) );
    define( 'SC_WPFMP_CLASSES_FOLDER', SC_WPFMP_PLUGIN_FOLDER . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR );
    define( 'SC_WPFMP_FUNCTIONS_FOLDER', SC_WPFMP_PLUGIN_FOLDER . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR );
    
    // Set data directory
    $uploads = wp_upload_dir();
    $uploads['basedir'] = str_replace( array('\\', '/'), DIRECTORY_SEPARATOR, $uploads['basedir'] );
    define( 'SC_WPFMP_DATA_FOLDER', $uploads['basedir'] . DIRECTORY_SEPARATOR . 'WPFMP_DATA' . DIRECTORY_SEPARATOR );
    define( 'SC_WPFMP_DATA_FOLDER_OLD', SC_WPFMP_PLUGIN_FOLDER . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR );
    define( 'SC_WPFMP_FILE_SCAN_DATA', SC_WPFMP_DATA_FOLDER . '.sc_wpfmp_scan_data' );
    define( 'SC_WPFMP_FILE_ALERT_CONTENT', SC_WPFMP_DATA_FOLDER . '.sc_wpfmp_admin_alert_content' );

    Can you check what each of these define are coming back with?

  6. HomeyG
    Member
    Posted 2 years ago #

    Thanks for pointing me in the right direction!

    It looks like for some reason the wp_upload_dir(); is not returning basedir or anything else.

    Notice: Undefined index: basedir. I get the same thing with url, subdir,baseurl etc....

    Here's what I had to do to get the plugin working:

    A) manually create the WPFMP_DATA folder under /uploads
    B) Add/change the following code in wordpress-file-monitor-plus.php:
    1.find:
    // Set data directory

    2.then comment out:
    #$uploads = wp_upload_dir();
    #$uploads['basedir'] = str_replace( array('\\', '/'), DIRECTORY_SEPARATOR, $uploads['basedir'] );

    3. Add this line:

    $Up = $_SERVER['DOCUMENT_ROOT'] . "/wp-content/uploads/";

    4. Change this:
    define( 'SC_WPFMP_DATA_FOLDER', $uploads['basedir'] . DIRECTORY_SEPARATOR . 'WPFMP_DATA' . DIRECTORY_SEPARATOR );

    To This:

    define( 'SC_WPFMP_DATA_FOLDER', $Up . DIRECTORY_SEPARATOR . 'WPFMP_DATA' . DIRECTORY_SEPARATOR );

    Basically swapped $uploads['basedir'] for $Up

    I have no idea why it's not finding the basedir but I'm happy that I can at least make it work on my other sites from here on out.

    It's very strange that I didn't have this issue with the first 4-5 sites I installed this on. I even checked the WP/includes/functions.php to make sure it was correct and it all looked fine. There's no reason I can see why wp_upload_dir() is not working.

    I'm running WP 3.4.1 and PHP Version 5.3.10

    It's a great plugin. Nice clean code and great commenting. Thanks for all your time and effort in putting it together.

  7. Scott Cariss
    Member
    Plugin Author

    Posted 2 years ago #

    I'm glad that you have fixed it though I'm not happy that you have had to alter the plugin code to make it work.

    I can only presume you are going to look into why wp_upload_dir() is not returning the correct info?

    Only thing I could think of is that some settings are not right somewhere. Possibly these sites have moved location, like to a different server, and they haven't been migrated properly where URLs and paths are now set incorrectly in the database.

    Glad you find my code clean and good commenting. This only happens on my public released content ;)

  8. HomeyG
    Member
    Posted 2 years ago #

    Thanks again for your assistance.

    I found what was causing problems on these sites. Just as you said, these sites were migrated and there was an old setting that was wrong.

    Here's where I fixed it:

    In wp admin area

    Settings-->Media---->Store uploads in this folder:

    The cpanel dir was still pointing to the old one instead of the new one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic