PluginProbe
FileBird – WordPress Media Library Folders & File Manager / 5.6
FileBird – WordPress Media Library Folders & File Manager v5.6
6.5.8 6.5.7 6.5.5 6.5.4 trunk 4.3.1 5.1.6 5.3 5.3.2 5.4.3 5.4.4 5.4.5 5.5 5.5.3 5.5.5 5.5.8 5.5.8.1 5.6 5.6.1 5.6.2 5.6.3 5.6.4 6.2.3 6.2.5 6.3 All 36 releases
filebird / filebird.php

filebird.php in FileBird – WordPress Media Library Folders & File Manager 5.6, at filebird.php

124 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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: 5.6.0
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 namespace FileBird;
15
16 defined( 'ABSPATH' ) || exit;
17
18 if ( function_exists( 'FileBird\\init' ) ) {
19 require_once plugin_dir_path( __FILE__ ) . 'includes/Fallback.php';
20 if ( isset( $_GET['activate'] ) ) { // phpcs:ignore
21 unset( $_GET['activate'] ); // phpcs:ignore
22 }
23 add_action(
24 'admin_init',
25 function() {
26 deactivate_plugins( plugin_basename( __FILE__ ) );
27 }
28 );
29 return;
30 }
31
32 if ( ! defined( 'NJFB_PREFIX' ) ) {
33 define( 'NJFB_PREFIX', 'filebird' );
34 }
35
36 if ( ! defined( 'NJFB_VERSION' ) ) {
37 define( 'NJFB_VERSION', '5.6.0' );
38 }
39
40 if ( ! defined( 'NJFB_PLUGIN_FILE' ) ) {
41 define( 'NJFB_PLUGIN_FILE', __FILE__ );
42 }
43
44 if ( ! defined( 'NJFB_PLUGIN_URL' ) ) {
45 define( 'NJFB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
46 }
47
48 if ( ! defined( 'NJFB_PLUGIN_PATH' ) ) {
49 define( 'NJFB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
50 }
51
52 if ( ! defined( 'NJFB_PLUGIN_BASE_NAME' ) ) {
53 define( 'NJFB_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
54 }
55
56 if ( ! defined( 'NJFB_REST_URL' ) ) {
57 define( 'NJFB_REST_URL', 'filebird/v1' );
58 }
59
60 if ( ! defined( 'NJFB_REST_PUBLIC_URL' ) ) {
61 define( 'NJFB_REST_PUBLIC_URL', 'filebird/public/v1' );
62 }
63
64 if ( ! defined( 'NJFB_UPLOAD_DIR' ) ) {
65 define( 'NJFB_UPLOAD_DIR', 'filebird-uploads' );
66 }
67
68 if ( file_exists( NJFB_PLUGIN_PATH . '/vendor/autoload.php' ) ) {
69 require_once NJFB_PLUGIN_PATH . '/vendor/autoload.php';
70 }
71
72 spl_autoload_register(
73 function ( $class ) {
74 $prefix = __NAMESPACE__; // project-specific namespace prefix
75 $base_dir = __DIR__ . '/includes'; // base directory for the namespace prefix
76
77 $len = strlen( $prefix );
78 if ( strncmp( $prefix, $class, $len ) !== 0 ) { // does the class use the namespace prefix?
79 return; // no, move to the next registered autoloader
80 }
81
82 $relative_class_name = substr( $class, $len );
83
84 // replace the namespace prefix with the base directory, replace namespace
85 // separators with directory separators in the relative class name, append
86 // with .php
87 $file = $base_dir . str_replace( '\\', '/', $relative_class_name ) . '.php';
88
89 if ( file_exists( $file ) ) {
90 require $file;
91 }
92 }
93 );
94
95 if ( ! function_exists( 'FileBird\\init' ) ) {
96 function init() {
97 Plugin::prepareRun();
98 I18n::loadPluginTextdomain();
99
100 new Classes\Feedback();
101 new Classes\Review();
102 new Classes\Svg();
103 Page\Settings::getInstance();
104
105 Classes\Convert::getInstance();
106 Controller\Folder::getInstance();
107
108 new Support\SupportController();
109 new Classes\Schedule();
110 new Blocks\BlockController();
111
112 if ( function_exists( 'register_block_type' ) ) {
113 require plugin_dir_path( __FILE__ ) . 'blocks/filebird-gallery/dist/init.php';
114 }
115
116 require_once plugin_dir_path( __FILE__ ) . 'includes/YC.php';
117 require_once plugin_dir_path( __FILE__ ) . 'includes/Recommended/Recommended.php';
118 }
119 }
120 add_action( 'plugins_loaded', 'FileBird\\init' );
121
122 register_activation_hook( __FILE__, array( 'FileBird\\Plugin', 'activate' ) );
123 register_deactivation_hook( __FILE__, array( 'FileBird\\Plugin', 'deactivate' ) );
124