Cannot redeclare bpsPro_autoupdate_bps_plugin() declared in bps-mu-tools.php:25

Home Forums BulletProof Security Free Cannot redeclare bpsPro_autoupdate_bps_plugin() declared in bps-mu-tools.php:25

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #33433
    dtasiacom
    Participant

    My WP site is down. The server returns:

    Fatal error: Cannot redeclare bpsPro_autoupdate_bps_plugin() (previously declared in /.../wp-content/mu-plugins/bps-mu-tools.php:25) in /.../wp-content/mu-plugins/bps-plugin-autoupdate.php on line 29

    I’m using BPS Free.

    #33434
    Sholly
    Participant

    It appears the latest BPS update is failing to delete the old Auto-Update plugin file in the mu-plugins folder [ bps-plugin-autoupdate.php ] when it replaces it with the newer file [ bps-mu-tools.php ]

    Both files declare the function [ bpsPro_autoupdate_bps_plugin ] which breaks our sites, so we manually remove the older one.

    #33435
    Sholly
    Participant

    Had the same issue, it appears the latest BPS update is failing to delete the old Auto-Update plugin file [ bps-plugin-autoupdate.php ] when it replaces it with [ bps-mu-tools.php ]

    Both file declare the function [ bpsPro_autoupdate_bps_plugin ] which breaks our sites, so manually remove the older one.

    Delete: wp-content/mu-plugins/ bps-plugin-autoupdate.php

    #33436
    AITpro Admin
    Keymaster

    Odd. The code to automatically delete the old bps-plugin-autoupdate.php file is in the file below which is executed on BPS plugin upgrades. I just double checked the code and it works fine on my test site. Do you see any other php errors that say anything about folder or file permissions? What type of server do you have? CGI or DSO? Are you using open_basedir? Do you have the Sucuri plugin installed? Just trying to figure out why BPS is unable to delete the bps-plugin-autoupdate.php file on your particular servers/websites.

    File: general-functions.php
    Code Line: 884

    delete_option('bulletproof_security_options_autoupdate');
    $autoupdate_master_file = WP_PLUGIN_DIR . '/bulletproof-security/admin/htaccess/bps-plugin-autoupdate.php';
    $autoupdate_muplugins_file = WP_CONTENT_DIR . '/mu-plugins/bps-plugin-autoupdate.php';
    @unlink($autoupdate_master_file);
    @unlink($autoupdate_muplugins_file);
    #33438
    dtasiacom
    Participant

    Thank you for the advice. I’ll try it out.

    Had the same issue, it appears the latest BPS update is failing to delete the old Auto-Update plugin file [ bps-plugin-autoupdate.php ] when it replaces it with [ bps-mu-tools.php ]

    Both file declare the function [ bpsPro_autoupdate_bps_plugin ] which breaks our sites, so manually remove the older one.

    Delete: wp-content/mu-plugins/ bps-plugin-autoupdate.php

    #33439
    dtasiacom
    Participant

    Thanks for the reply. I am unable to answer most of your questions as I only manage the WP install and not the server config. I have no other error message. The site does not use Sucuri.

    Odd. The code to automatically delete the old bps-plugin-autoupdate.php file is in the file below which is executed on BPS plugin upgrades. I just double checked the code and it works fine on my test site. Do you see any other php errors that say anything about folder or file permissions? What type of server do you have? CGI or DSO? Are you using open_basedir? Do you have the Sucuri plugin installed? Just trying to figure out why BPS is unable to delete the bps-plugin-autoupdate.php file on your particular servers/websites.

    #33440
    AITpro Admin
    Keymaster

    I just thought of a possible reason for why the bps-plugin-autoupdate.php file was not deleted on BPS upgrade.  The function for BPS upgrades to automatically delete that file uses this condition: if ( current_user_can('manage_options') ) {. So that may have something to do with the problem, but what I think occurred is the /includes/admin.php file also creates the bps-mu-tools.php file in another function at init which fires earlier than the general-functions.php file does. So that would mean the new bps-mu-tools.php file was created before the general-functions.php file had a chance to delete the old bps-plugin-autoupdate.php file. I will test that theory and in any case there needs to be an additional condition to check if the old bps-plugin-autoupdate.php file exists in the admin.php file before creating the new bps-mu-tools.php file.

    #33441
    AITpro Admin
    Keymaster

    Yep, that definitely causes the problem.  I will get another BPS plugin version released ASAP.

    #33442
    AITpro Admin
    Keymaster

    Ok BPS 2.1 has been released that has new conditions that prevent the problem from occurring.  Thanks for reporting this. Very much appreciated. 😉

    #33467
    dtasiacom
    Participant

    @Sholly

    You’re a life saver! Site is back up – big sigh of relief!


    @Admin

    Thanks for the quick troubleshooting!

    Had the same issue, it appears the latest BPS update is failing to delete the old Auto-Update plugin file [ bps-plugin-autoupdate.php ] when it replaces it with [ bps-mu-tools.php ]

    Both file declare the function [ bpsPro_autoupdate_bps_plugin ] which breaks our sites, so manually remove the older one.

    Delete: wp-content/mu-plugins/ bps-plugin-autoupdate.php

    #33481
    Hannah
    Participant

    I had two sites down that were fixed by removing the bpsPro autoupdate plugin. thanks for posting the fix! I have another with a 500 ISE that also seems to be caused by something misfiring with the last update and will post separately for help.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.