| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: CatFolders Lite - WP Media Folders |
| 4 |
* Plugin URI: https://wpmediafolders.com/ |
| 5 |
* Description: Organize and manage your files with WordPress media library folders. Unlimitedly fast, flexible, and professional. |
| 6 |
* Version: 1.9 |
| 7 |
* Author: CatFolders |
| 8 |
* Author URI: https://wpmediafolders.com/ |
| 9 |
* Text Domain: catfolders |
| 10 |
* Domain Path: /languages |
| 11 |
* |
| 12 |
* @package CatFolders Plugin |
| 13 |
*/ |
| 14 |
namespace CatFolders; |
| 15 |
|
| 16 |
defined( 'ABSPATH' ) || exit; |
| 17 |
|
| 18 |
global $wp_version; |
| 19 |
|
| 20 |
if ( function_exists( 'CatFolders\\init' ) ) { |
| 21 |
require_once plugin_dir_path( __FILE__ ) . 'includes/Views/fallback-exists.php'; |
| 22 |
add_action( |
| 23 |
'admin_init', |
| 24 |
function() { |
| 25 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 26 |
} |
| 27 |
); |
| 28 |
return; |
| 29 |
} |
| 30 |
|
| 31 |
if ( ! \version_compare( phpversion(), '7.2', '>=' ) ) { |
| 32 |
require_once plugin_dir_path( __FILE__ ) . 'includes/Views/fallback-minimum-php.php'; |
| 33 |
add_action( |
| 34 |
'admin_init', |
| 35 |
function() { |
| 36 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 37 |
} |
| 38 |
); |
| 39 |
return; |
| 40 |
}; |
| 41 |
|
| 42 |
if ( ! \version_compare( $wp_version, '5.2', '>=' ) ) { |
| 43 |
require_once plugin_dir_path( __FILE__ ) . 'includes/Views/fallback-minimum-wp.php'; |
| 44 |
add_action( |
| 45 |
'admin_init', |
| 46 |
function() { |
| 47 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 48 |
} |
| 49 |
); |
| 50 |
return; |
| 51 |
} |
| 52 |
|
| 53 |
if ( ! defined( 'CATF_PREFIX' ) ) { |
| 54 |
define( 'CATF_PREFIX', 'catf' ); |
| 55 |
} |
| 56 |
|
| 57 |
if ( ! defined( 'CATF_VERSION' ) ) { |
| 58 |
define( 'CATF_VERSION', '1.9' ); |
| 59 |
} |
| 60 |
|
| 61 |
if ( ! defined( 'CATF_PLUGIN_FILE' ) ) { |
| 62 |
define( 'CATF_PLUGIN_FILE', __FILE__ ); |
| 63 |
} |
| 64 |
|
| 65 |
if ( ! defined( 'CATF_PLUGIN_URL' ) ) { |
| 66 |
define( 'CATF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 67 |
} |
| 68 |
|
| 69 |
if ( ! defined( 'CATF_PLUGIN_PATH' ) ) { |
| 70 |
define( 'CATF_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
| 71 |
} |
| 72 |
|
| 73 |
if ( ! defined( 'CATF_PLUGIN_BASE_NAME' ) ) { |
| 74 |
define( 'CATF_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) ); |
| 75 |
} |
| 76 |
|
| 77 |
if ( ! defined( 'CATF_ROUTE_NAMESPACE' ) ) { |
| 78 |
define( 'CATF_ROUTE_NAMESPACE', 'CatFolders/v1' ); |
| 79 |
} |
| 80 |
|
| 81 |
if ( ! defined( 'CATF_LICENSE_API_URL' ) ) { |
| 82 |
define( 'CATF_LICENSE_API_URL', 'https://catfolders.com/' ); |
| 83 |
} |
| 84 |
|
| 85 |
if ( ! defined( 'CATF_LICENSE_API_ITEM_ID' ) ) { |
| 86 |
define( 'CATF_LICENSE_API_ITEM_ID', 10 ); |
| 87 |
} |
| 88 |
|
| 89 |
if ( ! defined( 'CATF_IS_DEVELOPMENT' ) ) { |
| 90 |
define( 'CATF_IS_DEVELOPMENT', false ); |
| 91 |
} |
| 92 |
|
| 93 |
if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) { |
| 94 |
require_once dirname( __FILE__ ) . '/vendor/autoload.php'; |
| 95 |
} |
| 96 |
|
| 97 |
if ( ! function_exists( 'CatFolders\\init' ) ) { |
| 98 |
function init() { |
| 99 |
new \CatFolders\Core\Initialize(); |
| 100 |
} |
| 101 |
} |
| 102 |
add_action( 'plugins_loaded', 'CatFolders\\init' ); |
| 103 |
|
| 104 |
register_activation_hook( __FILE__, array( 'CatFolders\\Plugin', 'activate' ) ); |
| 105 |
register_deactivation_hook( __FILE__, array( 'CatFolders\\Plugin', 'deactivate' ) ); |
| 106 |
|