Plugin Randomly Deactivating on Its Own

A plugin that I have continuously deactivates itself about every other day. I can not seem to figure out what is causing it though. Can someone provide some insight as to what might be causing this. I thought that it might be possible that the plugin is having some sort of error but I have not been able to see or find any error inside of the error logs. Ideas?

  • Ash
    • WordPress Hacker

    Hello there

    I hope you are well today and thanks for asking the question.

    Which plugin are you using that is deactivated by itself? Also, is it deactivated after a certain time or instantly just after your activation?

    Also, would you please check by deleting the plugin and installing again?

    Normally WP deactivates a plugin automatically if there are no files/required files in the plugin folder.

    Please let me know.

    Cheers
    Ash

  • Brashell
    • The Bug Hunter

    I think I have found what might be doing it, but it appears to only be triggered by an update.

    function wp_booking_multisite_update() {
    	global $wpdb;
    
    	if (function_exists('is_multisite') && is_multisite()) {
    		$blogsQry =  mysql_query("SELECT * FROM ".$wpdb->base_prefix."blogs");
    		while($blogRow = mysql_fetch_array($blogsQry)) {
    			$blog_id = $blogRow["blog_id"];
    			$blog_prefix=$blog_id."_";
    			if($blog_id==1) {
    				$blog_prefix="";
    			}
    			switch_to_blog($blog_id);
    			deactivate_plugins( '/wp-booking-calendar/wp-booking-calendar.php' );
    
    		}
    		restore_current_blog();
    	} 
    
    	$blog_prefix='';
    
    	$sql14="CREATE TABLE <code>&quot;.$wpdb->base_prefix.$blog_prefix.&quot;booking_pages</code> (
    	  <code>page_id</code> int(11) unsigned NOT NULL AUTO_INCREMENT,
    	  <code>page_type</code> char(1) NOT NULL DEFAULT '',
    	  <code>page_name</code> varchar(255) NOT NULL DEFAULT '',
    	  PRIMARY KEY (<code>page_id</code>)
    	) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
    	dbDelta($sql14);

    There is a lot more but it is just querys any ideas?

  • Ash
    • WordPress Hacker

    It's great that you found it. It seems the plugin is being deactivated while updating some query but may be plugin author forgot to activate plugin again.

    I think the better will be if you please ask the plugin author/codecanyon forum, he will answer you better.

    Cheers
    Ash

  • Brashell
    • The Bug Hunter

    I asked two weeks ago, still haven't hear a reply and I don't want to go to envato because I like the plugin, and its perfect and great and I spent a lot of time redoing the CSS so I don't want to give it up. Do you think you can take a peek at it and see what might be doing it?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.