PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
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 10.11 All 204 releases
← All changes | core/admin/page-ics-export.php +47 -45 10.1.311.8.4 View file →
@@ -12,14 +12,15 @@
12 12 * This is COMMERCIAL SCRIPT
13 13 * We are not guarantee correct work and support of Booking Calendar, if some file(s) was modified by someone else then wpdevelop.
14 14 */
15 15
16 -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16 +// Exit if accessed directly.
17 +if ( ! defined( 'ABSPATH' ) ) {exit;}
17 18
18 -//FixIn: 8.0
19 19
20 +
20 21 /**
21 - * Show Content
22 + * Show Content
22 23 * Update Content
23 24 * Define Slug
24 25 * Define where to show
25 26 */
@@ -29,15 +30,14 @@
29 30 public $settings_api = false;
30 31
31 32
32 33 public function in_page() {
33 - return 'wpbc-settings';
34 - }
35 -
34 + return 'wpbc-settings';
35 + }
36 36
37 37 public function tabs() {
38 38
39 - $tabs = array();
39 + $tabs = array();
40 40
41 41 $tabs[ 'sync' ] = array(
42 42 'title' => __( 'Sync', 'booking') // Title of TAB
43 43 , 'page_title'=> __( 'Sync', 'booking') // Title of Page
@@ -53,26 +53,26 @@
53 53 , 'subtabs' => array()
54 54 );
55 55
56 56
57 - $subtabs = array();
57 + $subtabs = array();
58 58
59 59 $subtabs[ 'export' ] = array(
60 60 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
61 - , 'title' => __('Export' ,'booking') . ' - .ics' // Title of TAB
62 - , 'page_title' => __('Export' ,'booking') . ' .ics '
61 + , 'title' => __('Export' ,'booking') . ' - .ics' // Title of TAB
62 + , 'page_title' => __('Export Bookings via .ics' ,'booking')
63 63 //. ' <span style="padding: 10px;font-size: 12px;font-style: italic;vertical-align: top;">Beta</span>' // Title of Page
64 - , 'hint' => __('Export' ,'booking') . ' .ics/ical ' . __('feed', 'booking') // Hint
64 + , 'hint' => __('Set up and configure the export of bookings into .ics feeds.' ,'booking') // Hint
65 65 , 'link' => '' // link
66 66 , 'position' => '' // 'left' || 'right' || ''
67 67 , 'css_classes' => '' // CSS class(es)
68 68 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
69 - //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
70 - , 'header_font_icon' => 'wpbc_icn_sync_alt' // CSS definition of Font Icon //FixIn: 9.6.1.4
71 - , 'default' => false // Is this sub tab activated by default or not: true || false.
69 + , 'font_icon' => 'wpbc-bi-box-arrow-up-right' // CSS definition of Font Icon
70 + , 'default' => false // Is this sub tab activated by default or not: true || false.
72 71 , 'disabled' => false // Is this sub tab deactivated: true || false.
73 72 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
74 73 , 'content' => 'content' // Function to load as conten of this TAB
74 +
75 75 );
76 76
77 77 $tabs[ 'sync' ]['subtabs'] = $subtabs;
78 78
@@ -108,8 +108,9 @@
108 108 $submit_form_name = 'wpbc_export_feeds'; // Define form name
109 109
110 110 // $this->get_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields (like required field) before submit.
111 111
112 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
112 113 if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) {
113 114
114 115 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
115 116 $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page
@@ -131,17 +132,16 @@
131 132
132 133 ?><div class="clear" style="margin-bottom:0px;"></div><?php
133 134
134 135
135 - if ( ! function_exists( 'mb_detect_encoding' ) ) { //FixIn: 2.0.5.3 //FixIn: 8.1.3.25
136 + if ( ! function_exists( 'mb_detect_encoding' ) ) { //FixIn: 2.0.5.3 // FixIn: 8.1.3.25.
136 137 ?>
137 138 <span class="metabox-holder">
138 139 <div class="clear" style="height:15px;"></div>
139 140 <div class="wpbc-settings-notice notice-error" style="text-align:left;font-size: 16px;padding: 5px 20px;">
140 - <strong><?php _e('Warning!' ,'booking'); ?></strong> <?php
141 -
142 - printf( __( 'This feature require %s', 'booking' ), 'PHP <strong>mbstring</strong> extension.'
143 - );
141 + <strong><?php esc_html_e('Warning!' ,'booking'); ?></strong> <?php
142 + /* translators: 1: PHP function description. */
143 + printf( esc_attr__( 'This feature require %s', 'booking' ), 'PHP <strong>mbstring</strong> extension.' );
144 144 ?>
145 145 </div>
146 146 <div class="clear" style="height:25px;"></div><?php
147 147 }
@@ -162,18 +162,19 @@
162 162 ?>
163 163 <span class="metabox-holder">
164 164 <div class="clear" style="height:15px;"></div>
165 165 <div class="wpbc-settings-notice notice-error" style="text-align:left;font-size: 16px;padding: 5px 20px;">
166 - <strong><?php _e('Important!' ,'booking'); ?></strong> <?php
166 + <strong><?php esc_html_e('Important!' ,'booking'); ?></strong> <?php
167 167
168 - printf( __( 'This feature require %s plugin. You can install %s plugin from this %spage%s.', 'booking' )
169 - , '<strong><a class="" href="'. home_url() .'/wp-admin/plugin-install.php?s=booking+manager+by+oplugins&tab=search&type=term">'
168 + /* translators: 1: ... */
169 + echo wp_kses_post( sprintf( __( 'This feature require %1$s plugin. You can install %2$s plugin from this %3$spage%4$s.', 'booking' )
170 + , '<strong><a href="'. esc_attr( home_url() .'/wp-admin/plugin-install.php?s=booking+manager+by+oplugins&tab=search&type=term' ). '">'
170 171 // , '<strong><a class="thickbox open-plugin-details-modal" href="'. home_url() .'/wp-admin/plugin-install.php?tab=plugin-information&plugin=booking-manager&TB_iframe=true&width=772&height=741" target="_blank">'
171 - . 'Booking Manager' . '</a></strong> ' . ' <strong>' .$wpbm_minimum_version.'</strong> ('. __('or newer','booking') . ') '
172 + . 'Booking Manager' . '</a></strong> ' . ' <strong>' .esc_attr($wpbm_minimum_version).'</strong> ('. esc_attr__('or newer','booking') . ') '
172 173 , '<strong>' . 'Booking Manager' . '</strong>'
173 174 , '<a target="_blank" href="https://wordpress.org/plugins/booking-manager/">'
174 175 , '</a>'
175 - );
176 + ) );
176 177 ?>
177 178 </div>
178 179 <div class="clear" style="height:25px;"></div><?php
179 180
@@ -198,19 +199,19 @@
198 199 ////////////////////////////////////////////////////////////////////////
199 200 ?>
200 201 <div class="clear" style="margin-bottom:0px;"></div>
201 202 <span class="metabox-holder">
202 - <form name="<?php echo $submit_form_name; ?>" id="<?php echo $submit_form_name; ?>" action="" method="post" autocomplete="off">
203 + <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" autocomplete="off">
203 204 <?php
204 205 // N o n c e field, and key for checking S u b m i t
205 206 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
206 - ?><input type="hidden" name="is_form_sbmitted_<?php echo $submit_form_name; ?>" id="is_form_sbmitted_<?php echo $submit_form_name; ?>" value="1" /><?php
207 + ?><input type="hidden" name="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" id="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" value="1" /><?php
207 208 ?>
208 209 <div class="clear" style="margin-top:10px;"></div>
209 210 <?php
210 211 // Add hidden input SEARCH KEY field into main form, if previosly was searching by ID or Title
211 212 if ( class_exists('wpdev_bk_personal') )
212 - wpbc_hidden_search_by_id_field_in_main_form( array( 'search_get_key' => 'wh_resource_id' ) ); //FixIn: 8.0.1.12
213 + wpbc_hidden_search_by_id_field_in_main_form( array( 'search_get_key' => 'wh_resource_id' ) ); // FixIn: 8.0.1.12.
213 214 ?>
214 215 <div id="wpbc_resources_link" class="clear"></div>
215 216 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
216 217 <div id="wpbc_resource_table_gcal_id" class="wpbc_settings_row wpbc_settings_row_rightNO"><?php
@@ -234,14 +235,15 @@
234 235
235 236 wpbc_close_meta_box_section();
236 237
237 238
238 - } ?>
239 - <input type="submit" value="<?php _e('Save Changes','booking'); ?>" class="button button-primary wpbc_submit_button" />
240 -
241 - <div class="clear" style="height:25px;"></div><?php
239 + }
240 + ?>
241 + <input type="submit" value="<?php esc_attr_e( 'Save Changes', 'booking' ); ?>" class="button button-primary wpbc_submit_button" />
242 + <div class="clear" style="height:25px;"></div>
243 + <?php
242 244
243 - wpbc_open_meta_box_section( 'wpbc_settings_ics_import_help_how', __('How it works', 'booking') );
245 + wpbc_open_meta_box_section( 'wpbc_settings_ics_import_help_how', __( 'How it works', 'booking' ) );
244 246
245 247 wpbc_ics_import_export__show_help_info( false );
246 248
247 249 wpbc_close_meta_box_section();
@@ -440,36 +442,36 @@
440 442 ?>
441 443 <table class="form-table">
442 444 <tbody><tr class="wpbc_tr_booking_export_feed_free" valign="top">
443 445 <th scope="row">
444 - <label for="booking_export_feed1" class="wpbc-form-text"><?php _e( '.ics feed URL', 'booking' ); ?></label>
446 + <label for="booking_export_feed1" class="wpbc-form-text"><?php esc_html_e( '.ics feed URL', 'booking' ); ?></label>
445 447 </th>
446 448 <td><fieldset class="wpdevelop">
447 - <legend class="screen-reader-text"><span><?php _e( '.ics feed URL', 'booking' ); ?></span></legend>
449 + <legend class="screen-reader-text"><span><?php esc_html_e( '.ics feed URL', 'booking' ); ?></span></legend>
448 450 <code style="font-size:12px;line-height: 2.4em;background: #ddd;color:#000;"><a
449 - href="<?php echo trim( home_url(), '/' ) . '/' . trim( $resource_export, '/'); ?>"
451 + href="<?php echo esc_url( trim( home_url(), '/' ) . '/' . trim( $resource_export, '/' ) ); ?>"
450 452 target="_blank"><?php
451 - $wpbc_h_u = home_url(); //FixIn: 8.1.3.6
453 + $wpbc_h_u = home_url(); // FixIn: 8.1.3.6.
452 454 if (strlen( $wpbc_h_u ) > 23 ) {
453 - echo substr( $wpbc_h_u, 0, 10 ) . '...' . substr( $wpbc_h_u, -10 );
455 + echo esc_attr( substr( $wpbc_h_u, 0, 10 ) . '...' . substr( $wpbc_h_u, -10 ) );
454 456 } else {
455 - echo $wpbc_h_u;
457 + echo esc_attr( $wpbc_h_u );
456 458 }?></a></code>
457 459 <input id="booking_export_feed1"
458 460 name="booking_export_feed1"
459 - value="<?php echo $resource_export; ?>"
461 + value="<?php echo esc_attr( $resource_export ); ?>"
460 462 placeholder=""
461 463 autocomplete="off"
462 464 type="text"
463 465 class="regular-text"
464 466 />
465 - <a href="<?php echo trim( home_url(), '/' ) . '/' . trim( $resource_export, '/'); ?>"
466 - title="<?php _e( 'Open in new window', 'booking' ); ?>"
467 + <a href="<?php echo esc_url( trim( home_url(), '/' ) . '/' . trim( $resource_export, '/') ); ?>"
468 + title="<?php esc_attr_e( 'Open in new window', 'booking' ); ?>"
467 469 target="_blank"><i class="wpbc_icn_open_in_new"></i></a>
468 - <p class="description"><?php _e( 'Please enter URL for generating .ics feed', 'booking' ); ?></p>
470 + <p class="description"><?php esc_html_e( 'Please enter URL for generating .ics feed', 'booking' ); ?></p>
469 471 <div class="wpbc-settings-notice notice-info" style="text-align:left;border-top:1px solid #f0f0f0;border-right:1px solid #f0f0f0;">
470 - <strong><?php _e( 'Note', 'booking' ) ?></strong>. <?php
471 - printf( __( 'This .ics feed of bookings starting from today for 1 year', 'booking' ) );
472 + <strong><?php esc_html_e( 'Note', 'booking' ); ?></strong>. <?php
473 + esc_html_e( 'This .ics feed of bookings starting from today for 1 year', 'booking' );
472 474 ?>
473 475 </div>
474 476 </fieldset></td>
475 477 </tr></tbody>
@@ -487,9 +489,9 @@
487 489
488 490 $validated_value = WPBC_Settings_API::validate_text_post_static( 'booking_export_feed1' );
489 491
490 492 $validated_value = explode( '/', $validated_value );
491 - foreach ( $validated_value as $v_i => $v_val ) { //FixIn: 8.1.1.9
493 + foreach ( $validated_value as $v_i => $v_val ) { // FixIn: 8.1.1.9.
492 494 if ( strpos( $v_val, '.') !== false ) {
493 495 $v_val = sanitize_file_name( $v_val );
494 496 }
495 497 $validated_value[ $v_i ] = $v_val;