| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: FileBird Lite |
| 4 |
* Plugin URI: https://ninjateam.org/wordpress-media-library-folders/ |
| 5 |
* Description: Organize thousands of WordPress media files into folders/ categories at ease. |
| 6 |
* Version: 4.3.1 |
| 7 |
* Author: Ninja Team |
| 8 |
* Author URI: https://ninjateam.org |
| 9 |
* Text Domain: filebird |
| 10 |
* Domain Path: /i18n/languages/ |
| 11 |
* |
| 12 |
* @package FileBirdPlugin |
| 13 |
*/ |
| 14 |
|
| 15 |
namespace FileBird; |
| 16 |
|
| 17 |
defined('ABSPATH') || exit; |
| 18 |
|
| 19 |
if (!defined('NJFB_PREFIX')) { |
| 20 |
define('NJFB_PREFIX', 'filebird'); |
| 21 |
} |
| 22 |
|
| 23 |
if (!defined('NJFB_VERSION')) { |
| 24 |
define('NJFB_VERSION', '4.3.1'); |
| 25 |
} |
| 26 |
|
| 27 |
if (!defined('NJFB_PLUGIN_FILE')) { |
| 28 |
define('NJFB_PLUGIN_FILE', __FILE__); |
| 29 |
} |
| 30 |
|
| 31 |
if (!defined('NJFB_PLUGIN_URL')) { |
| 32 |
define('NJFB_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 33 |
} |
| 34 |
|
| 35 |
if (!defined('NJFB_PLUGIN_PATH')) { |
| 36 |
define('NJFB_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
| 37 |
} |
| 38 |
|
| 39 |
if (!defined('NJFB_PLUGIN_BASE_NAME')) { |
| 40 |
define('NJFB_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); |
| 41 |
} |
| 42 |
|
| 43 |
if (!defined('NJFB_REST_URL')) { |
| 44 |
define('NJFB_REST_URL', 'filebird/v1'); |
| 45 |
} |
| 46 |
|
| 47 |
if (!defined('NJFB_REST_PUBLIC_URL')) { |
| 48 |
define('NJFB_REST_PUBLIC_URL', 'filebird/public/v1'); |
| 49 |
} |
| 50 |
|
| 51 |
spl_autoload_register(function ($class) { |
| 52 |
$prefix = __NAMESPACE__; // project-specific namespace prefix |
| 53 |
$base_dir = __DIR__ . '/includes'; // base directory for the namespace prefix |
| 54 |
|
| 55 |
$len = strlen($prefix); |
| 56 |
if (strncmp($prefix, $class, $len) !== 0) { // does the class use the namespace prefix? |
| 57 |
return; // no, move to the next registered autoloader |
| 58 |
} |
| 59 |
|
| 60 |
$relative_class_name = substr($class, $len); |
| 61 |
|
| 62 |
// replace the namespace prefix with the base directory, replace namespace |
| 63 |
// separators with directory separators in the relative class name, append |
| 64 |
// with .php |
| 65 |
$file = $base_dir . str_replace('\\', '/', $relative_class_name) . '.php'; |
| 66 |
|
| 67 |
if (file_exists($file)) { |
| 68 |
require $file; |
| 69 |
} |
| 70 |
}); |
| 71 |
|
| 72 |
function init() { |
| 73 |
Plugin::getInstance(); |
| 74 |
Plugin::activate(); |
| 75 |
|
| 76 |
I18n::loadPluginTextdomain(); |
| 77 |
|
| 78 |
Classes\ACF::getInstance(); |
| 79 |
Classes\Convert::getInstance(); |
| 80 |
Classes\PageBuilders::getInstance(); |
| 81 |
Classes\Feedback::getInstance(); |
| 82 |
Classes\Review::getInstance(); |
| 83 |
Classes\DocumentGallery::getInstance(); |
| 84 |
|
| 85 |
Classes\TabActive::hooks(); |
| 86 |
|
| 87 |
Page\Settings::getInstance(); |
| 88 |
Controller\Folder::getInstance(); |
| 89 |
Controller\FolderUser::getInstance(); |
| 90 |
Controller\CompatibleWpml::getInstance(); |
| 91 |
Controller\CompatiblePolylang::getInstance(); |
| 92 |
|
| 93 |
Controller\Api::getInstance(); |
| 94 |
} |
| 95 |
add_action('plugins_loaded', 'FileBird\\init'); |
| 96 |
|
| 97 |
register_activation_hook(__FILE__, array('FileBird\\Plugin', 'activate')); |
| 98 |
register_deactivation_hook(__FILE__, array('FileBird\\Plugin', 'deactivate')); |
| 99 |
|
| 100 |
if ( function_exists( 'register_block_type' ) ) { |
| 101 |
require plugin_dir_path(__FILE__) . 'blocks/filebird-gallery/src/init.php'; |
| 102 |
} |
| 103 |
|