Home › Forums › BulletProof Security Free › Cannot redeclare bpsPro_autoupdate_bps_plugin() declared in bps-mu-tools.php:25
- This topic has 10 replies, 4 voices, and was last updated 6 years, 5 months ago by
Hannah.
-
AuthorPosts
-
dtasiacom
ParticipantMy 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.
Sholly
ParticipantIt 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.
Sholly
ParticipantHad 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
AITpro Admin
KeymasterOdd. 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: 884delete_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);
dtasiacom
ParticipantThank 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
dtasiacom
ParticipantThanks 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.
AITpro Admin
KeymasterI 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.AITpro Admin
KeymasterYep, that definitely causes the problem. I will get another BPS plugin version released ASAP.
AITpro Admin
KeymasterOk BPS 2.1 has been released that has new conditions that prevent the problem from occurring. Thanks for reporting this. Very much appreciated. 😉
dtasiacom
ParticipantYou’re a life saver! Site is back up – big sigh of relief!
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
Hannah
ParticipantI 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.
-
AuthorPosts
- You must be logged in to reply to this topic.