PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 4.7.4
Responsive Menu – Create Mobile-Friendly Menu v4.7.4
4.7.4 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 All 91 releases
← All changes | responsive-menu.php +141 -165 4.0.2 → 4.7.4 View file →
@@ -3,9 +3,9 @@
3 3 /*
4 4 Plugin Name: Responsive Menu
5 5 Plugin URI: https://expresstech.io
6 6 Description: Highly Customisable Responsive Menu Plugin for WordPress
7 -Version: 4.0.2
7 +Version: 4.7.4
8 8 Author: ExpressTech
9 9 Text Domain: responsive-menu
10 10 Author URI: https://responsive.menu
11 11 License: GPL2
@@ -15,210 +15,186 @@
15 15 /**
16 16 * Constant as plugin version.
17 17 */
18 18 if ( ! defined( 'RMP_PLUGIN_VERSION' ) ) {
19 - define( 'RMP_PLUGIN_VERSION', '4.0.2' );
19 + define( 'RMP_PLUGIN_VERSION', '4.7.4' );
20 20 }
21 21
22 -define('RESPONSIVE_MENU_URL', plugin_dir_url( __FILE__ ) );
22 +define( 'RESPONSIVE_MENU_URL', plugin_dir_url( __FILE__ ) );
23 23
24 -add_action('admin_init', 'check_responsive_menu_php_version');
24 +/**
25 + * Minimum PHP version. The bundled scssphp library uses nullable type
26 + * declarations (`?Type $arg = null`), which are a parse error before PHP 7.1.
27 + * Keep this in sync with `Requires PHP` in readme.txt.
28 + */
29 +if ( ! defined( 'RMP_MINIMUM_PHP_VERSION' ) ) {
30 + define( 'RMP_MINIMUM_PHP_VERSION', '7.1' );
31 +}
32 +
33 +add_action( 'admin_init', 'check_responsive_menu_php_version' );
25 34 function check_responsive_menu_php_version() {
26 - if(version_compare(PHP_VERSION, '5.4', '<')):
27 - add_action('admin_notices', 'responsive_menu_deactivation_text');
28 - deactivate_plugins(plugin_basename(__FILE__));
29 - endif;
35 + if ( version_compare( PHP_VERSION, RMP_MINIMUM_PHP_VERSION, '<' ) ) :
36 + add_action( 'admin_notices', 'responsive_menu_deactivation_text' );
37 + deactivate_plugins( plugin_basename( __FILE__ ) );
38 + endif;
30 39 }
31 40
32 41 function responsive_menu_deactivation_text() {
33 - echo '<div class="error"><p>' . sprintf(
34 - 'Responsive Menu requires PHP 5.4 or higher to function and has therefore been automatically disabled.
35 - You are still on %s.%sPlease speak to your web host about upgrading your PHP version.',
36 - PHP_VERSION,
37 - '<br /><br />'
38 - ) . '</p></div>';
42 + echo '<div class="' . esc_attr( 'error' ) . '"><p>' . sprintf(
43 + 'Responsive Menu requires PHP %1$s or higher to function and has therefore been automatically disabled.
44 + You are still on %2$s.%3$sPlease speak to your web host about upgrading your PHP version.',
45 + esc_html( RMP_MINIMUM_PHP_VERSION ),
46 + PHP_VERSION,
47 + '<br /><br />'
48 + ) . '</p></div>';
39 49 }
40 50
41 -if(version_compare(PHP_VERSION, '5.4', '<'))
42 - return;
51 +if ( version_compare( PHP_VERSION, RMP_MINIMUM_PHP_VERSION, '<' ) ) {
52 + return;
53 +}
43 54
44 -if ( empty( get_option( 'is_rmp_new_version') ) && ! empty( get_option('responsive_menu_version') ) ) {
55 +// If this file called directly then abort.
56 +if ( ! defined( 'WPINC' ) ) {
57 + die;
58 +}
45 59
46 60 /**
47 - * Add admin notice to upgrade the plugin license.
61 + * Constant as plugin file.
48 62 */
49 -add_action( 'admin_notices', 'rmp_move_new_version_admin_notice' );
50 -function rmp_move_new_version_admin_notice() {
63 +if ( ! defined( 'RMP_PLUGIN_FILE' ) ) {
64 + define( 'RMP_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . 'responsive-menu.php' );
65 +}
51 66
52 - if ( ! empty( get_option( 'rm_upgrade_admin_notice' ) ) ) {
53 - return;
54 - }
67 +/**
68 + * Constant as dir of plugin.
69 + */
70 +if ( ! defined( 'RMP_PLUGIN_DIR_NAME' ) ) {
71 + define( 'RMP_PLUGIN_DIR_NAME', untrailingslashit( dirname( plugin_basename( __FILE__ ) ) ) );
72 +}
55 73
56 - if ( empty( $_GET['page'] ) || 'responsive-menu' !== $_GET['page'] ) {
57 - return;
58 - }
59 -?>
74 +/**
75 + * Constant as plugin path.
76 + */
77 +if ( ! defined( 'RMP_PLUGIN_PATH' ) ) {
78 + define( 'RMP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
79 +}
60 80
61 - <div class="notice-responsive-menu notice error is-dismissible rmp-version-upgrade-notice">
62 - <div class="notice-responsive-menu-logo">
63 - <img src="<?php echo RESPONSIVE_MENU_URL;?>/imgs/responsive-menu-logo.png" width="60" height="60" alt="logo" />
64 - </div>
65 - <div class="notice-responsive-menu-message">
66 - <h4 style="font-weight: 700;"><?php _e('Responsive Menu', 'responsive-menu-pro'); ?></h4>
67 - <p><?php _e( 'Try out our new version with improved layout, live preview and many more.', 'responsive-menu-pro' ); ?></p>
68 - </div>
69 - <div class="notice-responsive-menu-action">
70 - <a href="javascript:void(0)" class="rmp-upgrade-version" > <?php _e('Try, New version', 'responsive-menu-pro'); ?> </a>
71 - </div>
72 - </div>
73 -<?php
81 +/**
82 + * Constant as plugin URL.
83 + */
84 +if ( ! defined( 'RMP_PLUGIN_URL' ) ) {
85 + define( 'RMP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
74 86 }
75 87
76 -add_action( 'admin_notices', 'og_pro_deactivate_pro_version_notice');
88 +/**
89 + * Constant as URI of assets build.
90 + */
91 +if ( ! defined( 'RMP_PLUGIN_BUILD_URI' ) ) {
92 + define( 'RMP_PLUGIN_BUILD_URI', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/build' );
93 +}
77 94
78 -function og_pro_deactivate_pro_version_notice() {
79 - if(get_transient('og-admin-notice-activation-pro')) {
80 - ?>
81 - <div class="notice notice-error is-dismissible">
82 - <p>Responsive Menu Pro has been deactivated<p/>
95 +/**
96 + * Constant as dir of assets build.
97 + */
98 +if ( ! defined( 'RMP_PLUGIN_BUILD_DIR' ) ) {
99 + define( 'RMP_PLUGIN_BUILD_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/assets/build' );
100 +}
83 101
84 - </div>
85 - <?php
86 - delete_transient('og-admin-notice-activation-pro');
87 - }
102 +/**
103 + * Constant as path of template file.
104 + */
105 +if ( ! defined( 'RMP_PLUGIN_TEMPLATE_PATH' ) ) {
106 + define( 'RMP_PLUGIN_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
88 107 }
89 108
90 -function og_deactivate_responsive_menu_pro() {
109 +if ( ! defined( 'RMP_PLUGIN_PATH_V4' ) ) {
110 + define( 'RMP_PLUGIN_PATH_V4', RMP_PLUGIN_PATH . '/v4.0.0' );
111 +}
91 112
92 - $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
93 -
94 - if( is_plugin_active($plugin) ){
95 - deactivate_plugins( 'responsive-menu-pro/responsive-menu-pro.php');
96 - set_transient( 'og-admin-notice-activation-pro', true, 5 );
97 -
98 - return;
99 - }
113 +if ( ! defined( 'RMP_PLUGIN_URL_V4' ) ) {
114 + define( 'RMP_PLUGIN_URL_V4', RMP_PLUGIN_URL . '/v4.0.0' );
100 115 }
101 -//to check weather another plugin is acivated or not.
102 -register_activation_hook( __FILE__, 'og_deactivate_responsive_menu_pro');
103 116
104 -include dirname(__FILE__) . '/vendor/autoload.php';
105 -include dirname(__FILE__) . '/config/default_options.php';
106 -include dirname(__FILE__) . '/config/services.php';
107 -include dirname(__FILE__) . '/config/wp/scripts.php';
108 -include dirname(__FILE__) . '/config/routing.php';
109 -include dirname(__FILE__) . '/migration.php';
110 -include dirname(__FILE__) . '/config/polylang.php';
117 +/** Include the required files only*/
118 +require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/autoloader.php';
119 +require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/custom-functions.php';
120 +require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/default-options.php';
121 +require_once RMP_PLUGIN_PATH_V4 . '/libs/scssphp/vendor/autoload.php';
122 +require_once RMP_PLUGIN_PATH_V4 . '/templates/rmp-roadmap.php';
111 123
112 -} else {
124 +/**
125 + * To load plugin manifest class.
126 + *
127 + * @return void
128 + */
129 +function responsive_menu_features_plugin_loader() {
130 + \RMP\Features\Inc\Plugin::get_instance();
131 +}
113 132
114 - // If this file called directly then abort.
115 - if ( ! defined( 'WPINC' ) ) {
116 - die;
117 - }
133 +responsive_menu_features_plugin_loader();
118 134
119 - /**
120 - * Constant as plugin file.
121 - */
122 - if ( ! defined( 'RMP_PLUGIN_FILE' ) ) {
123 - define('RMP_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . 'responsive-menu.php');
124 - }
135 +// Active and de-active plugin hook.
136 +register_activation_hook( __FILE__, 'responsive_menu_plugin_activation' );
137 +register_deactivation_hook( __FILE__, 'responsive_menu_plugin_deactivation' );
125 138
126 - /**
127 - * Constant as dir of plugin.
128 - */
129 - if ( ! defined( 'RMP_PLUGIN_DIR_NAME' ) ) {
130 - define( 'RMP_PLUGIN_DIR_NAME', untrailingslashit ( dirname( plugin_basename( __FILE__ ) ) ) );
131 - }
139 +/**
140 + * Activation of plugin.
141 + *
142 + * @return void
143 + */
144 +function responsive_menu_plugin_activation() {
145 + $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
132 146
133 - /**
134 - * Constant as plugin path.
135 - */
136 - if ( ! defined( 'RMP_PLUGIN_PATH' ) ) {
137 - define( 'RMP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
138 - }
147 + // Check if responsive menu (paid version) is activate then deactivate it.
148 + if ( is_plugin_active( $plugin ) ) {
149 + deactivate_plugins( $plugin );
150 + set_transient( 'og-admin-notice-activation-pro', true, 5 );
151 + }
139 152
140 - /**
141 - * Constant as plugin URL.
142 - */
143 - if ( ! defined( 'RMP_PLUGIN_URL' ) ) {
144 - define( 'RMP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
145 - }
153 + // Keep the plugin's uploads directory from serving anything executable.
154 + \RMP\Features\Inc\Theme_Manager::get_instance()->protect_upload_dir();
146 155
147 - /**
148 - * Constant as URI of assets build.
149 - */
150 - if ( ! defined( 'RMP_PLUGIN_BUILD_URI' ) ) {
151 - define( 'RMP_PLUGIN_BUILD_URI', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/build' );
152 - }
156 + flush_rewrite_rules();
157 +}
153 158
154 - /**
155 - * Constant as dir of assets build.
156 - */
157 - if ( ! defined( 'RMP_PLUGIN_BUILD_DIR' ) ) {
158 - define( 'RMP_PLUGIN_BUILD_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/assets/build' );
159 - }
159 +/**
160 + * Deactivation of plugin.
161 + *
162 + * @return void
163 + */
164 +function responsive_menu_plugin_deactivation() {
165 + flush_rewrite_rules();
166 +}
160 167
161 - /**
162 - * Constant as path of template file.
163 - */
164 - if ( ! defined( 'RMP_PLUGIN_TEMPLATE_PATH' ) ) {
165 - define( 'RMP_PLUGIN_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
166 - }
168 +/**
169 + * Function to include the menu themes templates.
170 + *
171 + * @since 4.0.5
172 + *
173 + * @return void
174 + */
175 +function rm_includes_menu_theme_template() {
176 + $theme_manager = \RMP\Features\Inc\Theme_Manager::get_instance();
167 177
168 - if ( ! defined( 'RMP_PLUGIN_PATH_V4' ) ) {
169 - define ( 'RMP_PLUGIN_PATH_V4', RMP_PLUGIN_PATH . '/v4.0.0' );
170 - }
178 + // Check class theme manager has this method or not.
179 + if ( ! method_exists( $theme_manager, 'get_menu_active_themes' ) ) {
180 + return;
181 + }
171 182
172 - if ( ! defined( 'RMP_PLUGIN_URL_V4' ) ) {
173 - define ( 'RMP_PLUGIN_URL_V4', RMP_PLUGIN_URL . '/v4.0.0' );
174 - }
183 + $active_themes = $theme_manager->get_menu_active_themes();
184 + if ( empty( $active_themes ) ) {
185 + return;
186 + }
175 187
176 - /** Include the required files only*/
177 - require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/autoloader.php';
178 - require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/custom-functions.php';
179 - require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/default-options.php';
180 - require_once RMP_PLUGIN_PATH_V4 . '/libs/scssphp/vendor/autoload.php';
188 + // Include the file from each theme which has php template.
189 + foreach ( $active_themes as $key => $theme_name ) {
190 + $theme_index = $theme_manager->get_theme_index_file( $theme_name );
181 191
182 - /**
183 - * To load plugin manifest class.
184 - *
185 - * @return void
186 - */
187 - function responsive_menu_features_plugin_loader() {
188 - \RMP\Features\Inc\Plugin::get_instance();
189 - }
190 -
191 - responsive_menu_features_plugin_loader();
192 -
193 - // Active and de-active plugin hook.
194 - register_activation_hook( __FILE__, 'responsive_menu_plugin_activation' );
195 - register_deactivation_hook( __FILE__, 'responsive_menu_plugin_deactivation' );
196 -
197 - /**
198 - * Activation of plugin.
199 - *
200 - * @return void
201 - */
202 - function responsive_menu_plugin_activation() {
203 -
204 - $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
205 -
206 - // Check if responsive menu (paid version) is activate then deactivate it.
207 - if( is_plugin_active( $plugin ) ) {
208 - deactivate_plugins( $plugin );
209 - set_transient( 'og-admin-notice-activation-pro', true, 5 );
192 + if ( file_exists( $theme_index ) ) {
193 + require_once $theme_index;
210 194 }
211 -
212 - flush_rewrite_rules();
213 195 }
196 +}
214 197
215 - /**
216 - * Deactivation of plugin.
217 - *
218 - * @return void
219 - */
220 - function responsive_menu_plugin_deactivation() {
221 - flush_rewrite_rules();
222 - }
198 +rm_includes_menu_theme_template();
223 199
224 -}
200 +require_once 'review-banner-class.php';