* @copyright ShortPixel 2018-2020 * @package WordPress * @subpackage enable-media-replace * */ namespace EnableMediaReplace; define( 'EMR_VERSION', '4.0.2' ); if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /* Not sure why we define this? if(!defined("S3_UPLOADS_AUTOENABLE")) { define('S3_UPLOADS_AUTOENABLE', true); } */ if ( ! defined( 'EMR_ROOT_FILE' ) ) { define( 'EMR_ROOT_FILE', __FILE__ ); } if ( ! defined( 'SHORTPIXEL_AFFILIATE_CODE' ) ) { define( 'SHORTPIXEL_AFFILIATE_CODE', 'VKG6LYN28044' ); } /** Usage: * Define in wp-config.php * // User must have this capability to replace all * define('EMR_CAPABILITY' ,'edit_upload_all' ); * // User must have first capability to replace all OR second capability to replace only own files * define('EMR_CAPABILITY' ,array('edit_upload_all', 'edit_upload_user') ); * * **/ if ( ! defined( 'EMR_CAPABILITY' ) ) { define( 'EMR_CAPABILITY', false ); } /* if (! defined('EMR_CAPABILITY_USERONLY')) define('EMR_CAPABILITY_USERONLY', false); */ $plugin_path = plugin_dir_path( EMR_ROOT_FILE ); require_once( $plugin_path . 'build/shortpixel/autoload.php' ); require_once( $plugin_path . 'classes/compat.php' ); require_once( $plugin_path . 'classes/functions.php' ); require_once( $plugin_path . 'classes/replacer.php' ); require_once( $plugin_path . 'classes/uihelper.php' ); //require_once( $plugin_path . 'classes/file.php' ); require_once( $plugin_path . 'classes/cache.php' ); require_once( $plugin_path . 'classes/api.php' ); require_once( $plugin_path . 'classes/ajax.php' ); require_once( $plugin_path . 'classes/emr-plugin.php' ); require_once( $plugin_path . 'classes/installHelper.php' ); require_once( $plugin_path . 'classes/externals.php' ); require_once( $plugin_path . 'classes/external/elementor.php' ); require_once( $plugin_path . 'classes/external/wpbakery.php' ); require_once( $plugin_path . 'classes/external/upsell_installer.php' ); require_once( $plugin_path . 'classes/external/siteorigin.php' ); require_once( $plugin_path . 'thumbnail_updater.php' ); function emr() { return EnableMediaReplacePlugin::get(); } emr(); // runtime. //register_uninstall_hook( __FILE__, '\EnableMediaReplace\emr_uninstall' ); register_deactivation_hook( __FILE__, array('\EnableMediaReplace\InstallHelper','deactivatePlugin') ); register_uninstall_hook(__FILE__, array('\EnableMediaReplace\InstallHelper','uninstallPlugin') );