Shoora
4/22/2019 - 10:35 AM

Allows to Pull from live (WP Migrate DB Pro) without activating unwanted plugins locally

Allows to Pull from live (WP Migrate DB Pro) without activating unwanted plugins locally

<?php
/*
Plugin Name: Deactivate Plugins in Development
Plugin URI: https://gist.github.com/heyfletch/07a3677f69f94a02aaa02621075e5d6e
Description: Create a list of plugins to deactivate on local development. Doesn't effect production plugins. 
Author: Fletcher Digital
Version: 0.1
Author URI: https://fletcherdigital.com
*/

/* Disable specified plugins in development environment */
if (defined('WP_ENV') && WP_ENV == 'development') {

  $plugins = array(

    'autoptimize/autoptimize.php',
    'cloudflare/cloudflare.php',
    'google-analytics-for-wordpress/googleanalytics.php',
    'limit-login-attempts-reloaded/limit-login-attempts-reloaded.php',

  );

  require_once(ABSPATH . 'wp-admin/includes/plugin.php');

  deactivate_plugins($plugins);

}