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