| @@ -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 | |
| @@ -140,14 +143,31 @@ | ||
| 140 | 143 | case 'bottom': |
| 141 | 144 | $booking_menu_position = '99.999'; |
| 142 | 145 | break; |
| 143 | 146 | default: |
| 144 | - $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'; | |
| 145 | 166 | break; |
| 146 | 167 | } |
| 147 | 168 | |
| 148 | - // FixIn: 10.11.3.3. | |
| 149 | - | |
| 169 | +/** | |
| 150 | 170 | // //FixIn: 9.0.1.7 //scale image by this params: viewBox="-2 -1 20 20" |
| 151 | 171 | // if( 0 ) { |
| 152 | 172 | // // calendar4-range https://icons.getbootstrap.com/icons/calendar4-range/ |
| 153 | 173 | // $svg_icon_integarted = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="" viewBox="-2 -1 20 20">' |
| @@ -171,159 +191,112 @@ | ||
| 171 | 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">' |
| 172 | 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"/>' |
| 173 | 193 | // . '<path d="M7 10a1 1 0 0 0 0-2H1v2h6zm2-3h6V5H9a1 1 0 0 0 0 2z"/>' |
| 174 | 194 | // . '</svg>'; |
| 195 | +*/ | |
| 175 | 196 | |
| 176 | 197 | $svg_icon_integarted = wpbc_get_svg_logo( '#aaa', '#aaa', '0.4' ); // '#aaa', '#aaa', '0.2' . |
| 177 | 198 | |
| 178 | - self::$instance->admin_menu['master'] = new WPBC_Admin_Menus( | |
| 179 | - 'wpbc' , array ( | |
| 180 | - 'in_menu' => 'root' | |
| 181 | - //, 'mune_icon_url' => '/assets/img/icon-16x16.png' | |
| 182 | - , 'mune_icon_url' => $svg_icon_integarted // FixIn: 9.0.1.7. | |
| 183 | - , 'menu_title' => $title | |
| 184 | - , 'menu_title_second' => __('Bookings', 'booking') | |
| 185 | - , 'page_header' => __('Bookings Listing','booking') | |
| 186 | - , 'browser_header' => __('Bookings Listing', 'booking') . ' - ' . __('Booking Calendar', 'booking') | |
| 187 | - , 'user_role' => get_bk_option( 'booking_user_role_booking' ) | |
| 188 | - , 'position' => $booking_menu_position // 3.3 - top //( 58.9 ) // - middle | |
| 189 | - /* | |
| 190 | - (Optional). Positions for Core Menu Items | |
| 191 | - 2 Dashboard | |
| 192 | - 4 Separator | |
| 193 | - 5 Posts | |
| 194 | - 10 Media | |
| 195 | - 15 Links | |
| 196 | - 20 Pages | |
| 197 | - 25 Comments | |
| 198 | - 59 Separator | |
| 199 | - 60 Appearance | |
| 200 | - 65 Plugins | |
| 201 | - 70 Users | |
| 202 | - 75 Tools | |
| 203 | - 80 Settings | |
| 204 | - 99 Separator | |
| 205 | - */ | |
| 206 | - ) | |
| 207 | - ); | |
| 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 | + ) ); | |
| 208 | 209 | |
| 209 | - self::$instance->admin_menu['new'] = new WPBC_Admin_Menus( | |
| 210 | - 'wpbc-new' , array ( | |
| 211 | - 'in_menu' => 'wpbc' | |
| 212 | - , 'menu_title' => '+ ' . ucwords( __('Add booking', 'booking') ) // FixIn: 10.9.3.1. | |
| 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 | - ) | |
| 217 | - ); | |
| 218 | - self::$instance->admin_menu['availability'] = new WPBC_Admin_Menus( // FixIn: 9.3.0.1. | |
| 219 | - 'wpbc-availability' , array ( | |
| 220 | - 'in_menu' => 'wpbc' | |
| 221 | - , 'menu_title' => ucwords( __('Availability', 'booking') ) | |
| 222 | - , 'page_header' => ucwords( __('Availability','booking') ) | |
| 223 | - , 'browser_header'=> ucwords( __('Availability', 'booking') ) . ' - ' . __('Booking Calendar', 'booking') | |
| 224 | - , 'user_role' => get_bk_option( 'booking_user_role_availability' ) // FixIn: 9.5.2.2. | |
| 225 | - ) | |
| 226 | - ); | |
| 227 | - //FixIn: 9.8.15.2.4 | |
| 228 | - if ( class_exists( 'wpdev_bk_biz_m' ) ) | |
| 229 | - self::$instance->admin_menu['prices'] = new WPBC_Admin_Menus( | |
| 230 | - 'wpbc-prices' , array ( | |
| 231 | - 'in_menu' => 'wpbc' | |
| 232 | - , 'menu_title' => __('Prices', 'booking') | |
| 233 | - , 'page_header' => ucwords( __('Booking Prices','booking') ) | |
| 234 | - , 'browser_header'=> __('Prices', 'booking') . ' - ' . __('Booking Calendar', 'booking') | |
| 235 | - , 'user_role' => get_bk_option( 'booking_user_role_prices' ) //FixIn: 9.8.15.2.6 | |
| 236 | - ) | |
| 237 | - ); | |
| 238 | - if ( class_exists( 'wpdev_bk_personal' ) ) { | |
| 239 | - self::$instance->admin_menu['resources'] = new WPBC_Admin_Menus( | |
| 240 | - 'wpbc-resources' , array ( | |
| 241 | - 'in_menu' => 'wpbc' | |
| 242 | - , 'menu_title' => __('Resources', 'booking') | |
| 243 | - , 'page_header' => ucwords( __('Booking resources','booking') ) | |
| 244 | - , 'browser_header'=> __('Resources', 'booking') . ' - ' . __('Booking Calendar', 'booking') | |
| 245 | - , 'user_role' => get_bk_option( 'booking_user_role_resources' ) | |
| 246 | - ) | |
| 247 | - ); | |
| 248 | - } | |
| 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 | + ) ); | |
| 249 | 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 | + ) ); | |
| 250 | 226 | |
| 251 | - if ( ! class_exists( 'wpdev_bk_personal' ) ) { // FixIn: 10.1.3.1. | |
| 252 | - // FixIn: 9.8.15.7. | |
| 253 | - self::$instance->admin_menu['resources'] = new WPBC_Admin_Menus( | |
| 254 | - 'wpbc-resources' , array ( | |
| 255 | - 'in_menu' => 'wpbc' | |
| 256 | - , 'menu_title' => __('Publish', 'booking') // __('Resource', 'booking') | |
| 257 | - , 'page_header' => ucwords( __('Booking resource','booking') ) | |
| 258 | - , 'browser_header'=> __('Resource', 'booking') . ' - ' . __('Booking Calendar', 'booking') | |
| 259 | - , 'user_role' => get_bk_option( 'booking_user_role_settings' ) | |
| 260 | - ) | |
| 261 | - ); | |
| 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 | + ) ); | |
| 262 | 244 | } |
| 263 | 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 | + ) ); | |
| 264 | 253 | |
| 265 | - self::$instance->admin_menu['settings'] = new WPBC_Admin_Menus( | |
| 266 | - 'wpbc-settings' , array ( | |
| 267 | - 'in_menu' => 'wpbc' | |
| 268 | - , 'menu_title' => __('Settings', 'booking') | |
| 269 | - , 'page_header' => __('General Settings','booking') | |
| 270 | - , 'browser_header'=> __('Settings', 'booking') . ' - ' . __('Booking Calendar', 'booking') | |
| 271 | - , 'user_role' => get_bk_option( 'booking_user_role_settings' ) | |
| 272 | - ) | |
| 273 | - ); | |
| 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 | + ) ); | |
| 274 | 261 | |
| 262 | + if ( wpbc_is_user_can_access_wizard_page() ) { | |
| 275 | 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(); | |
| 276 | 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 | + } | |
| 277 | 276 | |
| 278 | - if ( | |
| 279 | - ( wpbc_is_user_can_access_wizard_page() ) && | |
| 280 | - ( ! wpbc_setup_wizard_page__is_all_steps_completed() ) | |
| 281 | - ){ | |
| 282 | 277 | |
| 283 | - $setup_steps = new WPBC_SETUP_WIZARD_STEPS(); | |
| 284 | - | |
| 285 | - self::$instance->admin_menu['setup'] = new WPBC_Admin_Menus( | |
| 286 | - 'wpbc-setup' , array ( | |
| 287 | - 'in_menu' => 'wpbc' | |
| 288 | - , 'menu_title' => $setup_steps->get_plugin_menu_title__setup_progress() | |
| 289 | - , 'page_header' => ucwords( __('Setup','booking') ) | |
| 290 | - , 'browser_header' => ucwords( __('Setup', 'booking') ) . ' - ' . __('Booking Calendar', 'booking') | |
| 291 | - , 'user_role' => get_bk_option( 'booking_user_role_settings' ) //FixIn: 9.8.15.2.6 | |
| 292 | - ) | |
| 293 | - ); | |
| 294 | - } | |
| 295 | - | |
| 296 | - | |
| 297 | - | |
| 298 | 278 | $simulate_user_id = wpbc_mu__is_simulated_login_as_user(); |
| 299 | 279 | if ( ! empty( $simulate_user_id ) ) { |
| 300 | 280 | |
| 301 | 281 | $custom_user = get_userdata( $simulate_user_id ); |
| 302 | 282 | |
| 303 | - self::$instance->admin_menu['log_off'] = new WPBC_Admin_Menus( | |
| 304 | - 'wpbc-log-off' , array ( | |
| 305 | - 'in_menu' => 'wpbc' | |
| 306 | - //, 'menu_title' => __( 'Log Out Simulated Login as', 'booking' ) . ' "' . $custom_user->display_name . '"' | |
| 307 | - , 'menu_title' => '<span style="color:#fffcdf;font-size: 11px;font-weight: 400;" title="' | |
| 308 | - . esc_attr( __( 'Log out as regular user and login as super booking admin user', 'booking' ) ) | |
| 309 | - .'">' | |
| 310 | - .__( 'Back to Super Admin', 'booking' ) | |
| 311 | - .'<span>' | |
| 312 | - /* translators: 1: ... */ | |
| 313 | - , 'page_header' => ucwords( sprintf( __( 'Need even more functionality? Check %1$s higher versions %2$s', 'booking' ), '', '' ) ) | |
| 314 | - , 'browser_header'=> 'Log In as Super Admin' | |
| 315 | - , 'user_role' => get_bk_option( 'booking_user_role_booking' ) | |
| 316 | - ) | |
| 317 | - ); | |
| 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 | + ) ); | |
| 318 | 290 | } |
| 291 | + | |
| 319 | 292 | } |
| 320 | 293 | |
| 321 | - | |
| 322 | - | |
| 323 | - /** | |
| 294 | + | |
| 295 | + | |
| 296 | + /** | |
| 324 | 297 | * Get Menu Object |
| 325 | - * | |
| 298 | + * | |
| 326 | 299 | * @param type - menu type |
| 327 | 300 | * @return boolean |
| 328 | 301 | */ |
| 329 | 302 | public function get_menu_object( $type ) { |
| @@ -329,13 +302,13 @@ | ||
| 329 | 302 | public function get_menu_object( $type ) { |
| 330 | 303 | |
| 331 | 304 | if ( isset( self::$instance->admin_menu[ $type ] ) ) |
| 332 | 305 | return self::$instance->admin_menu[ $type ]; |
| 333 | - else | |
| 306 | + else | |
| 334 | 307 | return false; |
| 335 | 308 | } |
| 336 | 309 | |
| 337 | - | |
| 310 | + | |
| 338 | 311 | // Include Files |
| 339 | 312 | private function includes() { |
| 340 | 313 | require_once WPBC_PLUGIN_DIR . '/includes/wpbc-include.php' ; |
| 341 | 314 | } |
| @@ -365,9 +338,9 @@ | ||
| 365 | 338 | |
| 366 | 339 | _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' ); |
| 367 | 340 | } |
| 368 | 341 | |
| 369 | - | |
| 342 | + | |
| 370 | 343 | // Unserializing instances of the class is forbidden |
| 371 | 344 | public function __wakeup() { |
| 372 | 345 | |
| 373 | 346 | _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' ); |
| @@ -372,12 +345,12 @@ | ||
| 372 | 345 | |
| 373 | 346 | _doing_it_wrong( __FUNCTION__, esc_html__( 'Action is not allowed!', 'booking' ), '1.0' ); |
| 374 | 347 | } |
| 375 | 348 | |
| 376 | - | |
| 349 | + | |
| 377 | 350 | // Initialization |
| 378 | 351 | private function start(){ |
| 379 | - | |
| 352 | + | |
| 380 | 353 | if ( ( defined( 'DOING_AJAX' ) ) && ( DOING_AJAX ) ){ // New A J A X R e s p o n d e r |
| 381 | 354 | |
| 382 | 355 | if ( 1 ) { |
| 383 | 356 | $wpdev_booking_obj_in_ajax = new wpdev_booking(); // GO |
| @@ -386,10 +359,10 @@ | ||
| 386 | 359 | $wpdev_bk_personal_in_ajax = new wpdev_bk_personal(); |
| 387 | 360 | } |
| 388 | 361 | } |
| 389 | 362 | |
| 390 | - require_once WPBC_PLUGIN_DIR . '/core/lib/wpbc-ajax.php'; // Ajax | |
| 391 | - | |
| 363 | + require_once WPBC_PLUGIN_DIR . '/core/lib/wpbc-ajax.php'; // Ajax | |
| 364 | + | |
| 392 | 365 | return false; |
| 393 | 366 | } else { // Usual Loading of plugin |
| 394 | 367 | |
| 395 | 368 | // We are having Response, its executed in other file: wpbc-response.php |
| @@ -399,12 +372,12 @@ | ||
| 399 | 372 | if( is_admin() ) { |
| 400 | 373 | // Define Notices System |
| 401 | 374 | self::$instance->notice = new WPBC_Notices(); |
| 402 | 375 | } |
| 403 | - | |
| 376 | + | |
| 404 | 377 | // Normal Start |
| 405 | 378 | self::$instance->booking_obj = new wpdev_booking(); // GO |
| 406 | - | |
| 379 | + | |
| 407 | 380 | // Cron Jobs ..... ///////////////////////////////////////////////// |
| 408 | 381 | self::$instance->cron = new WPBC_Cron(); |
| 409 | 382 | //////////////////////////////////////////////////////////////////// |
| 410 | 383 | } |
| @@ -409,15 +382,15 @@ | ||
| 409 | 382 | //////////////////////////////////////////////////////////////////// |
| 410 | 383 | } |
| 411 | 384 | return true; |
| 412 | 385 | } |
| 413 | - | |
| 386 | + | |
| 414 | 387 | } |
| 415 | 388 | |
| 416 | 389 | else: // Its seems that some instance of Booking Calendar still activted!!! |
| 417 | - | |
| 390 | + | |
| 418 | 391 | // FixIn: 7.0.1.6. |
| 419 | - global $wp_version; | |
| 392 | + global $wp_version; | |
| 420 | 393 | $wpbc_min_wp_version = version_compare( WP_BK_MIN_WP_VERSION, $wp_version, '<=' ); |
| 421 | 394 | |
| 422 | 395 | // FixIn: 7.0.1.6. |
| 423 | 396 | function wpbc_show_min_wp_version_error() { |
| @@ -423,27 +396,27 @@ | ||
| 423 | 396 | function wpbc_show_min_wp_version_error() { |
| 424 | 397 | |
| 425 | 398 | $message_type = 'error'; |
| 426 | 399 | $title = __( 'Error' , 'booking') . '!'; |
| 427 | - | |
| 428 | - | |
| 400 | + | |
| 401 | + | |
| 429 | 402 | $message = 'Booking Calendar '; |
| 430 | - | |
| 431 | - $booking_version_num = get_option( 'booking_version_num'); | |
| 403 | + | |
| 404 | + $booking_version_num = get_option( 'booking_version_num'); | |
| 432 | 405 | if ( ! empty( $booking_version_num ) ) |
| 433 | - $message .= '<strong>' . $booking_version_num . '</strong> '; | |
| 434 | - | |
| 435 | - | |
| 436 | - global $wp_version; | |
| 406 | + $message .= '<strong>' . $booking_version_num . '</strong> '; | |
| 437 | 407 | |
| 438 | - $message .= sprintf( 'require minimum %s . You are using %s. ' | |
| 439 | - , ' <strong>' . 'WordPress ' . WP_BK_MIN_WP_VERSION . '</strong>' | |
| 440 | - , ' <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>' ); | |
| 441 | 414 | if ( current_user_can( 'update_core' ) ){ |
| 442 | 415 | $message .= ' <a href="' . esc_url( self_admin_url( 'update-core.php' ) ) . '">' . 'Return to Dashboard → Updates' . '</a>'; |
| 443 | - } | |
| 444 | - | |
| 445 | - | |
| 416 | + } | |
| 417 | + | |
| 418 | + | |
| 446 | 419 | $message_content = ''; |
| 447 | 420 | |
| 448 | 421 | $message_content .= '<div class="clear"></div>'; |
| 449 | 422 | |
| @@ -458,29 +431,29 @@ | ||
| 458 | 431 | |
| 459 | 432 | $message_content .= '<div class="clear"></div>'; |
| 460 | 433 | |
| 461 | 434 | echo wp_kses_post( $message_content ); |
| 462 | - } | |
| 463 | - | |
| 435 | + } | |
| 436 | + | |
| 464 | 437 | function wpbc_show_activation_error() { |
| 465 | 438 | |
| 466 | 439 | $message_type = 'error'; |
| 467 | 440 | $title = __( 'Error' , 'booking') . '!'; |
| 468 | 441 | $message = 'Please deactivate previous old version of' . ' ' . 'Booking Calendar'; |
| 469 | - | |
| 470 | - $booking_version_num = get_option( 'booking_version_num'); | |
| 442 | + | |
| 443 | + $booking_version_num = get_option( 'booking_version_num'); | |
| 471 | 444 | if ( ! empty( $booking_version_num ) ) |
| 472 | - $message .= ' <strong>' . $booking_version_num . '</strong>'; | |
| 473 | - | |
| 474 | - | |
| 445 | + $message .= ' <strong>' . $booking_version_num . '</strong>'; | |
| 446 | + | |
| 447 | + | |
| 475 | 448 | $is_delete_if_deactive = get_bk_option( 'booking_is_delete_if_deactive' ); // check |
| 476 | 449 | |
| 477 | - if ( $is_delete_if_deactive == 'On' ) { | |
| 478 | - | |
| 450 | + if ( $is_delete_if_deactive == 'On' ) { | |
| 451 | + | |
| 479 | 452 | $message .= '<br/><br/> <strong>Warning!</strong> ' . 'All plugin data will be deleted when plugin had deactivated.' . ' ' |
| 480 | 453 | . sprintf( 'If you want to save your plugin data, please uncheck the %s"Delete plugin data"%s at the', '<strong>', '</strong>') . ' ' . __( 'Settings' , 'booking' ) . '.'; |
| 481 | 454 | } |
| 482 | - | |
| 455 | + | |
| 483 | 456 | $message_content = ''; |
| 484 | 457 | |
| 485 | 458 | $message_content .= '<div class="clear"></div>'; |
| 486 | 459 | |
| @@ -493,9 +466,9 @@ | ||
| 493 | 466 | |
| 494 | 467 | $message_content .= '</div>'; |
| 495 | 468 | |
| 496 | 469 | $message_content .= '<div class="clear"></div>'; |
| 497 | - | |
| 470 | + | |
| 498 | 471 | echo wp_kses_post( $message_content ); |
| 499 | 472 | } |
| 500 | 473 | |
| 501 | 474 | |
| @@ -502,9 +475,9 @@ | ||
| 502 | 475 | if ( ! $wpbc_min_wp_version ) // FixIn: 7.0.1.6. |
| 503 | 476 | add_action('admin_notices', 'wpbc_show_min_wp_version_error'); |
| 504 | 477 | else |
| 505 | 478 | add_action('admin_notices', 'wpbc_show_activation_error'); |
| 506 | - | |
| 479 | + | |
| 507 | 480 | return; // Exit |
| 508 | 481 | |
| 509 | 482 | endif; |
| 510 | 483 | |
| @@ -534,16 +507,16 @@ | ||
| 534 | 507 | $request_uri = $server_request_uri; //FixIn:5.4.1 |
| 535 | 508 | if ( strpos( $request_uri, 'page=wpbc') === false ) { |
| 536 | 509 | return; |
| 537 | 510 | } |
| 538 | - 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>'; | |
| 539 | 512 | // phpcs:ignore WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_phpinfo |
| 540 | 513 | phpinfo(); echo '</div>'; return; |
| 541 | - | |
| 542 | - ?><div style="width:auto;margin:0 0 0 215px;font-size:11px; "><?php | |
| 543 | 514 | |
| 515 | + ?><div style="width:auto;margin:0 0 0 215px;font-size:11px; "><?php | |
| 516 | + | |
| 544 | 517 | // SYSTEM INFO SHOWING //////////////////////////////////////////////////////// |
| 545 | - | |
| 518 | + | |
| 546 | 519 | //Note firstly need to define this in functions.php file: define('SAVEQUERIES', true); |
| 547 | 520 | global $wpdb; |
| 548 | 521 | echo '<div class="clear"></div>START SYSTEM<pre>'; |
| 549 | 522 | $qq_kk = 0; |
| @@ -549,10 +522,10 @@ | ||
| 549 | 522 | $qq_kk = 0; |
| 550 | 523 | $total_time = 0; |
| 551 | 524 | $total_num = 0; |
| 552 | 525 | foreach ( $wpdb->queries as $qq_k => $qq ) { |
| 553 | - if ( | |
| 554 | - ( strpos( $qq[0], 'booking') !== false ) | |
| 526 | + if ( | |
| 527 | + ( strpos( $qq[0], 'booking') !== false ) | |
| 555 | 528 | |
| 556 | 529 | ) { |
| 557 | 530 | if ( $qq[1] > 0.002 ) { echo '<div style="color:#A77;font-weight:bold;">'; } |
| 558 | 531 | debuge($qq_kk++, $qq); |
| @@ -562,21 +535,20 @@ | ||
| 562 | 535 | } |
| 563 | 536 | } |
| 564 | 537 | |
| 565 | 538 | echo '<div><pre class="prettyprint linenums" style="font-size:18px;">[' . esc_html( $total_num . '/' . $total_time ) . '] WPBC Requests TOTAL TIME</pre></div>'; |
| 566 | - | |
| 539 | + | |
| 567 | 540 | echo '<div class="clear"></div>'; |
| 568 | 541 | |
| 569 | 542 | echo '<div><pre class="prettyprint linenums" style="font-size:18px;">' . esc_html( get_num_queries() . '/' . timer_stop( 0, 3 ) ) . 'qps</pre></div>'; |
| 570 | - | |
| 571 | - echo '<div class="clear"></div>'; | |
| 572 | - | |
| 543 | + | |
| 544 | + echo '<div class="clear"></div>'; | |
| 545 | + | |
| 573 | 546 | echo "</pre>"; |
| 574 | 547 | ?><br/><br/><br/><br/><br/><br/><?php |
| 575 | - echo '<div class="clear"></div>'; | |
| 548 | + echo '<div class="clear"></div>'; | |
| 576 | 549 | |
| 577 | 550 | //////////////////////////////////////////////////////////////////////////////// |
| 578 | 551 | ?></div><?php |
| 579 | - | |
| 552 | + | |
| 580 | 553 | echo '</div>'; |
| 581 | 554 | } |
| 582 | - | |