PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 4.0.0
Responsive Menu – Create Mobile-Friendly Menu v4.0.0
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / responsive-menu.php

responsive-menu.php in Responsive Menu – Create Mobile-Friendly Menu 4.0.0, at responsive-menu.php

192 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: Responsive Menu
5 Plugin URI: https://expresstech.io
6 Description: Highly Customisable Responsive Menu Plugin for WordPress
7 Version: 4.0.0
8 Author: ExpressTech
9 Text Domain: responsive-menu
10 Author URI: https://responsive.menu
11 License: GPL2
12 Tags: responsive, menu, responsive menu, mega menu, max mega menu, max menu
13 */
14
15 /**
16 * Constant as plugin version.
17 */
18 if ( ! defined( 'RMP_PLUGIN_VERSION' ) ) {
19 define( 'RMP_PLUGIN_VERSION', '4.0.0' );
20 }
21
22 add_action('admin_init', 'check_responsive_menu_php_version');
23 function check_responsive_menu_php_version() {
24 if(version_compare(PHP_VERSION, '5.4', '<')):
25 add_action('admin_notices', 'responsive_menu_deactivation_text');
26 deactivate_plugins(plugin_basename(__FILE__));
27 endif;
28 }
29
30 function responsive_menu_deactivation_text() {
31 echo '<div class="error"><p>' . sprintf(
32 'Responsive Menu requires PHP 5.4 or higher to function and has therefore been automatically disabled.
33 You are still on %s.%sPlease speak to your web host about upgrading your PHP version.',
34 PHP_VERSION,
35 '<br /><br />'
36 ) . '</p></div>';
37 }
38
39 if(version_compare(PHP_VERSION, '5.4', '<'))
40 return;
41
42 if ( empty( get_option( 'is_rmp_new_version') ) && ! empty( get_option('responsive_menu_version') ) ) {
43
44 add_action( 'admin_notices', 'og_pro_deactivate_pro_version_notice');
45
46 function og_pro_deactivate_pro_version_notice() {
47 if(get_transient('og-admin-notice-activation-pro')) {
48 ?>
49 <div class="notice notice-error is-dismissible">
50 <p>Responsive Menu Pro has been deactivated<p/>
51
52 </div>
53 <?php
54 delete_transient('og-admin-notice-activation-pro');
55 }
56 }
57
58 function og_deactivate_responsive_menu_pro() {
59
60 $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
61
62 if( is_plugin_active($plugin) ){
63 deactivate_plugins( 'responsive-menu-pro/responsive-menu-pro.php');
64 set_transient( 'og-admin-notice-activation-pro', true, 5 );
65
66 return;
67 }
68 }
69 //to check weather another plugin is acivated or not.
70 register_activation_hook( __FILE__, 'og_deactivate_responsive_menu_pro');
71
72 include dirname(__FILE__) . '/vendor/autoload.php';
73 include dirname(__FILE__) . '/config/default_options.php';
74 include dirname(__FILE__) . '/config/services.php';
75 include dirname(__FILE__) . '/config/wp/scripts.php';
76 include dirname(__FILE__) . '/config/routing.php';
77 include dirname(__FILE__) . '/migration.php';
78 include dirname(__FILE__) . '/config/polylang.php';
79
80 } else {
81
82 // If this file called directly then abort.
83 if ( ! defined( 'WPINC' ) ) {
84 die;
85 }
86
87 /**
88 * Constant as plugin file.
89 */
90 if ( ! defined( 'RMP_PLUGIN_FILE' ) ) {
91 define('RMP_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . 'responsive-menu.php');
92 }
93
94 /**
95 * Constant as dir of plugin.
96 */
97 if ( ! defined( 'RMP_PLUGIN_DIR_NAME' ) ) {
98 define( 'RMP_PLUGIN_DIR_NAME', untrailingslashit ( dirname( plugin_basename( __FILE__ ) ) ) );
99 }
100
101 /**
102 * Constant as plugin path.
103 */
104 if ( ! defined( 'RMP_PLUGIN_PATH' ) ) {
105 define( 'RMP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
106 }
107
108 /**
109 * Constant as plugin URL.
110 */
111 if ( ! defined( 'RMP_PLUGIN_URL' ) ) {
112 define( 'RMP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
113 }
114
115 /**
116 * Constant as URI of assets build.
117 */
118 if ( ! defined( 'RMP_PLUGIN_BUILD_URI' ) ) {
119 define( 'RMP_PLUGIN_BUILD_URI', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/build' );
120 }
121
122 /**
123 * Constant as dir of assets build.
124 */
125 if ( ! defined( 'RMP_PLUGIN_BUILD_DIR' ) ) {
126 define( 'RMP_PLUGIN_BUILD_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/assets/build' );
127 }
128
129 /**
130 * Constant as path of template file.
131 */
132 if ( ! defined( 'RMP_PLUGIN_TEMPLATE_PATH' ) ) {
133 define( 'RMP_PLUGIN_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
134 }
135
136 if ( ! defined( 'RMP_PLUGIN_PATH_V4' ) ) {
137 define ( 'RMP_PLUGIN_PATH_V4', RMP_PLUGIN_PATH . '/v4.0.0' );
138 }
139
140 if ( ! defined( 'RMP_PLUGIN_URL_V4' ) ) {
141 define ( 'RMP_PLUGIN_URL_V4', RMP_PLUGIN_URL . '/v4.0.0' );
142 }
143
144 /** Include the required files only*/
145 require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/autoloader.php';
146 require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/custom-functions.php';
147 require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/default-options.php';
148 require_once RMP_PLUGIN_PATH_V4 . '/libs/scssphp/vendor/autoload.php';
149
150 /**
151 * To load plugin manifest class.
152 *
153 * @return void
154 */
155 function responsive_menu_features_plugin_loader() {
156 \RMP\Features\Inc\Plugin::get_instance();
157 }
158
159 responsive_menu_features_plugin_loader();
160
161 // Active and de-active plugin hook.
162 register_activation_hook( __FILE__, 'responsive_menu_plugin_activation' );
163 register_deactivation_hook( __FILE__, 'responsive_menu_plugin_deactivation' );
164
165 /**
166 * Activation of plugin.
167 *
168 * @return void
169 */
170 function responsive_menu_plugin_activation() {
171
172 $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
173
174 // Check if responsive menu (paid version) is activate then deactivate it.
175 if( is_plugin_active( $plugin ) ) {
176 deactivate_plugins( $plugin );
177 set_transient( 'og-admin-notice-activation-pro', true, 5 );
178 }
179
180 flush_rewrite_rules();
181 }
182
183 /**
184 * Deactivation of plugin.
185 *
186 * @return void
187 */
188 function responsive_menu_plugin_deactivation() {
189 flush_rewrite_rules();
190 }
191
192 }