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-import-gcal.php +33 -25 10.1.311.8.4 View file →
@@ -57,9 +57,10 @@
57 57 $this->fields['booking_gcal_auto_import_is_active'] = array(
58 58 'type' => 'checkbox'
59 59 , 'default' => 'Off'
60 60 , 'title' => __( 'Activate auto import', 'booking' )
61 - , 'label' => sprintf(__('Check this box to %sactivate%s auto import events and creation bookings from them' ,'booking'),'<b>','</b>')
61 + /* translators: 1: ... */
62 + , 'label' => sprintf( __( 'Check this box to %1$sactivate%2$s auto import events and creation bookings from them', 'booking' ),'<b>','</b>')
62 63 , 'description' => ''
63 64 , 'group' => 'auto_import'
64 65
65 66 );
@@ -97,19 +98,19 @@
97 98
98 99 $cron_info = '';
99 100 $readable_time_of_next_run = WPBC()->cron->get_readable_time_of_last_run( 'wpbc_import_gcal' );
100 101 if ( ! empty( $readable_time_of_next_run ) ) {
101 - $cron_info .= '<br/><strong>' . __( 'Last import', 'booking' ) . '</strong>: ' . $readable_time_of_next_run;
102 + $cron_info .= '<br/><strong>' . esc_html__( 'Last import', 'booking' ) . '</strong>: ' . $readable_time_of_next_run;
102 103 }
103 104 $readable_time_of_next_run = WPBC()->cron->get_readable_time_of_next_run( 'wpbc_import_gcal', '<strong>'.__( 'during', 'booking' ).'</strong> <code>' ) . '</code>';
104 105 if ( ! empty( $readable_time_of_next_run ) ) {
105 - $cron_info .= '<br/><strong>' . __( 'Next import', 'booking' ) . '</strong>: ' . $readable_time_of_next_run;
106 + $cron_info .= '<br/><strong>' . esc_html__( 'Next import', 'booking' ) . '</strong>: ' . $readable_time_of_next_run;
106 107 }
107 108
108 109 // $active_tasks_arr = WPBC()->cron->get_active_tasks_info();
109 110 // if ( ! empty( $active_tasks_arr['wpbc_import_gcal'] ) ) {
110 -// $cron_info .= '<br/><strong>' . __( 'Last import', 'booking' ) . '</strong>: ' . $active_tasks_arr['wpbc_import_gcal']['last_time__run__local'];
111 -// $cron_info .= '<br/><strong>' . __( 'Next import', 'booking' ) . '</strong>: ' . $active_tasks_arr['wpbc_import_gcal']['next_time__run__local'];
111 +// $cron_info .= '<br/><strong>' . esc_html__( 'Last import', 'booking' ) . '</strong>: ' . $active_tasks_arr['wpbc_import_gcal']['last_time__run__local'];
112 +// $cron_info .= '<br/><strong>' . esc_html__( 'Next import', 'booking' ) . '</strong>: ' . $active_tasks_arr['wpbc_import_gcal']['next_time__run__local'];
112 113 // $cron_info .= ' ' . __( 'during', 'booking' ) . ': <strong>' . wpbc_get_readable_time_interval( $active_tasks_arr['wpbc_import_gcal']['next_run_after_seconds'] ) . '</strong> ';
113 114 // }
114 115
115 116 $this->fields['booking_gcal_auto_import_time'] = array(
@@ -135,9 +136,10 @@
135 136 , 'title' => __('Google API Key', 'booking')
136 137 , 'description' => __('Please enter your Google API key. This field required to import events.' ,'booking')
137 138 . '<div class="wpbc-settings-notice notice-info" style="text-align:left;"><strong>'
138 139 . __('Note:' ,'booking') . '</strong> '
139 - . sprintf( __('You can check in this %sinstruction how to generate and use your Google API key%s.' ,'booking')
140 + /* translators: 1: ... */
141 + . sprintf( __( 'You can check in this %1$sinstruction how to generate and use your Google API key%2$s.', 'booking' )
140 142 , '<a href="https://wpbookingcalendar.com/faq/import-gc-events/">'
141 143 ,'</a>'
142 144 )
143 145 . '</div>'
@@ -255,9 +257,10 @@
255 257 , 'html' => ' <span class="description wpbc_offset_value">'
256 258 . __('You can specify an additional offset from you chosen start point. The offset can be negative.' ,'booking')
257 259 . '</span>
258 260 <span class="description wpbc_offset_datetime">'
259 - . sprintf( __('Type your date in format %s. Example: %s' ,'booking'), '<code>Y-m-d</code>', '<code>' . date_i18n( 'Y-m-d' ) . '</code>' )
261 + /* translators: 1: ... */
262 + . sprintf( __( 'Type your date in format %1$s. Example: %2$s', 'booking' ), '<code>Y-m-d</code>', '<code>' . date_i18n( 'Y-m-d' ) . '</code>' )
260 263 . '</span>
261 264 </fieldset>
262 265 </td>
263 266 </tr>'
@@ -337,9 +340,10 @@
337 340 , 'html' => ' <span class="description wpbc_offset_value">'
338 341 . __('You can specify an additional offset from you chosen start point. The offset can be negative.' ,'booking')
339 342 . '</span>
340 343 <span class="description wpbc_offset_datetime">'
341 - . sprintf( __('Type your date in format %s. Example: %s' ,'booking'), '<code>Y-m-d</code>', '<code>' . date_i18n( 'Y-m-d' ) . '</code>' )
344 + /* translators: 1: ... */
345 + . sprintf( __( 'Type your date in format %1$s. Example: %2$s', 'booking' ), '<code>Y-m-d</code>', '<code>' . date_i18n( 'Y-m-d' ) . '</code>' )
342 346 . '</span>
343 347 </fieldset>
344 348 </td>
345 349 </tr>'
@@ -356,9 +360,10 @@
356 360 , 'group' => 'help'
357 361 );
358 362 $this->fields['booking_gcal_events_help']['value'][] = '<h4 style="margin-top:-20px;">01. ' . __('To get Google Calendar API key please follow this instruction' ,'booking') . ':</h4>';
359 363 $this->fields['booking_gcal_events_help']['value'][] = '<ol style="list-style-type: decimal !important;margin-left: 15px;font-size:0.86em;">';
360 - $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Go to Google Developer Console: %s.' ,'booking'),'<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>') . '</li>';
364 + /* translators: 1: ... */
365 + $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__( 'Go to Google Developer Console: %s.' ,'booking'),'<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>') . '</li>';
361 366 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Give your project a name and click "Create".' ,'booking')) . '</li>';
362 367 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('In the sidebar click on "APIs & auth".' ,'booking')) . '</li>';
363 368 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Click APIs and make sure "Calendar API" is set to ON.' ,'booking')) . '</li>';
364 369 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Now click on "Credentials" in the sidebar.' ,'booking')) . '</li>';
@@ -363,9 +368,10 @@
363 368 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Click APIs and make sure "Calendar API" is set to ON.' ,'booking')) . '</li>';
364 369 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Now click on "Credentials" in the sidebar.' ,'booking')) . '</li>';
365 370 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Under the section "Public API access" click the button "Create new Key".' ,'booking')) . '</li>';
366 371 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('On the popup click the button "Server Key" and click "Create".' ,'booking')) . '</li>';
367 - $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('You will now see a table loaded with the top item being the API Key. Copy this and paste it into %sGoogle API Key%s field at this page.' ,'booking'),'<strong>','</strong>') . '</li>';
372 + /* translators: 1: ... */
373 + $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf( __( 'You will now see a table loaded with the top item being the API Key. Copy this and paste it into %1$sGoogle API Key%2$s field at this page.', 'booking' ),'<strong>','</strong>') . '</li>';
368 374 $this->fields['booking_gcal_events_help']['value'][] = '</ol>';
369 375
370 376 $this->fields['booking_gcal_events_help']['value'][] = '<h4>02. ' . __('Set Your Calendar to Public' ,'booking') . ':</h4>';
371 377 $this->fields['booking_gcal_events_help']['value'][] = '<ol style="list-style-type: decimal !important;margin-left: 15px;font-size:0.86em;">';
@@ -378,9 +384,10 @@
378 384 $this->fields['booking_gcal_events_help']['value'][] = '<h4>03. ' . __('Find Your Calendar ID' ,'booking') . ':</h4>';
379 385 $this->fields['booking_gcal_events_help']['value'][] = '<ol style="list-style-type: decimal !important;margin-left: 15px;font-size:0.86em;">';
380 386 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Navigate to your Google calendars.' ,'booking'),'<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>') . '</li>';
381 387 $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Open the settings for the calendar.' ,'booking')) . '</li>';
382 - $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf(__('Now copy the Calendar ID to use in the plugin settings in your WordPress admin. Make sure to %suse the Calendar ID only, not the entire XML feed URL%s.' ,'booking'),'<strong>','</strong>') . '</li>';
388 + /* translators: 1: ... */
389 + $this->fields['booking_gcal_events_help']['value'][] = '<li>' . sprintf( __( 'Now copy the Calendar ID to use in the plugin settings in your WordPress admin. Make sure to %1$suse the Calendar ID only, not the entire XML feed URL%2$s.', 'booking' ),'<strong>','</strong>') . '</li>';
383 390 $this->fields['booking_gcal_events_help']['value'][] = '</ol>';
384 391
385 392 ////////////////////////////////////////////////////////////////////////
386 393 }
@@ -443,21 +450,21 @@
443 450 $subtabs = array();
444 451
445 452 $subtabs[ 'gcal' ] = array(
446 453 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
447 - , 'title' => __('Import Google Calendar Events', 'booking') //__('Google Calendar' ,'booking') . ' - ' . __('Events Import' ,'booking') // Title of TAB
448 - , 'page_title' => __('Import Google Calendar Events', 'booking') //__('Import Settings' ,'booking') // Title of Page
449 - , 'hint' => __('Import Google Calendar Events' ,'booking') // Hint
454 + , 'title' => __('Import Google Calendar', 'booking') //__('Google Calendar' ,'booking') . ' - ' . __('Events Import' ,'booking') // Title of TAB
455 + , 'page_title' => __('Import Google Calendar Events', 'booking') //__('Import Settings' ,'booking') // Title of Page
456 + , 'hint' => __('Set up and configure the import of Google Calendar events using the API.' ,'booking') // Hint
450 457 , 'link' => '' // link
451 458 , 'position' => '' // 'left' || 'right' || ''
452 459 , 'css_classes' => '' // CSS class(es)
453 460 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
454 - //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
455 - , 'header_font_icon' => 'wpbc_icn_sync_alt' // CSS definition of Font Icon //FixIn: 9.6.1.4
461 + , 'font_icon' => 'wpbc-bi-google' // CSS definition of Font Icon
456 462 , 'default' => false // Is this sub tab activated by default or not: true || false.
457 463 , 'disabled' => false // Is this sub tab deactivated: true || false.
458 464 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
459 465 , 'content' => 'content' // Function to load as conten of this TAB
466 +
460 467 );
461 468
462 469 $tabs[ 'sync' ]['subtabs'] = $subtabs;
463 470
@@ -499,8 +506,9 @@
499 506 $submit_form_name = 'wpbc_import_gcal'; // Define form name
500 507
501 508 // $this->get_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields (like required field) before submit.
502 509
510 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
503 511 if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) {
504 512
505 513 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
506 514 $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
@@ -525,15 +533,15 @@
525 533
526 534 // Scroll links ////////////////////////////////////////////////////////
527 535 ?>
528 536 <div class="wpdvlp-sub-tabs" style="background:none;border:none;box-shadow: none;padding:0;"><span class="nav-tabs" style="text-align:right;">
529 - <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_general_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php _e('General Settings', 'booking'); ?></span></a>
537 + <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_general_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php esc_html_e('General Settings', 'booking'); ?></span></a>
530 538 <?php if ( wpbc_is_mu_user_can_be_here('only_super_admin') ) { ?>
531 - <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_auto_import_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php _e('Auto import events' ,'booking'); ?></span></a>
539 + <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_auto_import_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php esc_html_e('Auto import events' ,'booking'); ?></span></a>
532 540 <?php } ?>
533 - <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_default_settings_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php _e('Default settings for retrieving events' ,'booking'); ?></span></a>
541 + <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_settings_import_gcal_events_default_settings_metabox' );" original-title="" class="nav-tab go-to-link"><span><?php esc_html_e('Default settings for retrieving events' ,'booking'); ?></span></a>
534 542 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
535 - <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_resource_table_gcal_id' );" original-title="" class="nav-tab go-to-link"><span><?php _e('Resources' ,'booking'); ?></span></a>
543 + <a href="javascript:void(0);" onclick="javascript:wpbc_scroll_to('#wpbc_resource_table_gcal_id' );" original-title="" class="nav-tab go-to-link"><span><?php esc_html_e('Resources' ,'booking'); ?></span></a>
536 544 <?php } ?>
537 545 </span></div>
538 546 <?php
539 547
@@ -549,18 +557,18 @@
549 557 // Content ////////////////////////////////////////////////////////////
550 558 ?>
551 559 <div class="clear" style="margin-bottom:0px;"></div>
552 560 <span class="metabox-holder">
553 - <form name="<?php echo $submit_form_name; ?>" id="<?php echo $submit_form_name; ?>" action="" method="post" autocomplete="off">
561 + <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" autocomplete="off">
554 562 <?php
555 563 // N o n c e field, and key for checking S u b m i t
556 564 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
557 - ?><input type="hidden" name="is_form_sbmitted_<?php echo $submit_form_name; ?>" id="is_form_sbmitted_<?php echo $submit_form_name; ?>" value="1" /><?php
565 + ?><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
558 566 ?><div class="clear"></div><?php
559 567
560 568 // Add hidden input SEARCH KEY field into main form, if previosly was searching by ID or Title
561 569 if ( class_exists('wpdev_bk_personal') )
562 - wpbc_hidden_search_by_id_field_in_main_form( array( 'search_get_key' => 'wh_resource_id' ) ); //FixIn: 8.0.1.12
570 + wpbc_hidden_search_by_id_field_in_main_form( array( 'search_get_key' => 'wh_resource_id' ) ); // FixIn: 8.0.1.12.
563 571
564 572 ?><div class="clear" style="height:10px;"></div><?php
565 573
566 574 ?><div class="wpbc_settings_row wpbc_settings_row_left"><?php
@@ -610,9 +618,9 @@
610 618 ?>
611 619 </div>
612 620 <div class="clear"></div>
613 621 <?php } ?>
614 - <input type="submit" value="<?php _e('Save Changes','booking'); ?>" class="button button-primary wpbc_submit_button" />
622 + <input type="submit" value="<?php esc_attr_e('Save Changes','booking'); ?>" class="button button-primary wpbc_submit_button" />
615 623 </form>
616 624 </span>
617 625 <?php
618 626
@@ -795,9 +803,9 @@
795 803 function wpbc_fields_after_saving_to_db__import_gcal( $fields, $page_id ) {
796 804
797 805 if ( $page_id == 'import_gcal' ) { // Check our API ID relative saving of this settings page
798 806
799 - // Update Cron //FixIn: 7.0.1.9
807 + // Update Cron // FixIn: 7.0.1.9.
800 808 if ( $fields['booking_gcal_auto_import_is_active']['value'] == 'On' ) {
801 809
802 810 $booking_gcal_auto_import_time = $fields['booking_gcal_auto_import_time']['value'];
803 811