PluginProbe
Booking Calendar / 11.8.2
Booking Calendar v11.8.2
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | core/wpbc.php +180 -225 10.11.311.8.2 View file →
@@ -13,11 +13,11 @@
13 13 */
14 14
15 15 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16 16
17 -global $wp_version;
18 -$min_wp_version = version_compare( WP_BK_MIN_WP_VERSION, $wp_version, '<=' ); // FixIn: 7.0.1.6.
19 -if ( ( ! class_exists( 'Booking_Calendar' ) ) && ( $min_wp_version ) ) :
17 +global $wp_version;
18 +$wpbc_min_wp_version = version_compare( WP_BK_MIN_WP_VERSION, $wp_version, '<=' ); // FixIn: 7.0.1.6.
19 +if ( ( ! class_exists( 'Booking_Calendar' ) ) && ( $wpbc_min_wp_version ) ) :
20 20
21 21
22 22 // General Init Class
23 23 final class Booking_Calendar {
@@ -40,8 +40,11 @@
40 40 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Booking_Calendar ) ) {
41 41
42 42 self::$instance = new Booking_Calendar;
43 43 self::$instance->includes();
44 + if ( defined( 'WPBC_BOOKING_MODES_ACTIVE_ENGINE' ) && 'none' === WPBC_BOOKING_MODES_ACTIVE_ENGINE ) {
45 + return self::$instance;
46 + }
44 47 self::$instance->define_version();
45 48
46 49 add_action( 'init', array( self::$instance, 'wp_inited' ) );
47 50
@@ -58,9 +61,9 @@
58 61
59 62 make_bk_action('wpbc_booking_calendar_started');
60 63
61 64 if ( $is_continue_at_frontend ) { // Possible Load Admin or Front-End page
62 -
65 +
63 66 self::$instance->js = new WPBC_JS;
64 67 self::$instance->css = new WPBC_CSS;
65 68
66 69 if( is_admin() ) {
@@ -125,15 +128,8 @@
125 128
126 129 $title .= '<span style="margin-top:-2px;'.$badge_style.'" class="wpbc_badge_count name_item update-plugins count-'.$update_count.'" title=""><span class="update-count bk-update-count" style="white-space: nowrap;word-wrap: normal;">' . number_format_i18n( $update_count ) . '</span></span>';
127 130 $title .= '</div>';
128 131
129 - /**
130 - global $menu;
131 - if ( current_user_can( ) ) {
132 - $menu[] = array( '', 'read', 'separator-wpbc', '', 'wp-menu-separator wpbc' );
133 - }
134 - debuge($menu);
135 - */
136 132
137 133 $booking_menu_position = get_bk_option( 'booking_menu_position' );
138 134 switch ( $booking_menu_position ) {
139 135 case 'top':
@@ -147,14 +143,31 @@
147 143 case 'bottom':
148 144 $booking_menu_position = '99.999';
149 145 break;
150 146 default:
151 - $booking_menu_position = '3.3';
147 + /**
148 + * 3.3 - top //( 58.9 ) // - middle
149 + (Optional). Positions for Core Menu Items
150 + 2 Dashboard
151 + 4 Separator
152 + 5 Posts
153 + 10 Media
154 + 15 Links
155 + 20 Pages
156 + 25 Comments
157 + 59 Separator
158 + 60 Appearance
159 + 65 Plugins
160 + 70 Users
161 + 75 Tools
162 + 80 Settings
163 + 99 Separator
164 + */
165 + $booking_menu_position = '3.3';
152 166 break;
153 167 }
154 168
155 - // FixIn: 10.11.3.3.
156 -
169 +/**
157 170 // //FixIn: 9.0.1.7 //scale image by this params: viewBox="-2 -1 20 20"
158 171 // if( 0 ) {
159 172 // // calendar4-range https://icons.getbootstrap.com/icons/calendar4-range/
160 173 // $svg_icon_integarted = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="" viewBox="-2 -1 20 20">'
@@ -178,180 +191,112 @@
178 191 // $svg_icon_integarted = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-calendar3-range" viewBox="-2 -1 20 20">'
179 192 // . '<path d="M14 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM1 3.857C1 3.384 1.448 3 2 3h12c.552 0 1 .384 1 .857v10.286c0 .473-.448.857-1 .857H2c-.552 0-1-.384-1-.857V3.857z"/>'
180 193 // . '<path d="M7 10a1 1 0 0 0 0-2H1v2h6zm2-3h6V5H9a1 1 0 0 0 0 2z"/>'
181 194 // . '</svg>';
195 +*/
182 196
183 197 $svg_icon_integarted = wpbc_get_svg_logo( '#aaa', '#aaa', '0.4' ); // '#aaa', '#aaa', '0.2' .
184 198
185 - self::$instance->admin_menu['master'] = new WPBC_Admin_Menus(
186 - 'wpbc' , array (
187 - 'in_menu' => 'root'
188 - //, 'mune_icon_url' => '/assets/img/icon-16x16.png'
189 - , 'mune_icon_url' => $svg_icon_integarted // FixIn: 9.0.1.7.
190 - , 'menu_title' => $title
191 - , 'menu_title_second' => __('Bookings', 'booking')
192 - , 'page_header' => __('Bookings Listing','booking')
193 - , 'browser_header' => __('Bookings Listing', 'booking') . ' - ' . __('Booking Calendar', 'booking')
194 - , 'user_role' => get_bk_option( 'booking_user_role_booking' )
195 - , 'position' => $booking_menu_position // 3.3 - top //( 58.9 ) // - middle
196 - /*
197 - (Optional). Positions for Core Menu Items
198 - 2 Dashboard
199 - 4 Separator
200 - 5 Posts
201 - 10 Media
202 - 15 Links
203 - 20 Pages
204 - 25 Comments
205 - 59 Separator
206 - 60 Appearance
207 - 65 Plugins
208 - 70 Users
209 - 75 Tools
210 - 80 Settings
211 - 99 Separator
212 - */
213 - )
214 - );
199 + self::$instance->admin_menu['master'] = new WPBC_Admin_Menus( 'wpbc', array(
200 + 'in_menu' => 'root',
201 + 'mune_icon_url' => $svg_icon_integarted,
202 + 'menu_title' => $title,
203 + 'menu_title_second' => __( 'Bookings', 'booking' ),
204 + 'page_header' => __( 'Bookings Listing', 'booking' ),
205 + 'browser_header' => __( 'Bookings Listing', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ),
206 + 'user_role' => get_bk_option( 'booking_user_role_booking' ),
207 + 'position' => $booking_menu_position,
208 + ) );
215 209
216 - self::$instance->admin_menu['new'] = new WPBC_Admin_Menus(
217 - 'wpbc-new' , array (
218 - 'in_menu' => 'wpbc'
219 - , 'menu_title' => '+ ' . ucwords( __('Add booking', 'booking') ) // FixIn: 10.9.3.1.
220 - , 'page_header' => ucwords( __('Add booking','booking') )
221 - , 'browser_header'=> ucwords( __('Add booking', 'booking') ) . ' - ' . __('Booking Calendar', 'booking')
222 - , 'user_role' => get_bk_option( 'booking_user_role_addbooking' )
223 - )
224 - );
225 - self::$instance->admin_menu['availability'] = new WPBC_Admin_Menus( // FixIn: 9.3.0.1.
226 - 'wpbc-availability' , array (
227 - 'in_menu' => 'wpbc'
228 - , 'menu_title' => ucwords( __('Availability', 'booking') )
229 - , 'page_header' => ucwords( __('Availability','booking') )
230 - , 'browser_header'=> ucwords( __('Availability', 'booking') ) . ' - ' . __('Booking Calendar', 'booking')
231 - , 'user_role' => get_bk_option( 'booking_user_role_availability' ) // FixIn: 9.5.2.2.
232 - )
233 - );
234 - //FixIn: 9.8.15.2.4
235 - if ( class_exists( 'wpdev_bk_biz_m' ) )
236 - self::$instance->admin_menu['prices'] = new WPBC_Admin_Menus(
237 - 'wpbc-prices' , array (
238 - 'in_menu' => 'wpbc'
239 - , 'menu_title' => __('Prices', 'booking')
240 - , 'page_header' => ucwords( __('Booking Prices','booking') )
241 - , 'browser_header'=> __('Prices', 'booking') . ' - ' . __('Booking Calendar', 'booking')
242 - , 'user_role' => get_bk_option( 'booking_user_role_prices' ) //FixIn: 9.8.15.2.6
243 - )
244 - );
245 - if ( class_exists( 'wpdev_bk_personal' ) ) {
246 - self::$instance->admin_menu['resources'] = new WPBC_Admin_Menus(
247 - 'wpbc-resources' , array (
248 - 'in_menu' => 'wpbc'
249 - , 'menu_title' => __('Resources', 'booking')
250 - , 'page_header' => ucwords( __('Booking resources','booking') )
251 - , 'browser_header'=> __('Resources', 'booking') . ' - ' . __('Booking Calendar', 'booking')
252 - , 'user_role' => get_bk_option( 'booking_user_role_resources' )
253 - )
254 - );
255 - }
210 + self::$instance->admin_menu['new'] = new WPBC_Admin_Menus( 'wpbc-new', array(
211 + 'in_menu' => 'wpbc',
212 + 'menu_title' => '+ ' . ucwords( __( 'Add booking', 'booking' ) ),
213 + 'page_header' => ucwords( __( 'Add booking', 'booking' ) ),
214 + 'browser_header' => ucwords( __( 'Add booking', 'booking' ) ) . ' - ' . __( 'Booking Calendar', 'booking' ),
215 + 'user_role' => get_bk_option( 'booking_user_role_addbooking' ),
216 + ) );
256 217
218 + self::$instance->admin_menu['resources'] = new WPBC_Admin_Menus( 'wpbc-resources', array(
219 + 'in_menu' => 'wpbc',
220 + 'menu_title' => __( 'Resources', 'booking' ),
221 + 'page_header' => ucwords( __( 'Booking resources', 'booking' ) ),
222 + 'browser_header' => __( 'Resources', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ),
223 + 'user_role' => ( ( class_exists( 'wpdev_bk_personal' ) ) ? get_bk_option( 'booking_user_role_resources' )
224 + : get_bk_option( 'booking_user_role_settings' ) ),
225 + ) );
257 226
258 - if ( ! class_exists( 'wpdev_bk_personal' ) ) { // FixIn: 10.1.3.1.
259 - // FixIn: 9.8.15.7.
260 - self::$instance->admin_menu['resources'] = new WPBC_Admin_Menus(
261 - 'wpbc-resources' , array (
262 - 'in_menu' => 'wpbc'
263 - , 'menu_title' => __('Publish', 'booking') // __('Resource', 'booking')
264 - , 'page_header' => ucwords( __('Booking resource','booking') )
265 - , 'browser_header'=> __('Resource', 'booking') . ' - ' . __('Booking Calendar', 'booking')
266 - , 'user_role' => get_bk_option( 'booking_user_role_settings' )
267 - )
268 - );
227 + self::$instance->admin_menu['availability'] = new WPBC_Admin_Menus( // FixIn: 9.3.0.1.
228 + 'wpbc-availability', array(
229 + 'in_menu' => 'wpbc',
230 + 'menu_title' => ucwords( __( 'Availability', 'booking' ) ),
231 + 'page_header' => ucwords( __( 'Availability', 'booking' ) ),
232 + 'browser_header' => ucwords( __( 'Availability', 'booking' ) ) . ' - ' . __( 'Booking Calendar', 'booking' ),
233 + 'user_role' => get_bk_option( 'booking_user_role_availability' ),
234 + ) );
235 +
236 + if ( class_exists( 'wpdev_bk_biz_m' ) ) {
237 + self::$instance->admin_menu['prices'] = new WPBC_Admin_Menus( 'wpbc-prices', array(
238 + 'in_menu' => 'wpbc',
239 + 'menu_title' => __( 'Prices', 'booking' ),
240 + 'page_header' => ucwords( __( 'Booking Prices', 'booking' ) ),
241 + 'browser_header' => __( 'Prices', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ),
242 + 'user_role' => get_bk_option( 'booking_user_role_prices' ), //FixIn: 9.8.15.2.6
243 + ) );
269 244 }
270 245
246 + self::$instance->admin_menu['services'] = new WPBC_Admin_Menus( 'wpbc-services', array(
247 + 'in_menu' => 'wpbc',
248 + 'menu_title' => __( 'Services', 'booking' ),
249 + 'page_header' => __( 'Services', 'booking' ),
250 + 'browser_header' => __( 'Services', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ),
251 + 'user_role' => get_bk_option( 'booking_user_role_settings' ),
252 + ) );
271 253
272 - self::$instance->admin_menu['settings'] = new WPBC_Admin_Menus(
273 - 'wpbc-settings' , array (
274 - 'in_menu' => 'wpbc'
275 - , 'menu_title' => __('Settings', 'booking')
276 - , 'page_header' => __('General Settings','booking')
277 - , 'browser_header'=> __('Settings', 'booking') . ' - ' . __('Booking Calendar', 'booking')
278 - , 'user_role' => get_bk_option( 'booking_user_role_settings' )
279 - )
280 - );
254 + self::$instance->admin_menu['settings'] = new WPBC_Admin_Menus( 'wpbc-settings', array(
255 + 'in_menu' => 'wpbc',
256 + 'menu_title' => __( 'Settings', 'booking' ),
257 + 'page_header' => __( 'General Settings', 'booking' ),
258 + 'browser_header' => __( 'Settings', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ),
259 + 'user_role' => get_bk_option( 'booking_user_role_settings' ),
260 + ) );
281 261
262 + if ( wpbc_is_user_can_access_wizard_page() ) {
282 263
264 + $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
265 + $is_setup_menu_visible = wpbc_setup_wizard_is_initial_install_site()
266 + && ! $setup_steps->db__is_all_steps_completed();
283 267
268 + self::$instance->admin_menu['setup'] = new WPBC_Admin_Menus( 'wpbc-setup', array(
269 + 'in_menu' => $is_setup_menu_visible ? 'wpbc' : false,
270 + 'menu_title' => $setup_steps->get_plugin_menu_title__setup_progress(),
271 + 'page_header' => ucwords( __( 'Setup', 'booking' ) ),
272 + 'browser_header' => ucwords( __( 'Setup', 'booking' ) ) . ' - ' . __( 'Booking Calendar', 'booking' ),
273 + 'user_role' => get_bk_option( 'booking_user_role_settings' ),
274 + ) );
275 + }
284 276
285 - if (
286 - ( wpbc_is_user_can_access_wizard_page() ) &&
287 - ( ! wpbc_setup_wizard_page__is_all_steps_completed() )
288 - ){
289 277
290 - $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
291 -
292 - self::$instance->admin_menu['setup'] = new WPBC_Admin_Menus(
293 - 'wpbc-setup' , array (
294 - 'in_menu' => 'wpbc'
295 - , 'menu_title' => $setup_steps->get_plugin_menu_title__setup_progress()
296 - , 'page_header' => ucwords( __('Setup','booking') )
297 - , 'browser_header' => ucwords( __('Setup', 'booking') ) . ' - ' . __('Booking Calendar', 'booking')
298 - , 'user_role' => get_bk_option( 'booking_user_role_settings' ) //FixIn: 9.8.15.2.6
299 - )
300 - );
301 - }
302 -
303 -
304 -
305 278 $simulate_user_id = wpbc_mu__is_simulated_login_as_user();
306 279 if ( ! empty( $simulate_user_id ) ) {
307 280
308 281 $custom_user = get_userdata( $simulate_user_id );
309 282
310 - self::$instance->admin_menu['log_off'] = new WPBC_Admin_Menus(
311 - 'wpbc-log-off' , array (
312 - 'in_menu' => 'wpbc'
313 - //, 'menu_title' => __( 'Log Out Simulated Login as', 'booking' ) . ' "' . $custom_user->display_name . '"'
314 - , 'menu_title' => '<span style="color:#fffcdf;font-size: 11px;font-weight: 400;" title="'
315 - . esc_attr( __( 'Log out as regular user and login as super booking admin user', 'booking' ) )
316 - .'">'
317 - .__( 'Back to Super Admin', 'booking' )
318 - .'<span>'
319 - /* translators: 1: ... */
320 - , 'page_header' => ucwords( sprintf( __( 'Need even more functionality? Check %1$s higher versions %2$s', 'booking' ), '', '' ) )
321 - , 'browser_header'=> 'Log In as Super Admin'
322 - , 'user_role' => get_bk_option( 'booking_user_role_booking' )
323 - )
324 - );
283 + self::$instance->admin_menu['log_off'] = new WPBC_Admin_Menus( 'wpbc-log-off', array(
284 + 'in_menu' => 'wpbc',
285 + 'menu_title' => '<span style="color:#fffcdf;font-size: 11px;font-weight: 400;" title="' . esc_attr( __( 'Log out as regular user and login as super booking admin user', 'booking' ) ) . '">' . __( 'Back to Super Admin', 'booking' ) . '<span>',
286 + 'page_header' => ucwords( sprintf( __( 'Need even more functionality? Check %1$s higher versions %2$s', 'booking' ), '', '' ) ), /* translators: 1: ... */
287 + 'browser_header' => 'Log In as Super Admin',
288 + 'user_role' => get_bk_option( 'booking_user_role_booking' ),
289 + ) );
325 290 }
326 291
292 +}
327 293
328 294
329 - //FixIn: 8.0.1.6 // FixIn: 10.1.3.1.
330 - if ( ! class_exists( 'wpdev_bk_personal' ) ) {
331 295
332 - $is_show_this_menu = get_bk_option('booking_menu_go_pro');
333 -
334 - if ( 'hide' !== $is_show_this_menu )
335 - self::$instance->admin_menu['go_pro'] = new WPBC_Admin_Menus(
336 - 'wpbc-go-pro' , array (
337 - 'in_menu' => 'wpbc'
338 - , 'menu_title' => __('Get Pro', 'booking')
339 - /* translators: 1: ... */
340 - , 'page_header' => ucwords( sprintf( __( 'Need even more functionality? Check %1$s higher versions %2$s', 'booking' ), '', '' ) )
341 - , 'browser_header'=> 'Booking Calendar'
342 - , 'user_role' => get_bk_option( 'booking_user_role_booking' )
343 - )
344 - );
345 - }
346 -
347 -}
348 -
349 -
350 -
351 - /**
296 + /**
352 297 * Get Menu Object
353 - *
298 + *
354 299 * @param type - menu type
355 300 * @return boolean
356 301 */
357 302 public function get_menu_object( $type ) {
@@ -357,27 +302,38 @@
357 302 public function get_menu_object( $type ) {
358 303
359 304 if ( isset( self::$instance->admin_menu[ $type ] ) )
360 305 return self::$instance->admin_menu[ $type ];
361 - else
306 + else
362 307 return false;
363 308 }
364 309
365 -
310 +
366 311 // Include Files
367 312 private function includes() {
368 - require_once WPBC_PLUGIN_DIR . '/core/wpbc-include.php' ;
313 + require_once WPBC_PLUGIN_DIR . '/includes/wpbc-include.php' ;
369 314 }
370 -
371 -
372 - private function define_version() {
373 -
374 - // GET VERSION NUMBER
375 - $plugin_data = wpbc_file__read_header_info( WPBC_FILE , array( 'Name' => 'Plugin Name', 'PluginURI' => 'Plugin URI', 'Version' => 'Version', 'Description' => 'Description', 'Author' => 'Author', 'AuthorURI' => 'Author URI', 'TextDomain' => 'Text Domain', 'DomainPath' => 'Domain Path' ) , 'plugin' );
376 - if (!defined('WPDEV_BK_VERSION')) define('WPDEV_BK_VERSION', $plugin_data['Version'] );
377 - }
378 315
379 316
317 + private function define_version() {
318 +
319 + // GET VERSION NUMBER
320 + $plugin_data = wpbc_file__read_header_info( WPBC_FILE, array(
321 + 'Name' => 'Plugin Name',
322 + 'PluginURI' => 'Plugin URI',
323 + 'Version' => 'Version',
324 + 'Description' => 'Description',
325 + 'Author' => 'Author',
326 + 'AuthorURI' => 'Author URI',
327 + 'TextDomain' => 'Text Domain',
328 + 'DomainPath' => 'Domain Path',
329 + ), 'plugin' );
330 + if ( ! defined( 'WPDEV_BK_VERSION' ) ) {
331 + define( 'WPDEV_BK_VERSION', $plugin_data['Version'] );
332 + }
333 + }
334 +
335 +
380 336 // Cloning instances of the class is forbidden
381 337 public function __clone() {
382 338
383 339 _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' );
@@ -382,9 +338,9 @@
382 338
383 339 _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' );
384 340 }
385 341
386 -
342 +
387 343 // Unserializing instances of the class is forbidden
388 344 public function __wakeup() {
389 345
390 346 _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' );
@@ -389,12 +345,12 @@
389 345
390 346 _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' );
391 347 }
392 348
393 -
349 +
394 350 // Initialization
395 351 private function start(){
396 -
352 +
397 353 if ( ( defined( 'DOING_AJAX' ) ) && ( DOING_AJAX ) ){ // New A J A X R e s p o n d e r
398 354
399 355 if ( 1 ) {
400 356 $wpdev_booking_obj_in_ajax = new wpdev_booking(); // GO
@@ -403,10 +359,10 @@
403 359 $wpdev_bk_personal_in_ajax = new wpdev_bk_personal();
404 360 }
405 361 }
406 362
407 - require_once WPBC_PLUGIN_DIR . '/core/lib/wpbc-ajax.php'; // Ajax
408 -
363 + require_once WPBC_PLUGIN_DIR . '/core/lib/wpbc-ajax.php'; // Ajax
364 +
409 365 return false;
410 366 } else { // Usual Loading of plugin
411 367
412 368 // We are having Response, its executed in other file: wpbc-response.php
@@ -416,12 +372,12 @@
416 372 if( is_admin() ) {
417 373 // Define Notices System
418 374 self::$instance->notice = new WPBC_Notices();
419 375 }
420 -
376 +
421 377 // Normal Start
422 378 self::$instance->booking_obj = new wpdev_booking(); // GO
423 -
379 +
424 380 // Cron Jobs ..... /////////////////////////////////////////////////
425 381 self::$instance->cron = new WPBC_Cron();
426 382 ////////////////////////////////////////////////////////////////////
427 383 }
@@ -426,16 +382,16 @@
426 382 ////////////////////////////////////////////////////////////////////
427 383 }
428 384 return true;
429 385 }
430 -
386 +
431 387 }
432 388
433 389 else: // Its seems that some instance of Booking Calendar still activted!!!
434 -
390 +
435 391 // FixIn: 7.0.1.6.
436 - global $wp_version;
437 - $min_wp_version = version_compare( WP_BK_MIN_WP_VERSION, $wp_version, '<=' );
392 + global $wp_version;
393 + $wpbc_min_wp_version = version_compare( WP_BK_MIN_WP_VERSION, $wp_version, '<=' );
438 394
439 395 // FixIn: 7.0.1.6.
440 396 function wpbc_show_min_wp_version_error() {
441 397
@@ -440,27 +396,27 @@
440 396 function wpbc_show_min_wp_version_error() {
441 397
442 398 $message_type = 'error';
443 399 $title = __( 'Error' , 'booking') . '!';
444 -
445 -
400 +
401 +
446 402 $message = 'Booking Calendar ';
447 -
448 - $booking_version_num = get_option( 'booking_version_num');
403 +
404 + $booking_version_num = get_option( 'booking_version_num');
449 405 if ( ! empty( $booking_version_num ) )
450 - $message .= '<strong>' . $booking_version_num . '</strong> ';
451 -
452 -
453 - global $wp_version;
406 + $message .= '<strong>' . $booking_version_num . '</strong> ';
454 407
455 - $message .= sprintf( 'require minimum %s . You are using %s. '
456 - , ' <strong>' . 'WordPress ' . WP_BK_MIN_WP_VERSION . '</strong>'
457 - , ' <strong>' . 'WordPress ' . $wp_version . '</strong>' );
408 +
409 + global $wp_version;
410 +
411 + $message .= sprintf( 'require minimum %s . You are using %s. '
412 + , ' <strong>' . 'WordPress ' . WP_BK_MIN_WP_VERSION . '</strong>'
413 + , ' <strong>' . 'WordPress ' . $wp_version . '</strong>' );
458 414 if ( current_user_can( 'update_core' ) ){
459 415 $message .= ' <a href="' . esc_url( self_admin_url( 'update-core.php' ) ) . '">' . 'Return to Dashboard &rarr; Updates' . '</a>';
460 - }
461 -
462 -
416 + }
417 +
418 +
463 419 $message_content = '';
464 420
465 421 $message_content .= '<div class="clear"></div>';
466 422
@@ -475,29 +431,29 @@
475 431
476 432 $message_content .= '<div class="clear"></div>';
477 433
478 434 echo wp_kses_post( $message_content );
479 - }
480 -
435 + }
436 +
481 437 function wpbc_show_activation_error() {
482 438
483 439 $message_type = 'error';
484 440 $title = __( 'Error' , 'booking') . '!';
485 441 $message = 'Please deactivate previous old version of' . ' ' . 'Booking Calendar';
486 -
487 - $booking_version_num = get_option( 'booking_version_num');
442 +
443 + $booking_version_num = get_option( 'booking_version_num');
488 444 if ( ! empty( $booking_version_num ) )
489 - $message .= ' <strong>' . $booking_version_num . '</strong>';
490 -
491 -
445 + $message .= ' <strong>' . $booking_version_num . '</strong>';
446 +
447 +
492 448 $is_delete_if_deactive = get_bk_option( 'booking_is_delete_if_deactive' ); // check
493 449
494 - if ( $is_delete_if_deactive == 'On' ) {
495 -
450 + if ( $is_delete_if_deactive == 'On' ) {
451 +
496 452 $message .= '<br/><br/> <strong>Warning!</strong> ' . 'All plugin data will be deleted when plugin had deactivated.' . ' '
497 453 . sprintf( 'If you want to save your plugin data, please uncheck the %s"Delete plugin data"%s at the', '<strong>', '</strong>') . ' ' . __( 'Settings' , 'booking' ) . '.';
498 454 }
499 -
455 +
500 456 $message_content = '';
501 457
502 458 $message_content .= '<div class="clear"></div>';
503 459
@@ -510,18 +466,18 @@
510 466
511 467 $message_content .= '</div>';
512 468
513 469 $message_content .= '<div class="clear"></div>';
514 -
470 +
515 471 echo wp_kses_post( $message_content );
516 472 }
517 473
518 474
519 - if ( ! $min_wp_version ) // FixIn: 7.0.1.6.
475 + if ( ! $wpbc_min_wp_version ) // FixIn: 7.0.1.6.
520 476 add_action('admin_notices', 'wpbc_show_min_wp_version_error');
521 477 else
522 478 add_action('admin_notices', 'wpbc_show_activation_error');
523 -
479 +
524 480 return; // Exit
525 481
526 482 endif;
527 483
@@ -543,10 +499,10 @@
543 499
544 500
545 501 //if ( ! defined( 'SAVEQUERIES') ) define('SAVEQUERIES', true);
546 502
547 - //add_action( 'admin_footer', 'show_debug_info', 130 );
548 -function show_debug_info() {
503 + //add_action( 'admin_footer', 'wpbc_show_debug_info', 130 );
504 +function wpbc_show_debug_info() {
549 505
550 506 $server_request_uri = ( ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( $_SERVER['REQUEST_URI'] ) : '' ); /* phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ /* FixIn: sanitize_unslash */
551 507 $request_uri = $server_request_uri; //FixIn:5.4.1
552 508 if ( strpos( $request_uri, 'page=wpbc') === false ) {
@@ -551,16 +507,16 @@
551 507 $request_uri = $server_request_uri; //FixIn:5.4.1
552 508 if ( strpos( $request_uri, 'page=wpbc') === false ) {
553 509 return;
554 510 }
555 - echo '<div style="width:800px;margin:10px auto;"><style type="text/css"> a:link{background: inherit !important; } pre { white-space: pre-wrap; }</style>';
511 + echo '<div style="width:800px;margin:10px auto;"><style type="text/css"> a:link{background: inherit !important; } pre { white-space: pre-wrap; }</style>';
556 512 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_phpinfo
557 513 phpinfo(); echo '</div>'; return;
558 -
559 - ?><div style="width:auto;margin:0 0 0 215px;font-size:11px; "><?php
560 514
515 + ?><div style="width:auto;margin:0 0 0 215px;font-size:11px; "><?php
516 +
561 517 // SYSTEM INFO SHOWING ////////////////////////////////////////////////////////
562 -
518 +
563 519 //Note firstly need to define this in functions.php file: define('SAVEQUERIES', true);
564 520 global $wpdb;
565 521 echo '<div class="clear"></div>START SYSTEM<pre>';
566 522 $qq_kk = 0;
@@ -566,10 +522,10 @@
566 522 $qq_kk = 0;
567 523 $total_time = 0;
568 524 $total_num = 0;
569 525 foreach ( $wpdb->queries as $qq_k => $qq ) {
570 - if (
571 - ( strpos( $qq[0], 'booking') !== false )
526 + if (
527 + ( strpos( $qq[0], 'booking') !== false )
572 528
573 529 ) {
574 530 if ( $qq[1] > 0.002 ) { echo '<div style="color:#A77;font-weight:bold;">'; }
575 531 debuge($qq_kk++, $qq);
@@ -579,21 +535,20 @@
579 535 }
580 536 }
581 537
582 538 echo '<div><pre class="prettyprint linenums" style="font-size:18px;">[' . esc_html( $total_num . '/' . $total_time ) . '] WPBC Requests TOTAL TIME</pre></div>';
583 -
539 +
584 540 echo '<div class="clear"></div>';
585 541
586 542 echo '<div><pre class="prettyprint linenums" style="font-size:18px;">' . esc_html( get_num_queries() . '/' . timer_stop( 0, 3 ) ) . 'qps</pre></div>';
587 -
588 - echo '<div class="clear"></div>';
589 -
543 +
544 + echo '<div class="clear"></div>';
545 +
590 546 echo "</pre>";
591 547 ?><br/><br/><br/><br/><br/><br/><?php
592 - echo '<div class="clear"></div>';
548 + echo '<div class="clear"></div>';
593 549
594 550 ////////////////////////////////////////////////////////////////////////////////
595 551 ?></div><?php
596 -
552 +
597 553 echo '</div>';
598 554 }
599 -