PluginProbe
Booking Calendar / 11.8.2
Booking Calendar v11.8.2
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 10.11.3 All 202 releases
← All changes | includes/_feedback/feedback.php +27 -25 10.1011.8.2 View file →
@@ -17,21 +17,21 @@
17 17 if ( ! defined( 'WPBC_FEEDBACK_TIMEOUT' ) ) { define( 'WPBC_FEEDBACK_TIMEOUT', '+2 days' ); }
18 18 //if ( ! defined( 'WPBC_FEEDBACK_TIMEOUT' ) ) { define( 'WPBC_FEEDBACK_TIMEOUT', '+30 seconds' ); }
19 19
20 20 // == For testing ==
21 -//update_option( 'booking_feedback_03', gmdate( 'Y-m-d H:i:s', strtotime( '+10 seconds', strtotime( 'now' ) ) ) );
21 +//update_option( 'booking_feedback_04', gmdate( 'Y-m-d H:i:s', strtotime( '+10 seconds', strtotime( 'now' ) ) ) );
22 22
23 23 // Init Timer
24 -// update_option( 'booking_feedback_03', gmdate( 'Y-m-d H:i:s', strtotime( WPBC_FEEDBACK_TIMEOUT, strtotime( 'now' ) ) ) );
24 +// update_option( 'booking_feedback_04', gmdate( 'Y-m-d H:i:s', strtotime( WPBC_FEEDBACK_TIMEOUT, strtotime( 'now' ) ) ) );
25 25
26 26 // Reset
27 -// delete_option( 'booking_feedback_03');
27 +// delete_option( 'booking_feedback_04');
28 28
29 29 function wpbc_get_feedback_defaults( $param_name ){
30 30
31 31 $defaults = array(
32 32 'page_where_load' => 'wpbc-ajx_booking_availability', // Name of page, where to load feedback. Defined in pages, like this: do_action( 'wpbc_hook_settings_page_footer', 'wpbc-ajx_booking_availability' );
33 - 'max_version' => '11.1', // If version of Booking Calendar 9.6 or newer than do not show this Feedback
33 + 'max_version' => '12.0', // If version of Booking Calendar 12.0 or newer than do not show this Feedback
34 34 'feedback_email' => 'feedback2@wpbookingcalendar.com'
35 35 );
36 36
37 37 return $defaults[ $param_name ];
@@ -185,9 +185,9 @@
185 185 return false;
186 186 }
187 187
188 188 if ( wpbc_is__feedback_01__timeout_need_to_show() ) { // Check if time go out
189 - update_option( 'booking_feedback_03', '' );
189 + update_option( 'booking_feedback_04', '' );
190 190 } else {
191 191 return false;
192 192 }
193 193
@@ -440,15 +440,15 @@
440 440 $after_action_message = __( 'Done', 'booking' );
441 441
442 442 // Update new period for showing Feedback
443 443 $feedback_date = gmdate('Y-m-d H:i:s', strtotime( WPBC_FEEDBACK_TIMEOUT, strtotime( 'now' ) ) );
444 - update_option('booking_feedback_03', $feedback_date );
444 + update_option('booking_feedback_04', $feedback_date );
445 445
446 446 } elseif ( ( $feedback_stars > 0 ) && ( $feedback_stars <= 5 ) ) {
447 447
448 448 // Send email
449 449 wpbc_feedback_01__send_email( $feedback_stars, $feedback__note );
450 - update_option('booking_feedback_03_rating', $feedback_stars );
450 + update_option('booking_feedback_04_rating', $feedback_stars );
451 451
452 452 }
453 453
454 454 if ( ( 5 == $feedback_stars ) && ( 'rate5' != $feedback__note ) ) {
@@ -530,11 +530,11 @@
530 530 $to = wpbc_get_feedback_defaults( 'feedback_email' );
531 531
532 532 // debuge('In email', htmlentities($to), $subject, htmlentities($message), $headers, $attachments) ;
533 533 // debuge( '$to, $subject, $message, $headers, $attachments',htmlspecialchars($to), htmlspecialchars($subject), htmlspecialchars($message), htmlspecialchars($headers), htmlspecialchars($attachments));
534 -
535 - $return = wp_mail( $to, $subject, $message, $headers, $attachments );
536 -
534 + if ( wpbc_email_api_is_allow_send( true, '', '' ) ) {
535 + $return = wp_mail( $to, $subject, $message, $headers, $attachments );
536 + }
537 537 }
538 538
539 539
540 540
@@ -543,18 +543,20 @@
543 543 * @return string
544 544 */
545 545 function wpbc_feedback_01_get_version(){
546 546
547 - if ( substr( WPDEV_BK_VERSION, 0, 3 ) == '11.' ) {
548 - $show_version = substr( WPDEV_BK_VERSION, 3 );
549 - if ( substr( $show_version, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) ) ) === WP_BK_VERSION_NUM ) {
550 - $show_version = substr( $show_version, 0, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) - 1 ) );
551 - $show_version = str_replace( '.', ' ', $show_version ) . ' ' . WP_BK_VERSION_NUM;
552 - }
547 + // if ( substr( WPDEV_BK_VERSION, 0, 3 ) == '11.' ) {
548 + // $show_version = substr( WPDEV_BK_VERSION, 3 );
549 + // if ( substr( $show_version, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) ) ) === WP_BK_VERSION_NUM ) {
550 + // $show_version = substr( $show_version, 0, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) - 1 ) );
551 + // $show_version = str_replace( '.', ' ', $show_version ) . ' ' . WP_BK_VERSION_NUM;
552 + // }
553 + //
554 + // } else {
555 + // $show_version = WPDEV_BK_VERSION;
556 + // }
553 557
554 - } else {
555 - $show_version = WPDEV_BK_VERSION;
556 - }
558 + $show_version = wpbc_get_wpbc_versions_numbers();
557 559
558 560 $ver = wpbc_get_plugin_version_type();
559 561 if ( class_exists( 'wpdev_bk_multiuser' ) ) {
560 562 $ver = 'MultiUser';
@@ -591,9 +593,9 @@
591 593 function wpbc_is__feedback_01__timeout_need_to_show() {
592 594
593 595 //return true;
594 596
595 - $feedback_01_date = get_option( 'booking_feedback_03' );
597 + $feedback_01_date = get_option( 'booking_feedback_04' );
596 598
597 599 if (
598 600 ( ! empty( $feedback_01_date ) )
599 601 && ( ( strtotime( 'now' ) - strtotime( $feedback_01_date ) ) > 0 )
@@ -617,9 +619,9 @@
617 619 if ( version_compare( WP_BK_VERSION_NUM, wpbc_get_feedback_defaults( 'max_version' ) , '>=') ) {
618 620 return false;
619 621 }
620 622 $feedback_date = gmdate( 'Y-m-d H:i:s', strtotime( WPBC_FEEDBACK_TIMEOUT, strtotime( 'now' ) ) );
621 - add_option( 'booking_feedback_03', $feedback_date );
623 + add_option( 'booking_feedback_04', $feedback_date );
622 624 }
623 625 add_bk_action( 'wpbc_before_activation' , 'wpbc_is__feedback_01__timer_install' );
624 626
625 627
@@ -629,11 +631,11 @@
629 631 */
630 632 if (
631 633 ( ! wpbc_is_this_demo() )
632 634 ) {
633 - $js_css_loading = new WPBC_Feedback_01;
634 - $js_css_loading->define_ajax_hook();
635 + $wpbc_js_css_loading = new WPBC_Feedback_01;
636 + $wpbc_js_css_loading->define_ajax_hook();
635 637
636 - if ( ! empty( get_option( 'booking_feedback_03' ) ) ){
637 - $js_css_loading->init_load_css_js();
638 + if ( ! empty( get_option( 'booking_feedback_04' ) ) ){
639 + $wpbc_js_css_loading->init_load_css_js();
638 640 }
639 641 }