Plugin Directory

Changeset 3425670


Ignore:
Timestamp:
12/22/2025 09:57:26 PM (3 months ago)
Author:
bookingor
Message:

new update

Location:
bookingor/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • bookingor/trunk/README.txt

    r3413175 r3425670  
    55Tested up to: 6.9
    66Donate link: https://bookingor.com
    7 Stable tag: 1.0.12
     7Stable tag: 1.0.13
    88Requires PHP: 7.2
    99License: GPLv2 or later
     
    324324*  updated plugin files
    325325
     326= 1.0.13 =
     327*  Updated Files
     328
    326329
    327330== Upgrade Notice ==
  • bookingor/trunk/admin/class-bookingor-admin.php

    r3323784 r3425670  
    243243        wp_enqueue_script($this->plugin_name . '-full-calendar-time-grid', plugins_url('js/full-calender/packages/timegrid/index.global.js', __FILE__), array('jquery'), '6.10.0', true);
    244244        wp_enqueue_script($this->plugin_name . '-full-calendar-interaction', plugins_url('js/full-calender/packages/interaction/index.global.js', __FILE__), array('jquery'), '6.10.0', true);
    245         wp_localize_script('jquery', 'TCN_BIND', array('GET_URL' => admin_url('admin-ajax.php')));
     245        $ajax_nonce = wp_create_nonce('bookingor_ajax_nonce');
     246        wp_localize_script('jquery', 'TCN_BIND', array('GET_URL' => admin_url('admin-ajax.php'), 'nonce' => $ajax_nonce));
    246247        // tostr
    247248        wp_enqueue_script($this->plugin_name . '-toastr', plugin_dir_url(dirname(__FILE__)) . 'includes/toastr/js/jquery.toast.js', array(), '2.1.4', true);
  • bookingor/trunk/admin/include/booking/booking-control.php

    r3365351 r3425670  
    111111        // phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
    112112        if (isset($_REQUEST['action'])) {
     113                        if (isset($_POST['nonce'])) {
     114                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     115                    $response = [
     116                        'status' => htmlspecialchars('error'),
     117                        'message' => htmlspecialchars('Nonce verification failed.')
     118                    ];
     119                }
     120            }
    113121            $get_book_id = sanitize_text_field(wp_unslash($_REQUEST['booking_stats_id'] ?? ""));
    114122            $get_book_status = sanitize_text_field(wp_unslash($_POST['book_status'] ?? ""));
  • bookingor/trunk/admin/include/category/category-control.php

    r3204898 r3425670  
    3939        // phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
    4040        if (isset($_REQUEST["id"])) {
    41             $id = stripslashes(filter_var($_REQUEST["id"], FILTER_SANITIZE_NUMBER_INT)); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
     41            if (isset($_POST['nonce'])) {
     42                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     43                    $response = [
     44                        'status' => htmlspecialchars('error'),
     45                        'message' => htmlspecialchars('Nonce verification failed.')
     46                    ];
     47                }
     48            }
     49            $id = stripslashes(filter_var($_REQUEST["id"], FILTER_SANITIZE_NUMBER_INT)); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.
    4250
    4351            $get_category_in_booking = $wpdb->get_results(
     
    6270                    'message' => htmlspecialchars('Category is already in use.')
    6371                ];
    64                 echo wp_json_encode($response);;
    65                 exit;
     72                echo wp_json_encode($response);
     73                die();
    6674            }
    6775        }
     
    97105                'message' => htmlspecialchars("Category Updated successfully")
    98106            ];
    99             echo wp_json_encode($response);;
    100             exit;
     107            echo wp_json_encode($response);
     108            die();
    101109        }
    102110    }
     
    116124        $category = $wpdb->prefix . self::$dp_prefix . 'categories';
    117125        if (isset($_REQUEST['action'])) {
     126        if (isset($_POST['nonce'])) {
     127                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     128                    $response = [
     129                        'status' => htmlspecialchars('error'),
     130                        'message' => htmlspecialchars('Nonce verification failed.')
     131                    ];
     132                }
     133            }
    118134            $category_name   = sanitize_text_field(wp_unslash($_POST['tcn_category_name'] ?? ""));
    119135            $category_icon   = absint(wp_unslash($_POST['tcn_category_icon_id'] ?? ""));
     
    140156                'message' => htmlspecialchars('Category Added successfully.')
    141157            ];
    142             echo wp_json_encode($response);;
    143             exit;
     158            echo wp_json_encode($response);
     159            die();
    144160        }
    145161    }
     
    194210            );
    195211       
    196         echo wp_json_encode($response);;
     212        echo wp_json_encode($response);
    197213        die;
    198214    }
  • bookingor/trunk/admin/include/customer/customer-control.php

    r3204898 r3425670  
    5757        $id = stripslashes(filter_var($_REQUEST["id"] ?? "", FILTER_SANITIZE_NUMBER_INT)); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
    5858
     59                    if (isset($_POST['nonce'])) {
     60                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     61                    $response = [
     62                        'status' => htmlspecialchars('error'),
     63                        'message' => htmlspecialchars('Nonce verification failed.')
     64                    ];
     65                }
     66            }
    5967        $get_customer_in_booking = $wpdb->get_results(
    6068            $wpdb->prepare(
  • bookingor/trunk/admin/include/location/location-control.php

    r3234242 r3425670  
    6161        // phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
    6262        if (isset($_REQUEST['action'])) {
     63                        if (isset($_POST['nonce'])) {
     64                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     65                    $response = [
     66                        'status' => htmlspecialchars('error'),
     67                        'message' => htmlspecialchars('Nonce verification failed.')
     68                    ];
     69                }
     70            }
    6371            $location_title = sanitize_text_field(wp_unslash($_POST['bookingor_location_title'] ?? ''));
    6472            $location_icon = sanitize_text_field(wp_unslash($_POST['location_icon_id'] ?? ''));
     
    138146        $update_location = $wpdb->prefix . self::$dp_prefix . 'location';
    139147        if (isset($_REQUEST['action'])) {
     148                        if (isset($_POST['nonce'])) {
     149                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     150                    $response = [
     151                        'status' => htmlspecialchars('error'),
     152                        'message' => htmlspecialchars('Nonce verification failed.')
     153                    ];
     154                }
     155            }
    140156            $location_title = sanitize_text_field(wp_unslash($_POST['bookingor_location_title'] ?? ""));
    141157            $location_id   = sanitize_text_field(wp_unslash($_POST['location_id'] ?? ""));
  • bookingor/trunk/admin/include/notification/notification-control.php

    r3236597 r3425670  
    4848        // phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
    4949        if (isset($_REQUEST['action'])) {
     50
     51                        if (isset($_POST['nonce'])) {
     52                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     53                    $response = [
     54                        'status' => htmlspecialchars('error'),
     55                        'message' => htmlspecialchars('Nonce verification failed.')
     56                    ];
     57                }
     58            }
    5059            $email_get_id = sanitize_text_field(wp_unslash($_POST['email_id'] ?? ""));
    5160            $email_subject = sanitize_text_field(wp_unslash($_POST['subject'] ?? ""));
  • bookingor/trunk/admin/include/services/service-control.php

    r3204898 r3425670  
    139139        $service_get_id = isset($_REQUEST['get_service_id']) ? intval($_REQUEST['get_service_id']) : 0;
    140140        if (isset($_REQUEST['action'])) {
     141            if (isset($_POST['nonce'])) {
     142                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     143                    $response = [
     144                        'status' => htmlspecialchars('error'),
     145                        'message' => htmlspecialchars('Nonce verification failed.')
     146                    ];
     147                }
     148            }
    141149            // phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
    142150            $service_name   = sanitize_text_field(wp_unslash($_POST['service_name'] ?? ""));
     
    295303
    296304        if (isset($_REQUEST['action'])) {
     305
     306                        if (isset($_POST['nonce'])) {
     307                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     308                    $response = [
     309                        'status' => htmlspecialchars('error'),
     310                        'message' => htmlspecialchars('Nonce verification failed.')
     311                    ];
     312                }
     313            }
    297314            //tab basic
    298315            $service_name   = sanitize_text_field(wp_unslash($_POST['service_name'] ?? ""));
     
    433450        $delete_staff_assign_service = $wpdb->prefix . self::$dp_prefix . 'staff_assign_service';
    434451        $id = sanitize_text_field(wp_unslash(isset($_REQUEST["id"]) ? $_REQUEST["id"] : ""));
     452
     453         if (isset($_POST['nonce'])) {
     454                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     455                    $response = [
     456                        'status' => htmlspecialchars('error'),
     457                        'message' => htmlspecialchars('Nonce verification failed.')
     458                    ];
     459                }
     460        }
     461
    435462        $wpdb->delete($delete_service, array(
    436463            'service_id' => $id
  • bookingor/trunk/admin/include/staff/staff-control.php

    r3260393 r3425670  
    119119        $staff_get_id =  isset($_REQUEST['get_staff_id']) ? intval($_REQUEST['get_staff_id']) : 0;
    120120        if (isset($_REQUEST['action'])) {
     121
     122                        if (isset($_POST['nonce'])) {
     123                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     124                    $response = [
     125                        'status' => htmlspecialchars('error'),
     126                        'message' => htmlspecialchars('Nonce verification failed.')
     127                    ];
     128                }
     129            }
    121130            $staff_first_name = sanitize_text_field(isset($_POST['staff_first_name']) ? $_POST['staff_first_name'] : '');
    122131            $staff_last_name = sanitize_text_field(isset($_POST['staff_last_name']) ? $_POST['staff_last_name'] : '');
     
    251260        $staff_location_assign = $wpdb->prefix . self::$dp_prefix . 'location_assign_staff';
    252261        if (isset($_REQUEST['action'])) {
     262                        if (isset($_POST['nonce'])) {
     263                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     264                    $response = [
     265                        'status' => htmlspecialchars('error'),
     266                        'message' => htmlspecialchars('Nonce verification failed.')
     267                    ];
     268                }
     269            }
    253270            $staff_first_name =  sanitize_text_field($_POST['staff_first_name'] ?? "");
    254271            $staff_last_name = sanitize_text_field($_POST['staff_last_name'] ?? "");
  • bookingor/trunk/admin/include/templates/templates-control.php

    r3323784 r3425670  
    1414    {
    1515        if (isset($_REQUEST['action'])) {
     16
     17                        if (isset($_POST['nonce'])) {
     18                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     19                    $response = [
     20                        'status' => htmlspecialchars('error'),
     21                        'message' => htmlspecialchars('Nonce verification failed.')
     22                    ];
     23                }
     24            }
    1625            if (isset($_REQUEST['editingId']) && sanitize_text_field($_REQUEST['editingId']) === '1') {
    1726                update_option(self::$name_prefix . '_settings_background_border_active_design_1', sanitize_text_field($_POST['settings_background_border_active_design_1'] . 'px' ?? ''));
     
    175184    {
    176185        if (isset($_REQUEST['action'])) {
     186                        if (isset($_POST['nonce'])) {
     187                if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'bookingor_ajax_nonce')) {
     188                    $response = [
     189                        'status' => htmlspecialchars('error'),
     190                        'message' => htmlspecialchars('Nonce verification failed.')
     191                    ];
     192                }
     193            }
    177194            //stripe
    178195            $dcimal_point = get_option(self::$name_prefix . '_currency_decimal_point');
  • bookingor/trunk/admin/js/business-profile/business-profile.js

    r3235740 r3425670  
    158158      console.log(business_work_hours);
    159159      post_data.action = "profile_update_Options";
     160      post_data.nonce = TCN_BIND.nonce;
    160161      $.post({
    161162        url: TCN_BIND.GET_URL,
  • bookingor/trunk/admin/js/category/category.js

    r3204898 r3425670  
    6161      var postData = $(this).serialize();
    6262      postData += '&action=bp_add_category';
     63     postData += '&nonce=' +TCN_BIND.nonce;
     64
    6365   
    6466      $.post({
     
    142144      var dataId = $(this).attr('data-id');
    143145      var deleteData = 'action=bp_delete_category&id=' + dataId ;
     146      deleteData += '&nonce=' + TCN_BIND.nonce;
    144147   
    145148      $.post({
     
    173176      var postData = $(this).serialize();
    174177      postData += '&action=bp_update_category';
     178            postData += '&nonce=' +TCN_BIND.nonce;
     179
    175180   
    176181      $.post({
  • bookingor/trunk/admin/js/customer/customer.js

    r3204898 r3425670  
    2222      var data_id = $(this).attr('data-id');
    2323      var delete_data = 'action=customer_delete&id=' + data_id;
     24      delete_data += '&nonce=' +TCN_BIND.nonce;
    2425      $.post({
    2526        url: TCN_BIND.GET_URL,
  • bookingor/trunk/admin/js/dashboard/dashboard.js

    r3204898 r3425670  
    88    function bookingor_weekly_chart() {
    99      var post_data = 'action=bookingor_weekly_chart';
     10      post_data += '&nonce=' +TCN_BIND.nonce;
    1011      $.ajax({
    1112        url: TCN_BIND.GET_URL,
  • bookingor/trunk/admin/js/location/backend-location.js

    r3235350 r3425670  
    271271      post_data.action = 'bp_add_location';
    272272      post_data.location_work_day = JSON.stringify(location_work_days);
     273      post_data.nonce = TCN_BIND.nonce;
    273274      $.post({
    274275        url: TCN_BIND.GET_URL,
     
    341342      var data_id = $(this).attr('data-id');
    342343      var delete_data = 'action=bp_delete_location&id=' + data_id;
     344      delete_data += '&nonce=' +TCN_BIND.nonce;
    343345      $.post(TCN_BIND.GET_URL, delete_data, function (res) {
    344346        location.reload();
     
    389391      post_data.action = 'bp_update_location';
    390392      post_data.location_timesheet_update = JSON.stringify(location_work_days_update);
     393      post_data.nonce = TCN_BIND.nonce;
    391394      $.post({
    392395        url: TCN_BIND.GET_URL,
  • bookingor/trunk/admin/js/service/service.js

    r3365351 r3425670  
    572572      var data_id = $(this).attr('data-id');
    573573      var delete_data = 'action=bp_delete_service&id=' + data_id;
     574       delete_data += '&nonce=' +TCN_BIND.nonce;
    574575      $.post({
    575576        url: TCN_BIND.GET_URL,
     
    761762        extra_duration = 0;
    762763      }
     764      post_data.nonce = TCN_BIND.nonce;
    763765      cache: false
    764766      $.post({
     
    945947      }
    946948      cache: false
     949            post_data.nonce = TCN_BIND.nonce;
     950
    947951      $.post({
    948952        url: TCN_BIND.GET_URL,
  • bookingor/trunk/admin/js/staff/staff.js

    r3235350 r3425670  
    7777            var data_id = $(this).attr("data-id");
    7878            var delete_data = "action=bp_delete_staff&id=" + data_id;
     79            delete_data += '&nonce=' +TCN_BIND.nonce;
    7980
    8081            $.post(TCN_BIND.GET_URL, delete_data, function (res) {
     
    120121            staff_assign_location_update();
    121122            post_data.staff_work_day = JSON.stringify(staff_work_days);
     123                  post_data.nonce = TCN_BIND.nonce;
     124
    122125            $.post({
    123126                url: TCN_BIND.GET_URL,
     
    174177            post_data.staff_work_day = JSON.stringify(staff_work_days);
    175178            post_data.action = "bp_add_staff";
     179            post_data.nonce = TCN_BIND.nonce;
    176180            $.post({
    177181                url: TCN_BIND.GET_URL,
Note: See TracChangeset for help on using the changeset viewer.