Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/truebooker-appointment-booking/helper/userin.php
+++ b/truebooker-appointment-booking/helper/userin.php
@@ -48,9 +48,6 @@
$truebooker_user_time = $postdata['truebooker_user_time'];
}
-// if (isset($_POST['truebooker_service_qty'])) {
- // $truebooker_user_quantity = intval($_POST['truebooker_service_qty']);
-// }
if (isset($postdata['truebooker_service_qty'])) {
$truebooker_user_quantity = $postdata['truebooker_service_qty'];
@@ -121,10 +118,7 @@
!empty($truebooker_user_quantity)
) {
- $wpdb->insert($table_truebooker_customers,
- $data
- );
-
+ $wpdb->insert($table_truebooker_customers,$data);
$truebooker_table_setting = $wpdb->prefix . 'truebooker_setting';
--- a/truebooker-appointment-booking/main/truebooker-appointment.php
+++ b/truebooker-appointment-booking/main/truebooker-appointment.php
@@ -6,9 +6,6 @@
</script>
<?php
-
-$nameErr = $lnameErr = $emailErr = $phone_err = $date_err = "";
-
global $wpdb, $table_truebooker_customers, $truebooker_user_id, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phone, $truebooker_user_note, $truebooker_user_dt, $name, $lname , $email , $phone , $note , $date , $table_truebooker_customers, $truebooker_user_id,$result ;
?>
<main class="tba-main tba-main-listing-container tba-default-box" id="all-page-main-container">
--- a/truebooker-appointment-booking/main/truebooker-dashboard.php
+++ b/truebooker-appointment-booking/main/truebooker-dashboard.php
@@ -13,8 +13,7 @@
<script>setTimeout(function tba_user_insert_data() { jQuery( ".tba-popconfirm" ).hide(); }, 4000);</script>
<?php
-$nameErr = $lnameErr = $emailErr = $phone_err = $date_err = "";
-
+
global $wpdb, $table_truebooker_customers, $truebooker_user_id, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phone, $truebooker_user_note, $truebooker_user_dt, $name, $lname , $email , $phone , $note , $date , $result, $truebooker_appointment_status , $service_id, $service_name, $tba_user_id, $tba_user_fname, $tba_user_lname, $tba_user_mail, $tba_user_phcode, $tba_user_ph, $tba_user_dt, $tba_user_tym, $tba_user_meridiem, $tba_user_app_status;
?>
<main class="tba-main tba-main-listing-container tba-default-box" id="all-page-main-container">
@@ -553,7 +552,7 @@
$updated = $wpdb->update( $table_truebooker_customers, $data, $where );
- $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$table_truebooker_customers} WHERE truebooker_user_id='{$idStr}'"), ARRAY_A);
+ $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$table_truebooker_customers} WHERE truebooker_user_id = %d",$idStr), ARRAY_A);
foreach ( $result as $row ){
$tba_user_email = $row['truebooker_user_email'];
$tba_user_firstname = $row['truebooker_user_firstname'];
--- a/truebooker-appointment-booking/main/truebooker-main.php
+++ b/truebooker-appointment-booking/main/truebooker-main.php
@@ -180,7 +180,9 @@
);
}
foreach ( $truebooker_tables as $table ) {
- $wpdb->query("DROP TABLE IF EXISTS `{$table}` ");
+ if (!empty($table)) {
+ $wpdb->query("DROP TABLE IF EXISTS `{$table}` ");
+ }
}
do_action('truebooker_after_uninstall');
--- a/truebooker-appointment-booking/main/truebooker-setting-insert.php
+++ b/truebooker-appointment-booking/main/truebooker-setting-insert.php
@@ -11,69 +11,36 @@
exit;
}
-if (isset($_POST['truebooker_stripe_api'])) {
- $truebooker_stripe_api = sanitize_text_field(
- wp_unslash( $_POST['truebooker_stripe_api'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_stripe_scretkey'])) {
- $truebooker_stripe_scretkey = sanitize_text_field(
- wp_unslash( $_POST['truebooker_stripe_scretkey'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_payment_select'])) {
- $truebooker_payment_select = sanitize_text_field(
- wp_unslash( $_POST['truebooker_payment_select'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_paypalid'])) {
- $truebooker_paypalid = sanitize_text_field(
- wp_unslash( $_POST['truebooker_paypalid'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_paypalapi'])) {
- $truebooker_paypalapi = sanitize_text_field(
- wp_unslash( $_POST['truebooker_paypalapi'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_payment_email'])) {
- $truebooker_payment_email = sanitize_email(
- wp_unslash( $_POST['truebooker_payment_email'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_api_username'])) {
- $truebooker_api_username = sanitize_text_field(
- wp_unslash( $_POST['truebooker_api_username'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_payment_mode'])) {
- $truebooker_payment_mode = sanitize_text_field(
- wp_unslash( $_POST['truebooker_payment_mode'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_s_sendername'])) {
- $truebooker_s_sendername = sanitize_text_field(
- wp_unslash( $_POST['truebooker_s_sendername'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_s_sendermail'])) {
- $truebooker_s_sendermail = sanitize_email(
- wp_unslash( $_POST['truebooker_s_sendermail'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_s_adminmail'])) {
- $truebooker_s_adminmail = sanitize_email(
- wp_unslash( $_POST['truebooker_s_adminmail'] ?? '' )
-);
-}
-if (isset($_POST['truebooker_s_subject'])) {
- $truebooker_s_subject = sanitize_text_field(
- wp_unslash( $_POST['truebooker_s_subject'] ?? '' )
-);
-}
-
+ $table_truebooker_setting = $wpdb->prefix . 'truebooker_setting';
+
+ $truebooker_stripe_api = isset($_POST['truebooker_stripe_api']) ? sanitize_text_field( wp_unslash($_POST['truebooker_stripe_api']) ) : '';
+ $truebooker_stripe_scretkey = isset($_POST['truebooker_stripe_scretkey']) ? sanitize_text_field( wp_unslash($_POST['truebooker_stripe_scretkey']) ) : '';
+ $truebooker_payment_select = isset($_POST['truebooker_payment_select']) ? sanitize_text_field( wp_unslash($_POST['truebooker_payment_select']) ) : '';
+
+ $truebooker_paypalid = isset($_POST['truebooker_paypalid']) ? sanitize_text_field( wp_unslash($_POST['truebooker_paypalid']) ) : '';
+ $truebooker_paypalapi = isset($_POST['truebooker_paypalapi']) ? sanitize_text_field( wp_unslash($_POST['truebooker_paypalapi']) ) : '';
+
+ $truebooker_payment_email = isset($_POST['truebooker_payment_email']) ? sanitize_email( wp_unslash($_POST['truebooker_payment_email']) ) : '';
+ $truebooker_api_username = isset($_POST['truebooker_api_username']) ? sanitize_text_field( wp_unslash($_POST['truebooker_api_username']) ) : '';
+ $truebooker_payment_mode = isset($_POST['truebooker_payment_mode']) ? sanitize_text_field( wp_unslash($_POST['truebooker_payment_mode']) ) : '';
+
+ $truebooker_s_name = isset($_POST['truebooker_s_name']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_name']) ) : '';
+ $truebooker_s_mail = isset($_POST['truebooker_s_mail']) ? sanitize_email( wp_unslash($_POST['truebooker_s_mail']) ) : '';
+ $truebooker_s_phone = isset($_POST['truebooker_s_phone']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_phone']) ) : '';
-// $table_truebooker_setting = $wpdb->prefix . 'truebooker_setting';
+ $truebooker_s_date = isset($_POST['truebooker_s_date']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_date']) ) : '';
+ $truebooker_s_time = isset($_POST['truebooker_s_time']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_time']) ) : '';
+ $truebooker_s_service = isset($_POST['truebooker_s_service']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_service']) ) : '';
+
+ $truebooker_s_success = isset($_POST['truebooker_s_success']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_success']) ) : '';
+ $truebooker_s_error = isset($_POST['truebooker_s_error']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_error']) ) : '';
+
+ $truebooker_s_sendername = isset($_POST['truebooker_s_sendername']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_sendername']) ) : '';
+ $truebooker_s_sendermail = isset($_POST['truebooker_s_sendermail']) ? sanitize_email( wp_unslash($_POST['truebooker_s_sendermail']) ) : '';
+ $truebooker_s_adminmail = isset($_POST['truebooker_s_adminmail']) ? sanitize_email( wp_unslash($_POST['truebooker_s_adminmail']) ) : '';
+
+ $truebooker_s_subject = isset($_POST['truebooker_s_subject']) ? sanitize_text_field( wp_unslash($_POST['truebooker_s_subject']) ) : '';
+
$payment_setting = esc_html__( 'payment_settings', 'truebooker-appointment-booking' );
$messages_settings = esc_html__( 'messages_settings', 'truebooker-appointment-booking' );
--- a/truebooker-appointment-booking/main/truebooker-setting.php
+++ b/truebooker-appointment-booking/main/truebooker-setting.php
@@ -35,12 +35,7 @@
<a class="nav-link" href="#tba_content1"><i class="fa fa-money"></i> <?php echo esc_html__( 'Payments Setting', 'truebooker-appointment-booking' )?></a>
</li>
<li class="nav-item active">
- <a class="nav-link" href="#tba_contentstyle">
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M18.543 5.62022L18.0874 4.84928C17.7428 4.26624 17.5706 3.97472 17.2774 3.85846C16.9842 3.74222 16.6527 3.83395 15.9896 4.0174L14.8633 4.32673C14.44 4.42192 13.9958 4.36792 13.6093 4.17428L13.2983 3.99935C12.9668 3.79236 12.7119 3.48717 12.5707 3.12844L12.2625 2.2308C12.0598 1.63678 11.9585 1.33977 11.7172 1.16988C11.476 1 11.1555 1 10.5145 1H9.48546C8.84457 1 8.52407 1 8.28278 1.16988C8.04154 1.33977 7.94019 1.63678 7.73751 2.2308L7.42924 3.12844C7.28812 3.48717 7.03317 3.79236 6.70171 3.99935L6.39075 4.17428C6.00421 4.36792 5.56007 4.42192 5.13674 4.32673L4.01038 4.0174C3.34729 3.83395 3.01576 3.74222 2.72261 3.85846C2.42946 3.97472 2.25718 4.26624 1.9126 4.84928L1.45699 5.62022C1.13399 6.16675 0.972491 6.44002 1.00384 6.73092C1.03518 7.02181 1.25138 7.25624 1.68378 7.72508L2.6355 8.7625C2.86812 9.0496 3.03327 9.55 3.03327 9.99991C3.03327 10.45 2.86817 10.9502 2.63553 11.2374L1.68378 12.2748C1.25138 12.7437 1.03519 12.9781 1.00384 13.2691C0.972491 13.5599 1.13399 13.8332 1.45699 14.3797L1.91259 15.1506C2.25716 15.7336 2.42946 16.0252 2.72261 16.1414C3.01576 16.2577 3.3473 16.166 4.0104 15.9825L5.1367 15.6731C5.56011 15.5779 6.00433 15.632 6.39091 15.8257L6.70183 16.0007C7.03323 16.2077 7.28811 16.5128 7.42922 16.8715L7.73751 17.7693C7.94019 18.3633 8.04154 18.6603 8.28278 18.8302C8.52407 19 8.84457 19 9.48546 19H10.5145C11.1555 19 11.476 19 11.7172 18.8302C11.9585 18.6603 12.0598 18.3633 12.2625 17.7693L12.5708 16.8715C12.7119 16.5128 12.9667 16.2077 13.2982 16.0007L13.6091 15.8257C13.9957 15.632 14.4399 15.5779 14.8633 15.6731L15.9896 15.9825C16.6527 16.166 16.9842 16.2577 17.2774 16.1414C17.5706 16.0252 17.7428 15.7336 18.0874 15.1506L18.543 14.3797C18.866 13.8332 19.0275 13.5599 18.9962 13.2691C18.9648 12.9781 18.7486 12.7437 18.3162 12.2748L17.3645 11.2374C17.1318 10.9502 16.9667 10.45 16.9667 9.99991C16.9667 9.55 17.1319 9.0496 17.3645 8.7625L18.3162 7.72508C18.7486 7.25624 18.9648 7.02181 18.9962 6.73092C19.0275 6.44002 18.866 6.16675 18.543 5.62022Z" stroke="#0F1D40" stroke-width="1.5"/>
- <path d="M13.191 9.99298C13.191 11.7327 11.7446 13.143 9.96029 13.143C8.17598 13.143 6.72955 11.7327 6.72955 9.99298C6.72955 8.25327 8.17598 6.84297 9.96029 6.84297C11.7446 6.84297 13.191 8.25327 13.191 9.99298Z" stroke="#0F1D40" stroke-width="1.5"/>
- </svg>
- <?php echo esc_html__( 'Customize Setting', 'truebooker-appointment-booking' )?></a>
+ <a class="nav-link" href="#tba_contentstyle"><i class="fa fa-gear"></i><?php echo esc_html__( 'Customize Setting', 'truebooker-appointment-booking' )?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tba_content2"><i class="fa fa-comments"></i> <?php echo esc_html__( 'Messages Setting', 'truebooker-appointment-booking' )?></a>
--- a/truebooker-appointment-booking/main/truebooker-user.php
+++ b/truebooker-appointment-booking/main/truebooker-user.php
@@ -161,7 +161,6 @@
$table_truebooker_services = $wpdb->prefix . 'truebooker_service';
- //$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$table_truebooker_services}"), ARRAY_A);
$tsd = 0;
@@ -279,13 +278,9 @@
<div class="col-lg-12 col-md-12 col-sm-12 tba-details-tbl" id="mytable">
<h2 class="tba-page-heading"><?php esc_html_e('Manage Customers', 'truebooker-appointment-booking'); ?></h2>
- <?php
-
+ <?php
$table_truebooker_customers = $wpdb->prefix . 'truebooker_user';
-
-
-
$tsd = 0;
@@ -438,11 +433,10 @@
exit;
}
-
- /******* / verify nonce **********/
-
-
-
+
+ /******* / verify nonce **********/
+
+
$table_truebooker_customers = $wpdb->prefix . 'truebooker_user';
if (isset($_POST['truebooker_user_id'])) {
@@ -468,8 +462,6 @@
if($delete){
echo '<div class="truebooker_success tba-popconfirm"><h5 class="tba_success">' . esc_attr( 'Success', 'truebooker-appointment-booking' ) . '</h5><span>' . esc_attr( 'User has been deleted successfully.', 'truebooker-appointment-booking' ) . '</span></div><div class="tba-loading"></div>';
-
- header("Refresh: 0");
?>
<script type="text/javascript"> jQuery(window).load(function() { jQuery(".tba-loading").fadeOut("slow");}); setTimeout(function(){ location.reload(); }, 1000);</script>
@@ -480,6 +472,7 @@
}
}else{
+
echo '<div class="truebooker_error tba-popconfirm"><span>'.esc_attr( 'Select at least 1 record to delete', 'truebooker-appointment-booking' ).'</span></div>';
}
--- a/truebooker-appointment-booking/main/views/bookingform-frontend.php
+++ b/truebooker-appointment-booking/main/views/bookingform-frontend.php
@@ -18,7 +18,7 @@
- global $wpdb, $table_truebooker_services, $truebooker_service_id, $result, $service_price, $select_payment , $table_truebooker_customers, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phone, $truebooker_user_phonecode, $truebooker_user_note, $truebooker_created_at, $truebooker_user_dt, $truebooker_user_service, $message, $nameErr, $lnameErr, $emailErr, $phone_err, $date_err, $service_err, $headers, $headers2, $message1, $subject, $to, $truebooker_time_meridiem, $truebooker_appointment_status, $details2, $details, $summary, $table_truebooker_setting, $paysandbox;
+ global $wpdb, $table_truebooker_services, $truebooker_service_id, $result, $service_price, $select_payment , $table_truebooker_customers, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phone, $truebooker_user_phonecode, $truebooker_user_note, $truebooker_created_at, $truebooker_user_dt, $truebooker_user_service, $message, $service_err, $headers, $headers2, $message1, $subject, $to, $truebooker_time_meridiem, $truebooker_appointment_status, $details2, $details, $summary, $table_truebooker_setting, $paysandbox;
$table_truebooker_services = $wpdb->prefix . 'truebooker_service';
@@ -73,8 +73,7 @@
<?php
-// Get form style (you can change this later to admin option)
-// $style = get_option('truebooker_form_style', 'default');
+
$style = sanitize_text_field($atts['style']);
if ($style === 'style1') {
@@ -170,58 +169,6 @@
});
</script>
-<script>
-
-/*
-jQuery(document).ready(function() {
- // Attach an event listener to the name select field
- jQuery('#truebooker_service_category').on('change', function() {
- const selectedName = jQuery(this).val();
- var AjaxUrl = '<?php //echo esc_html(TRUEBOOKER_URL)."/main/truebooker-service-price.php"; ?>';
- jQuery.ajax({
- url: AjaxUrl,
- method: 'POST',
- data: { tba_service_id: selectedName },
- dataType: 'json',
- success: function(response) {
- if (response) {
- jQuery('#s-price').val(response);
- } else {
- jQuery('#s-price').val('Price not found');
- }
- },
- error: function() {
- jQuery('#s-price').val('Error fetching price');
- }
- });
- });
-
- // Attach an event listener to the name select field
- jQuery('#truebooker_service_category').on('change', function() {
- const selectedName = jQuery(this).val();
- var AjaxUrl = '<?php //echo esc_html(TRUEBOOKER_URL)."/main/truebooker-service-name.php"; ?>';
- jQuery.ajax({
- url: AjaxUrl,
- method: 'POST',
- data: { tba_service_id: selectedName },
- dataType: 'json',
- success: function(response) {
- if (response) {
- jQuery('#s-name').val(response);
- } else {
- jQuery('#s-name').val('Name not found');
- }
- },
- error: function() {
- jQuery('#s-name').val('Error fetching name');
- }
- });
- });
-});
-
-*/
-
-</script>
<?php
return ob_get_clean();
--- a/truebooker-appointment-booking/main/views/truebooker-category.php
+++ b/truebooker-appointment-booking/main/views/truebooker-category.php
@@ -10,8 +10,7 @@
global $wpdb, $table_truebooker_categories, $truebooker_category_id,$result ;
- // $table_truebooker_categories = $wpdb->prefix . 'truebooker_categories';
-
+
if (isset($_POST['truebooker_category_id'])) {
$truebooker_category_id = intval( $_POST['truebooker_category_id'] ?? 0 );
}
--- a/truebooker-appointment-booking/main/views/truebooker-user-insert.php
+++ b/truebooker-appointment-booking/main/views/truebooker-user-insert.php
@@ -1,218 +0,0 @@
-<?php
-
-require_once( str_replace('//','/',dirname(__FILE__).'/') .'../../../../../wp-config.php');
-
-global $wpdb, $table_truebooker_customers, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phonecode, $truebooker_user_phone, $truebooker_user_note, $truebooker_user_dt, $truebooker_user_time, $truebooker_time_meridiem, $truebooker_user_service, $truebooker_appointment_status;
-
- if ( ! isset( $_POST[ 'truebooker_meta_box_noncename' ] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash($_POST['truebooker_meta_box_noncename'] ) ), 'truebooker_meta_box_nonce' ) ) {
- $er_msg = esc_html__('Sorry, Your request can not be processed due to security reason.', 'truebooker');
- $message ['php_error']= '<div class="truebooker_error tba-popconfirm"><span>'.$er_msg.'</span></div>';
- echo wp_json_encode($message);
- exit;
- }
-
-if (isset($_POST['truebooker_user_firstname'])) {
- $truebooker_user_firstname = $_POST['truebooker_user_firstname'];
-}
-if (isset($_POST['truebooker_user_lastname'])) {
- $truebooker_user_lastname = sanitize_text_field($_POST['truebooker_user_lastname']);
-}
-if (isset($_POST['truebooker_user_email'])) {
- $truebooker_user_email = $_POST['truebooker_user_email'];
-}
-if (isset($_POST['truebooker_user_phonecode'])) {
- $truebooker_user_phonecode = $_POST['truebooker_user_phonecode'];
-}
-if (isset($_POST['truebooker_user_phone'])) {
- $truebooker_user_phone = $_POST['truebooker_user_phone'];
-}
-if (isset($_POST['truebooker_user_note'])) {
- $truebooker_user_note = sanitize_text_field($_POST['truebooker_user_note']);
-}
-if (isset($_POST['truebooker_user_dt'])) {
- $truebooker_user_dt = $_POST['truebooker_user_dt'];
-}
-if (isset($_POST['truebooker_user_time'])) {
- $truebooker_user_time = $_POST['truebooker_user_time'];
-}
-if (isset($_POST['truebooker_time_meridiem'])) {
- $truebooker_time_meridiem = $_POST['truebooker_time_meridiem'];
-}
-if (isset($_POST['truebooker_user_service'])) {
- $truebooker_user_service = $_POST['truebooker_user_service'];
-}
-if (isset($_POST['truebooker_user_service_p'])) {
- $truebooker_user_service_p = $_POST['truebooker_user_service_p'];
-}
-if (isset($_POST['truebooker_appointment_status'])) {
- $truebooker_appointment_status = $_POST['truebooker_appointment_status'];
-}
-
-global $wpdb, $table_truebooker_setting, $result, $paysandbox;
-
-$table_truebooker_setting = $wpdb->prefix . 'truebooker_setting';
-$message = $summary = array();
-
-$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_truebooker_setting ORDER BY truebooker_setting_id DESC LIMIT 20"), ARRAY_A);
-
-
- global $wpdb, $table_truebooker_setting, $result;
-
- $table_truebooker_customers = $wpdb->prefix . 'truebooker_user';
-
- $truebooker_user_firstname = sanitize_text_field($_POST['truebooker_user_firstname']);
- $truebooker_user_lastname = sanitize_text_field($_POST['truebooker_user_lastname']);
- $truebooker_user_email = sanitize_text_field($_POST['truebooker_user_email']);
- $truebooker_user_phone = sanitize_text_field($_POST['truebooker_user_phone']);
- $truebooker_user_phonecode = sanitize_text_field($_POST['truebooker_user_phonecode']);
- $truebooker_user_note = sanitize_text_field($_POST['truebooker_user_note']);
- $truebooker_user_service = sanitize_text_field($_POST['truebooker_user_service']);
- $truebooker_user_dt = sanitize_text_field($_POST['truebooker_user_dt']);
- $truebooker_user_time = sanitize_text_field($_POST['truebooker_user_time']);
- $truebooker_time_meridiem = sanitize_text_field($_POST['truebooker_time_meridiem']);
- $truebooker_appointment_status = sanitize_text_field($_POST['truebooker_appointment_status']);
-
-
-$data = array(
- 'truebooker_user_firstname' => $truebooker_user_firstname,
- 'truebooker_user_lastname' => $truebooker_user_lastname,
- 'truebooker_user_email' => $truebooker_user_email,
- 'truebooker_user_phone' => $truebooker_user_phone,
- 'truebooker_user_phonecode' => $truebooker_user_phonecode,
- 'truebooker_user_note' => $truebooker_user_note,
- 'truebooker_user_service' => $truebooker_user_service,
- 'truebooker_user_dt' => $truebooker_user_dt,
- 'truebooker_user_time' => $truebooker_user_time,
- 'truebooker_time_meridiem' => $truebooker_time_meridiem,
- 'truebooker_appointment_status' => $truebooker_appointment_status,
-);
-
-
-
- if(
- !empty($truebooker_user_firstname) &&
- !empty($truebooker_user_lastname) &&
- !empty($truebooker_user_email) &&
- !empty($truebooker_user_phone) &&
- !empty($truebooker_user_dt) &&
- !empty($truebooker_user_time) &&
- !empty($truebooker_user_service)
-) {
- $wpdb->insert($table_truebooker_customers,
- $data
- );
-
- global $wpdb, $table_truebooker_setting, $result, $paysandbox, $suc_msg;
-
- $table_truebooker_setting = $wpdb->prefix . 'truebooker_setting';
-
- $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_truebooker_setting ORDER BY truebooker_setting_id DESC LIMIT 20"), ARRAY_A);
-
- $to = sanitize_text_field($_POST['truebooker_user_email']);
- $from = $result['2']['truebooker_setting_value'];
- $subject = $result['0']['truebooker_setting_value'];
- $details = ''. esc_html__( 'Your Appointment Booked successfully!', 'truebooker' ).'
-
-'.esc_html__( 'Customer Name:', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_firstname']).' '.sanitize_text_field($_POST['truebooker_user_lastname']).'
-'.esc_html__( 'Service:', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_service']).'
-'.esc_html__( 'Date & Time:', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_dt']).' '.sanitize_text_field($_POST['truebooker_user_time']).' '.sanitize_text_field($_POST['truebooker_time_meridiem']).'
-
-'.esc_html__( 'Thank you,', 'truebooker' ).'';
- $details2 = ''.esc_html__( 'Hi administrator,', 'truebooker' ).'
-
-'.esc_html__( 'You have one confirmed', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_service']).' '.esc_html__( 'appointment of', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_firstname']).' '.sanitize_text_field($_POST['truebooker_user_lastname']).'. '.esc_html__( 'The appointment is added to your schedule.', 'truebooker' ).'
-
-'.esc_html__( 'Thank you,', 'truebooker' ).'';
- $headers = ''.esc_html__( 'From:', 'truebooker' ).' '.get_option('admin_email').'';
- $headers2 = ''.esc_html__( 'From:', 'truebooker' ).' '.sanitize_text_field($_POST['truebooker_user_email']).'';
-
- wp_mail($to, $subject, $details, $headers);
- wp_mail($from, $subject, $details2, $headers2);
-
- if(!empty($result['5']['truebooker_setting_value']) ){
- $suc_msg = $result['5']['truebooker_setting_value'];
- } else {
- $suc_msg ='Appointment has been booked successfully!!';
- }
- $message ['success'] = '<div class="truebooker_success tba-popconfirm"><span>'.$suc_msg.'</span></div>';
-
- }
- else {
- if(!empty($result['4']['truebooker_setting_value']) ){
- $er_msg = $result['4']['truebooker_setting_value'];
- } else {
- $er_msg ='There is some error!!';
- }
- $message ['php_error']= '<div class="truebooker_error tba-popconfirm"><span>'.$er_msg.'</span></div>';
-
- if(!empty($result['11']['truebooker_setting_value']) ){
- $er_msg = $result['11']['truebooker_setting_value'];
- } else {
- $er_msg ='Please enter your name';
- }
- if(empty($truebooker_user_firstname)) {
- $error_msg['truebooker_user_firstname'] = $er_msg;
- }
- if(empty($truebooker_user_lastname)) {
- $error_msg['truebooker_user_lastname'] = $er_msg;
- }
-
- if(!empty($result['10']['truebooker_setting_value']) ){
- $er_msg = $result['10']['truebooker_setting_value'];
- } else {
- $er_msg ='Please enter your email';
- }
- if(empty($truebooker_user_email)) {
- $error_msg['truebooker_user_email'] = $er_msg;
- }
- else {
- if (!filter_var($truebooker_user_email, FILTER_VALIDATE_EMAIL)) {
- $error_msg['truebooker_user_email'] = "Please enter valid email address";
- }
- }
-
- if(!empty($result['9']['truebooker_setting_value']) ){
- $er_msg = $result['9']['truebooker_setting_value'];
- } else {
- $er_msg ='Please enter your phone';
- }
- if(empty($truebooker_user_phone)) {
- $error_msg['truebooker_user_phone'] = $er_msg;
- }
- else {
- if (!preg_match("/^[0-9]*$/", $truebooker_user_phone)) {
- $error_msg['truebooker_user_phone'] = "Only numeric value is allowed";
- }
- }
-
- if(!empty($result['8']['truebooker_setting_value']) ){
- $er_msg = $result['8']['truebooker_setting_value'];
- } else {
- $er_msg ='Please select date';
- }
- if(empty($truebooker_user_dt)) {
- $error_msg['truebooker_user_dt'] = $er_msg;
- }
-
- if(!empty($result['7']['truebooker_setting_value']) ){
- $er_msg = $result['7']['truebooker_setting_value'];
- } else {
- $er_msg ='Please select time';
- }
- if(empty($truebooker_user_time)) {
- $error_msg['truebooker_user_time'] = $er_msg;
- }
-
- if(!empty($result['6']['truebooker_setting_value']) ){
- $er_msg = $result['6']['truebooker_setting_value'];
- } else {
- $er_msg ='Please select service';
- }
- if(empty($truebooker_user_service)) {
- $error_msg['truebooker_user_service'] = $er_msg;
- }
- $message['error']=$error_msg;
- }
-
- echo json_encode($message);
-?>
No newline at end of file
--- a/truebooker-appointment-booking/main/views/truebooker-user.php
+++ b/truebooker-appointment-booking/main/views/truebooker-user.php
@@ -1,78 +0,0 @@
-<?php
-
-require_once( str_replace('//','/',dirname(__FILE__).'/') .'../../../../../wp-config.php');
-
-global $wpdb, $table_truebooker_customers, $truebooker_user_id, $truebooker_user_firstname, $truebooker_user_lastname, $truebooker_user_email, $truebooker_user_phone, $truebooker_user_note, $truebooker_user_dt, $truebooker_user_time, $truebooker_time_meridiem, $result;
-
-$table_truebooker_customers = $wpdb->prefix . 'truebooker_user';
-
-$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$table_truebooker_customers} ORDER BY truebooker_user_id DESC"), ARRAY_A);
-?>
-
-<h2 class="tba-page-heading"><?php esc_html_e('Manage Customers', 'truebooker'); ?></h2>
-<?php
-
- if(count($result) == 0) { ?>
- <h4><?php esc_html_e('No Record Found!', 'truebooker'); ?></h4>
-<?php }
- else { ?>
-
- <section class="tba-table-container">
- <div class="tba-table__header-wrapper" id="tba_user_table">
- <form method="post" name="bulk_action_form">
- <input id='search-box' placeholder='Search here..' class="tba_search">
- <table>
- <thead class="has-gutter">
- <tr>
- <th colspan="1" rowspan="1" class="tba-table_1_column_1 tba-table-column is-leaf tba-table__cell">
- <input type="checkbox" aria-hidden="false" class="tba-checkbox__original" name="checked" value="" id="select_all">
- </th>
- <th colspan="1" rowspan="1" class="tba-table_1_column_2 is-leaf is-sortable tba-table__cell" id="name" data-order="desc" >
- <div class="cell"><?php esc_html_e('Full Name', 'truebooker'); ?>
- <span class="caret-wrapper"><i class="sort-caret ascending"></i><i class="sort-caret descending"></i></span>
- </div>
- </th>
- <th colspan="1" rowspan="1" class="tba-table_1_column_2 is-leaf is-sortable tba-table__cell" id="email" data-order="desc">
- <div class="cell"><?php esc_html_e('Email', 'truebooker'); ?>
- <span class="caret-wrapper"><i class="sort-caret ascending"></i><i class="sort-caret descending"></i></span>
- </div>
- </th>
- <th colspan="1" rowspan="1" class="tba-table_1_column_2 is-leaf is-sortable tba-table__cell" id="phone" data-order="desc" >
- <div class="cell"><?php esc_html_e('Phone', 'truebooker'); ?>
- <span class="caret-wrapper"><i class="sort-caret ascending"></i><i class="sort-caret descending"></i></span>
- </div>
- </th>
- <th colspan="1" rowspan="1" class="tba-table_1_column_2 is-leaf is-sortable tba-table__cell" id="cdate" data-order="desc" >
- <div class="cell"><?php esc_html_e('Created Date', 'truebooker'); ?>
- <span class="caret-wrapper"><i class="sort-caret ascending"></i><i class="sort-caret descending"></i></span>
- </div>
- </th>
-
- <th colspan="1" rowspan="1" class="tba-table_1_column_2 is-leaf is-sortable tba-table__cell deleteall" id="delete" data-order="desc" >
- <div class="cell">
- <input type="submit" name="deleteall" id="deleteall" value="Delete" class="tba-button" onclick="return delete_confirm();"/>
- </div>
- </th>
- </tr>
- </thead>
- <?php
- foreach ( $result as $row ) {
- ?>
-
- <tr>
- <td><input type="checkbox" aria-hidden="false" class="tba-checkbox__original checkbox" name="checked_id[]" value="<?php echo esc_attr($row['truebooker_user_id']); ?>"></td>
- <td><?php echo esc_html__($row['truebooker_user_firstname']); ?> <?php echo esc_html__($row['truebooker_user_lastname']); ?></td>
- <td><?php echo esc_html__($row['truebooker_user_email']); ?></td>
- <td><?php echo esc_html__($row['truebooker_user_phonecode']); ?> <?php echo esc_html__($row['truebooker_user_phone']); ?></td>
- <td><?php echo esc_html__($row['truebooker_user_created']); ?></td>
- <td><input type="submit" name="delete" id="delete" value="Delete" class="tba-button" onclick="return delete_confirm();"/><i class="fa fa-sharp fa-light fa-trash"></i></td>
- </tr>
-
- <?php } ?>
-
- </table>
-
- </form>
- </div>
- </section>
- <?php } ?>
No newline at end of file
--- a/truebooker-appointment-booking/shortcodes/tbab-myaccount.php
+++ b/truebooker-appointment-booking/shortcodes/tbab-myaccount.php
@@ -1,106 +0,0 @@
-<?php
-if ( ! defined( 'ABSPATH' ) ) { exit; }
-//[tbab-myaccount]
-
-function truebooker_myaccount(){
-
- global $truebooker_helperobj,$orderinfoobj, $tbab_tabledataobj,$lostpassword,$dashboard_section,$truebooker_myaccountobj;
-
- $return ='';
- $dashboard_section = get_query_var( 'dashboard_section', 'dashboard' );
-
- ob_start();
-
-
-
-
- if ( is_user_logged_in() )
- {
-
- ?>
-
- <div class="tbab-accountpage truebooker-form row">
- <div class="col-md-12">
- <div class="col-md-4">
- <?php
-
- if( file_exists(TRUEBOOKER_DIR . '/templates/navigation.php') )
- {
- echo '<div class="tbab-account-menubar">';
- require_once TRUEBOOKER_DIR . '/templates/navigation.php';
- echo '</div>';
- }
-
- ?>
- </div>
- <div class="col-md-8">
- <?php
-
-
- if ( $dashboard_section === 'mybooking' ) {
- require_once TRUEBOOKER_DIR . '/templates/booking.php';
- }
-
- else if ( $dashboard_section === 'address' ) {
- require_once TRUEBOOKER_DIR . '/templates/address.php';
- }
-
- else if ( $dashboard_section === 'profile' ) {
- require_once TRUEBOOKER_DIR . '/templates/edit-account.php';
- }
- else
- {
- require_once TRUEBOOKER_DIR . '/templates/dashbord.php';
- }
-
- ?>
- </div>
- </div>
- </div>
-
- <?php
- }
- else
- {
-
- $my_c = filter_input( INPUT_GET, "ukey", FILTER_SANITIZE_STRING );
-
- if ( !empty($my_c)) {
-
- require_once TRUEBOOKER_DIR . '/templates/reset-password.php';
- }
- else
- {
- require_once TRUEBOOKER_DIR . '/templates/login-register.php';
- require_once TRUEBOOKER_DIR . '/templates/lost-password.php';
- }
-
- }
-
- return ob_get_clean();
-}
-
-
-add_shortcode( 'tbab-myaccount', 'truebooker_myaccount' );
-
-
-
-
-function add_custom_dashboard_rewrite_rules() {
- add_rewrite_rule(
- '^tbab-my-account/([^/]+)?$',
- 'index.php?pagename=tbab-my-account&dashboard_section=$matches[1]',
- 'top'
- );
-}
-add_action( 'init', 'add_custom_dashboard_rewrite_rules' );
-
-function add_custom_dashboard_query_vars( $query_vars ) {
- $query_vars[] = 'dashboard_section';
- return $query_vars;
-}
-add_filter( 'query_vars', 'add_custom_dashboard_query_vars' );
-
-
-
-?>
No newline at end of file
--- a/truebooker-appointment-booking/truebooker-appointment-booking.php
+++ b/truebooker-appointment-booking/truebooker-appointment-booking.php
@@ -1,14 +1,15 @@
<?php
/**
* Plugin Name: Truebooker - Appointment Booking and Scheduler System
-* Plugin URI:https://wordpress.org/plugins/truebooker-appointment-booking
+* Plugin URI: https://wordpress.org/plugins/truebooker-appointment-booking
* Description: Truebooker - Appointment Booking plugin for online book anything, anytime, anywhere. A perfect choice for medical centers, beauty salons, hair shops, car services.
- * Version: 1.1.4
+ * Version: 1.1.5
+ * Requires at least: 6.5
* Author: ThemetechMount
- * Author URI:https://themetechmount.com/
+ * Author URI: https://themetechmount.com/
* Text Domain: truebooker-appointment-booking
* Domain Path: /languages
- * Tested up to: 6.9.1
+ * Tested up to: 6.9
* Requires PHP: 7.4
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -18,7 +19,7 @@
exit;
}
-define( 'TRUEBOOKER_VERSION', '1.1.4' );
+define( 'TRUEBOOKER_VERSION', '1.1.5' );
define( 'TRUEBOOKER_DIR', trailingslashit( dirname( __FILE__ ) ) );
define( 'TRUEBOOKER_URL', plugins_url( '', __FILE__ ) );
define( 'TRUEBOOKER_PATH', plugin_dir_path( __FILE__ ) );
@@ -39,21 +40,17 @@
if( !function_exists('truebooker_scripts_styles') ){
function truebooker_scripts_styles() {
-
+
wp_enqueue_script( 'truebooker-custom', plugin_dir_url(__FILE__) . '/assets/js/truebooker_custom.js', array( 'jquery' ) );
wp_enqueue_script( 'truebooker-bootstrap', plugin_dir_url(__FILE__) . '/assets/js/bootstrap.js', array( 'jquery' ) );
wp_enqueue_style ( 'truebooker-variables', plugin_dir_url(__FILE__) . '/assets/css/truebooker_variables.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_style ( 'animate', plugin_dir_url(__FILE__) . '/assets/css/animate.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_script( 'jquery-timepicker', plugin_dir_url(__FILE__) . '/assets/js/jquery.timepicker.min.js', array( 'jquery' ) );
- wp_enqueue_script( 'intlTelInput', plugin_dir_url(__FILE__) . '/assets/js/intlTelInput.js', array( 'jquery' ) );
- wp_enqueue_script( 'intlTelInput-jquery-min', plugin_dir_url(__FILE__) . '/assets/js/intlTelInput-jquery.min.js', array( 'jquery' ) );
+ wp_enqueue_script( 'intlTelInput-min', plugin_dir_url(__FILE__) . '/assets/js/intlTelInput.min.js', array( 'jquery' ) );
wp_enqueue_script( 'utils', plugin_dir_url(__FILE__) . '/assets/js/utils.js', array( 'jquery' ) );
wp_enqueue_style ( 'intlTelInput', plugin_dir_url(__FILE__) . '/assets/css/intlTelInput.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_style ( 'add_google_fonts ', 'https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap', false );
- // iconset-fontawesome
- wp_enqueue_style( 'font-awesome', plugin_dir_url(__FILE__) .'/assets/font-awesome/css/font-awesome.min.css' );
-
//country and state
wp_enqueue_script( 'country', TRUEBOOKER_URL . '/assets/js/country.js', array( 'jquery' ));
@@ -94,10 +91,13 @@
function load_truebooker_bootstrap_css($hook) {
$current_screen = get_current_screen();
- // Check if we're on a TrueBooker plugin page (replace 'truebooker' with actual screen ID)
if (isset($current_screen->id) && strpos($current_screen->id, 'truebooker') !== false) {
- wp_enqueue_style ( 'truebooker-css', plugin_dir_url(__FILE__) . '/assets/css/truebooker_css.css', array(), TRUEBOOKER_VERSION );
+ wp_enqueue_style ( 'truebooker-css', plugin_dir_url(__FILE__) . 'assets/css/truebooker_css.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_style('truebooker-bootstrap', plugin_dir_url(__FILE__) . 'assets/css/bootstrap.css');
+ // iconset-fontawesome
+ wp_enqueue_style( 'truebooker-font-awesome', plugin_dir_url(__FILE__) .'assets/font-awesome/css/all.min.css',array(),'6.5.1');
+ wp_enqueue_style( 'truebooker-font-awesome-shim', plugin_dir_url(__FILE__) .'assets/font-awesome/css/v4-shims.min.css',array('truebooker-font-awesome'),'6.5.1');
+
}
}
add_action('admin_enqueue_scripts', 'load_truebooker_bootstrap_css');
@@ -111,13 +111,13 @@
wp_enqueue_script( 'jquery-front', TRUEBOOKER_URL . '/assets/js/truebooker_front.js', array( 'jquery' ) );
wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_script( 'jquery-timepicker', TRUEBOOKER_URL . '/assets/js/jquery.timepicker.min.js', array( 'jquery' ) );
- wp_enqueue_script( 'intlTelInput', TRUEBOOKER_URL . '/assets/js/intlTelInput.js', array( 'jquery' ) );
- wp_enqueue_script( 'intlTelInput-jquery-min', TRUEBOOKER_URL . '/assets/js/intlTelInput-jquery.min.js', array( 'jquery' ) );
+ wp_enqueue_script( 'intlTelInput-min', TRUEBOOKER_URL . '/assets/js/intlTelInput.min.js', array( 'jquery' ) );
wp_enqueue_script( 'utils', TRUEBOOKER_URL . '/assets/js/utils.js', array( 'jquery' ) );
wp_enqueue_style( 'intlTelInput', TRUEBOOKER_URL . '/assets/css/intlTelInput.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_style( 'truebooker-bootstrap', TRUEBOOKER_URL . '/assets/css/bootstrap.css', array(), TRUEBOOKER_VERSION );
wp_enqueue_style( 'add_google_fonts', 'https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap', false );
- wp_enqueue_style( 'font-awesome', TRUEBOOKER_URL .'/assets/font-awesome/css/font-awesome.min.css' );
+ wp_enqueue_style( 'truebooker-font-awesome', plugin_dir_url(__FILE__) .'assets/font-awesome/css/all.min.css',array(),'6.5.1');
+ wp_enqueue_style( 'truebooker-font-awesome-shim', plugin_dir_url(__FILE__) .'assets/font-awesome/css/v4-shims.min.css',array('truebooker-font-awesome'),'6.5.1');
wp_enqueue_script( 'country', TRUEBOOKER_URL . '/assets/js/country.js', array( 'jquery' ) );
@@ -153,15 +153,22 @@
add_filter('body_class', 'truebooker_plugin_body_class');
-function remove_admin_notices_on_truebooker_pages() {
- $current_screen = get_current_screen();
- if (isset($current_screen->id) && strpos($current_screen->id, 'truebooker') !== false) {
- remove_all_actions('admin_notices');
- }
+function truebooker_plugin_row_meta( $links, $file ) {
+
+ if ( plugin_basename( __FILE__ ) === $file ) {
+
+ $row_meta = array(
+ 'truebooker_pro' => '<a href="' . esc_url( 'https://truebookerplugin.com/pricing' ) . '" target="_blank" rel="noopener noreferrer"><strong>' . esc_html__( 'Get Truebooker Pro', 'truebooker-appointment-booking' ) . '</strong></a>',
+ );
+
+ $links = array_merge( $links, $row_meta );
+ }
+
+ return $links;
}
-add_action('admin_head', 'remove_admin_notices_on_truebooker_pages');
+add_filter( 'plugin_row_meta', 'truebooker_plugin_row_meta', 10, 2 );
?>
No newline at end of file