PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
← All changes | Inc/Admin/Modules.php +87 -20 4.3.04.0 View file →
@@ -1,21 +1,20 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Admin;
3 +namespace WPAdminify\Inc\Admin;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use \PXLBSAdminify\Inc\Admin\AdminSettings;
7 -use \PXLBSAdminify\Inc\Admin\AdminSettingsModel;
8 -use \PXLBSAdminify\Inc\Modules\MenuEditor\MenuEditor;
9 -use \PXLBSAdminify\Inc\Modules\MenuDuplicator\MenuDuplicator;
10 -use \PXLBSAdminify\Inc\Modules\PostDuplicator\PostDuplicator;
11 -use \PXLBSAdminify\Inc\Modules\PostTypesOrder\PostTypesOrder;
12 -use \PXLBSAdminify\Inc\Modules\Folders\Folders;
13 -use \PXLBSAdminify\Inc\Modules\DisableComments\DisableComments;
14 -use \PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation;
15 -use \PXLBSAdminify\Inc\Modules\DismissNotices\Dismiss_Admin_Notices;
16 -use \PXLBSAdminify\Inc\Modules\DashboardWidget\DashboardWidget;
17 -use PXLBSAdminify\Inc\Admin\Options\RollbackVersion;
5 +use WPAdminify\Inc\Utils;
6 +use \WPAdminify\Inc\Admin\AdminSettings;
7 +use \WPAdminify\Inc\Admin\AdminSettingsModel;
8 +use \WPAdminify\Inc\Modules\MenuEditor\MenuEditor;
9 +use \WPAdminify\Inc\Modules\MenuDuplicator\MenuDuplicator;
10 +use \WPAdminify\Inc\Modules\PostDuplicator\PostDuplicator;
11 +use \WPAdminify\Inc\Modules\PostTypesOrder\PostTypesOrder;
12 +use \WPAdminify\Inc\Modules\Folders\Folders;
13 +use \WPAdminify\Inc\Modules\DisableComments\DisableComments;
14 +use \WPAdminify\Inc\Modules\ServerInformation\ServerInformation;
15 +use \WPAdminify\Inc\Modules\DismissNotices\Dismiss_Admin_Notices;
16 +use WPAdminify\Inc\Admin\Options\RollbackVersion;
18 17
19 18 // no direct access allowed
20 19 if (!defined('ABSPATH')) {
21 20 exit;
@@ -33,11 +32,11 @@
33 32
34 33 public function __construct()
35 34 {
36 35 $this->modules_init();
36 + add_action('admin_notices', [$this, 'module_conflict_notice'], -9999999);
37 37 }
38 38
39 -
40 39 /**
41 40 * Include Moduels
42 41 *
43 42 * @return void
@@ -67,14 +66,9 @@
67 66 if (!empty($this->options['disable_comments']['enable_disable_comments'] ) ) {
68 67 new DisableComments();
69 68 }
70 69
71 - if (!empty($this->options['dashboard_widgets'])) {
72 - new DashboardWidget();
73 - }
74 -
75 70 // new ServerInformation();
76 -
77 71 MenuEditor::get_instance();
78 72
79 73 // TO DO: Turned Off for future release, after making Network Options stable
80 74 // if (Utils::check_modules($this->options['server_info'])) {
@@ -79,6 +73,79 @@
79 73 // TO DO: Turned Off for future release, after making Network Options stable
80 74 // if (Utils::check_modules($this->options['server_info'])) {
81 75 // new RollbackVersion();
82 76 // }
77 + }
78 +
79 + public function maybe_conflicted_plugins_active( $plugins )
80 + {
81 + // $options = (array) AdminSettings::get_instance()->get();
82 + // if (!Utils::check_modules($options[$module_name])) {
83 + // return false;
84 + // }
85 +
86 + $active_plugins = get_option('active_plugins', []);
87 +
88 + $is_found = false;
89 +
90 + $_plugin = null;
91 +
92 + foreach ($active_plugins as $plugin) {
93 + if (in_array($plugin, $plugins)) {
94 + $is_found = true;
95 + $_plugin = $plugin;
96 + }
97 + }
98 +
99 + if (!$is_found) {
100 + return false;
101 + }
102 +
103 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
104 +
105 + $all_plugins = get_plugins();
106 +
107 + return $all_plugins[$_plugin];
108 + }
109 +
110 + public function module_conflict_notice()
111 + {
112 + $this->maybe_show_folder_module_notice();
113 + }
114 +
115 + public function maybe_show_folder_module_notice()
116 + {
117 + $plugins = [
118 + 'folders/folders.php',
119 + 'filebird/filebird.php',
120 + 'real-media-library-lite/index.php',
121 + 'wicked-folders/wicked-folders.php',
122 + 'real-category-library-lite/index.php',
123 + 'wp-media-folders/wp-media-folders.php',
124 + 'media-library-plus/maxgalleria-media-library.php',
125 + ];
126 +
127 + $result = $this->maybe_conflicted_plugins_active( $plugins );
128 +
129 + if (!$result) {
130 + return;
131 + }
132 +
133 +?>
134 +
135 + <div class="notice notice-warning is-dismissible">
136 + <p class="notice-brand-identifier"><img width="100" src="<?php echo esc_url(WP_ADMINIFY_ASSETS_IMAGE) . 'logos/logo-text-light.svg'; ?>" alt=""></p>
137 + <br />
138 + <?php echo sprintf(wp_kses_post('<p>You are using <strong>%s</strong> plugin, which serve the same purpose as our folder module.</p><p>We have Disabled our <strong>Folder</strong> module, to avoid conflicts.</p>'), esc_html($result['Name'])); ?>
139 +
140 + </div>
141 +
142 +<?php
143 +
144 + $adminSettings = AdminSettings::get_instance();
145 +
146 + $options = get_option($adminSettings->prefix);
147 + $options['folders'] = false; // force disable
148 +
149 + update_option($adminSettings->prefix, $options);
83 150 }
84 151 }