Plugin Directory

Changeset 3069376


Ignore:
Timestamp:
04/12/2024 06:16:21 AM (23 months ago)
Author:
webmuehle
Message:

Update 1.8.7 - Performance Issue fixed

Location:
court-reservation
Files:
595 added
2 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • court-reservation/trunk/admin/class-courtres-admin.php

    r3015566 r3069376  
    429429            $option_email_1 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_1'" )->option_value;
    430430            $option_email_2 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_2'" )->option_value;
     431            $option_email_10 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_10'" )->option_value;
     432            $option_email_9 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_9'" )->option_value;
    431433            $option_email_3 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_3'" )->option_value;
    432434            $option_email_4 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_4'" )->option_value;
     
    470472            // <from 1.5.0
    471473
    472             $subject = sprintf(
    473                 __( 'New reservation on %1$s on %2$s at %3$s for %4$s and %5$s.', 'court-reservation' ),
    474                 $court->name,
    475                 $dateStr,
    476                 $hour_from_till,
    477                 $player->display_name,
    478                 $players_list
    479             );
    480 
    481474            if ( $email_template ) {
    482475                $placeholders = array(
     
    504497    <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="padding: 0;">';
    505498
    506             $message___=email_message($message_,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8);
     499            $message___=email_message($message_,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8,$option_email_10);
    507500
    508501            $message=$message__ . $message___ . '
     
    513506            if (!isset($option_email_1)) { $option_email_1=wp_get_current_user()->display_name; }
    514507            if (!isset($option_email_2)) { $option_email_2=wp_get_current_user()->user_email; }
     508            if (!isset($option_email_10)) { $option_email_10=__( 'New reservation', 'court-reservation' ); }
     509            if (!isset($option_email_9) || $option_email_9=="")
     510            {
     511                $subject = sprintf(
     512                    __( 'New reservation on %1$s on %2$s at %3$s for %4$s and %5$s.', 'court-reservation' ),
     513                    $court->name,
     514                    $dateStr,
     515                    $hour_from_till,
     516                    $player->display_name,
     517                    $players_list
     518                );
     519            }   
     520            else
     521            {   
     522               
     523                $subject = $option_email_9;
     524            }
     525
    515526            $header1 = 'From: ' . sanitize_text_field($option_email_1) . '<' . sanitize_email($option_email_2) . '>';
    516527            $headers = array('Content-Type: text/html; charset=UTF-8',$header1);
  • court-reservation/trunk/admin/partials/courtres-emailtemplate.php

    r2811334 r3069376  
    122122    }
    123123
     124    // save option_email_10
     125    if ( isset( $_POST['option_email_10'] ) && (int) $_POST['option_email_10_id'] > 0 ) { // edit
     126        $wpdb->update(
     127            $table_name,
     128            array(
     129                'option_value' => sanitize_text_field( $_POST['option_email_10'] ),
     130            ),
     131            array( 'option_id' => (int) $_POST['option_email_10_id'] ),
     132            array( '%s' )
     133        );
     134        $message = __( 'Successfully changed!', 'court-reservation' );
     135    } else { // create
     136        $wpdb->insert(
     137            $table_name,
     138            array(
     139                'option_name'  => 'option_email_10',
     140                'option_value' => sanitize_text_field( $_POST['option_email_10'] ),
     141            ),
     142            array( '%s', '%s' )
     143        );
     144        $message = __( 'Successfully created!', 'court-reservation' );
     145    }
     146
     147    // save option_email_9
     148    if ( isset( $_POST['option_email_9'] ) && (int) $_POST['option_email_9_id'] > 0 ) { // edit
     149        $wpdb->update(
     150            $table_name,
     151            array(
     152                'option_value' => sanitize_text_field( $_POST['option_email_9'] ),
     153            ),
     154            array( 'option_id' => (int) $_POST['option_email_9_id'] ),
     155            array( '%s' )
     156        );
     157        $message = __( 'Successfully changed!', 'court-reservation' );
     158    } else { // create
     159        $wpdb->insert(
     160            $table_name,
     161            array(
     162                'option_name'  => 'option_email_9',
     163                'option_value' => sanitize_text_field( $_POST['option_email_9'] ),
     164            ),
     165            array( '%s', '%s' )
     166        );
     167        $message = __( 'Successfully created!', 'court-reservation' );
     168    }
     169
    124170    // save option_email_3
    125171    if ( isset( $_POST['option_email_3'] ) && (int) $_POST['option_email_3_id'] > 0 ) { // edit
     
    313359}
    314360
     361// option_email_10
     362$option_email_10 = $wpdb->get_row( "SELECT * FROM $table_name WHERE option_name = 'option_email_10'" );
     363if ( !isset( $option_email_10 ) ) {
     364    $option_email_10               = new stdClass();
     365    $option_email_10->option_id    = 0;
     366    $option_email_10->option_name  = 'option_email_10';
     367    $option_email_10->option_value = '';
     368}
     369
     370// option_email_9
     371$option_email_9 = $wpdb->get_row( "SELECT * FROM $table_name WHERE option_name = 'option_email_9'" );
     372if ( !isset( $option_email_9 ) ) {
     373    $option_email_9               = new stdClass();
     374    $option_email_9->option_id    = 0;
     375    $option_email_9->option_name  = 'option_email_9';
     376    $option_email_9->option_value = '';
     377}
    315378
    316379// option_email_3
     
    423486                <input type="hidden" name="option_email_1_id" value="<?php echo esc_attr( $option_email_1->option_id ); ?>" />
    424487                <input type="hidden" name="option_email_2_id" value="<?php echo esc_attr( $option_email_2->option_id ); ?>" />
     488                <input type="hidden" name="option_email_10_id" value="<?php echo esc_attr( $option_email_10->option_id ); ?>" />
     489                <input type="hidden" name="option_email_9_id" value="<?php echo esc_attr( $option_email_9->option_id ); ?>" />
    425490                <input type="hidden" name="option_email_3_id" value="<?php echo esc_attr( $option_email_3->option_id ); ?>" />
    426491                <input type="hidden" name="option_email_4_id" value="<?php echo esc_attr( $option_email_4->option_id ); ?>" />
     
    464529                            <?php echo esc_html__( 'Use the following placeholders:', 'court-reservation' ); ?><br>
    465530                            [court_name], [date_on], [hours_from_till], [player_name_creator], [players_list]<br />
    466                             <strong><?php echo esc_html__( 'Not supported placeholders from v1.5.0:', 'court-reservation' ); ?></strong>
    467                             [player_name_1], [player_name_2], [player_name_3], [player_name_4]
    468531                        </td>
    469532                        <td>
     
    502565                        </td>
    503566                    </tr>
     567                    <tr id="option_email_9_tr">
     568                        <td>
     569                            <?php echo esc_html__( 'Subject', 'court-reservation' ); ?>
     570                        </td>
     571                        <td>
     572                            <input name="option_email_9" value="<?php echo esc_attr( $option_email_9->option_value ); ?>"  placeholder="<?php echo esc_attr__( 'default', 'court-reservation' ); ?>">
     573                        </td>
     574                    </tr>
     575                    <tr id="option_email_10_tr">
     576                        <td>
     577                            <?php echo esc_html__( 'Header title', 'court-reservation' ); ?>
     578                        </td>
     579                        <td>
     580                            <input name="option_email_10" value="<?php echo esc_attr( $option_email_10->option_value ); ?>"  placeholder="<?php echo esc_attr__( 'default', 'court-reservation' ); ?>">
     581                        </td>
     582                    </tr>
    504583                    <tr>
    505584                        <td style="font-size: 14px; font-weight: 600;">
  • court-reservation/trunk/admin/partials/courtres-emailtemplatepreview.php

    r2811334 r3069376  
    2626$option_email_1 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_1'" )->option_value;
    2727$option_email_2 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_2'" )->option_value;
     28$option_email_10 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_10'" )->option_value;
     29$option_email_9 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_9'" )->option_value;
    2830$option_email_3 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_3'" )->option_value;
    2931$option_email_4 = $wpdb->get_row( "SELECT * FROM $table_settings WHERE option_name = 'option_email_4'" )->option_value;
     
    8284                <div style="width: 100%; max-width: 600px; margin-left: auto; margin-right: auto;">
    8385<?php
    84                     $message=email_message($email_template,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8);
     86                    $message=email_message($email_template,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8,$option_email_10);
    8587                    echo wp_kses_post($message);
    8688?>
  • court-reservation/trunk/admin/partials/courtres-piramid.php

    r2811334 r3069376  
    4848    array_walk($piramid, function(&$value, &$key)
    4949    {
    50         $value[$key] = sanitize_text_field($value[$key]);
     50        if (isset($value[$key])) { $value[$key] = sanitize_text_field($value[$key]); }
    5151    });
    5252
  • court-reservation/trunk/courtres.php

    r3015566 r3069376  
    1717 * Plugin URI:        https://www.courtreservation.io
    1818 * Description:       Reservation system for tennis, squash and badminton
    19  * Version:           1.8.6
     19 * Version:           1.8.7
    2020 * Author:            Webmühle e.U.
    2121 * Author URI:        https://www.webmuehle.at
     
    119119 * Rename this for your plugin and update it as you release new versions.
    120120 */
    121 define( 'Court_Reservation', '1.8.6' );
     121define( 'Court_Reservation', '1.8.7' );
    122122
    123123require_once plugin_dir_path( __FILE__ ) . 'functions.php';
  • court-reservation/trunk/functions.php

    r2914654 r3069376  
    4141}
    4242
    43 function email_message($message1,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8)
     43function email_message($message1,$option_email_3,$option_email_4,$option_email_5,$option_email_6,$option_email_7,$option_email_8,$option_email_10)
    4444{
    4545
     
    6767                                            <td id="header_wrapper" style="display: table-cell !important; padding: 0 0 0 48px; text-align: left; height: 100px;">
    6868
    69                                                 <h1 style=\'font-family: "Helvetica Neue",Helvetica,Roboto,Arial,sans-serif; font-size: 30px; font-weight: 300; line-height: 150%; margin: 0; text-align: left; text-shadow: 0 1px 0 #2b87da; color: #fff; background-color: inherit;\' bgcolor="inherit">' . __( 'New reservation', 'court-reservation' ) . '</h1>
     69                                                <h1 style=\'font-family: "Helvetica Neue",Helvetica,Roboto,Arial,sans-serif; font-size: 30px; font-weight: 300; line-height: 150%; margin: 0; text-align: left; text-shadow: 0 1px 0 #2b87da; color: #fff; background-color: inherit;\' bgcolor="inherit">' . esc_attr($option_email_10) . '</h1>
    7070
    7171                                            </td>
  • court-reservation/trunk/includes/class-courtres.php

    r3025344 r3069376  
    257257
    258258        $this->loader->add_action( 'wp_ajax_ajax_cr_navigator', $plugin_public, 'ajax_cr_navigator' );
     259        $this->loader->add_action( 'wp_ajax_nopriv_ajax_cr_navigator', $plugin_public, 'ajax_cr_navigator' );
    259260        $this->loader->add_action( 'wp_ajax_ajax_cr_navigator2', $plugin_public, 'ajax_cr_navigator2' );
    260261        $this->loader->add_action( 'wp_ajax_ajax_cr_navigator_full_view', $plugin_public, 'ajax_cr_navigator_full_view' );
     262        $this->loader->add_action( 'wp_ajax_nopriv_ajax_cr_navigator_full_view', $plugin_public, 'ajax_cr_navigator_full_view' );
    261263        $this->loader->add_action( 'wp_ajax_ajax_cr_navigator_calendar', $plugin_public, 'ajax_cr_navigator_calendar' );
    262         $this->loader->add_action( 'wp_ajax_nopriv_ajax_cr_navigator', $plugin_public, 'ajax_cr_navigator' );
     264        $this->loader->add_action( 'wp_ajax_nopriv_ajax_cr_navigator_calendar', $plugin_public, 'ajax_cr_navigator_calendar' );
     265
    263266
    264267        // get_player_select_html in add reservation popup
  • court-reservation/trunk/public/class-courtres-public.php

    r3015566 r3069376  
    413413            $block_colours = get_option('option_event_type_color');
    414414            $block_type=$block->name;
    415             if ($block_colours[$block_type]=="0") { $block_colours[$block_type]="inherit"; }
     415            if (!isset($block_colours) || !is_array($block_colours)) { $block_colours=array(); }
     416            if (!isset($block_colours[$block_type]) || $block_colours[$block_type]=="0") { $block_colours[$block_type]="inherit"; }
    416417            else { $block_colours[$block_type]=$block_colours[$block_type] . " !important"; }
    417418
     
    490491
    491492            $block_colours = get_option('option_reservation_type_color');
     493
    492494            $block_type=$reservation->type;
    493             if ($block_colours[$block_type]=="0") { $block_colours[$block_type]="inherit"; }
     495            if (is_bool($block_colours)) { unset($block_colours); $block_colours=array(); $block_colours[$block_type]="inherit"; }
     496            elseif ($block_colours[$block_type]=="0") { $block_colours[$block_type]="inherit"; }
    494497            else { $block_colours[$block_type]=$block_colours[$block_type] . " !important"; }
    495498
  • court-reservation/trunk/public/class-piramids-public.php

    r2814619 r3069376  
    183183        wp_localize_script(
    184184            $this->plugin_name . 'piramid',
    185             $this->plugin_name . '_params',
     185            $this->plugin_name . '_params_pir',
    186186            array(
    187187                'ajax_url'                      => admin_url( 'admin-ajax.php' ),
  • court-reservation/trunk/public/js/courtres-public.js

    r2914654 r3069376  
    149149                            $step  = $step < 0 ? 0 : $step;
    150150                        } else if ($cr_days.data( 'navigator' ) === 'next') {
    151                             $step = +$step + (parseInt($("#cr-table-" + id).data('navigator-step')) || 0);
     151                            if (window.innerWidth > 900) {
     152                                $step = +$step + (parseInt($("#cr-table-" + id).data('navigator-step')) || 0);
     153                            } else {
     154                                $step = +$step + 1;
     155                            }
    152156                        } else if ($cr_days.data( 'navigator' ) === 'prev-month') {
    153157                            $step = +$step - (parseInt($cr_days.data('day')) || 0);
  • court-reservation/trunk/public/js/piramid-public.js

    r2812123 r3069376  
    66    $( document ).ready(
    77        function () {
    8             cr_params = (typeof courtres_params !== 'undefined') ? courtres_params : null;
     8            cr_params = (typeof courtres_params_pir !== 'undefined') ? courtres_params_pir : null;
    99            // console.log('cr_params', cr_params);
    1010
  • court-reservation/trunk/public/partials/courtres-public-table-calendar.php

    r2914654 r3069376  
    2222                    $tillDay                   = $fromDay === 0 ? $court->days : $fromDay + $court->days;
    2323                }
     24
     25                if (isset($_GET['navigator_step']))
     26                {
     27                    $koliko=$_GET['navigator_step'];
     28                    $odabrani_dan1=strtotime($danas);
     29                    if ($koliko<0) { $odabrani_dan2 = strtotime("$koliko day", $odabrani_dan1); }
     30                    else { $odabrani_dan2 = strtotime("+$koliko day", $odabrani_dan1); }
     31                    $odabrani_dan = date('Y-m-d', $odabrani_dan2);
     32                    // $odabrani_dan = $_POST['datum'];
     33                    // $odabrani_dan_ = strtotime($odabrani_dan);
     34                    // $danas_ = strtotime($danas);
     35                    // $razlika =  round( ($odabrani_dan_-$danas_) / (60 * 60 * 24) );
     36                    $_SESSION['cr_from']=$_GET['navigator_step'];
     37                    $fromDay                   = isset( $_SESSION['cr_from'] ) ? intval( $_SESSION['cr_from'] ) : 0; // $court->days;
     38                    $tillDay                   = $fromDay === 0 ? $court->days : $fromDay + $court->days;
     39                }
     40
    2441                // $danas=date('2023-06-05');
    2542                $danas_bez1=explode("-",$odabrani_dan);
  • court-reservation/trunk/public/partials/courtres-public-table-full-view.php

    r3015566 r3069376  
    155155                    if ( $day != $fromDay ) {
    156156                        echo ' mob_minus'; }
    157                     echo "' colspan='" . esc_attr( $broj_court ) . "'>" . esc_html(date_i18n( 'l', strtotime( '+' . $day . ' day', $nowTZTS ) )) . '<br/>' . esc_html(date_i18n( $dateformat, strtotime( '+' . $day . ' day', $nowTZTS ) )) . '</th>';
     157                    if ($day<0) { $date_for_print=date_i18n( 'l', strtotime( $day . ' day', $nowTZTS ) ); }
     158                    else { $date_for_print=date_i18n( 'l', strtotime( '+' . $day . ' day', $nowTZTS ) ); }
     159                    echo "' colspan='" . esc_attr( $broj_court ) . "'>" . esc_html($date_for_print) . '<br/>' . esc_html(date_i18n( $dateformat, strtotime( '+' . $day . ' day', $nowTZTS ) )) . '</th>';
    158160            }
    159161
  • court-reservation/trunk/readme.txt

    r3015566 r3069376  
    55Requires at least: 3.0.1
    66Tested up to: 6.4.1
    7 Stable tag: 1.8.6
     7Stable tag: 1.8.7
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
     
    1111
    1212
    13 With this plugin it is easy and quick to integrate a reservation system for tennis, padel, squash, volleyball, badminton or all kinds of settings where a court needs to be reserved.
     13With this plugin, it is easy and quick to integrate a reservation system for tennis, padel, squash, volleyball, badminton or all kinds of settings where a court needs to be reserved.
    1414
    1515== Description ==
    16 With this plugin it is easy and quick to integrate a reservation system on your WordPress site. With just a few clicks, you can create additional courts which can then be integrated via shortcode anywhere on your website.
     16With this plugin, it is easy and quick to integrate a reservation system on your WordPress site. With just a few clicks, you can create additional courts which can then be integrated via shortcode anywhere on your website.
    1717With our new ULTIMATE plan, you can create unlimited pyramid competitions/tournaments, where members of your club can challenge each other. Pyramids are as fast and easy to set up as our regular court reservations system and brings a lot of new excitement into your club.
    1818
     
    2929**FEATURES OF THE PREMIUM VERSION**
    3030* All of the FREE VERSION, but no limitation in possible courts or members
    31 * For just 129,99$ a year
     31* For just 109,99$ a year
    3232
    3333**FEATURES OF THE ULTIMATE VERSION**
    3434* All of the PREMIUM VERSION, and
    3535* Ladder Competitions / Pyramid Tournaments
     36* Individual colors for reservation types
    3637* For just 199,99$ a year
    3738
     
    7273
    7374== Changelog ==
     75= 1.8.7 =
     76* PHP 8 warnings fixed
     77* Performance increased
     78
     79= 1.8.6 =
     80* Navigation fixed
     81
     82= 1.8.5 =
     83* Diverse bug fixes
     84
    7485= 1.8.4 =
    7586* Min-Max-issue solved
Note: See TracChangeset for help on using the changeset viewer.