Title: Plugin Randomly Deactivated Automatically
Last modified: June 15, 2021

---

# Plugin Randomly Deactivated Automatically

 *  Resolved [F R](https://wordpress.org/support/users/frosado/)
 * (@frosado)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/)
 * Hello and thanks for such a great plugin!
 * We are evaluating the plugin using version 3.1.8 and we are noticing an issue
   where every few days the plugin will deactivate itself. We must go to the plugin
   page and click on Activate once again to turn it back on. It will work ok for
   a while and then stop working again.
 * There are no changes being made to the plugin folders or the WordPress installation(
   no active development) and we have not been able to find a pattern as to why 
   or when it becomes deactivated. No other plugin on the site is encountering this
   issue or exhibiting this behavior.
 * Is there any way of seeing why the plugin is becoming inactive from time to time?
 * We are using WordPress 5.7.2 running the Oceanica theme from MotoPress.
 * Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [F R](https://wordpress.org/support/users/frosado/)
 * (@frosado)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556511)
 * UPDATE: The WP Business Intelligence plugin is causing the following error reported
   in the WordPress Site Health Status screen:
 *     ```
       An active PHP session was detected
   
       A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.
       ```
   
 * and
 *     ```
       The REST API encountered an error
   
       The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
   
       The REST API request failed due to an error.
       Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)
       ```
   
 * I believe this may be why the plugin will “crash” and become deactivated sometimes.
   I determined that this plugin was the cause for the error by turning off and 
   on each of the site plugins one by one. Deactivating this plugin solves the two
   errors reported above.
 *  Plugin Author [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * (@joeyoungblood)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556555)
 * Hi there, thanks for the report. We have multiple test sites live running Lite
   and Pro and I am not able to recreate this issue on any of them. Our main site
   is itself a test site and runs just fine.
 * A plugin deactivating and being able to be reactivated is often a sign of plugin
   conflict. There is a chance another activated plugin and ours are conflicting
   causing this issue.
 * Please try deactivating your plugins one at a time to see if you can discover
   the conflict.
 * We are opening an investigating on this asap, but will need more details to help
   us track down what is happening (and if it is in our plugin to fix it).
 * If you don’t mind, please send in a contact request via our site with more details
   to help our investigatinon: [https://www.wpbusinessintelligence.com/contact/](https://www.wpbusinessintelligence.com/contact/)
 * Include in your request:
    1. WP Version 2. Database type(s) being used (including
   WP database and b.i. databases connected if Pro) 3. Theme and version 4. List
   of plugins installed and versions (denote free or premium) 5. PHP version 6. 
   Error messages 7. Where and hpw you gained those error messages (i.e. debug, 
   error logging, etc…)
    -  This reply was modified 4 years, 11 months ago by [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/).
 *  Thread Starter [F R](https://wordpress.org/support/users/frosado/)
 * (@frosado)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556580)
 * Thank you [@joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
   for your response. I’ve submitted a ticket with the details requested.
 *  Plugin Author [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * (@joeyoungblood)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556581)
 * Quick update, I can confirm the existence of the Site Health message appears 
   to be related to the Lite plugin. However, this is on test sites that are not
   deactivating the plugin.
 * I have logged this as a bug and the team and I will get to working on a fix for
   this specific issue, but it may not fix the deactivation issue you are reporting.
 *  Thread Starter [F R](https://wordpress.org/support/users/frosado/)
 * (@frosado)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556621)
 * An update on my end: Looking at the Chrome Console one one of the pages that 
   displays the query results, I see the following error in a WPBI JS. Not sure 
   if it is at all related, if it is a critical error, or how this would cause sporadic
   deactivation of the plugin, but I figured I would share it.
 * (I can’t upload screenshots here or in the support ticket page you shared previously,
   so I am just pasting the error message and related code below.)
 *     ```
       jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 3.3.2
       (index):242 Uncaught TypeError: Cannot read property 'defaults' of undefined
           at (index):242
           at HTMLDocument.ready (wpbiDocReady.js?ver=1.0.0:26)
       (anonymous) @ (index):242
       ready @ wpbiDocReady.js?ver=1.0.0:26
       ```
   
 * The console flags the error as stemming from the third line below:
 *     ```
       <script type="text/javascript">
       docReady(function () {
         jQuery.extend(true, jQuery.fn.dataTable.defaults, {
       	"order": [],
       	"searching": false,
       	"responsive": true
         });
         var table = jQuery("#datatable-1").DataTable({"pageLength":-1});
         table.buttons().container().appendTo( jQuery('#datatable-1-buttons') );
       });
       </script>
       ```
   
 * Hopefully this helps.
 *  Plugin Author [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * (@joeyoungblood)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556634)
 * Thanks Fabian for the information in the ticket and the extra info. I will be
   sending you an email in the morning as it is getting late here (Texas time). 
   We will do our best to fix this as quickly as possible.
 *  Plugin Author [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * (@joeyoungblood)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14556858)
 * Found a fix for part of your issue though it is tough to say how exactly this
   will impact your site or the usage of our plugin.
 * For the “The Rest API Encountered and Error” issue about cURL add the following
   code to the bottom of your functions.php in your child theme.
 *     ```
       <?php
       function mymodule_curl_before_request($curlhandle){
               session_write_close();
       }
       add_action( 'requests-curl.before_request','mymodule_curl_before_request', 9999 );
       ```
   
 * Found this on TRAC here: [https://core.trac.wordpress.org/ticket/50491](https://core.trac.wordpress.org/ticket/50491)
   
   And solution here: [https://core.trac.wordpress.org/ticket/50491#comment:2](https://core.trac.wordpress.org/ticket/50491#comment:2)
 * The session issue appears to be fairly widespread at the moment impacting a lot
   of plugins but not causing many visible issues. I was able to see this fixed 
   the error on Site Health but am not sure how else it might impact the issues 
   you are having. There’s a chance it might help stabilize your system while plugins
   like ours upgrade and this issue fades away.
 * We are still working on this issue, but I am turning in for the evening as it’s
   late here in Texas.
    -  This reply was modified 4 years, 11 months ago by [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/).
    -  This reply was modified 4 years, 11 months ago by [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/).
 *  Thread Starter [F R](https://wordpress.org/support/users/frosado/)
 * (@frosado)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14559089)
 * Hello,
 * I implemented the suggested change to my functions.php file, and it resolved 
   the REST API error. Site Health is still displaying the “An active PHP session
   was detected” error. (The error regarding the plugin deactivating itself happens
   every few days and is random, so I can’t report on it unless I see it happening.)
 * Testing around the site I notice that now, WordPress pages set to PRIVATE with
   a password require that the password be entered every time they are loaded, vs
   the first time the page is visited. That is a draw back to the user experience
   as they must re-enter the page password every time they now visit it. I imagine
   we won’t be able to have it both ways, so unless there is a less “global” way
   of fixing the Curl error we are stuck?
 * Thanks for all the help and ideas!
 *  Plugin Author [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * (@joeyoungblood)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14567129)
 * This bug has been patched in today’s release of v3.1.9 Lite. You can read about
   the bug fix here: [https://wordpress.org/support/topic/3-1-9-bug-fix/](https://wordpress.org/support/topic/3-1-9-bug-fix/)
 * The above conversation lists code to fix the cURL error, while this is officially
   recommended on TRAC please use this code at your own risk. It is not officially
   recommend by our plugin to use this code and we are uncertain of any related 
   issues that may arise from its implementation.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Plugin Randomly Deactivated Automatically’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-business-intelligence-lite_eae8f9.
   svg)
 * [WP Business Intelligence Lite](https://wordpress.org/plugins/wp-business-intelligence-lite/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-business-intelligence-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-business-intelligence-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-business-intelligence-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-business-intelligence-lite/reviews/)

## Tags

 * [plugin activation](https://wordpress.org/support/topic-tag/plugin-activation/)
 * [plugin deactivation](https://wordpress.org/support/topic-tag/plugin-deactivation/)

 * 9 replies
 * 2 participants
 * Last reply from: [joeyoungblood](https://wordpress.org/support/users/joeyoungblood/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-randomly-deactivated-automatically/#post-14567129)
 * Status: resolved