Plugin Directory

Changeset 3805019


Ignore:
Timestamp:
11/16/2026 11:47:29 AM (6 days ago)
Author:
akhilesh1992
Message:

V4.3.3

Location:
google-calendar-events/trunk
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • google-calendar-events/trunk/assets/generated/add-ons.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/admin-add-calendar.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/admin-add-calendar.min.js

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/admin-global.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/admin.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/admin.min.js

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/connect.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/default-calendar-common.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/default-calendar-grid.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/default-calendar-list.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/default-calendar.min.js

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/design-system.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/misc-settings.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/oauth-helper-admin.min.js

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/sc-event-admin.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/sc-event-admin.min.js

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/assets/generated/sc-event-single.min.css

    r3783403 r3805019  
    1 /*! Simple Calendar - 4.3.2
     1/*! Simple Calendar - 4.3.3
    22 * https://simplecalendar.io
    33 * Copyright (c) Xtendify Technologies 2026
  • google-calendar-events/trunk/google-calendar-events.php

    r3783403 r3805019  
    66 * Author:      Simple Calendar
    77 * Author URI:  https://simplecalendar.io
    8  * Version:    4.3.2
     8 * Version:    4.3.3
    99 * Text Domain: google-calendar-events
    1010 * Domain Path: /i18n
     11 * License: GPLv2 or later
     12 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1113 *
    1214 * @copyright   2013-2023 Xtendify Technologies. All rights reserved.
    … …  
    2224$this_plugin_dir = plugin_dir_url(__FILE__);
    2325$this_plugin_constants = [
    24         'SIMPLE_CALENDAR_VERSION' => '4.3.2',
     26        'SIMPLE_CALENDAR_VERSION' => '4.3.3',
    2527        'SIMPLE_CALENDAR_MAIN_FILE' => __FILE__,
    2628        'SIMPLE_CALENDAR_URL' => $this_plugin_dir,
    … …  
    4345$this_plugin_checks = new SimCal_WP_Requirements('Simple Calendar', plugin_basename(__FILE__), [
    4446        'PHP' => '7.3',
    45         'WordPress' => '4.2',
     47        'WordPress' => '5.3',
    4648        'Extensions' => ['curl', 'iconv', 'json', 'mbstring'],
    4749]);
  • google-calendar-events/trunk/includes/abstracts/admin-page.php

    r3551626 r3805019  
    160160                $default = $description ? '<p>' . $description . '</p>' : '';
    161161
    162                 echo apply_filters('simcal_' . $this->option_group . '_' . $this->id . '_sections_callback', $default);
     162                echo wp_kses_post(
     163                        apply_filters('simcal_' . $this->option_group . '_' . $this->id . '_sections_callback', $default),
     164                );
    163165        }
    164166
  • google-calendar-events/trunk/includes/abstracts/calendar.php

    r3783403 r3805019  
    828828                $params = [
    829829                        'action' => 'TEMPLATE',
    830                         'text' => rawurlencode(strip_tags((string) $event->title)),
     830                        'text' => rawurlencode(wp_strip_all_tags((string) $event->title)),
    831831                        'dates' => $gcal_dt_string,
    832                         'details' => rawurlencode(strip_tags((string) $event->description)),
    833                         'location' => rawurlencode(strip_tags((string) ($event->start_location['address'] ?? ''))),
     832                        'details' => rawurlencode(wp_strip_all_tags((string) $event->description)),
     833                        'location' => rawurlencode(wp_strip_all_tags((string) ($event->start_location['address'] ?? ''))),
    834834                        'trp' => 'false',
    835835                ];
    … …  
    909909
    910910                echo '<div class="' .
    911                         $calendar_class .
     911                        esc_attr($calendar_class) .
    912912                        '" ' .
    913913                        'data-calendar-id="' .
    914                         $this->id .
     914                        esc_attr($this->id) .
    915915                        '" ' .
    916916                        'data-timezone="' .
    917                         $this->timezone .
     917                        esc_attr($this->timezone) .
    918918                        '" ' .
    919919                        'data-offset="' .
    920                         $this->offset .
     920                        esc_attr($this->offset) .
    921921                        '" ' .
    922922                        'data-week-start="' .
    923                         $this->week_starts .
     923                        esc_attr($this->week_starts) .
    924924                        '" ' .
    925925                        'data-calendar-start="' .
    926                         $this->start .
     926                        esc_attr($this->start) .
    927927                        '" ' .
    928928                        'data-calendar-end="' .
    929                         $this->end .
     929                        esc_attr($this->end) .
    930930                        '" ' .
    931931                        'data-events-first="' .
    932                         $this->earliest_event .
     932                        esc_attr($this->earliest_event) .
    933933                        '" ' .
    934934                        'data-events-last="' .
    935                         $this->latest_event .
     935                        esc_attr($this->latest_event) .
    936936                        '"' .
    937937                        '>';
    … …  
    10711071                if ('yes' == $poweredby || simcal_is_powered_by_mandatory($this->id)) {
    10721072                        $align = is_rtl() ? 'left' : 'right';
    1073                         echo '<small class="simcal-powered simcal-align-' .
    1074                                 $align .
    1075                                 '">' .
    1076                                 sprintf(
    1077                                         __('Powered by <a href="%s" target="_blank">Simple Calendar</a>', 'google-calendar-events'),
    1078                                         simcal_get_url('home'),
    1079                                 ) .
    1080                                 '</small>';
     1073                        $credit = sprintf(
     1074                                /* translators: %s: URL to the Simple Calendar website */
     1075                                __('Powered by <a href="%s" target="_blank">Simple Calendar</a>', 'google-calendar-events'),
     1076                                esc_url(simcal_get_url('home')),
     1077                        );
     1078
     1079                        echo '<small class="simcal-powered simcal-align-' . esc_attr($align) . '">' . wp_kses_post($credit) . '</small>';
    10811080                }
    10821081        }
  • google-calendar-events/trunk/includes/admin/ajax.php

    r3632810 r3805019  
    243243                $nonce = isset($_POST['nonce']) ? esc_attr($_POST['nonce']) : '';
    244244                if (!wp_verify_nonce($nonce, 'simcal_rating_nonce')) {
     245                        /* translators: %s: error details */
    245246                        wp_send_json_error(sprintf(__('An error occurred: %s', 'google-calendar-events'), 'Nonce verification failed.'));
    246247                }
    247                 update_option('simple-calendar_admin_footer_text_rated', date('Y-m-d', time()));
     248                update_option('simple-calendar_admin_footer_text_rated', gmdate('Y-m-d', time()));
    248249        }
    249250
    … …  
    273274                $nonce = isset($_POST['nonce']) ? esc_attr($_POST['nonce']) : '';
    274275                if (!wp_verify_nonce($nonce, 'simcal_license_manager')) {
     276                        /* translators: %s: error details */
    275277                        wp_send_json_error(sprintf(__('An error occurred: %s', 'google-calendar-events'), 'Nonce verification failed.'));
    276278                }
    … …  
    278280                if (!current_user_can('edit_posts')) {
    279281                        wp_send_json_error(
     282                                /* translators: %s: error details */
    280283                                sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.'),
    281284                        );
    … …  
    321324                        wp_send_json_error(
    322325                                sprintf(
     326                                        /* translators: %s: error message */
    323327                                        __('There was an error processing your request: %s', 'google-calendar-events'),
    324328                                        $response->get_error_message(),
    … …  
    361365                // Verify this request comes from the add-ons licenses activation settings page.
    362366                if (empty($nonce) || !wp_verify_nonce($nonce, 'simcal_license_manager')) {
     367                        /* translators: %s: error details */
    363368                        wp_send_json_error(sprintf(__('An error occurred: %s', 'google-calendar-events'), 'Nonce verification failed.'));
    364369                }
    … …  
    367372                if (!current_user_can('edit_posts')) {
    368373                        wp_send_json_error(
     374                                /* translators: %s: error details */
    369375                                sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.'),
    370376                        );
  • google-calendar-events/trunk/includes/admin/bulk-actions.php

    r3663004 r3805019  
    9898                                jQuery( document ).ready( function() {
    9999                                        <?php foreach ($this->actions as $action_name => $action): ?>
    100                                                 jQuery( '<option>' ).val( '<?php echo $action_name; ?>' ).text( '<?php echo $action[
    101         'menu_text'
    102 ]; ?>').appendTo( 'select[name="action"]' );
    103                                                 jQuery( '<option>' ).val( '<?php echo $action_name; ?>' ).text( '<?php echo $action[
    104         'menu_text'
    105 ]; ?>').appendTo( 'select[name="action2"]' );
     100                                                jQuery( '<option>' ).val( '<?php echo esc_js($action_name); ?>' ).text( '<?php echo esc_js(
     101        $action['menu_text'],
     102); ?>' ).appendTo( 'select[name="action"]' );
     103                                                jQuery( '<option>' ).val( '<?php echo esc_js($action_name); ?>' ).text( '<?php echo esc_js(
     104        $action['menu_text'],
     105); ?>' ).appendTo( 'select[name="action2"]' );
    106106                                        <?php endforeach; ?>
    107107                                } );
    … …  
    212212                }
    213213
    214                 $post_ids_count = is_array($post_ids) ? count($post_ids) : 1;
    215 
    216214                if ($pagenow == 'edit.php' && $post_type == $this->bulk_action_post_type) {
    217215                        if (isset($_REQUEST['success_action'])) {
    218                                 // Print notice in admin bar.
     216                                // Print notice in admin bar. Message must be a translated string literal at registration.
    219217                                $message = $this->actions[$_REQUEST['success_action']]['admin_notice'];
    220 
    221                                 if (is_array($message)) {
    222                                         $message = sprintf(
    223                                                 _n($message['single'], $message['plural'], $post_ids_count, 'google-calendar-events'),
    224                                                 $post_ids_count,
    225                                         );
    226                                 }
    227218
    228219                                $class = 'updated notice is-dismissible above-h2';
    229220                                if (!empty($message)) {
    230                                         echo "<div class=\"{$class}\"><p>{$message}</p></div>";
     221                                        echo '<div class="' . esc_attr($class) . '"><p>' . esc_html($message) . '</p></div>';
    231222                                }
    232223                        }
  • google-calendar-events/trunk/includes/admin/fields/checkbox.php

    r2943704 r3805019  
    4444                if (!empty($this->options) && count((array) $this->options) > 1) {
    4545                        if (!empty($this->description)) {
    46                                 echo '<p class="description">' . wp_kses_post($this->description) . ' ' . $this->tooltip . '</p>';
     46                                $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     47                                echo '<p class="description">' .
     48                                        wp_kses_post($this->description) .
     49                                        ' ' .
     50                                        wp_kses($this->tooltip, $allowed_tooltip) .
     51                                        '</p>';
    4752                        } ?>
    48                         <fieldset class="<?php echo $this->class; ?>" <?php echo !empty($this->style) ? 'style="' . $this->style . '"' : ''; ?>>
     53                        <fieldset class="<?php echo esc_attr($this->class); ?>" <?php echo !empty($this->style)
     54        ? 'style="' . esc_attr($this->style) . '"'
     55        : ''; ?>>
    4956                                <?php if (!empty($this->title)) {
    50         echo '<legend class="screen-reader-text"><span>' . $this->title . '</span></legend>';
     57        echo '<legend class="screen-reader-text"><span>' . esc_html($this->title) . '</span></legend>';
    5158    } ?>
    5259                                <ul>
    5360                                        <?php foreach ($this->options as $option => $name): ?>
    5461                                                <li>
    55                                                         <label for="<?php echo $this->id . '-' . trim(strval($option)); ?>">
    56                                                                 <input name="<?php echo $this->name; ?>"
    57                                                                        id="<?php echo $this->id . '-' . trim(strval($option)); ?>"
     62                                                        <label for="<?php echo esc_attr($this->id . '-' . trim(strval($option))); ?>">
     63                                                                <input name="<?php echo esc_attr($this->name); ?>"
     64                                                                       id="<?php echo esc_attr($this->id . '-' . trim(strval($option))); ?>"
    5865                                                                       class="simcal-field simcal-field-checkbox"
    5966                                                                       type="checkbox"
    60                                                                        value="<?php echo trim(strval($option)); ?>"
     67                                                                       value="<?php echo esc_attr(trim(strval($option))); ?>"
    6168                                                                                <?php checked($this->value, 'yes', true); ?>
    62                                                                         <?php echo $this->attributes; ?>
     69                                                                        <?php echo wp_kses_post($this->attributes); ?>
    6370                                                                        /><?php echo esc_attr($name); ?>
    6471                                                        </label>
    … …  
    7077                } else {
    7178                         ?>
    72                         <span class="simcal-field-bool" <?php echo $this->style ? 'style="' . $this->style . '"' : ''; ?>>
     79                        <span class="simcal-field-bool" <?php echo $this->style ? 'style="' . esc_attr($this->style) . '"' : ''; ?>>
    7380                                <?php if (!empty($this->title)): ?>
    74                                         <span class="screen-reader-text"><?php echo $this->title; ?></span>
     81                                        <span class="screen-reader-text"><?php echo esc_html($this->title); ?></span>
    7582                                <?php endif; ?>
    76                                 <input name="<?php echo $this->name; ?>"
     83                                <input name="<?php echo esc_attr($this->name); ?>"
    7784                                       type="checkbox"
    78                                        id="<?php echo $this->id; ?>"
    79                                        class="simcal-field simcal-field-checkbox sc-chk-box <?php echo $this->class; ?>"
     85                                       id="<?php echo esc_attr($this->id); ?>"
     86                                       class="simcal-field simcal-field-checkbox sc-chk-box <?php echo esc_attr($this->class); ?>"
    8087                                       value="yes"
    8188                                        <?php checked($this->value, 'yes', true); ?>
    82                                         <?php echo $this->attributes; ?>/><?php echo !empty($this->text) ? $this->text : __('Yes', 'google-calendar-events'); ?>
    83                         </span>                                 
     89                                        <?php echo wp_kses_post($this->attributes); ?>/><?php echo !empty($this->text)
     90        ? esc_html($this->text)
     91        : esc_html__('Yes', 'google-calendar-events'); ?>
     92                        </span>
    8493                        <?php
    85    echo $this->tooltip;
     94   $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     95   echo wp_kses($this->tooltip, $allowed_tooltip);
    8696   if (!empty($this->description)) {
    8797        echo '<p class="description">' . wp_kses_post($this->description) . '</p>';
  • google-calendar-events/trunk/includes/admin/fields/date-picker.php

    r2943704 r3805019  
    7272                        echo '<p class="description">' . wp_kses_post($this->description) . '</p>';
    7373                } ?>
    74                 <div id="<?php echo $this->id; ?>"
    75                      class="<?php echo $this->class; ?>"
    76                      <?php echo $this->style ? 'style="' . $this->style . '"' : ''; ?>
    77                          <?php echo $this->attributes; ?>>
     74                <div id="<?php echo esc_attr($this->id); ?>"
     75                     class="<?php echo esc_attr($this->class); ?>"
     76                     <?php echo $this->style ? 'style="' . esc_attr($this->style) . '"' : ''; ?>
     77                         <?php echo wp_kses_post($this->attributes); ?>>
    7878                        <?php if (false === $this->range) { ?>
    7979                                <i class="simcal-icon-calendar"></i>
    8080                                <input type="<?php echo $this->inline === true ? 'text' : 'hidden'; ?>"
    81                                        name="<?php echo $this->name; ?>"
    82                                        value="<?php echo $this->value; ?>"
     81                                       name="<?php echo esc_attr($this->name); ?>"
     82                                       value="<?php echo esc_attr($this->value); ?>"
    8383                                       placeholder="..."
    8484                                       readonly="readonly" />
    8585                                <?php if (true === $this->inline) {
    86         echo $this->tooltip;
     86        $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     87        echo wp_kses($this->tooltip, $allowed_tooltip);
    8788    }} ?>
    8889                </div>
  • google-calendar-events/trunk/includes/admin/fields/datetime-format.php

    r3551626 r3805019  
    4747                $this->subtype = isset($field['subtype']) ? $field['subtype'] : '';
    4848                $this->type_class = 'simcal-field-datetime-format simcal-field-' . $this->subtype . '-format-field';
    49                 $this->timestamp = mktime(13, 10, 00, 1, 1, intval(date('Y', time())) + 1);
     49                $this->timestamp = mktime(13, 10, 00, 1, 1, intval(gmdate('Y', time())) + 1);
    5050
    5151                parent::__construct($field);
    … …  
    6868        public function html()
    6969        {
    70                 $id = $this->id ? ' id="' . $this->id . '" ' : '';
    71                 $class = $this->class ? ' class="' . $this->class . '" ' : '';
    72                 $style = $this->style ? ' style="' . $this->style . '" ' : '';
    73                 $attr = $this->attributes;
    74                 ?>
    75                 <div <?php echo $id . $class . $style . $attr; ?>>
     70                $id = $this->id ? ' id="' . esc_attr($this->id) . '" ' : '';
     71                $class = $this->class ? ' class="' . esc_attr($this->class) . '" ' : '';
     72                $style = $this->style ? ' style="' . esc_attr($this->style) . '" ' : '';
     73                $attr = wp_kses_post($this->attributes);
     74                ?>
     75                <div <?php echo wp_kses_post($id . $class . $style . $attr); ?>>
    7676                        <?php
    7777   if (!empty($this->description)) {
    78         echo '<p class="description">' . $this->description . '</p>';
     78        echo '<p class="description">' . wp_kses_post($this->description) . '</p>';
    7979   }
    8080
    … …  
    9090   ?>
    9191                        <input type="hidden"
    92                                name="<?php echo $this->name; ?>"
    93                                value="<?php echo trim($this->value); ?>" />
     92                               name="<?php echo esc_attr($this->name); ?>"
     93                               value="<?php echo esc_attr(trim($this->value)); ?>" />
    9494                        <span>
    95                                 <em><?php _e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
    96                                 <code><?php echo date_i18n($this->value, $this->timestamp); ?></code>
     95                                <em><?php esc_html_e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
     96                                <code><?php echo esc_html(date_i18n($this->value, $this->timestamp)); ?></code>
    9797                        </span>
    9898                </div>
    … …  
    194194                ?>
    195195                <div>
    196                         <label for="<?php echo $this->id; ?>-weekday">
    197                                 <?php _e('Weekday', 'google-calendar-events'); ?>
    198                                 <select name="" id="<?php echo $this->id; ?>-weekday">
    199                                         <option value="" data-preview=""></option>
    200                                         <option value="D" <?php selected('D', strpbrk('D', $this->value)); ?> data-preview="<?php echo date_i18n(
    201         'D',
    202         $this->timestamp,
    203  ); ?>"><?php echo date_i18n('D', $this->timestamp); ?></option>
    204                                         <option value="l" <?php selected('l', strpbrk('l', $this->value)); ?> data-preview="<?php echo date_i18n(
    205         'l',
    206         $this->timestamp,
    207  ); ?>"><?php echo date_i18n('l', $this->timestamp); ?></option>
     196                        <label for="<?php echo esc_attr($this->id); ?>-weekday">
     197                                <?php esc_html_e('Weekday', 'google-calendar-events'); ?>
     198                                <select name="" id="<?php echo esc_attr($this->id); ?>-weekday">
     199                                        <option value="" data-preview=""></option>
     200                                        <option value="D" <?php selected('D', strpbrk('D', $this->value)); ?> data-preview="<?php echo esc_attr(
     201        date_i18n('D', $this->timestamp),
     202 ); ?>"><?php echo esc_html(date_i18n('D', $this->timestamp)); ?></option>
     203                                        <option value="l" <?php selected('l', strpbrk('l', $this->value)); ?> data-preview="<?php echo esc_attr(
     204        date_i18n('l', $this->timestamp),
     205 ); ?>"><?php echo esc_html(date_i18n('l', $this->timestamp)); ?></option>
    208206                                </select>
    209207                        </label>
    … …  
    222220                ?>
    223221                <div>
    224                         <label for="<?php echo $this->id; ?>-day">
    225                                 <?php _e('Day', 'google-calendar-events'); ?>
    226                                 <select name="" id="<?php echo $this->id; ?>-day">
    227                                         <option value="" data-preview=""></option>
    228                                         <option value="j" <?php selected('j', strpbrk('j', $this->value)); ?> data-preview="<?php echo date(
    229         'j',
    230         $this->timestamp,
    231  ); ?>"><?php echo date('j', $this->timestamp); ?></option>
    232                                         <option value="d" <?php selected('d', strpbrk('d', $this->value)); ?> data-preview="<?php echo date(
    233         'd',
    234         $this->timestamp,
    235  ); ?>"><?php echo date('d', $this->timestamp); ?></option>
     222                        <label for="<?php echo esc_attr($this->id); ?>-day">
     223                                <?php esc_html_e('Day', 'google-calendar-events'); ?>
     224                                <select name="" id="<?php echo esc_attr($this->id); ?>-day">
     225                                        <option value="" data-preview=""></option>
     226                                        <option value="j" <?php selected('j', strpbrk('j', $this->value)); ?> data-preview="<?php echo esc_attr(
     227        gmdate('j', $this->timestamp),
     228 ); ?>"><?php echo esc_html(gmdate('j', $this->timestamp)); ?></option>
     229                                        <option value="d" <?php selected('d', strpbrk('d', $this->value)); ?> data-preview="<?php echo esc_attr(
     230        gmdate('d', $this->timestamp),
     231 ); ?>"><?php echo esc_html(gmdate('d', $this->timestamp)); ?></option>
    236232                                </select>
    237233                        </label>
    … …  
    250246                ?>
    251247                <div>
    252                         <label for="<?php echo $this->id; ?>-month">
    253                                 <?php _e('Month', 'google-calendar-events'); ?>
    254                                 <select name="" id="<?php echo $this->id; ?>-month">
    255                                         <option value="" data-preview=""></option>
    256                                         <option value="F" <?php selected('F', strpbrk('F', $this->value)); ?> data-preview="<?php echo date_i18n(
    257         'F',
    258         $this->timestamp,
    259  ); ?>"><?php echo date_i18n('F', $this->timestamp); ?></option>
    260                                         <option value="M" <?php selected('M', strpbrk('M', $this->value)); ?> data-preview="<?php echo date_i18n(
    261         'M',
    262         $this->timestamp,
    263  ); ?>"><?php echo date_i18n('M', $this->timestamp); ?></option>
    264                                         <option value="m" <?php selected('m', strpbrk('m', $this->value)); ?> data-preview="<?php echo date(
    265         'm',
    266         $this->timestamp,
    267  ); ?>"><?php echo date('m', $this->timestamp); ?></option>
    268                                         <option value="n" <?php selected('n', strpbrk('n', $this->value)); ?> data-preview="<?php echo date(
    269         'n',
    270         $this->timestamp,
    271  ); ?>"><?php echo date('n', $this->timestamp); ?></option>
     248                        <label for="<?php echo esc_attr($this->id); ?>-month">
     249                                <?php esc_html_e('Month', 'google-calendar-events'); ?>
     250                                <select name="" id="<?php echo esc_attr($this->id); ?>-month">
     251                                        <option value="" data-preview=""></option>
     252                                        <option value="F" <?php selected('F', strpbrk('F', $this->value)); ?> data-preview="<?php echo esc_attr(
     253        date_i18n('F', $this->timestamp),
     254 ); ?>"><?php echo esc_html(date_i18n('F', $this->timestamp)); ?></option>
     255                                        <option value="M" <?php selected('M', strpbrk('M', $this->value)); ?> data-preview="<?php echo esc_attr(
     256        date_i18n('M', $this->timestamp),
     257 ); ?>"><?php echo esc_html(date_i18n('M', $this->timestamp)); ?></option>
     258                                        <option value="m" <?php selected('m', strpbrk('m', $this->value)); ?> data-preview="<?php echo esc_attr(
     259        gmdate('m', $this->timestamp),
     260 ); ?>"><?php echo esc_html(gmdate('m', $this->timestamp)); ?></option>
     261                                        <option value="n" <?php selected('n', strpbrk('n', $this->value)); ?> data-preview="<?php echo esc_attr(
     262        gmdate('n', $this->timestamp),
     263 ); ?>"><?php echo esc_html(gmdate('n', $this->timestamp)); ?></option>
    272264                                </select>
    273265                        </label>
    … …  
    286278                ?>
    287279                <div>
    288                         <label for="<?php echo $this->id; ?>-year">
    289                                 <?php _e('Year', 'google-calendar-events'); ?>
    290                                 <select name="" id="<?php echo $this->id; ?>-year">
    291                                         <option value="" data-preview=""></option>
    292                                         <option value="Y" <?php selected('Y', strpbrk('Y', $this->value)); ?> data-preview="<?php echo date(
    293         'Y',
    294         $this->timestamp,
    295  ); ?>"><?php echo date('Y', $this->timestamp); ?></option>
    296                                         <option value="y" <?php selected('y', strpbrk('y', $this->value)); ?> data-preview="<?php echo date(
    297         'y',
    298         $this->timestamp,
    299  ); ?>"><?php echo date('y', $this->timestamp); ?></option>
     280                        <label for="<?php echo esc_attr($this->id); ?>-year">
     281                                <?php esc_html_e('Year', 'google-calendar-events'); ?>
     282                                <select name="" id="<?php echo esc_attr($this->id); ?>-year">
     283                                        <option value="" data-preview=""></option>
     284                                        <option value="Y" <?php selected('Y', strpbrk('Y', $this->value)); ?> data-preview="<?php echo esc_attr(
     285        gmdate('Y', $this->timestamp),
     286 ); ?>"><?php echo esc_html(gmdate('Y', $this->timestamp)); ?></option>
     287                                        <option value="y" <?php selected('y', strpbrk('y', $this->value)); ?> data-preview="<?php echo esc_attr(
     288        gmdate('y', $this->timestamp),
     289 ); ?>"><?php echo esc_html(gmdate('y', $this->timestamp)); ?></option>
    300290                                </select>
    301291                        </label>
    … …  
    314304                ?>
    315305                <div>
    316                         <label for="<?php echo $this->id; ?>-hours">
    317                                 <?php _e('Hours', 'google-calendar-events'); ?>
    318                                 <select name="" id="<?php echo $this->id; ?>-hours">
    319                                         <option value="" data-preview=""></option>
    320                                         <option value="g" <?php selected('g', strpbrk('g', $this->value)); ?> data-preview="<?php echo date(
    321         'g',
    322         $this->timestamp,
    323  ); ?>"><?php echo date('g', $this->timestamp) . ' (12h)'; ?></option>
    324                                         <option value="G" <?php selected('G', strpbrk('G', $this->value)); ?> data-preview="<?php echo date(
    325         'G',
    326         $this->timestamp - 43200,
    327  ); ?>"><?php echo date('G', $this->timestamp - 43200) . ' (24h)'; ?></option>
    328                                         <option value="h" <?php selected('h', strpbrk('h', $this->value)); ?> data-preview="<?php echo date(
    329         'h',
    330         $this->timestamp,
    331  ); ?>"><?php echo date('h', $this->timestamp) . ' (12h)'; ?></option>
    332                                         <option value="H" <?php selected('H', strpbrk('H', $this->value)); ?> data-preview="<?php echo date(
    333         'H',
    334         $this->timestamp - 43200,
    335  ); ?>"><?php echo date('H', $this->timestamp - 43200) . ' (24h)'; ?></option>
     306                        <label for="<?php echo esc_attr($this->id); ?>-hours">
     307                                <?php esc_html_e('Hours', 'google-calendar-events'); ?>
     308                                <select name="" id="<?php echo esc_attr($this->id); ?>-hours">
     309                                        <option value="" data-preview=""></option>
     310                                        <option value="g" <?php selected('g', strpbrk('g', $this->value)); ?> data-preview="<?php echo esc_attr(
     311        gmdate('g', $this->timestamp),
     312 ); ?>"><?php echo esc_html(gmdate('g', $this->timestamp) . ' (12h)'); ?></option>
     313                                        <option value="G" <?php selected('G', strpbrk('G', $this->value)); ?> data-preview="<?php echo esc_attr(
     314        gmdate('G', $this->timestamp - 43200),
     315 ); ?>"><?php echo esc_html(gmdate('G', $this->timestamp - 43200) . ' (24h)'); ?></option>
     316                                        <option value="h" <?php selected('h', strpbrk('h', $this->value)); ?> data-preview="<?php echo esc_attr(
     317        gmdate('h', $this->timestamp),
     318 ); ?>"><?php echo esc_html(gmdate('h', $this->timestamp) . ' (12h)'); ?></option>
     319                                        <option value="H" <?php selected('H', strpbrk('H', $this->value)); ?> data-preview="<?php echo esc_attr(
     320        gmdate('H', $this->timestamp - 43200),
     321 ); ?>"><?php echo esc_html(gmdate('H', $this->timestamp - 43200) . ' (24h)'); ?></option>
    336322                                </select>
    337323                        </label>
    … …  
    350336                ?>
    351337                <div>
    352                         <label for="<?php echo $this->id; ?>-minutes">
    353                                 <?php _e('Minutes', 'google-calendar-events'); ?>
    354                                 <select name="" id="<?php echo $this->id; ?>-minutes">
    355                                         <option value="" data-preview=""></option>
    356                                         <option value="i" <?php selected('i', strpbrk('i', $this->value)); ?> data-preview="<?php echo date(
    357         'i',
    358         $this->timestamp,
    359  ); ?>"><?php echo date('i', $this->timestamp); ?></option>
     338                        <label for="<?php echo esc_attr($this->id); ?>-minutes">
     339                                <?php esc_html_e('Minutes', 'google-calendar-events'); ?>
     340                                <select name="" id="<?php echo esc_attr($this->id); ?>-minutes">
     341                                        <option value="" data-preview=""></option>
     342                                        <option value="i" <?php selected('i', strpbrk('i', $this->value)); ?> data-preview="<?php echo esc_attr(
     343        gmdate('i', $this->timestamp),
     344 ); ?>"><?php echo esc_html(gmdate('i', $this->timestamp)); ?></option>
    360345                                </select>
    361346                        </label>
    … …  
    374359                ?>
    375360                <div>
    376                         <label for="<?php echo $this->id; ?>-meridiem">
    377                                 <?php _e('Meridiem', 'google-calendar-events'); ?>
    378                                 <select name="" id="<?php echo $this->id; ?>-meridiem">
    379                                         <option value="" data-preview=""></option>
    380                                         <option value="a" <?php selected('a', strpbrk('a', $this->value)); ?> data-preview="<?php echo date(
    381         'a',
    382         $this->timestamp,
    383  ); ?>"><?php echo date('a', $this->timestamp); ?></option>
    384                                         <option value="A" <?php selected('A', strpbrk('A', $this->value)); ?> data-preview="<?php echo date(
    385         'A',
    386         $this->timestamp,
    387  ); ?>"><?php echo date('A', $this->timestamp); ?></option>
     361                        <label for="<?php echo esc_attr($this->id); ?>-meridiem">
     362                                <?php esc_html_e('Meridiem', 'google-calendar-events'); ?>
     363                                <select name="" id="<?php echo esc_attr($this->id); ?>-meridiem">
     364                                        <option value="" data-preview=""></option>
     365                                        <option value="a" <?php selected('a', strpbrk('a', $this->value)); ?> data-preview="<?php echo esc_attr(
     366        gmdate('a', $this->timestamp),
     367 ); ?>"><?php echo esc_html(gmdate('a', $this->timestamp)); ?></option>
     368                                        <option value="A" <?php selected('A', strpbrk('A', $this->value)); ?> data-preview="<?php echo esc_attr(
     369        gmdate('A', $this->timestamp),
     370 ); ?>"><?php echo esc_html(gmdate('A', $this->timestamp)); ?></option>
    388371                                </select>
    389372                        </label>
    … …  
    402385                ?>
    403386                <div>
    404                         <label for="<?php echo $this->id; ?>-divider">
    405                                 <?php _ex('Divider', 'A character to separate two elements', 'google-calendar-events'); ?>
    406                                 <select name="" id="<?php echo $this->id; ?>-divider">
     387                        <label for="<?php echo esc_attr($this->id); ?>-divider">
     388                                <?php echo esc_html_x('Divider', 'A character to separate two elements', 'google-calendar-events'); ?>
     389                                <select name="" id="<?php echo esc_attr($this->id); ?>-divider">
    407390                                        <option value="" data-preview=""></option>
    408391                                        <option value="."  <?php selected('.', strpbrk('.', $this->value)); ?> data-preview="."  data-trim="true">.</option>
  • google-calendar-events/trunk/includes/admin/fields/license.php

    r3551626 r3805019  
    102102                                        </div>
    103103                                        <?php if (!empty($this->card_description)) { ?>
    104                                                 <p class="sc_text--body_b3 sc_addon_item_desc"><?php echo $this->card_description; ?></p>
     104                                                <p class="sc_text--body_b3 sc_addon_item_desc"><?php echo wp_kses_post($this->card_description); ?></p>
    105105                                        <?php } ?>
    106106                        <?php } ?>
    107107
    108                         <div class="simcal-addon-manage-license-field" data-addon="<?php echo $this->addon; ?>">
     108                        <div class="simcal-addon-manage-license-field" data-addon="<?php echo esc_attr($this->addon); ?>">
    109109                                <input
    110110                                        type="text"
    111                                         <?php echo $disabled; ?>
    112                                         name="<?php echo $this->name; ?>"
    113                                         id="<?php echo $this->id; ?>"
    114                                         value="<?php echo $this->value; ?>"
    115                                         class="<?php echo trim('sc_input sc_input_muted sc_input_full ' . $this->class); ?>"
     111                                        <?php echo wp_kses_post($disabled); ?>
     112                                        name="<?php echo esc_attr($this->name); ?>"
     113                                        id="<?php echo esc_attr($this->id); ?>"
     114                                        value="<?php echo esc_attr($this->value); ?>"
     115                                        class="<?php echo esc_attr(trim('sc_input sc_input_muted sc_input_full ' . $this->class)); ?>"
    116116                                />
    117117
    … …  
    121121        ? ''
    122122        : ' is_hidden'; ?>"
    123                                                 data-add-on="<?php echo $this->addon; ?>"
     123                                                data-add-on="<?php echo esc_attr($this->addon); ?>"
    124124                                        >
    125125                                                <span class="sc_btn_submit"><?php esc_html_e('Deactivate', 'google-calendar-events'); ?></span>
    … …  
    136136        ? ''
    137137        : ' is_hidden'; ?>"
    138                                                 data-add-on="<?php echo $this->addon; ?>"
     138                                                data-add-on="<?php echo esc_attr($this->addon); ?>"
    139139                                        >
    140140                                                <span class="sc_btn_submit"><?php esc_html_e('Activate', 'google-calendar-events'); ?></span>
    … …  
    149149                                        <span class="error sc-error-notice is_hidden"></span>
    150150                                        <strong class="label sc_license_active_label<?php echo $show_active_label ? '' : ' is_hidden'; ?>">
    151                                                 <?php _e('(active)', 'google-calendar-events'); ?>
     151                                                <?php esc_html_e('(active)', 'google-calendar-events'); ?>
    152152                                        </strong>
    153153                                </div>
  • google-calendar-events/trunk/includes/admin/fields/radio.php

    r2943704 r3805019  
    5353        {
    5454                ?>
    55                 <fieldset id="<?php echo $this->id; ?>"
    56                           class="<?php echo $this->class; ?>"
    57                         <?php echo $this->style ? 'style="' . $this->style . '"' : ''; ?>>
     55                <fieldset id="<?php echo esc_attr($this->id); ?>"
     56                          class="<?php echo esc_attr($this->class); ?>"
     57                        <?php echo $this->style ? 'style="' . esc_attr($this->style) . '"' : ''; ?>>
    5858                        <?php
    5959   echo $this->description ? '<p class="description">' . wp_kses_post($this->description) . '</p>' : '';
    … …  
    6161   if (!empty($this->title)): ?>
    6262                                <legend class="screen-reader-text">
    63                                         <span><?php echo $this->title; ?></span>
     63                                        <span><?php echo esc_html($this->title); ?></span>
    6464                                </legend>
    6565                                <?php endif;
    … …  
    6868                                <?php foreach ($this->options as $option => $name): ?>
    6969                                        <li>
    70                                                 <label for="<?php echo $this->id . '-' . trim(strval($option)); ?>">
    71                                                         <input name="<?php echo $this->name; ?>"
    72                                                                id="<?php echo $this->id . '-' . trim(strval($option)); ?>"
     70                                                <label for="<?php echo esc_attr($this->id . '-' . trim(strval($option))); ?>">
     71                                                        <input name="<?php echo esc_attr($this->name); ?>"
     72                                                               id="<?php echo esc_attr($this->id . '-' . trim(strval($option))); ?>"
    7373                                                               class="simcal-field simcal-field-radio"
    7474                                                               type="radio"
    75                                                                value="<?php echo trim(strval($option)); ?>"
    76                                                                 <?php echo $this->attributes; ?>
     75                                                               value="<?php echo esc_attr(trim(strval($option))); ?>"
     76                                                                <?php echo wp_kses_post($this->attributes); ?>
    7777                                                                <?php checked($option, $this->value, true); ?>
    7878                                                                />
    … …  
    8383                        </ul>
    8484
    85                         <?php echo $this->tooltip; ?>
     85                        <?php
     86   $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     87   echo wp_kses($this->tooltip, $allowed_tooltip);?>
    8688
    8789                </fieldset>
  • google-calendar-events/trunk/includes/admin/fields/select.php

    r2943704 r3805019  
    9898                ?>
    9999                <select name="<?php
    100   echo $this->name;
     100  echo esc_attr($this->name);
    101101  if ($this->multiselect === true) {
    102102        echo '[]';
    103103  }
    104104  ?>"
    105                         id="<?php echo $this->id; ?>"
    106                         style="<?php echo $this->style; ?>"
    107                         class="<?php echo $this->class; ?>"
    108                                 <?php echo $this->attributes; ?>
     105                        id="<?php echo esc_attr($this->id); ?>"
     106                        style="<?php echo esc_attr($this->style); ?>"
     107                        class="<?php echo esc_attr($this->class); ?>"
     108                                <?php echo wp_kses_post($this->attributes); ?>
    109109                                <?php echo $this->multiselect === true ? ' multiple="multiple"' : ''; ?>>
    110110                        <?php
    … …  
    119119                $selected = selected($this->value, trim(strval($option)), false);
    120120        }
    121         echo '<option value="' . $option . '" ' . $selected . '>' . esc_attr($name) . '</option>';
     121        echo '<option value="' . esc_attr($option) . '" ';
     122        echo wp_kses_post($selected);
     123        echo '>' . esc_attr($name) . '</option>';
    122124   }
    123125   ?>
    124126                </select>
    125127                <?php
    126   echo $this->tooltip;
     128  $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     129  echo wp_kses($this->tooltip, $allowed_tooltip);
    127130
    128131  if (!empty($this->description)) {
  • google-calendar-events/trunk/includes/admin/fields/standard.php

    r2943704 r3805019  
    5252        {
    5353                ?>
    54                 <input type="<?php echo $this->subtype; ?>"
    55                        name="<?php echo $this->name; ?>"
    56                        id="<?php echo $this->id; ?>"
    57                        value="<?php echo $this->value; ?>"
    58                        class="<?php echo $this->class; ?>"<?php
    59 echo $this->style ? 'style="' . $this->style . '" ' : ' ';
    60 echo $this->placeholder ? 'placeholder="' . $this->placeholder . '"' : ' ';
    61 echo $this->attributes;
     54                <input type="<?php echo esc_attr($this->subtype); ?>"
     55                       name="<?php echo esc_attr($this->name); ?>"
     56                       id="<?php echo esc_attr($this->id); ?>"
     57                       value="<?php echo esc_attr($this->value); ?>"
     58                       class="<?php echo esc_attr($this->class); ?>"<?php
     59echo $this->style ? 'style="' . esc_attr($this->style) . '" ' : ' ';
     60echo $this->placeholder ? 'placeholder="' . esc_attr($this->placeholder) . '"' : ' ';
     61echo wp_kses_post($this->attributes);
    6262?>/>
    6363                <?php
    64   echo $this->tooltip;
     64  $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     65  echo wp_kses($this->tooltip, $allowed_tooltip);
    6566
    6667  if (!empty($this->description)) {
    … …  
    6970
    7071  if (is_string($this->validation) && !empty($this->validation)) {
    71         echo $this->validation;
     72        echo wp_kses_post($this->validation);
    7273  }
    7374        }
  • google-calendar-events/trunk/includes/admin/fields/textarea.php

    r2943704 r3805019  
    5050                ?>
    5151                <textarea
    52                         name="<?php echo $this->name; ?>"
    53                         id="<?php echo $this->id; ?>"
     52                        name="<?php echo esc_attr($this->name); ?>"
     53                        id="<?php echo esc_attr($this->id); ?>"
    5454                        <?php
    55    echo $this->class ? 'class="' . $this->class . '" ' : '';
    56    echo $this->placeholder ? 'placeholder="' . $this->placeholder . '" ' : '';
    57    echo $this->style ? 'style="' . $this->style . '" ' : '';
    58    echo $this->attributes;
    59    ?>><?php echo $this->value; ?></textarea>
     55   echo $this->class ? 'class="' . esc_attr($this->class) . '" ' : '';
     56   echo $this->placeholder ? 'placeholder="' . esc_attr($this->placeholder) . '" ' : '';
     57   echo $this->style ? 'style="' . esc_attr($this->style) . '" ' : '';
     58   echo wp_kses_post($this->attributes);
     59   ?>><?php echo esc_textarea($this->value); ?></textarea>
    6060                <?php
    61   echo $this->tooltip;
     61  $allowed_tooltip = ['i' => ['class' => [], 'data-tip' => []]];
     62  echo wp_kses($this->tooltip, $allowed_tooltip);
    6263
    6364  if (!empty($this->description)) {
  • google-calendar-events/trunk/includes/admin/metaboxes/settings.php

    r3783403 r3805019  
    157157                        }
    158158                        ?>
    159                         <label for="_feed_type"><span><?php _e('Event Source', 'google-calendar-events'); ?></span>
     159                        <label for="_feed_type"><span><?php esc_html_e('Event Source', 'google-calendar-events'); ?></span>
    160160                                <select name="_feed_type" id="_feed_type">
    161161                                        <optgroup
    162                                                         label="<?php _ex('Get events from', 'From which calendar source to load events from', 'google-calendar-events'); ?>">
     162                                                        label="<?php echo esc_attr_x(
     163        'Get events from',
     164        'From which calendar source to load events from',
     165        'google-calendar-events',
     166       ); ?>">
    163167                                                <?php foreach ($feed_options as $feed => $name) { ?>
    164                                                         <option value="<?php echo $feed; ?>" <?php selected($feed, $feed_type, true); ?>><?php echo $name; ?></option>
     168                                                        <option value="<?php echo esc_attr($feed); ?>" <?php selected($feed, $feed_type, true); ?>><?php echo esc_html(
     169        $name,
     170); ?></option>
    165171                                                <?php } ?>
    166172                                        </optgroup>
    … …  
    180186                        }
    181187                        ?>
    182                         <label for="_calendar_type"><span><?php _e('Calendar Type', 'google-calendar-events'); ?></span>
     188                        <label for="_calendar_type"><span><?php esc_html_e('Calendar Type', 'google-calendar-events'); ?></span>
    183189                                <select name="_calendar_type" id="_calendar_type">
    184                                         <optgroup label="<?php _e('Calendar to use', 'google-calendar-events'); ?>">
     190                                        <optgroup label="<?php esc_html_e('Calendar to use', 'google-calendar-events'); ?>">
    185191                                                <?php foreach ($calendar_options as $calendar => $name) { ?>
    186                                                         <option value="<?php echo $calendar; ?>" <?php selected(
     192                                                        <option value="<?php echo esc_attr($calendar); ?>" <?php selected(
    187193        $calendar,
    188194        $calendar_type,
    189195        true,
    190 ); ?>><?php echo $name; ?></option>
     196); ?>><?php echo esc_html($name); ?></option>
    191197                                                <?php } ?>
    192198                                        </optgroup>
    … …  
    198204        foreach ($calendar_views as $calendar => $views) {
    199205                $calendar_type_view = isset($calendar_view[$calendar]) ? $calendar_view[$calendar] : ''; ?>
    200                                         <label for="_calendar_view_<?php echo $calendar; ?>">
    201                                                 <span><?php _e('View', 'google-calendar-events'); ?></span>
    202                                                 <select name="_calendar_view[<?php echo $calendar; ?>]"
    203                                                                 id="_calendar_view_<?php echo $calendar; ?>">
    204                                                         <optgroup label="<?php _e('View to display', 'google-calendar-events'); ?>">
     206                                        <label for="_calendar_view_<?php echo esc_attr($calendar); ?>">
     207                                                <span><?php esc_html_e('View', 'google-calendar-events'); ?></span>
     208                                                <select name="_calendar_view[<?php echo esc_attr($calendar); ?>]"
     209                                                                id="_calendar_view_<?php echo esc_attr($calendar); ?>">
     210                                                        <optgroup label="<?php esc_html_e('View to display', 'google-calendar-events'); ?>">
    205211                                                                <?php foreach ($views as $view => $name) { ?>
    206                                                                         <option value="<?php echo $view; ?>" <?php selected($view, $calendar_type_view, true); ?>><?php echo $name; ?></option>
     212                                                                        <option value="<?php echo esc_attr($view); ?>" <?php selected($view, $calendar_type_view, true); ?>><?php echo esc_html(
     213        $name,
     214); ?></option>
    207215                                                                <?php } ?>
    208216                                                        </optgroup>
    … …  
    259267                                $class = $tab['class'] ? $tab['class'] : [];
    260268
    261                                 echo '<li class="' . $key . '-settings ' . $key . '-tab ' . implode(' ', $class) . '" data-tab="' . $key . '">';
     269                                echo '<li class="' .
     270                                        esc_attr($key) .
     271                                        '-settings ' .
     272                                        esc_attr($key) .
     273                                        '-tab ' .
     274                                        esc_attr(implode(' ', $class)) .
     275                                        '" data-tab="' .
     276                                        esc_attr($key) .
     277                                        '">';
    262278                                echo '<a href="#' .
    263                                         $tab['target'] .
     279                                        esc_attr($tab['target']) .
    264280                                        '"><i class="' .
    265                                         $icon .
     281                                        esc_attr($icon) .
    266282                                        '" ></i> <span>' .
    267283                                        esc_html($tab['label']) .
    … …  
    286302                        <thead>
    287303                                <tr>
    288                                         <th colspan="2"><?php _e('Event Settings', 'google-calendar-events'); ?></th>
     304                                        <th colspan="2"><?php esc_html_e('Event Settings', 'google-calendar-events'); ?></th>
    289305                                </tr>
    290306                        </thead>
    … …  
    292308                                <tr class="simcal-panel-field">
    293309                                        <th>
    294                                                 <label for="_calendar_begins"><?php _e('Calendar Start', 'google-calendar-events'); ?></label>
     310                                                <label for="_calendar_begins"><?php esc_html_e('Calendar Start', 'google-calendar-events'); ?></label>
    295311                                        </th>
    296312                                        <td>
    … …  
    325341                                                                id="_calendar_begins"
    326342                                                                class="simcal-field simcal-field-select simcal-field-inline simcal-field-switch-other">
    327                                                         <optgroup label="<?php _e('Days', 'google-calendar-events'); ?>">
     343                                                        <optgroup label="<?php esc_html_e('Days', 'google-calendar-events'); ?>">
    328344                                                                <option value="today"
    329345                                                                                data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
    330                                                                         <?php selected('today', $calendar_begins, true); ?>><?php _e('Today', 'google-calendar-events'); ?></option>
     346                                                                        <?php selected('today', $calendar_begins, true); ?>><?php esc_html_e('Today', 'google-calendar-events'); ?></option>
    331347                                                                <option value="now"
    332348                                                                                data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
    333                                                                         <?php selected('now', $calendar_begins, true); ?>><?php _e('Now', 'google-calendar-events'); ?></option>
     349                                                                        <?php selected('now', $calendar_begins, true); ?>><?php esc_html_e('Now', 'google-calendar-events'); ?></option>
    334350                                                                <option value="days_before"
    335351                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    338354                $calendar_begins,
    339355                true,
    340           ); ?>><?php _e('Day(s) before today', 'google-calendar-events'); ?></option>
     356          ); ?>><?php esc_html_e('Day(s) before today', 'google-calendar-events'); ?></option>
    341357                                                                <option value="days_after"
    342358                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    345361                $calendar_begins,
    346362                true,
    347           ); ?>><?php _e('Day(s) after today', 'google-calendar-events'); ?></option>
     363          ); ?>><?php esc_html_e('Day(s) after today', 'google-calendar-events'); ?></option>
    348364                                                        </optgroup>
    349                                                         <optgroup label="<?php _e('Weeks', 'google-calendar-events'); ?>">
     365                                                        <optgroup label="<?php esc_html_e('Weeks', 'google-calendar-events'); ?>">
    350366                                                                <option value="this_week"
    351367                                                                                data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
    352                                                                         <?php selected('this_week', $calendar_begins, true); ?>><?php _e('This week', 'google-calendar-events'); ?></option>
     368                                                                        <?php selected(
     369                'this_week',
     370                $calendar_begins,
     371                true,
     372         ); ?>><?php esc_html_e('This week', 'google-calendar-events'); ?></option>
    353373                                                                <option value="weeks_before"
    354374                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    357377                $calendar_begins,
    358378                true,
    359           ); ?>><?php _e('Week(s) before current', 'google-calendar-events'); ?></option>
     379          ); ?>><?php esc_html_e('Week(s) before current', 'google-calendar-events'); ?></option>
    360380                                                                <option value="weeks_after"
    361381                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    364384                $calendar_begins,
    365385                true,
    366           ); ?>><?php _e('Week(s) after current', 'google-calendar-events'); ?></option>
     386          ); ?>><?php esc_html_e('Week(s) after current', 'google-calendar-events'); ?></option>
    367387                                                        </optgroup>
    368                                                         <optgroup label="<?php _e('Months', 'google-calendar-events'); ?>">
     388                                                        <optgroup label="<?php esc_html_e('Months', 'google-calendar-events'); ?>">
    369389                                                                <option value="this_month"
    370390                                                                                data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
    371                                                                         <?php selected('this_month', $calendar_begins, true); ?>><?php _e('This month', 'google-calendar-events'); ?></option>
     391                                                                        <?php selected(
     392                'this_month',
     393                $calendar_begins,
     394                true,
     395         ); ?>><?php esc_html_e('This month', 'google-calendar-events'); ?></option>
    372396                                                                <option value="months_before"
    373397                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    376400                $calendar_begins,
    377401                true,
    378           ); ?>><?php _e('Month(s) before current', 'google-calendar-events'); ?></option>
     402          ); ?>><?php esc_html_e('Month(s) before current', 'google-calendar-events'); ?></option>
    379403                                                                <option value="months_after"
    380404                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    383407                $calendar_begins,
    384408                true,
    385           ); ?>><?php _e('Month(s) after current', 'google-calendar-events'); ?></option>
     409          ); ?>><?php esc_html_e('Month(s) after current', 'google-calendar-events'); ?></option>
    386410                                                        </optgroup>
    387                                                         <optgroup label="<?php _e('Years', 'google-calendar-events'); ?>">
     411                                                        <optgroup label="<?php esc_html_e('Years', 'google-calendar-events'); ?>">
    388412                                                                <option value="this_year"
    389413                                                                                data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
    390                                                                         <?php selected('this_year', $calendar_begins, true); ?>><?php _e('This year', 'google-calendar-events'); ?></option>
     414                                                                        <?php selected(
     415                'this_year',
     416                $calendar_begins,
     417                true,
     418         ); ?>><?php esc_html_e('This year', 'google-calendar-events'); ?></option>
    391419                                                                <option value="years_before"
    392420                                                                                data-show-field="_calendar_begins_nth" <?php selected(
    … …  
    394422                $calendar_begins,
    395423                true,
    396           ); ?>><?php _e('Year(s) before current', 'google-calendar-events'); ?></option>
     424          ); ?>><?php esc_html_e('Year(s) before current', 'google-calendar-events'); ?></option>
    397425                                                                <option value="years_after"
    398426                                                                                data-hide-field="_calendar_begins_custom_date"
    … …  
    401429                $calendar_begins,
    402430                true,
    403           ); ?>><?php _e('Year(s) after current', 'google-calendar-events'); ?></option>
     431          ); ?>><?php esc_html_e('Year(s) after current', 'google-calendar-events'); ?></option>
    404432                                                        </optgroup>
    405                                                         <optgroup label="<?php _e('Other', 'google-calendar-events'); ?>">
     433                                                        <optgroup label="<?php esc_html_e('Other', 'google-calendar-events'); ?>">
    406434                                                                <option value="custom_date"
    407435                                                                                data-hide-field="_calendar_begins_nth"
    … …  
    410438                $calendar_begins,
    411439                true,
    412           ); ?>><?php _e('Specific date', 'google-calendar-events'); ?></option>
     440          ); ?>><?php esc_html_e('Specific date', 'google-calendar-events'); ?></option>
    413441                                                        </optgroup>
    414442                                                </select>
    … …  
    422450      ]); ?>
    423451                                                <i class="simcal-icon-help simcal-help-tip"
    424                                                    data-tip="<?php _e(
     452                                                   data-tip="<?php esc_attr_e(
    425453                'The calendar default opening date. It will automatically adapt based on the chosen calendar type.',
    426454                'google-calendar-events',
    … …  
    430458                                <tr class="simcal-panel-field">
    431459                                        <th>
    432                                                 <label for="_feed_earliest_event_date"><?php _e('Earliest Event', 'google-calendar-events'); ?></label>
     460                                                <label for="_feed_earliest_event_date"><?php esc_html_e('Earliest Event', 'google-calendar-events'); ?></label>
    433461                                        </th>
    434462                                        <td>
    … …  
    458486                $earliest_event,
    459487                true,
    460          ); ?>><?php _e('Same as start date', 'google-calendar-events'); ?></option>
     488         ); ?>><?php esc_html_e('Same as start date', 'google-calendar-events'); ?></option>
    461489                                                        <option value="days_before"
    462490                                                                        data-show-field="_feed_earliest_event_date_range" <?php selected(
    … …  
    464492                $earliest_event,
    465493                true,
    466          ); ?>><?php _e('Day(s) before start date', 'google-calendar-events'); ?></option>
     494         ); ?>><?php esc_html_e('Day(s) before start date', 'google-calendar-events'); ?></option>
    467495                                                        <option value="weeks_before"
    468496                                                                        data-show-field="_feed_earliest_event_date_range" <?php selected(
    … …  
    470498                $earliest_event,
    471499                true,
    472          ); ?>><?php _e('Week(s) before start date', 'google-calendar-events'); ?></option>
     500         ); ?>><?php esc_html_e('Week(s) before start date', 'google-calendar-events'); ?></option>
    473501                                                        <option value="months_before"
    474502                                                                        data-show-field="_feed_earliest_event_date_range" <?php selected(
    … …  
    476504                $earliest_event,
    477505                true,
    478          ); ?>><?php _e('Month(s) before start date', 'google-calendar-events'); ?></option>
     506         ); ?>><?php esc_html_e('Month(s) before start date', 'google-calendar-events'); ?></option>
    479507                                                        <option value="years_before"
    480508                                                                        data-show-field="_feed_earliest_event_date_range" <?php selected(
    … …  
    482510                $earliest_event,
    483511                true,
    484          ); ?>><?php _e('Year(s) before start date', 'google-calendar-events'); ?></option>
     512         ); ?>><?php esc_html_e('Year(s) before start date', 'google-calendar-events'); ?></option>
    485513                                                </select>
    486514                                                <i class="simcal-icon-help simcal-help-tip"
    487                                                    data-tip="<?php _e(
     515                                                   data-tip="<?php esc_attr_e(
    488516                'Set the date for the earliest possible event to show in calendar. There will not be events before this date.',
    489517                'google-calendar-events',
    … …  
    493521                                <tr class="simcal-panel-field">
    494522                                        <th>
    495                                                 <label for="_feed_latest_event_date"><?php _e('Latest Event', 'google-calendar-events'); ?></label>
     523                                                <label for="_feed_latest_event_date"><?php esc_html_e('Latest Event', 'google-calendar-events'); ?></label>
    496524                                        </th>
    497525                                        <td>
    … …  
    521549                $earliest_event,
    522550                true,
    523          ); ?>><?php _e('Day end of start date', 'google-calendar-events'); ?></option>
     551         ); ?>><?php esc_html_e('Day end of start date', 'google-calendar-events'); ?></option>
    524552                                                        <option value="days_after"
    525553                                                                        data-show-field="_feed_latest_event_date_range" <?php selected(
    … …  
    527555                $latest_event,
    528556                true,
    529          ); ?>><?php _e('Day(s) after start date', 'google-calendar-events'); ?></option>
     557         ); ?>><?php esc_html_e('Day(s) after start date', 'google-calendar-events'); ?></option>
    530558                                                        <option value="weeks_after"
    531559                                                                        data-show-field="_feed_latest_event_date_range" <?php selected(
    … …  
    533561                $latest_event,
    534562                true,
    535          ); ?>><?php _e('Weeks(s) after start date', 'google-calendar-events'); ?></option>
     563         ); ?>><?php esc_html_e('Weeks(s) after start date', 'google-calendar-events'); ?></option>
    536564                                                        <option value="months_after"
    537565                                                                        data-show-field="_feed_latest_event_date_range" <?php selected(
    … …  
    539567                $latest_event,
    540568                true,
    541          ); ?>><?php _e('Month(s) after start date', 'google-calendar-events'); ?></option>
     569         ); ?>><?php esc_html_e('Month(s) after start date', 'google-calendar-events'); ?></option>
    542570                                                        <option value="years_after"
    543571                                                                        data-show-field="_feed_latest_event_date_range" <?php selected(
    … …  
    545573                $latest_event,
    546574                true,
    547          ); ?>><?php _e('Year(s) after start date', 'google-calendar-events'); ?></option>
     575         ); ?>><?php esc_html_e('Year(s) after start date', 'google-calendar-events'); ?></option>
    548576                                                </select>
    549577                                                <i class="simcal-icon-help simcal-help-tip"
    550                                                    data-tip="<?php _e(
     578                                                   data-tip="<?php esc_attr_e(
    551579                'Set the date for the latest possible event to show on calendar. There will not be events after this date.',
    552580                'google-calendar-events',
    … …  
    573601                        <thead>
    574602                                <tr>
    575                                         <th colspan="2"><?php _e('Miscellaneous', 'google-calendar-events'); ?></th>
     603                                        <th colspan="2"><?php esc_html_e('Miscellaneous', 'google-calendar-events'); ?></th>
    576604                                </tr>
    577605                        </thead>
    … …  
    580608                                <tr class="simcal-panel-field">
    581609                                        <th>
    582                                                 <label for="_display_ics_export"><?php _e('Export Calendar', 'google-calendar-events'); ?></label>
     610                                                <label for="_display_ics_export"><?php esc_html_e('Export Calendar', 'google-calendar-events'); ?></label>
    583611                                        </th>
    584612                                        <td>
    … …  
    649677                                <tr class="simcal-panel-field">
    650678                                        <th>
    651                                                 <label for="_calendar_is_static"><?php _e('Static Calendar', 'google-calendar-events'); ?></label>
     679                                                <label for="_calendar_is_static"><?php esc_html_e('Static Calendar', 'google-calendar-events'); ?></label>
    652680                                        </th>
    653681                                        <td>
    … …  
    671699                                <tr class="simcal-panel-field">
    672700                                        <th>
    673                                                 <label for="_no_events_message"><?php _e('No Events Message', 'google-calendar-events'); ?></label>
     701                                                <label for="_no_events_message"><?php esc_html_e('No Events Message', 'google-calendar-events'); ?></label>
    674702                                        </th>
    675703                                        <td>
    … …  
    689717                                <tr class="simcal-panel-field">
    690718                                        <th>
    691                                                 <label for="_event_formatting"><?php _e('Event Formatting', 'google-calendar-events'); ?></label>
     719                                                <label for="_event_formatting"><?php esc_html_e('Event Formatting', 'google-calendar-events'); ?></label>
    692720                                        </th>
    693721                                        <td>
    … …  
    719747                                <tr class="simcal-panel-field">
    720748                                        <th>
    721                                                 <label for="_poweredby"><?php _e('Powered By', 'google-calendar-events'); ?></label>
     749                                                <label for="_poweredby"><?php esc_html_e('Powered By', 'google-calendar-events'); ?></label>
    722750                                        </th>
    723751                                        <td>
    … …  
    758786                        <thead>
    759787                                <tr>
    760                                         <th colspan="2"><?php _e('Date and Time', 'google-calendar-events'); ?></th>
     788                                        <th colspan="2"><?php esc_html_e('Date and Time', 'google-calendar-events'); ?></th>
    761789                                </tr>
    762790                        </thead>
    … …  
    764792                                <tr class="simcal-panel-field">
    765793                                        <th>
    766                                                 <label for="_calendar_timezone_setting"><?php _e('Timezone', 'google-calendar-events'); ?></label>
     794                                                <label for="_calendar_timezone_setting"><?php esc_html_e('Timezone', 'google-calendar-events'); ?></label>
    767795                                        </th>
    768796                                        <td>
    … …  
    788816        $timezone_setting,
    789817        true,
    790        ); ?>><?php printf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', $timezone_default); ?></option>
     818       ); ?>><?php echo esc_html(sprintf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', $timezone_default)); ?></option>
    791819                                                        <?php if ($show_use_calendar) { ?>
    792820                                                                <option id="use_calendar" value="use_calendar"
    793                                                                                 data-show-field="_use_calendar_warning" <?php selected('use_calendar', $timezone_setting, true); ?>><?php _ex(
     821                                                                                data-show-field="_use_calendar_warning" <?php selected(
     822                'use_calendar',
     823                $timezone_setting,
     824                true,
     825          ); ?>><?php echo esc_html_x(
    794826        'Event source default',
    795827        'Use the calendar default setting',
    … …  
    802834                $timezone_setting,
    803835                true,
    804          ); ?>><?php _ex('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
     836         ); ?>><?php echo esc_html_x('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
    805837                                                </select>
    806838                                                <select name="_feed_timezone"
    … …  
    811843                                                </select>
    812844                                                <i class="simcal-icon-help simcal-help-tip"
    813                                                    data-tip="<?php _e(
     845                                                   data-tip="<?php esc_attr_e(
    814846                'Using a different timezone may alter the date and time display of your calendar events. We recommended using the site default timezone.',
    815847                'google-calendar-events',
    816848         ); ?>"></i>
    817849                                                <p id="_use_calendar_warning" style="display: none;" class="simcal-field">
    818                                                         <span class="attention"><?php _e('Warning', 'google-calendar-events'); ?>:</span>
    819                                                         <?php _e(
    820         'Setting this to <code>Event source default</code> can at times cause unexpected results. Please test thoroughly.',
    821         'google-calendar-events',
     850                                                        <span class="attention"><?php esc_html_e('Warning', 'google-calendar-events'); ?>:</span>
     851                                                        <?php echo wp_kses_post(
     852        __(
     853                'Setting this to <code>Event source default</code> can at times cause unexpected results. Please test thoroughly.',
     854                'google-calendar-events',
     855        ),
    822856       ); ?>
    823857                                                        <a href="http://docs.simplecalendar.io/timezone-settings/"
    824                                                            target="_blank"><?php _e('See details.', 'google-calendar-events'); ?></a>
     858                                                           target="_blank"><?php esc_html_e('See details.', 'google-calendar-events'); ?></a>
    825859                                                </p>
    826860                                        </td>
    … …  
    828862                                <tr class="simcal-panel-field">
    829863                                        <th>
    830                                                 <label for="_calendar_date_format_setting"><?php _e('Date Format', 'google-calendar-events'); ?></label>
     864                                                <label for="_calendar_date_format_setting"><?php esc_html_e('Date Format', 'google-calendar-events'); ?></label>
    831865                                        </th>
    832866                                        <td>
    … …  
    846880                $date_format_setting,
    847881                true,
    848          ); ?>><?php _ex('Site default', 'Use this site default setting', 'google-calendar-events'); ?></option>
     882         ); ?>><?php echo esc_html_x('Site default', 'Use this site default setting', 'google-calendar-events'); ?></option>
    849883                                                        <option value="use_custom"
    850884                                                                        data-show-field="_calendar_date_format" <?php selected(
    … …  
    852886                $date_format_setting,
    853887                true,
    854          ); ?>><?php _ex('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
     888         ); ?>><?php echo esc_html_x('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
    855889                                                        <option value="use_custom_php"
    856890                                                                        data-show-field="_calendar_date_format_php_field" <?php selected(
    … …  
    858892                $date_format_setting,
    859893                true,
    860          ); ?>><?php _e('Custom (PHP format)', 'google-calendar-events'); ?></option>
     894         ); ?>><?php esc_html_e('Custom (PHP format)', 'google-calendar-events'); ?></option>
    861895                                                </select>
    862896                                                <i class="simcal-icon-help simcal-help-tip"
    863                                                    data-tip="<?php _e(
     897                                                   data-tip="<?php esc_attr_e(
    864898                'This option sets how calendars display event dates. It is recommended to keep your site default setting.',
    865899                'google-calendar-events',
    … …  
    867901                                                <p id="_calendar_date_format_default"
    868902                                                   style="<?php echo $date_format_setting != 'use_site' ? 'display: none;' : ''; ?>">
    869                                                         <em><?php _e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
    870                                                         <code><?php echo date_i18n($date_format_default, time()); ?></code>
     903                                                        <em><?php esc_html_e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
     904                                                        <code><?php echo esc_html(date_i18n($date_format_default, time())); ?></code>
    871905                                                </p>
    872906                                                <?php simcal_print_field([
    … …  
    886920                                                                           id="_calendar_date_format_php"
    887921                                                                           class="simcal-field simcal-field-text simcal-field-small"
    888                                                                            value="<?php echo $date_format_php; ?>"/>
    889                                                                 <?php printf(
    890                 __('Enter a date format using %s values.', 'google-calendar-events'),
    891                 '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>',
     922                                                                           value="<?php echo esc_attr($date_format_php); ?>"/>
     923                                                                <?php echo wp_kses_post(
     924                sprintf(
     925                        /* translators: %s: link to PHP date format documentation */
     926                        __('Enter a date format using %s values.', 'google-calendar-events'),
     927                        '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>',
     928                ),
    892929        ); ?>
    893930                                                        </label>
    894931                                                        <p>
    895                                                                 <em><?php _e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
    896                                                                 <code><?php echo date_i18n($date_format_php, time()); ?></code>
     932                                                                <em><?php esc_html_e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
     933                                                                <code><?php echo esc_html(date_i18n($date_format_php, time())); ?></code>
    897934                                                        </p>
    898935                                                </div>
    … …  
    901938                                <tr class="simcal-panel-field">
    902939                                        <th>
    903                                                 <label for="_calendar_datetime_separator"><?php _e('Separator', 'google-calendar-events'); ?></label>
     940                                                <label for="_calendar_datetime_separator"><?php esc_html_e('Separator', 'google-calendar-events'); ?></label>
    904941                                        </th>
    905942                                        <td>
    … …  
    922959                                <tr class="simcal-panel-field">
    923960                                        <th>
    924                                                 <label for="_calendar_datetime_separator_spacing"><?php _e(
     961                                                <label for="_calendar_datetime_separator_spacing"><?php esc_html_e(
    925962        'Preserve Separator Spacing',
    926963        'google-calendar-events',
    … …  
    947984                                <tr class="simcal-panel-field">
    948985                                        <th>
    949                                                 <label for="_calendar_time_format_setting"><?php _e('Time Format', 'google-calendar-events'); ?></label>
     986                                                <label for="_calendar_time_format_setting"><?php esc_html_e('Time Format', 'google-calendar-events'); ?></label>
    950987                                        </th>
    951988                                        <td>
    … …  
    9651002                $time_format_setting,
    9661003                true,
    967          ); ?>><?php _ex('Site default', 'Use this site default setting', 'google-calendar-events'); ?></option>
     1004         ); ?>><?php echo esc_html_x('Site default', 'Use this site default setting', 'google-calendar-events'); ?></option>
    9681005                                                        <option value="use_custom"
    9691006                                                                        data-show-field="_calendar_time_format" <?php selected(
    … …  
    9711008                $time_format_setting,
    9721009                true,
    973          ); ?>><?php _ex('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
     1010         ); ?>><?php echo esc_html_x('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
    9741011                                                        <option value="use_custom_php"
    9751012                                                                        data-show-field="_calendar_time_format_php_field" <?php selected(
    … …  
    9771014                $time_format_setting,
    9781015                true,
    979          ); ?>><?php _e('Custom (PHP format)', 'google-calendar-events'); ?></option>
     1016         ); ?>><?php esc_html_e('Custom (PHP format)', 'google-calendar-events'); ?></option>
    9801017                                                </select>
    9811018                                                <i class="simcal-icon-help simcal-help-tip"
    982                                                    data-tip="<?php _e(
     1019                                                   data-tip="<?php esc_attr_e(
    9831020                'This option sets how calendars display event times. It is recommended to keep your site default setting.',
    9841021                'google-calendar-events',
    … …  
    9861023                                                <p id="_calendar_time_format_default"
    9871024                                                   style="<?php echo $time_format_setting != 'use_site' ? 'display: none;' : ''; ?>">
    988                                                         <em><?php _e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
    989                                                         <code><?php echo date_i18n($time_format_default, time()); ?></code>
     1025                                                        <em><?php esc_html_e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
     1026                                                        <code><?php echo esc_html(date_i18n($time_format_default, time())); ?></code>
    9901027                                                </p>
    9911028                                                <?php simcal_print_field([
    … …  
    10051042                                                                           id="_calendar_time_format_php"
    10061043                                                                           class="simcal-field simcal-field-text simcal-field-small"
    1007                                                                            value="<?php echo $time_format_php; ?>"/>
    1008                                                                 <?php printf(
    1009                 __('Enter a time format using %s values.', 'google-calendar-events'),
    1010                 '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>',
     1044                                                                           value="<?php echo esc_attr($time_format_php); ?>"/>
     1045                                                                <?php echo wp_kses_post(
     1046                sprintf(
     1047                        /* translators: %s: link to PHP date format documentation */
     1048                        __('Enter a time format using %s values.', 'google-calendar-events'),
     1049                        '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>',
     1050                ),
    10111051        ); ?>
    10121052                                                        </label>
    10131053                                                        <p>
    1014                                                                 <em><?php _e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
    1015                                                                 <code><?php echo date_i18n($time_format_php, time()); ?></code>
     1054                                                                <em><?php esc_html_e('Preview', 'google-calendar-events'); ?>:</em>&nbsp;&nbsp;
     1055                                                                <code><?php echo esc_html(date_i18n($time_format_php, time())); ?></code>
    10161056                                                        </p>
    10171057                                                </div>
    … …  
    10201060                                <tr class="simcal-panel-field">
    10211061                                        <th>
    1022                                                 <label for="_calendar_week_starts_on_setting"><?php _e('Week Starts On', 'google-calendar-events'); ?></label>
     1062                                                <label for="_calendar_week_starts_on_setting"><?php esc_html_e('Week Starts On', 'google-calendar-events'); ?></label>
    10231063                                        </th>
    10241064                                        <td>
    … …  
    10381078        $week_starts_setting,
    10391079        true,
    1040        ); ?>><?php printf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', date_i18n('l', strtotime("Sunday + $week_starts_default Days"))); ?></option>
     1080       ); ?>><?php echo esc_html(sprintf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', date_i18n('l', strtotime("Sunday + $week_starts_default Days")))); ?></option>
    10411081                                                        <option value="use_custom" <?php selected(
    10421082        'use_custom',
    10431083        $week_starts_setting,
    10441084        true,
    1045        ); ?>><?php _ex('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
     1085       ); ?>><?php echo esc_html_x('Custom', 'Use a custom setting', 'google-calendar-events'); ?></option>
    10461086                                                </select>
    10471087                                                <select
    … …  
    10521092                                                        <?php $day_names = simcal_get_calendar_names_i18n('day', 'full'); ?>
    10531093                                                        <?php for ($i = 0; $i <= 6; $i++): ?>
    1054                                                                 <option value="<?php echo $i; ?>" <?php selected($i, $week_starts, true); ?>><?php echo $day_names[$i]; ?></option>
     1094                                                                <option value="<?php echo esc_attr($i); ?>" <?php selected($i, $week_starts, true); ?>><?php echo esc_html(
     1095        $day_names[$i],
     1096); ?></option>
    10551097                                                        <?php endfor; ?>
    10561098                                                </select>
    10571099                                                <i class="simcal-icon-help simcal-help-tip"
    1058                                                    data-tip="<?php _e(
     1100                                                   data-tip="<?php esc_attr_e(
    10591101                'Some calendars may use this setting to display the start of the week. It is recommended to keep the site default setting.',
    10601102                'google-calendar-events',
    … …  
    10671109                        <thead>
    10681110                                <tr>
    1069                                         <th colspan="2"><?php _e('Cache', 'google-calendar-events'); ?></th>
     1111                                        <th colspan="2"><?php esc_html_e('Cache', 'google-calendar-events'); ?></th>
    10701112                                </tr>
    10711113                        </thead>
    … …  
    10801122                                <tr class="simcal-panel-field">
    10811123                                        <th>
    1082                                                 <label for="_feed_cache_user_amount"><?php _ex(
     1124                                                <label for="_feed_cache_user_amount"><?php echo esc_html_x(
    10831125        'Refresh Interval',
    10841126        'Cache maximum interval',
    … …  
    10911133                                                           id="_feed_cache_user_amount"
    10921134                                                           class="simcal-field simcal-field-number simcal-field-tiny simcal-field-inline"
    1093                                                            value="<?php echo $cache_freq; ?>"
     1135                                                           value="<?php echo esc_attr($cache_freq); ?>"
    10941136                                                           min="0"/>
    10951137                                                <select name="_feed_cache_user_unit"
    … …  
    11001142        $cache_unit,
    11011143        true,
    1102        ); ?>><?php _e('Minute(s)', 'google-calendar-events'); ?></option>
     1144       ); ?>><?php esc_html_e('Minute(s)', 'google-calendar-events'); ?></option>
    11031145                                                        <option value="3600" <?php selected(
    11041146        '3600',
    11051147        $cache_unit,
    11061148        true,
    1107        ); ?>><?php _e('Hour(s)', 'google-calendar-events'); ?></option>
     1149       ); ?>><?php esc_html_e('Hour(s)', 'google-calendar-events'); ?></option>
    11081150                                                        <option value="86400" <?php selected(
    11091151        '86400',
    11101152        $cache_unit,
    11111153        true,
    1112        ); ?>><?php _e('Day(s)', 'google-calendar-events'); ?></option>
     1154       ); ?>><?php esc_html_e('Day(s)', 'google-calendar-events'); ?></option>
    11131155                                                        <option value="604800" <?php selected(
    11141156        '604800',
    11151157        $cache_unit,
    11161158        true,
    1117        ); ?>><?php _e('Week(s)', 'google-calendar-events'); ?></option>
     1159       ); ?>><?php esc_html_e('Week(s)', 'google-calendar-events'); ?></option>
    11181160                                                </select>
    11191161                                                <i class="simcal-icon-help simcal-help-tip"
    1120                                                    data-tip="<?php _e(
     1162                                                   data-tip="<?php esc_attr_e(
    11211163                'If you add, edit or remove events in your calendar very often, you can set a lower interval to refresh the events displayed. Set a higher interval for best performance.',
    11221164                'google-calendar-events',
    … …  
    11531195                                                <tr class="simcal-panel-field">
    11541196                                                        <th>
    1155                                                                 <label for="<?php echo $the_field->id; ?>"><?php echo $the_field->title; ?></label>
     1197                                                                <label for="<?php echo esc_attr($the_field->id); ?>"><?php echo esc_html($the_field->title); ?></label>
    11561198                                                        </th>
    11571199                                                        <td><?php $the_field->html(); ?></td>
  • google-calendar-events/trunk/includes/admin/notices.php

    r3551626 r3805019  
    105105
    106106                                        echo '<div class="' .
    107                                                 $notice->type .
     107                                                esc_attr($notice->type) .
    108108                                                ' ' .
    109                                                 $notice->class .
     109                                                esc_attr($notice->class) .
    110110                                                ' simcal-admin-notice" data-notice-id="' .
    111                                                 $name .
     111                                                esc_attr($name) .
    112112                                                '">' .
    113                                                 $dismiss_link .
    114                                                 $notice->content .
     113                                                wp_kses_post($dismiss_link) .
     114                                                wp_kses_post($notice->content) .
    115115                                                '</div>';
    116116                                },
  • google-calendar-events/trunk/includes/admin/pages/components/progress.php

    r3551626 r3805019  
    5656        $li_class = 'sc_checklist_item' . ($item_completed ? ' is_completed' : '');
    5757        ?>
    58                                         <li<?php echo $li_attrs; ?> class="<?php echo esc_attr($li_class); ?>">
     58                                        <li<?php echo wp_kses_post($li_attrs); ?> class="<?php echo esc_attr($li_class); ?>">
    5959                                                <span class="sc_checklist_checkbox">
    6060                                                        <?php if ($item_completed) { ?>
  • google-calendar-events/trunk/includes/admin/pages/connect/partials/google-calendar-api-key-connect.php

    r3577278 r3805019  
    160160                               
    161161                                <?php esc_html_e('Connect in a single click without API keys, available in the&nbsp;', 'google-calendar-events'); ?>
    162                                 <a href="<?php echo simcal_ga_campaign_url(
    163         'https://simplecalendar.io/downloads/google-calendar-pro/',
    164         'core-plugin',
    165         'connect-api-key-pro-addon',
     162                                <a href="<?php echo esc_url(
     163        simcal_ga_campaign_url(
     164                'https://simplecalendar.io/downloads/google-calendar-pro/',
     165                'core-plugin',
     166                'connect-api-key-pro-addon',
     167        ),
    166168    ); ?>" target="_blank" class="sc_connect_pro_link">
    167169                                        <img src="<?php echo esc_url($assets_base . 'crown.svg'); ?>" alt="" />
  • google-calendar-events/trunk/includes/admin/pages/connect/partials/helpful-links.php

    r3551626 r3805019  
    2525                </h3>
    2626                <div class="sc_helpful_links_cards_wrapper">
    27                         <a href="<?php echo simcal_ga_campaign_url(
    28         'https://docs.simplecalendar.io/',
    29         'core-plugin',
    30         'connect-documentation',
     27                        <a href="<?php echo esc_url(
     28        simcal_ga_campaign_url('https://docs.simplecalendar.io/', 'core-plugin', 'connect-documentation'),
    3129   ); ?>" target="_blank" class="sc_helpful_link_card">
    3230                                <span class="sc_icon--circle">
  • google-calendar-events/trunk/includes/admin/pages/connect/partials/render-connect-fields.php

    r3551626 r3805019  
    8686                </div>
    8787                <?php if (!empty($field_after[$key])) { ?>
    88                         <?php echo $field_after[$key]; ?>
     88                        <?php echo wp_kses_post($field_after[$key]); ?>
    8989                <?php } ?>
    9090        </div>
  • google-calendar-events/trunk/includes/admin/pages/connect/sidebar.php

    r3585959 r3805019  
    231231                                </li>
    232232                        </ul>
    233                         <a href="<?php echo simcal_ga_campaign_url(
    234         'https://simplecalendar.io/downloads/google-calendar-pro/',
    235         'core-plugin',
    236         'connect-sidebar-pro-addon',
     233                        <a href="<?php echo esc_url(
     234        simcal_ga_campaign_url(
     235                'https://simplecalendar.io/downloads/google-calendar-pro/',
     236                'core-plugin',
     237                'connect-sidebar-pro-addon',
     238        ),
    237239   ); ?>" target="_blank" class="sc_btn sc_btn--blue sc_connect_pro_btn">
    238240                                <?php esc_html_e('Upgrade to Pro', 'google-calendar-events'); ?>
  • google-calendar-events/trunk/includes/admin/pages/connect/steps/pro-credentials.php

    r3577278 r3805019  
    110110        <p
    111111                class="sc_text--body_b2 sc_text--dark sc_connect_credentials_subtitle"
    112                 data-sc-subtitle-disconnected="<?php echo esc_attr__(
     112                data-sc-subtitle-disconnected="<?php echo esc_attr(
    113113        $show_own_credentials
    114                 ? 'Enter your Google OAuth client credentials to get started. Your data is stored securely on your site and never on our servers.'
    115                 : 'Almost there! Connect your Google Calendar events in a single click using authentication via Simple Calendar.',
    116         'google-calendar-events',
     114                ? __(
     115                        'Enter your Google OAuth client credentials to get started. Your data is stored securely on your site and never on our servers.',
     116                        'google-calendar-events',
     117                )
     118                : __(
     119                        'Almost there! Connect your Google Calendar events in a single click using authentication via Simple Calendar.',
     120                        'google-calendar-events',
     121                ),
    117122  ); ?>"
    118123                data-sc-subtitle-connected="<?php echo esc_attr__(
    … …  
    162167                                </div>
    163168                                <span id="sc_connect_oauth_status" class="sc_text--body_b2 sc_connect_oauth_status">
    164                                         <?php echo $auth_status_text; ?>
     169                                        <?php echo esc_html($auth_status_text); ?>
    165170                                </span>
    166171                        </div>
  • google-calendar-events/trunk/includes/admin/pages/licenses.php

    r3551626 r3805019  
    5858                ?>
    5959                <br><br>
    60                 <a href="#" class="simcal-ml-[2px]" id="simcal-reset-licenses" data-dialog="<?php _e(
     60                <a href="#" class="simcal-ml-[2px]" id="simcal-reset-licenses" data-dialog="<?php esc_attr_e(
    6161        'WARNING: Are you sure you want to start over and delete all license keys from the settings?',
    6262        'google-calendar-events',
    6363  ); ?>">
    64                         <?php _e('Delete your license keys', 'google-calendar-events'); ?>
     64                        <?php esc_html_e('Delete your license keys', 'google-calendar-events'); ?>
    6565                        <i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i>
    6666                </a>
  • google-calendar-events/trunk/includes/admin/pages/system-status.php

    r3632810 r3805019  
    7070                ?>
    7171                <div id="simcal-system-status-report">
    72                         <p><?php _e('Please copy and paste this information when contacting support:', 'google-calendar-events'); ?> </p>
     72                        <p><?php esc_html_e(
     73        'Please copy and paste this information when contacting support:',
     74        'google-calendar-events',
     75   ); ?> </p>
    7376                        <textarea readonly="readonly" onclick="this.select();"></textarea>
    74                         <p><?php _e(
     77                        <p><?php esc_html_e(
    7578        'You can also download your information as a text file to attach, or simply view it below.',
    7679        'google-calendar-events',
    7780   ); ?></p>
    78                         <p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e(
     81                        <p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php esc_html_e(
    7982        'Download System Report',
    8083        'google-calendar-events',
    … …  
    136139                '<mark class="error">' .
    137140                sprintf(
     141                        /* translators: 1: memory limit, 2: Codex URL for increasing PHP memory */
    138142                        __(
    139143                                '%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>',
    … …  
    218222  include_once ABSPATH . 'wp-admin/includes/theme-install.php';
    219223
    220   if (version_compare($wp_version, '3.4', '<')) {
    221         $active_theme = get_theme_data(get_stylesheet_directory() . '/style.css');
    222         $theme_name = '<a href="' . $active_theme['URI'] . '" target="_blank">' . $active_theme['Name'] . '</a>';
    223         $theme_version = $active_theme['Version'];
    224         $theme_author = '<a href="' . $active_theme['AuthorURI'] . '" target="_blank">' . $active_theme['Author'] . '</a>';
    225         $theme_export = $active_theme['Name'] . ' - ' . $theme_version;
    226   } else {
    227         $active_theme = wp_get_theme();
    228         $theme_name = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>';
    229         $theme_version = $active_theme->Version;
    230         $theme_author = $active_theme->Author;
    231         $theme_export = $active_theme->Name . ' - ' . $theme_version;
    232   }
     224  $active_theme = wp_get_theme();
     225  $theme_name = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>';
     226  $theme_version = $active_theme->Version;
     227  $theme_author = $active_theme->Author;
     228  $theme_export = $active_theme->Name . ' - ' . $theme_version;
    233229
    234230  $theme_update_version = $theme_version;
    … …  
    247243                $theme_version .
    248244                ' (' .
     245                /* translators: %s: available theme version number */
    249246                sprintf(__('%s is available', 'google-calendar-events'), esc_html($theme_update_version)) .
    250247                ')</mark>';
    … …  
    266263
    267264  if ($is_child_theme) {
    268         if (version_compare($wp_version, '3.4', '<')) {
    269                 $parent_theme = $parent_theme_export = $active_theme['Template'];
    270         } else {
    271                 $parent = wp_get_theme($active_theme->Template);
    272                 $parent_theme = '<dl>';
    273                 $parent_theme .= '<dt>' . __('Name', 'google-calendar-events') . '</dt>';
    274                 $parent_theme .= '<dd>' . $parent->Name . '</dd>';
    275                 $parent_theme .= '<dt>' . __('Author', 'google-calendar-events') . '</dt>';
    276                 $parent_theme .= '<dd>' . $parent->Author . '</dd>';
    277                 $parent_theme .= '<dt>' . __('Version', 'google-calendar-events') . '</dt>';
    278                 $parent_theme .= '<dd>' . $parent->Version . '</dd>';
    279                 $parent_theme .= '</dl>';
    280 
    281                 $parent_theme_export = strip_tags($parent->Name) . ' - ' . $parent->Version;
    282         }
     265        $parent = wp_get_theme($active_theme->Template);
     266        $parent_theme = '<dl>';
     267        $parent_theme .= '<dt>' . __('Name', 'google-calendar-events') . '</dt>';
     268        $parent_theme .= '<dd>' . $parent->Name . '</dd>';
     269        $parent_theme .= '<dt>' . __('Author', 'google-calendar-events') . '</dt>';
     270        $parent_theme .= '<dd>' . $parent->Author . '</dd>';
     271        $parent_theme .= '<dt>' . __('Version', 'google-calendar-events') . '</dt>';
     272        $parent_theme .= '<dd>' . $parent->Version . '</dd>';
     273        $parent_theme .= '</dl>';
     274
     275        $parent_theme_export = wp_strip_all_tags($parent->Name) . ' - ' . $parent->Version;
    283276  }
    284277
    … …  
    340333                                                        $plugin_version .
    341334                                                        ' (' .
     335                                                        /* translators: %s: available plugin version number */
    342336                                                        sprintf(__('%s is available', 'google-calendar-events'), esc_html($plugin_update_version)) .
    343337                                                        ')</mark>';
    … …  
    356350                $plugin .= '</dl>';
    357351
    358                 $sections['plugins'][sanitize_key(strip_tags($plugin_name))] = [
     352                $sections['plugins'][sanitize_key(wp_strip_all_tags($plugin_name))] = [
    359353                        'label' => $plugin_name,
    360                         'label_export' => strip_tags($plugin_data['Title']),
     354                        'label_export' => wp_strip_all_tags($plugin_data['Title']),
    361355                        'result' => $plugin,
    362356                        'result_export' => $plugin_data['Version'],
    … …  
    388382  }
    389383
    390   if ($wpdb->use_mysqli) {
    391         $mysql = @mysqli_get_server_info($wpdb->dbh);
     384  $mysql_version = $wpdb->db_version();
     385  if ($mysql_version) {
     386        $mysql = $mysql_version;
    392387  } else {
    393388        $mysql = '<mark class="error">' . __('Cannot connect to MySQL database.', 'google-calendar-events') . '</mark>';
    … …  
    405400        $server_timezone =
    406401                '<mark class="error">' .
     402                /* translators: %s: server timezone name */
    407403                sprintf(__('Server default timezone is %s - it should be UTC', 'google-calendar-events'), $default_timezone) .
    408404                '</mark>';
    … …  
    604600        if (isset($sections[$panel])): ?>
    605601                                <table class="widefat simcal-system-status-report-panel">
    606                                         <thead class="<?php echo $panel; ?>">
     602                                        <thead class="<?php echo esc_attr($panel); ?>">
    607603                                                <tr>
    608                                                         <th colspan="3" data-export="<?php echo $v['export']; ?>"><?php echo $v['label']; ?></th>
     604                                                        <th colspan="3" data-export="<?php echo esc_attr($v['export']); ?>"><?php echo esc_html($v['label']); ?></th>
    609605                                                </tr>
    610606                                        </thead>
    … …  
    617613        ?>
    618614                                                                <td class="tooltip"><?php echo isset($cell['tooltip'])
    619                 ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="' . $cell['tooltip'] . '"></i> '
     615                ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="' . esc_attr($cell['tooltip']) . '"></i> '
    620616                : ''; ?></td>
    621                                                                 <td class="label" data-export="<?php echo trim($label_export); ?>"><?php echo $cell['label']; ?></td>
    622                                                                 <td class="result" data-export="<?php echo trim($result_export); ?>"><?php echo $cell['result']; ?></td>
     617                                                                <td class="label" data-export="<?php echo esc_attr(trim($label_export)); ?>"><?php echo wp_kses_post(
     618        $cell['label'],
     619); ?></td>
     620                                                                <td class="result" data-export="<?php echo esc_attr(trim($result_export)); ?>"><?php echo wp_kses_post(
     621        $cell['result'],
     622); ?></td>
    623623                                                        </tr>
    624624                                                <?php endforeach; ?>
    … …  
    694694                                var file = new Blob( [ report ], { type: 'text/plain' } );
    695695                                jQuery( this ).attr( 'href', URL.createObjectURL( file ) );
    696                                 jQuery( this ).attr( 'download', '<?php echo sanitize_title(
    697         str_replace(['http://', 'https://'], '', get_bloginfo('url')) . '-system-report-' . date('Y-m-d', time()),
     696                                jQuery( this ).attr( 'download', '<?php echo esc_attr(
     697        sanitize_title(
     698                str_replace(['http://', 'https://'], '', get_bloginfo('url')) . '-system-report-' . gmdate('Y-m-d', time()),
     699        ),
    698700    ); ?>' );
    699701                        } );
  • google-calendar-events/trunk/includes/admin/post-types.php

    r3717083 r3805019  
    107107                        case 'feed':
    108108                                $feed = simcal_get_feed($post_id);
    109                                 echo isset($feed->name) ? $feed->name : '&mdash;';
     109                                echo isset($feed->name) ? esc_html($feed->name) : '&mdash;';
    110110                                break;
    111111
    … …  
    128128                                }
    129129
    130                                 echo $info;
     130                                echo wp_kses_post($info);
    131131                                break;
    132132
    … …  
    497497                if ($post_type == 'calendar' && isset($post->ID)) {
    498498                        echo '<a id="simcal-clear-cache" class="button" data-id="' .
    499                                 $post->ID .
     499                                absint($post->ID) .
    500500                                ' ">' .
    501501                                '<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i> ' .
    502                                 __('Clear cache', 'google-calendar-events') .
     502                                esc_html__('Clear cache', 'google-calendar-events') .
    503503                                '</a>';
    504504                }
    … …  
    528528                if (in_array($post_type, $post_types)) { ?>
    529529                        <a href="#TB_inline?height=250&width=500&inlineId=simcal-insert-shortcode-panel" id="simcal-insert-shortcode-button" class="thickbox button insert-calendar add_calendar">
    530                                 <span class="wp-media-buttons-icon dashicons-before dashicons-calendar-alt"></span> <?php _e(
     530                                <span class="wp-media-buttons-icon dashicons-before dashicons-calendar-alt"></span> <?php esc_html_e(
    531531        'Add Calendar',
    532532        'google-calendar-events',
    … …  
    548548                <div id="simcal-insert-shortcode-panel" style="display:none;">
    549549                        <div class="simcal-insert-shortcode-panel">
    550                                 <h1><?php _e('Add Calendar', 'google-calendar-events'); ?></h1>
    551                                 <?php _e('Add a calendar to your post.', 'google-calendar-events'); ?>
     550                                <h1><?php esc_html_e('Add Calendar', 'google-calendar-events'); ?></h1>
     551                                <?php esc_html_e('Add a calendar to your post.', 'google-calendar-events'); ?>
    552552                                <?php if (!empty($calendars) && is_array($calendars)): ?>
    553553                                        <p>
    … …  
    555555                                                        <?php $multiselect = count($calendars) > 15 ? ' simcal-field-select-enhanced' : ''; ?>
    556556                                                        <select id="simcal-choose-calendar"
    557                                                                 class="simcal-field simcal-field-select<?php echo $multiselect; ?>"
     557                                                                class="simcal-field simcal-field-select<?php echo esc_attr($multiselect); ?>"
    558558                                                                name="">
    559559                                                                <?php foreach ($calendars as $id => $title): ?>
    560                                                                         <option value="<?php echo $id; ?>"><?php echo $title; ?></option>
     560                                                                        <option value="<?php echo esc_attr($id); ?>"><?php echo esc_html($title); ?></option>
    561561                                                                <?php endforeach; ?>
    562562                                                        </select>
    563563                                                </label>
    564564                                        </p>
    565                                         <p><input type="button" value="<?php _e(
     565                                        <p><input type="button" value="<?php esc_attr_e(
    566566        'Insert Calendar',
    567567        'google-calendar-events',
    568568     ); ?>" id="simcal-insert-shortcode" class="button button-primary button-large" name="" /></p>
    569569                                <?php else: ?>
    570                                         <p><em><?php _e('Could not find any calendars to add to this post.', 'google-calendar-events'); ?></em></p>
    571                                         <strong><a href="post-new.php?post_type=calendar"><?php _e(
     570                                        <p><em><?php esc_html_e('Could not find any calendars to add to this post.', 'google-calendar-events'); ?></em></p>
     571                                        <strong><a href="post-new.php?post_type=calendar"><?php esc_html_e(
    572572        'Please add and configure new calendar first.',
    573573        'google-calendar-events',
  • google-calendar-events/trunk/includes/admin/updater.php

    r3551626 r3805019  
    200200                        $wp_list_table = _get_list_table('WP_Plugins_List_Table');
    201201                        echo '<tr class="plugin-update-tr"><td colspan="' .
    202                                 $wp_list_table->get_column_count() .
     202                                esc_attr((string) $wp_list_table->get_column_count()) .
    203203                                '" class="plugin-update colspanchange"><div class="update-message">';
    204204
    … …  
    211211                        );
    212212
     213                        $allowed_html = [
     214                                'a' => [
     215                                        'href' => true,
     216                                        'target' => true,
     217                                        'class' => true,
     218                                ],
     219                        ];
     220
    213221                        if (empty($version_info->download_link)) {
    214222                                printf(
    215                                         __(
    216                                                 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.',
    217                                                 'google-calendar-events',
     223                                        wp_kses(
     224                                                /* translators: 1: plugin name, 2: changelog URL, 3: new version number */
     225                                                __(
     226                                                        'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.',
     227                                                        'google-calendar-events',
     228                                                ),
     229                                                $allowed_html,
    218230                                        ),
    219231                                        esc_html($version_info->name),
    … …  
    223235                        } else {
    224236                                printf(
    225                                         __(
    226                                                 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.',
    227                                                 'google-calendar-events',
     237                                        wp_kses(
     238                                                /* translators: 1: plugin name, 2: changelog URL, 3: new version number, 4: update URL */
     239                                                __(
     240                                                        'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.',
     241                                                        'google-calendar-events',
     242                                                ),
     243                                                $allowed_html,
    228244                                        ),
    229245                                        esc_html($version_info->name),
    … …  
    373389                if (!current_user_can('update_plugins')) {
    374390                        wp_die(
    375                                 __('You do not have permission to install plugin updates', 'google-calendar-events'),
    376                                 __('Error', 'google-calendar-events'),
     391                                esc_html__('You do not have permission to install plugin updates', 'google-calendar-events'),
     392                                esc_html__('Error', 'google-calendar-events'),
    377393                                ['response' => 403],
    378394                        );
    … …  
    382398
    383399                if ($response && isset($response->sections['changelog'])) {
    384                         echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
     400                        echo '<div style="background:#fff;padding:10px;">' . wp_kses_post($response->sections['changelog']) . '</div>';
    385401                }
    386402
  • google-calendar-events/trunk/includes/calendars/admin/default-calendar-admin.php

    r3663004 r3805019  
    8383                <table id="default-calendar-settings">
    8484                        <thead>
    85                         <tr><th colspan="2"><?php _e('Default Calendar', 'google-calendar-events'); ?></th></tr>
     85                        <tr><th colspan="2"><?php esc_html_e('Default Calendar', 'google-calendar-events'); ?></th></tr>
    8686                        </thead>
    8787                        <tbody class="simcal-panel-section">
    8888
    8989                        <tr class="simcal-panel-field simcal-default-calendar-grid" style="display: none;">
    90                                 <th><label for="_default_calendar_event_bubbles_action"><?php _e(
     90                                <th><label for="_default_calendar_event_bubbles_action"><?php esc_html_e(
    9191        'Event Bubbles',
    9292        'google-calendar-events',
    … …  
    116116                        </tr>
    117117                        <tr class="simcal-panel-field simcal-default-calendar-grid" style="display: none;">
    118                                 <th><label for="_default_calendar_trim_titles"><?php _e('Trim Event Titles', 'google-calendar-events'); ?></label></th>
     118                                <th><label for="_default_calendar_trim_titles"><?php esc_html_e(
     119        'Trim Event Titles',
     120        'google-calendar-events',
     121    ); ?></label></th>
    119122                                <td>
    120123                                        <?php
    … …  
    154157                        </tr>
    155158                        <tr class="simcal-panel-field simcal-default-calendar-grid" style="display: none;">
    156                                 <th><label for="_default_calendar_grid_desktop_list_mobile"><?php _e(
     159                                <th><label for="_default_calendar_grid_desktop_list_mobile"><?php esc_html_e(
    157160        'Switch to List View on Mobile',
    158161        'google-calendar-events',
    … …  
    176179                        </tr>
    177180                        <tr class="simcal-panel-field simcal-default-calendar-list" style="display: none;">
    178                                 <th><label for="_default_calendar_list_grouped_span"><?php _e('Span', 'google-calendar-events'); ?></label></th>
     181                                <th><label for="_default_calendar_list_grouped_span"><?php esc_html_e('Span', 'google-calendar-events'); ?></label></th>
    179182                                <td>
    180183                                        <?php
    … …  
    213216                        </tr>
    214217                        <tr class="simcal-panel-field simcal-default-calendar-list" style="display: none;">
    215                                 <th><label for="_default_calendar_list_header"><?php _e('Hide Header', 'google-calendar-events'); ?></label></th>
     218                                <th><label for="_default_calendar_list_header"><?php esc_html_e(
     219        'Hide Header',
     220        'google-calendar-events',
     221    ); ?></label></th>
    216222                                <td>
    217223                                        <?php
    … …  
    229235                        </tr>
    230236                        <tr class="simcal-panel-field simcal-default-calendar-list" style="display: none;">
    231                                 <th><label for="_default_calendar_compact_list"><?php _e('Compact List', 'google-calendar-events'); ?></label></th>
     237                                <th><label for="_default_calendar_compact_list"><?php esc_html_e(
     238        'Compact List',
     239        'google-calendar-events',
     240    ); ?></label></th>
    232241                                <td>
    233242                                        <?php
    … …  
    248257                        </tr>
    249258                        <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list"  style="display: none;">
    250                                 <th><label for="_default_calendar_limit_visible_events"><?php _e(
     259                                <th><label for="_default_calendar_limit_visible_events"><?php esc_html_e(
    251260        'Limit Visible Events',
    252261        'google-calendar-events',
    … …  
    289298                        </tr>
    290299                        <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list" style="display: none;">
    291                                 <th><label for="_default_calendar_event_bubbles_action"><?php _e(
     300                                <th><label for="_default_calendar_event_bubbles_action"><?php esc_html_e(
    292301        'Expand Multi-day Events',
    293302        'google-calendar-events',
    … …  
    308317        'id' => '_default_calendar_expand_multi_day_events',
    309318        'tooltip' => __(
    310                 'For events spanning multiple days, you can display them on each day of the event, ' .
    311                         'only on the first day of the event, or on all days of the event, but only up to the current day. ' .
    312                         'Third option applies to list views only.',
     319                'For events spanning multiple days, you can display them on each day of the event, only on the first day of the event, or on all days of the event, but only up to the current day. Third option applies to list views only.',
    313320                'google-calendar-events',
    314321        ),
    … …  
    341348                        <tbody class="simcal-panel-section">
    342349                        <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list" style="display: none;">
    343                                 <th><label for="_default_calendar_style_theme"><?php _e('Theme', 'google-calendar-events'); ?></label></th>
     350                                <th><label for="_default_calendar_style_theme"><?php esc_html_e('Theme', 'google-calendar-events'); ?></label></th>
    344351                                <td>
    345352                                        <?php
    … …  
    362369                        </tr>
    363370                        <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list" style="display: none;">
    364                                 <th><label for="_default_calendar_style_today"><?php _e('Today', 'google-calendar-events'); ?></label></th>
     371                                <th><label for="_default_calendar_style_today"><?php esc_html_e('Today', 'google-calendar-events'); ?></label></th>
    365372                                <td>
    366373                                        <?php
    … …  
    383390                        </tr>
    384391                        <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list" style="display: none;">
    385                                 <th><label for="_default_calendar_style_days_events"><?php _e(
     392                                <th><label for="_default_calendar_style_days_events"><?php esc_html_e(
    386393        'Days with Events',
    387394        'google-calendar-events',
  • google-calendar-events/trunk/includes/calendars/views/default-calendar-grid.php

    r3663004 r3805019  
    205205
    206206            <table class="simcal-calendar-grid"
    207                    data-event-bubble-trigger="<?php echo $calendar->event_bubble_trigger; ?>">
     207                   data-event-bubble-trigger="<?php echo esc_attr($calendar->event_bubble_trigger); ?>">
    208208                <thead class="simcal-calendar-head">
    209209                <tr>
    210210                                        <?php if (!$calendar->static) { ?>
    211                         <td class="simcal-nav simcal-prev-wrapper" colspan="<?php echo apply_filters(
    212                                 'simcal_prev_cols',
    213                                 '1',
     211                        <td class="simcal-nav simcal-prev-wrapper" colspan="<?php echo esc_attr(
     212                                (string) apply_filters('simcal_prev_cols', '1'),
    214213                        ); ?>">
    215                             <button class="simcal-nav-button simcal-month-nav simcal-prev" title="<?php _e(
     214                            <button class="simcal-nav-button simcal-month-nav simcal-prev" title="<?php esc_attr_e(
    216215                                'Previous Month',
    217216                                'google-calendar-events',
    218                             ); ?>" aria-label="<?php _e(
     217                            ); ?>" aria-label="<?php esc_attr_e(
    219218        'Previous Month',
    220219        'google-calendar-events',
    … …  
    222221                        </td>
    223222                                        <?php } ?>
    224                     <td colspan="<?php echo apply_filters('simcal_current_cols', $calendar->static ? '7' : '5'); ?>"
     223                    <td colspan="<?php echo esc_attr(
     224                        (string) apply_filters('simcal_current_cols', $calendar->static ? '7' : '5'),
     225                    ); ?>"
    225226                        class="simcal-nav simcal-current"
    226227                        aria-live="polite"
    227228                        aria-atomic="true"
    228                         data-calendar-current="<?php echo $calendar->start; ?>">
     229                        data-calendar-current="<?php echo esc_attr((string) $calendar->start); ?>">
    229230                                                <?php
    230231      echo '<h3>';
    … …  
    242243
    243244      foreach ($current as $k => $v) {
    244         echo ' <span class="simcal-current-' . $k, '">' . wp_date($v, $calendar->start) . '</span> ';
     245        echo ' <span class="simcal-current-' .
     246                esc_attr($k) .
     247                '">' .
     248                esc_html(wp_date($v, $calendar->start, new \DateTimeZone($calendar->timezone))) .
     249                '</span> ';
    245250      }
    246251
    … …  
    249254                    </td>
    250255                                        <?php if (!$calendar->static) { ?>
    251                         <td class="simcal-nav simcal-next-wrapper" colspan="<?php echo apply_filters(
    252                                 'simcal_next_cols',
    253                                 '1',
     256                        <td class="simcal-nav simcal-next-wrapper" colspan="<?php echo esc_attr(
     257                                (string) apply_filters('simcal_next_cols', '1'),
    254258                        ); ?>">
    255                             <button class="simcal-nav-button simcal-month-nav simcal-next" title="<?php _e(
     259                            <button class="simcal-nav-button simcal-month-nav simcal-next" title="<?php esc_attr_e(
    256260                                'Next Month',
    257261                                'google-calendar-events',
    258                             ); ?>" aria-label="<?php _e(
     262                            ); ?>" aria-label="<?php esc_attr_e(
    259263        'Next Month',
    260264        'google-calendar-events',
    … …  
    272276
    273277     for ($i = $week_starts; $i <= 6; $i++): ?>
    274                         <th class="simcal-week-day simcal-week-day-<?php echo $i; ?>"
    275                             data-screen-small="<?php echo mb_substr($week_days_short[$i], 0, 1, 'UTF-8'); ?>"
    276                             data-screen-medium="<?php echo $week_days_short[$i]; ?>"
    277                             data-screen-large="<?php echo $week_days_full[$i]; ?>"><?php echo $week_days_short[
    278         $i
    279 ]; ?></th>
     278                        <th class="simcal-week-day simcal-week-day-<?php echo esc_attr((string) $i); ?>"
     279                            data-screen-small="<?php echo esc_attr(mb_substr($week_days_short[$i], 0, 1, 'UTF-8')); ?>"
     280                            data-screen-medium="<?php echo esc_attr($week_days_short[$i]); ?>"
     281                            data-screen-large="<?php echo esc_attr($week_days_full[$i]); ?>"><?php echo esc_html(
     282        $week_days_short[$i],
     283); ?></th>
    280284                                                <?php endfor;
    281285
    282286     if ($week_starts !== 0):
    283287        for ($i = 0; $i < $week_starts; $i++): ?>
    284                             <th class="simcal-week-day simcal-week-day-<?php echo $i; ?>"
    285                                 data-screen-small="<?php echo mb_substr($week_days_short[$i], 0, 1, 'UTF-8'); ?>"
    286                                 data-screen-medium="<?php echo $week_days_short[$i]; ?>"
    287                                 data-screen-large="<?php echo $week_days_full[$i]; ?>"><?php echo $week_days_short[
    288         $i
    289 ]; ?></th>
     288                            <th class="simcal-week-day simcal-week-day-<?php echo esc_attr((string) $i); ?>"
     289                                data-screen-small="<?php echo esc_attr(
     290                                        mb_substr($week_days_short[$i], 0, 1, 'UTF-8'),
     291                                ); ?>"
     292                                data-screen-medium="<?php echo esc_attr($week_days_short[$i]); ?>"
     293                                data-screen-large="<?php echo esc_attr($week_days_full[$i]); ?>"><?php echo esc_html(
     294        $week_days_short[$i],
     295); ?></th>
    290296                                                        <?php endfor;
    291297     endif;
    … …  
    294300                </thead>
    295301
    296                                 <?php echo $this->draw_month(
    297         date($this->format_timestamp($calendar->start, 'n')),
    298         date($this->format_timestamp($calendar->start, 'Y')),
    299     ); ?>
     302                                <?php
     303    $month_html = $this->draw_month(
     304        $this->format_timestamp($calendar->start, 'n'),
     305        $this->format_timestamp($calendar->start, 'Y'),
     306    );
     307    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- draw_month() escapes at the leaf nodes.
     308    echo $month_html;
     309    ?>
    300310            </table>
    301311
    … …  
    432442                ob_start();
    433443
    434                 echo '<tbody class="simcal-month simcal-month-' . $month . '">' . "\n";
    435                 echo "\t" . '<tr class="simcal-week simcal-week-' . $week_of_year . '">';
     444                echo '<tbody class="simcal-month simcal-month-' . esc_attr((string) $month) . '">' . "\n";
     445                echo "\t" . '<tr class="simcal-week simcal-week-' . esc_attr((string) $week_of_year) . '">';
    436446
    437447                $days_in_row = 0;
    … …  
    448458                        $last_void_day_class = $a === $void_days_needed - 1 ? 'simcal-day-void-last' : '';
    449459
    450                         echo '<td class="simcal-day simcal-day-void ' . $last_void_day_class . '"></td>' . "\n";
     460                        echo '<td class="simcal-day simcal-day-void ' . esc_attr($last_void_day_class) . '"></td>' . "\n";
    451461
    452462                        // Reset day of the week count (sun, 0 - sat, 6).
    … …  
    477487                                $bg_color = '#' . $the_color->getHex();
    478488                                $color = $the_color->isDark() ? '#ffffff' : '#000000';
    479                                 $border_style = ' style="border: 1px solid ' . $bg_color . ';"';
     489                                $border_style = 'border: 1px solid ' . $bg_color . ';';
    480490                        } elseif ($current_max < $now) {
    481491                                $day_classes .= ' simcal-past simcal-day';
    … …  
    511521                                                // Event title in list.
    512522                                                $title = !empty($event->title) ? trim($event->title) : __('Event', 'google-calendar-events');
    513                                                 if ($calendar->trim_titles >= 1) {
    514                                                         $title =
    515                                                                 strlen($title) > $calendar->trim_titles
    516                                                                         ? mb_substr($title, 0, $calendar->trim_titles) . '&hellip;'
    517                                                                         : $title;
     523                                                $title_html = esc_html($title);
     524                                                if ($calendar->trim_titles >= 1 && mb_strlen($title) > $calendar->trim_titles) {
     525                                                        $title_html = esc_html(mb_substr($title, 0, $calendar->trim_titles)) . '&hellip;';
    518526                                                }
    519527
    … …  
    524532                                                        $bullet =
    525533                                                                '<span class="simcal-event-color" style="background-color: ' .
    526                                                                 $event_color .
     534                                                                esc_attr($event_color) .
    527535                                                                ';" aria-hidden="true"></span> ';
    528536                                                        $bullet_colors[] = $event_color;
    … …  
    532540
    533541                                                // Event contents.
    534                                                 $list_events .= "\t" . '<li class="' . $event_classes . '"' . $event_visibility . '>' . "\n";
    535                                                 $list_events .= "\t\t" . '<span class="simcal-event-title">' . $bullet . $title . '</span>' . "\n";
     542                                                $list_events .= "\t" . '<li class="' . esc_attr($event_classes) . '"' . $event_visibility . '>' . "\n";
     543                                                $list_events .= "\t\t" . '<span class="simcal-event-title">' . $bullet . $title_html . '</span>' . "\n";
    536544                                                $list_events .=
    537545                                                        "\t\t" .
    … …  
    571579
    572580                        // The actual days with numbers and events in each row cell.
    573                         echo '<td class="' . $day_classes . '" data-events-count="' . strval($count) . '">' . "\n";
     581                        echo '<td class="' . esc_attr($day_classes) . '" data-events-count="' . esc_attr(strval($count)) . '">' . "\n";
    574582
    575583                        if ($color) {
    576                                 $day_style = ' style="background-color: ' . $bg_color . '; color: ' . $color . '"';
     584                                $day_style = 'background-color: ' . $bg_color . '; color: ' . $color;
    577585                        } elseif ($count > 0) {
    578586                                $the_color = new Color($calendar->days_events_color);
    579587                                $color = !$color ? ($the_color->isDark() ? '#ffffff' : '#000000') : $color;
    580588                                $bg_color = !$bg_color ? '#' . $the_color->getHex() : $bg_color;
    581                                 $day_style = ' style="background-color: ' . $bg_color . '; color: ' . $color . '"';
     589                                $day_style = 'background-color: ' . $bg_color . '; color: ' . $color;
    582590                        } else {
    583591                                $day_style = '';
    584592                        }
    585593
    586                         echo "\t" . '<div' . $border_style . '>' . "\n";
    587                         echo "\t\t" . '<span class="simcal-day-label simcal-day-number"' . $day_style . '>' . $day . '</span>' . "\n";
     594                        echo "\t" . '<div' . ($border_style ? ' style="' . esc_attr($border_style) . '"' : '') . '>' . "\n";
     595                        echo "\t\t" .
     596                                '<span class="simcal-day-label simcal-day-number"' .
     597                                ($day_style ? ' style="' . esc_attr($day_style) . '"' : '') .
     598                                '>' .
     599                                esc_html((string) $day) .
     600                                '</span>' .
     601                                "\n";
     602                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- event HTML from get_event_html(); attrs escaped above.
    588603                        echo "\t\t" . $list_events . "\n";
    589604                        echo "\t\t";
    … …  
    614629                                // Open a new week row.
    615630                                if ($day < $days_in_month) {
    616                                         echo '<tr class="simcal-week simcal-week-' . $week_of_year++ . '">' . "\n";
     631                                        echo '<tr class="simcal-week simcal-week-' . esc_attr((string) $week_of_year++) . '">' . "\n";
    617632                                }
    618633
    … …  
    632647                        $last_void_day_class = $i == $remainder_days ? 'simcal-day-void-last' : '';
    633648
    634                         echo '<td class="simcal-day simcal-day-void ' . $last_void_day_class . '"></td>' . "\n";
     649                        echo '<td class="simcal-day simcal-day-void ' . esc_attr($last_void_day_class) . '"></td>' . "\n";
    635650
    636651                        $week_day++;
  • google-calendar-events/trunk/includes/calendars/views/default-calendar-list.php

    r3663004 r3805019  
    190190
    191191                if ($calendar instanceof Default_Calendar) {
    192                         $disabled = $calendar->static === true || empty($calendar->events) ? ' disabled="disabled"' : '';
     192                        $is_nav_disabled = $calendar->static === true || empty($calendar->events);
    193193
    194194                        $hide_header = get_post_meta($this->calendar->id, '_default_calendar_list_header', true) == 'yes' ? true : false;
    … …  
    205205                        );
    206206
    207                         echo '<div class="simcal-calendar-list ' . $compact_list_class . '">';
     207                        echo '<div class="simcal-calendar-list ' . esc_attr($compact_list_class) . '">';
    208208
    209209                        if (!$hide_header && !$static_calendar) {
    … …  
    213213                                echo "\t\t" .
    214214                                        '<button class="simcal-nav-button simcal-prev" title="' .
    215                                         __('Previous', 'google-calendar-events') .
    216                                         '"' .
    217                                         $disabled .
    218                                         ' aria-label="' .
    219                                         __('Previous', 'google-calendar-events') .
    220                                         '">' .
    221                                         "\n";
     215                                        esc_attr__('Previous', 'google-calendar-events') .
     216                                        '"';
     217                                disabled($is_nav_disabled);
     218                                echo ' aria-label="' . esc_attr__('Previous', 'google-calendar-events') . '">' . "\n";
    222219                                echo "\t\t\t" . '<i class="simcal-icon-left" aria-hidden="true"></i>' . "\n";
    223220                                echo "\t\t" . '</button>' . "\n";
    … …  
    230227                                echo "\t" .
    231228                                        '<div class="simcal-nav simcal-current ' .
    232                                         $header_class .
     229                                        esc_attr($header_class) .
    233230                                        '" aria-live="polite" aria-atomic="true" data-calendar-current="' .
    234                                         $calendar->start .
     231                                        esc_attr((string) $calendar->start) .
    235232                                        '">' .
    236233                                        "\n";
    … …  
    241238                                echo "\t\t" .
    242239                                        '<button class="simcal-nav-button simcal-next" title="' .
    243                                         __('Next', 'google-calendar-events') .
    244                                         '"' .
    245                                         $disabled .
    246                                         ' aria-label="' .
    247                                         __('Next', 'google-calendar-events') .
    248                                         '">';
     240                                        esc_attr__('Next', 'google-calendar-events') .
     241                                        '"';
     242                                disabled($is_nav_disabled);
     243                                echo ' aria-label="' . esc_attr__('Next', 'google-calendar-events') . '">';
    249244                                echo "\t\t\t" . '<i class="simcal-icon-right" aria-hidden="true"></i>' . "\n";
    250245                                echo "\t\t" . '</button>' . "\n";
    … …  
    254249                        }
    255250
     251                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- draw_list() escapes at the leaf nodes.
    256252                        echo $this->draw_list($calendar->start);
    257253
    … …  
    469465                                if ($date_order['y'] < $date_order['m']) {
    470466                                        // 2020, August - September.
    471                                         $large = $small = date('Y', $st) . ', ';
     467                                        $large = $small = gmdate('Y', $st) . ', ';
    472468                                        $large .= date_i18n('F', $st) . ' - ' . date_i18n('F', $et);
    473469                                        $small .= date_i18n('M', $st) . ' - ' . date_i18n('M', $et);
    … …  
    476472                                        $large = date_i18n('F', $st) . ' - ' . date_i18n('F', $et) . ', ';
    477473                                        $small = date_i18n('M', $st) . ' - ' . date_i18n('M', $et) . ' ';
    478                                         $year = date('Y', $st);
     474                                        $year = gmdate('Y', $st);
    479475                                        $large .= $year;
    480476                                        $small .= $year;
    … …  
    482478                        }
    483479                } else {
    484                         $large = $small = date('Y', $st) . ' - ' . date('Y', $et);
     480                        $large = $small = gmdate('Y', $st) . ' - ' . gmdate('Y', $et);
    485481                }
    486482
    … …  
    546542                $current_events = $this->get_events($timestamp);
    547543                $format = $calendar->date_format;
     544                /* translators: 1: start date, 2: end date */
     545                $nothing_from_to_format = __('Nothing from %1$s to %2$s.', 'google-calendar-events');
    548546
    549547                ob_start();
    … …  
    553551                $block_tag = $calendar->compact_list && !empty($current_events) ? 'div' : 'dl';
    554552
    555                 $data_heading = '';
    556553                $heading = $this->get_heading();
    557                 foreach ($heading as $k => $v) {
    558                         $data_heading .= ' data-heading-' . $k . '="' . $v . '"';
    559                 }
    560554
    561555                echo '<' .
    562                         $block_tag .
     556                        tag_escape($block_tag) .
    563557                        ' class="simcal-events-list-container"' .
    564558                        ' data-prev="' .
    565                         $this->prev .
     559                        esc_attr((string) $this->prev) .
    566560                        '"' .
    567561                        ' data-next="' .
    568                         $this->next .
    569                         '"' .
    570                         $data_heading .
    571                         '>';
     562                        esc_attr((string) $this->next) .
     563                        '"';
     564                foreach ($heading as $k => $v) {
     565                        echo ' data-heading-' . esc_attr($k) . '="' . esc_attr($v) . '"';
     566                }
     567                echo '>';
    572568
    573569                if (!empty($current_events) && is_array($current_events)):
    … …  
    616612                                        $bg_color = '#' . $the_color->getHex();
    617613                                        $color = $the_color->isDark() ? '#ffffff' : '#000000';
    618                                         $border_style = ' style="border-bottom: 1px solid ' . $bg_color . ';" ';
    619                                         $bg_style = ' style="background-color: ' . $bg_color . '; color: ' . $color . ';"';
    620 
    621                                         echo "\t" . '<dt class="simcal-day-label"' . $border_style . '>';
    622                                         echo '<span' . $bg_style . '>';
     614                                        $border_style = 'border-bottom: 1px solid ' . $bg_color . ';';
     615                                        $bg_style = 'background-color: ' . $bg_color . '; color: ' . $color . ';';
     616
     617                                        echo "\t" . '<dt class="simcal-day-label" style="' . esc_attr($border_style) . '">';
     618                                        echo '<span style="' . esc_attr($bg_style) . '">';
    623619
    624620                                        echo $format
    625621                                                ? '<span class="simcal-date-format" data-date-format="' .
    626                                                         $format .
     622                                                        esc_attr($format) .
    627623                                                        '">' .
    628                                                         date_i18n($format, $day_date_ts_offset, strtotime($day_date_offset->toDateTimeString())) .
     624                                                        esc_html(date_i18n($format, $day_date_ts_offset, strtotime($day_date_offset->toDateTimeString()))) .
    629625                                                        '</span> '
    630626                                                : ' ';
    … …  
    639635
    640636                                // Add day of week number to CSS class.
    641                                 $day_classes = 'simcal-weekday-' . date('w', $day_date_ts_offset);
     637                                $day_classes = 'simcal-weekday-' . gmdate('w', $day_date_ts_offset);
    642638
    643639                                // Is this the present, the past or the future, Doc?
    … …  
    690686                                                                "\t" .
    691687                                                                '<li class="' .
    692                                                                 $event_classes .
     688                                                                esc_attr($event_classes) .
    693689                                                                '" style="' .
    694                                                                 $event_visibility .
    695                                                                 $event_color .
     690                                                                esc_attr($event_visibility . $event_color) .
    696691                                                                '" data-start="' .
    697692                                                                esc_attr($event->start) .
    … …  
    724719                                                        "\t" .
    725720                                                        '<li class="' .
    726                                                         $event_classes .
     721                                                        esc_attr($event_classes) .
    727722                                                        '" style="' .
    728                                                         $event_visibility .
    729                                                         $event_color .
     723                                                        esc_attr($event_visibility . $event_color) .
    730724                                                        '" itemscope itemtype="http://schema.org/Event" data-start="' .
    731725                                                        esc_attr($event->start) .
    … …  
    762756                                // Print final list of events for the current day.
    763757                                $tag = $calendar->compact_list ? 'div' : 'dd';
    764                                 echo '<' . $tag . ' class="' . $day_classes . '" data-events-count="' . strval($count) . '">' . "\n";
     758                                echo '<' .
     759                                        tag_escape($tag) .
     760                                        ' class="' .
     761                                        esc_attr($day_classes) .
     762                                        '" data-events-count="' .
     763                                        esc_attr(strval($count)) .
     764                                        '">' .
     765                                        "\n";
     766                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- event HTML from get_event_html(); attrs escaped above.
    765767                                echo "\t" . $list_events . "\n";
    766                                 echo '</' . $tag . '>' . "\n";
     768                                echo '</' . tag_escape($tag) . '>' . "\n";
    767769                        endforeach;
    768770                else:
    … …  
    772774
    773775                        if ('events' == $calendar->group_type) {
    774                                 echo !empty($message) ? $message : __('There are no upcoming events.', 'google-calendar-events');
     776                                echo !empty($message)
     777                                        ? wp_kses_post($message)
     778                                        : esc_html__('There are no upcoming events.', 'google-calendar-events');
    775779                        } else {
    776780                                if (!empty($message)) {
    777                                         echo $message;
     781                                        echo wp_kses_post($message);
    778782                                } else {
    779783                                        $from = Carbon::createFromTimestamp($this->start, $calendar->timezone)->getTimestamp();
    780784                                        $to = Carbon::createFromTimestamp($this->end, $calendar->timezone)->getTimestamp();
    781                                         echo apply_filters(
    782                                                 'simcal_no_events_message',
    783                                                 sprintf(
    784                                                         __('Nothing from %1$s to %2$s.', 'google-calendar-events'),
    785                                                         date_i18n($calendar->date_format, $from),
    786                                                         date_i18n($calendar->date_format, $to),
    787                                                 ),
    788                                                 $calendar->id,
    789                                                 $from,
    790                                                 $to,
     785                                        $nothing_message = sprintf(
     786                                                $nothing_from_to_format,
     787                                                date_i18n($calendar->date_format, $from),
     788                                                date_i18n($calendar->date_format, $to),
     789                                        );
     790                                        echo wp_kses_post(
     791                                                (string) apply_filters('simcal_no_events_message', $nothing_message, $calendar->id, $from, $to),
    791792                                        );
    792793                                }
    … …  
    796797                endif;
    797798
    798                 echo '</' . $block_tag . '>';
     799                echo '</' . tag_escape($block_tag) . '>';
    799800
    800801                return ob_get_clean();
  • google-calendar-events/trunk/includes/events/event-builder.php

    r3663004 r3805019  
    11061106                if ($unknown > 0) {
    11071107                        if ($known > 0) {
    1108                                 /* translators: One more person attending the event. */
    1109                                 $others = sprintf(_n('1 more attendee', '%s more attendees', $unknown, 'google-calendar-events'), $unknown);
     1108                                $others = sprintf(
     1109                                        /* translators: %s: number of additional attendees */
     1110                                        _n('%s more attendee', '%s more attendees', $unknown, 'google-calendar-events'),
     1111                                        number_format_i18n($unknown),
     1112                                );
    11101113                        } else {
    1111                                 /* translators: One or more persons attending the event whose name is unknown. */
    11121114                                $others = sprintf(
    1113                                         _n('1 anonymous attendee', '%s anonymous attendees', $unknown, 'google-calendar-events'),
    1114                                         $unknown,
     1115                                        /* translators: %s: number of anonymous attendees */
     1116                                        _n('%s anonymous attendee', '%s anonymous attendees', $unknown, 'google-calendar-events'),
     1117                                        number_format_i18n($unknown),
    11151118                                );
    11161119                        }
  • google-calendar-events/trunk/includes/events/event.php

    r3564571 r3805019  
    402402                }
    403403
    404                 $location['name'] = isset($var['name']) ? esc_attr(strip_tags($var['name'])) : '';
    405                 $location['address'] = isset($var['address']) ? esc_attr(strip_tags($var['address'])) : '';
     404                $location['name'] = isset($var['name']) ? esc_attr(wp_strip_all_tags($var['name'])) : '';
     405                $location['address'] = isset($var['address']) ? esc_attr(wp_strip_all_tags($var['address'])) : '';
    406406                $location['lat'] = isset($var['lat']) ? $this->esc_coordinate($var['lat']) : 0;
    407407                $location['lng'] = isset($var['lng']) ? $this->esc_coordinate($var['lng']) : 0;
  • google-calendar-events/trunk/includes/events/events.php

    r3551626 r3805019  
    542542                $y = intval($year);
    543543                $w = absint($week);
    544                 $m = date('n', strtotime(strval($y) . '-W' . strval($w)));
     544                $m = gmdate('n', strtotime(strval($y) . '-W' . strval($w)));
    545545                $month_dt = Carbon::createFromDate($y, $m, 2, $this->timezone);
    546546                $days = [];
  • google-calendar-events/trunk/includes/feeds/admin/google-admin.php

    r3585959 r3805019  
    9494                                '<em style="font-size: 14px;">' .
    9595                                sprintf(
     96                                        /* translators: %s: URL to Google Calendar Pro add-on */
    9697                                        __(
    9798                                                '<strong>Note:</strong> Calendars configured to use the <a href="%s" class=" hover:simcal-text-green-600 simcal-underline" target="_blank">Google Calendar Pro add-on</a> use a different method of authorization.',
    … …  
    146147                        '<p class="description">' .
    147148                        sprintf(
     149                                /* translators: %s: URL to Google API key documentation */
    148150                                __(
    149151                                        '<a href="%s" class="simcal-underline hover:simcal-text-green-600 simcal-text-[13px]" target="_blank">Step-by-step instructions</a> ',
    … …  
    153155                        ) .
    154156                        sprintf(
     157                                /* translators: %s: URL to Google Developers Console */
    155158                                __(
    156159                                        '<a href="%s" class="simcal-pl-[20px] simcal-underline hover:simcal-text-green-600 simcal-text-[13px]" target="_blank">Google Developers Console</a> ',
    … …  
    255258                        <table>
    256259                                <thead>
    257                                         <tr><th colspan="2"><?php _e('Google Calendar Settings', 'google-calendar-events'); ?></th></tr>
     260                                        <tr><th colspan="2"><?php esc_html_e('Google Calendar Settings', 'google-calendar-events'); ?></th></tr>
    258261                                </thead>
    259262                                <?php Settings::print_panel_fields($inputs, $post_id); ?>
    … …  
    274277                return sprintf(
    275278                        '<p class="description">' .
     279                                /* translators: %1$s: URL to documentation for making a Google Calendar public */
    276280                                __(
    277                                         'Step 1: Set the Google Calendar you want to use as <strong>"public."</strong> <a href="%1s" target="_blank">Detailed instructions</a>',
     281                                        'Step 1: Set the Google Calendar you want to use as <strong>"public."</strong> <a href="%1$s" target="_blank">Detailed instructions</a>',
    278282                                        'google-calendar-events',
    279283                                ) .
    280284                                '<br />' .
     285                                /* translators: %2$s: URL to documentation for finding a Google Calendar ID */
    281286                                __(
    282                                         'Step 2: Copy and paste your Google Calendar ID here. <a href="%2s" target="_blank">Detailed instructions</a>',
     287                                        'Step 2: Copy and paste your Google Calendar ID here. <a href="%2$s" target="_blank">Detailed instructions</a>',
    283288                                        'google-calendar-events',
    284289                                ) .
    … …  
    376381                                        '<i class="simcal-icon-warning"></i> ' .
    377382                                        sprintf(
     383                                                /* translators: %s: URL to Simple Calendar settings page */
    378384                                                __(
    379385                                                        'Your Google Calendar events will not show up until you <a href="%s">create and save a Google API key</a>.',
  • google-calendar-events/trunk/includes/feeds/admin/grouped-calendars-admin.php

    r3564571 r3805019  
    8080                        <table>
    8181                                <thead>
    82                                 <tr><th colspan="2"><?php _e('Grouped Calendar Settings', 'google-calendar-events'); ?></th></tr>
     82                                <tr><th colspan="2"><?php esc_html_e('Grouped Calendar Settings', 'google-calendar-events'); ?></th></tr>
    8383                                </thead>
    8484                                <tbody class="simcal-panel-section">
    8585                                <tr class="simcal-panel-field">
    86                                         <th><label for="_grouped_calendars_source"><?php _e('Get Calendars From', 'google-calendar-events'); ?></label></th>
     86                                        <th><label for="_grouped_calendars_source"><?php esc_html_e(
     87        'Get Calendars From',
     88        'google-calendar-events',
     89     ); ?></label></th>
    8790                                        <td>
    8891                                                <?php
    … …  
    98101        $source,
    99102        true,
    100        ); ?>><?php _e('Manual selection', 'google-calendar-events'); ?></option>
     103       ); ?>><?php esc_html_e('Manual selection', 'google-calendar-events'); ?></option>
    101104                                                        <option value="category" data-show-field="_grouped_calendars_category" <?php selected(
    102105        'category',
    103106        $source,
    104107        true,
    105        ); ?>><?php _e('Category', 'google-calendar-events'); ?></option>
     108       ); ?>><?php esc_html_e('Category', 'google-calendar-events'); ?></option>
    106109                                                </select>
    107                                                 <i class="simcal-icon-help simcal-help-tip" data-tip="<?php _e(
     110                                                <i class="simcal-icon-help simcal-help-tip" data-tip="<?php esc_attr_e(
    108111        'Choose from which calendar feeds you want to get events from. Choose them individually or select all those belonging to calendar feed categories.',
    109112        'google-calendar-events',
    … …  
    171174        $style .= ' width: 100%; max-width: 500px';
    172175        echo '<input type="text" disabled="disabled" name="_grouped_calendars_category" id="_grouped_calendars_category" style="' .
    173                 $style .
     176                esc_attr($style) .
    174177                '" placeholder="' .
    175                 __('There are no calendar categories yet.', 'google-calendar-events') .
     178                esc_attr__('There are no calendar categories yet.', 'google-calendar-events') .
    176179                '" />';
    177180      }?>
  • google-calendar-events/trunk/includes/feeds/admin/ics-feed-admin.php

    r3632810 r3805019  
    124124                        <table>
    125125                                <thead>
    126                                         <tr><th colspan="2"><?php _e('ICS Feed Settings', 'google-calendar-events'); ?></th></tr>
     126                                        <tr><th colspan="2"><?php esc_html_e('ICS Feed Settings', 'google-calendar-events'); ?></th></tr>
    127127                                </thead>
    128128                                <?php do_action('simcal_ics_feed_settings_fields_before', $post_id); ?>
    … …  
    273273                return sprintf(
    274274                        '<p class="description">' .
     275                                /* translators: %1$s: URL to ICS feed import documentation */
    275276                                __(
    276277                                        'Export or download an ICS/iCal file from your calendar. <a href="%1$s" target="_blank">Detailed instructions</a>',
  • google-calendar-events/trunk/includes/feeds/google.php

    r3731889 r3805019  
    208208                                                        // Event title & description.
    209209                                                        $title = $event->getSummary() ?? '';
    210                                                         $title = strip_tags($title);
     210                                                        $title = wp_strip_all_tags($title);
    211211                                                        $title = !empty($title)
    212212                                                                ? sanitize_text_field(iconv(mb_detect_encoding($title, mb_detect_order(), true), 'UTF-8', $title))
    … …  
    597597                                if (!is_array($response_arr)) {
    598598                                        throw new Google_Service_Exception(
    599                                                 __('Unable to fetch calendar events via OAuth.', 'google-calendar-events'),
     599                                                esc_html__('Unable to fetch calendar events via OAuth.', 'google-calendar-events'),
    600600                                                1,
    601601                                        );
    … …  
    603603
    604604                                if (isset($response_arr['Error']) && !empty($response_arr['Error'])) {
    605                                         throw new Google_Service_Exception($response_arr['Error'], 1);
     605                                        throw new Google_Service_Exception(esc_html((string) $response_arr['Error']), 1);
    606606                                }
    607607
    … …  
    610610                                                ? (string) $response_arr['message']
    611611                                                : __('Unable to fetch calendar events via OAuth.', 'google-calendar-events');
    612                                         throw new Google_Service_Exception($message, 1);
     612                                        throw new Google_Service_Exception(esc_html($message), 1);
    613613                                }
    614614
    … …  
    622622
    623623                                if (is_array($response) && isset($response['Error']) && !empty($response['Error'])) {
    624                                         throw new Google_Service_Exception($response['Error'], 1);
     624                                        throw new Google_Service_Exception(esc_html((string) $response['Error']), 1);
    625625                                }
    626626                        } else {
  • google-calendar-events/trunk/includes/feeds/ics-feed.php

    r3694641 r3805019  
    250250                }
    251251
     252                if (empty($file['tmp_name']) || !is_uploaded_file($file['tmp_name'])) {
     253                        return new \WP_Error('ics_upload_error', __('The ICS file could not be uploaded.', 'google-calendar-events'));
     254                }
     255
    252256                $filename = isset($file['name']) ? sanitize_file_name(wp_basename(wp_unslash($file['name']))) : '';
    253257                $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
    … …  
    293297
    294298                $filename = self::build_timestamped_filename($filename, $extension);
    295                 $destination = trailingslashit($upload_dir) . $filename;
    296                 $moved = is_uploaded_file($file['tmp_name']) ? @move_uploaded_file($file['tmp_name'], $destination) : false;
    297 
    298                 if (!$moved && false === file_put_contents($destination, $contents)) {
    299                         return new \WP_Error('ics_move_failed', __('The ICS file could not be saved.', 'google-calendar-events'));
    300                 }
    301 
    302                 $relative_path = trailingslashit(self::get_upload_subdirectory()) . $filename;
     299
     300                if (!function_exists('wp_handle_upload')) {
     301                        require_once ABSPATH . 'wp-admin/includes/file.php';
     302                }
     303
     304                $subdir_name = self::get_upload_subdirectory();
     305                $filter_upload_dir = static function ($dirs) use ($subdir_name) {
     306                        $subdir = '/' . $subdir_name;
     307                        $dirs['subdir'] = $subdir;
     308                        $dirs['path'] = $dirs['basedir'] . $subdir;
     309                        $dirs['url'] = $dirs['baseurl'] . $subdir;
     310
     311                        return $dirs;
     312                };
     313
     314                $overrides = [
     315                        'test_form' => false,
     316                        'test_type' => false,
     317                        'mimes' => [
     318                                'ics' => 'text/calendar',
     319                                'ical' => 'text/calendar',
     320                        ],
     321                        'unique_filename_callback' => static function () use ($filename) {
     322                                return $filename;
     323                        },
     324                ];
     325
     326                add_filter('upload_dir', $filter_upload_dir);
     327                $uploaded = wp_handle_upload($file, $overrides);
     328                remove_filter('upload_dir', $filter_upload_dir);
     329
     330                if (isset($uploaded['error'])) {
     331                        return new \WP_Error('ics_move_failed', $uploaded['error']);
     332                }
     333
     334                $relative_path = trailingslashit(self::get_upload_subdirectory()) . wp_basename($uploaded['file']);
    303335                update_post_meta($post_id, '_ics_feed_file', $relative_path);
    304336                delete_post_meta($post_id, '_ics_feed_url');
  • google-calendar-events/trunk/includes/frontend/sc-event-single.php

    r3717083 r3805019  
    397397                do_action('simcal_before_event_detail', $post, $context);
    398398
    399                 $wrapper_class = esc_attr(implode(' ', $classes));
     399                $wrapper_class = implode(' ', $classes);
    400400                $schema_meta_html = !empty($context['schema_meta']) ? $context['schema_meta'] : '';
    401401                ?>
    402                 <div class="<?php echo $wrapper_class; ?>" itemscope itemtype="https://schema.org/Event">
    403                         <?php echo $schema_meta_html; ?>
     402                <div class="<?php echo esc_attr($wrapper_class); ?>" itemscope itemtype="https://schema.org/Event">
     403                        <?php echo wp_kses($schema_meta_html, [
     404        'meta' => [
     405                'itemprop' => true,
     406                'content' => true,
     407        ],
     408        'span' => [
     409                'itemprop' => true,
     410                'itemscope' => true,
     411                'itemtype' => true,
     412                'style' => true,
     413        ],
     414   ]); ?>
    404415                        <?php do_action('simcal_before_event_detail_summary', $post, $context); ?>
    405416                        <div class="simcal-event-detail__body">
    … …  
    451462                ?>
    452463                <figure class="simcal-event-detail__featured">
    453                         <?php echo $featured_image; ?>
     464                        <?php echo wp_kses_post($featured_image); ?>
    454465                </figure>
    455466                <?php
    … …  
    470481
    471482                do_action('simcal_before_event_detail_meta', $post, $context);
     483
     484                $calendar_icon = $this->calendar_icon();
     485                $svg_allowed = $this->get_svg_allowed_html();
    472486                ?>
    473487                <div class="simcal-event-detail__meta">
    … …  
    475489                                <h3 class="simcal-event-detail__meta-label"><?php esc_html_e('Start', 'google-calendar-events'); ?></h3>
    476490                                <p class="simcal-event-detail__meta-value">
    477                                         <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo $this->calendar_icon(); ?></span>
     491                                        <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo wp_kses($calendar_icon, $svg_allowed); ?></span>
    478492                                        <span><?php echo esc_html($start_label); ?></span>
    479493                                </p>
    … …  
    482496                                <h3 class="simcal-event-detail__meta-label"><?php esc_html_e('End', 'google-calendar-events'); ?></h3>
    483497                                <p class="simcal-event-detail__meta-value">
    484                                         <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo $this->calendar_icon(); ?></span>
     498                                        <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo wp_kses($calendar_icon, $svg_allowed); ?></span>
    485499                                        <span><?php echo esc_html($end_label); ?></span>
    486500                                </p>
    … …  
    519533                        <h2 class="simcal-event-detail__description-title"><?php esc_html_e('Description', 'google-calendar-events'); ?></h2>
    520534                        <div class="simcal-event-detail__description-content" itemprop="description">
    521                                 <?php echo $description_html; ?>
     535                                <?php echo wp_kses_post($description_html); ?>
    522536                        </div>
    523537                </div>
    … …  
    539553                $lat = !empty($context['lat']) ? (float) $context['lat'] : 0;
    540554                $lng = !empty($context['lng']) ? (float) $context['lng'] : 0;
    541                 $location_attrs = $location ? ' itemprop="location" itemscope itemtype="https://schema.org/Place"' : '';
    542 
    543555                do_action('simcal_before_event_detail_location', $post, $context);
    544556
    … …  
    565577                 */
    566578                $map_html = apply_filters('simcal_event_detail_map_html', $map_html, $post, $context);
     579                $pin_icon = $this->pin_icon();
     580                $svg_allowed = $this->get_svg_allowed_html();
    567581                ?>
    568                 <div class="simcal-event-detail__sidebar-card simcal-event-detail__location"<?php echo $location_attrs; ?>>
     582                <div class="simcal-event-detail__sidebar-card simcal-event-detail__location"<?php if (
     583        $location
     584  ): ?> itemprop="location" itemscope itemtype="https://schema.org/Place"<?php endif; ?>>
    569585                        <h2 class="simcal-event-detail__sidebar-title"><?php esc_html_e('Address', 'google-calendar-events'); ?></h2>
    570586                        <p class="simcal-event-detail__location-address">
    571                                 <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo $this->pin_icon(); ?></span>
     587                                <span class="simcal-event-detail__icon" aria-hidden="true"><?php echo wp_kses($pin_icon, $svg_allowed); ?></span>
    572588                                <?php if ($location): ?>
    573589                                        <meta itemprop="name" content="<?php echo esc_attr($location); ?>" />
    … …  
    582598                                <span><?php echo esc_html($address); ?></span>
    583599                        </p>
    584                         <?php echo $map_html; ?>
     600                        <?php echo wp_kses_post($map_html); ?>
    585601                        <?php do_action('simcal_event_detail_location', $post, $context); ?>
    586602                </div>
    … …  
    626642                                        <div class="simcal-event-detail__row">
    627643                                                <dt><?php esc_html_e('Category', 'google-calendar-events'); ?></dt>
    628                                                 <dd><?php echo $categories; ?></dd>
     644                                                <dd><?php echo wp_kses_post($categories); ?></dd>
    629645                                        </div>
    630646                                <?php endif; ?>
    … …  
    632648                                        <div class="simcal-event-detail__row">
    633649                                                <dt><?php esc_html_e('Tag', 'google-calendar-events'); ?></dt>
    634                                                 <dd><?php echo $tags; ?></dd>
     650                                                <dd><?php echo wp_kses_post($tags); ?></dd>
    635651                                        </div>
    636652                                <?php endif; ?>
    … …  
    821837        protected function format_in_timezone($timestamp, $timezone, $format)
    822838        {
    823                 if (function_exists('wp_date')) {
    824                         try {
    825                                 return wp_date($format, $timestamp, new \DateTimeZone($timezone));
    826                         } catch (\Exception $e) {
    827                                 return wp_date($format, $timestamp);
    828                         }
    829                 }
    830 
    831                 $utc = gmdate('Y-m-d H:i:s', $timestamp);
    832 
    833                 return get_date_from_gmt($utc, $format);
     839                try {
     840                        return wp_date($format, $timestamp, new \DateTimeZone($timezone));
     841                } catch (\Exception $e) {
     842                        $utc = gmdate('Y-m-d H:i:s', $timestamp);
     843
     844                        return get_date_from_gmt($utc, $format);
     845                }
    834846        }
    835847
    … …  
    878890                return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 21s-6-5.3-6-10a6 6 0 1 1 12 0c0 4.7-6 10-6 10z"/><circle cx="12" cy="11" r="2.2"/></svg>';
    879891        }
     892
     893        /**
     894         * Allowed HTML for inline SVG icons.
     895         *
     896         * @since 4.3.2
     897         *
     898         * @return array
     899         */
     900        protected function get_svg_allowed_html()
     901        {
     902                return [
     903                        'svg' => [
     904                                'xmlns' => true,
     905                                'viewbox' => true,
     906                                'fill' => true,
     907                                'stroke' => true,
     908                                'stroke-width' => true,
     909                                'stroke-linecap' => true,
     910                                'stroke-linejoin' => true,
     911                        ],
     912                        'rect' => [
     913                                'x' => true,
     914                                'y' => true,
     915                                'width' => true,
     916                                'height' => true,
     917                                'rx' => true,
     918                        ],
     919                        'path' => [
     920                                'd' => true,
     921                        ],
     922                        'circle' => [
     923                                'cx' => true,
     924                                'cy' => true,
     925                                'r' => true,
     926                        ],
     927                ];
     928        }
    880929}
  • google-calendar-events/trunk/includes/functions/admin-svg.php

    r2943704 r3805019  
    77 *
    88 */
     9
     10if (!defined('ABSPATH')) {
     11        exit();
     12}
     13
    914function svgfillstar()
    1015{
  • google-calendar-events/trunk/includes/functions/admin.php

    r3717083 r3805019  
    999999        }
    10001000
     1001        /* translators: %s: keyboard shortcut to copy (e.g. Ctrl+C) */
    10011002        $shortcut = sprintf(__('Press %s to copy.', 'google-calendar-events'), $cmd);
    10021003        $shortcode = sprintf('[calendar id="%s"]', $post_id);
    … …  
    10051006                "class='simcal-shortcode simcal-calendar-shortcode simcal-shortcode-tip' " .
    10061007                "title='" .
    1007                 $shortcut .
     1008                esc_attr($shortcut) .
    10081009                "' " .
    10091010                "onclick='this.select();' value='" .
    1010                 $shortcode .
     1011                esc_attr($shortcode) .
    10111012                "' />";
    10121013}
    … …  
    10631064                $name = $current_user->user_firstname ? $current_user->user_firstname : '';
    10641065                ?>
    1065                 <div id="simcal-drip" class="<?php echo $screen; ?>">
     1066                <div id="simcal-drip" class="<?php echo esc_attr($screen); ?>">
    10661067                        <div class="signup">
    10671068                                <p>
    1068                                         <?php _e(
    1069         "Enter your name and email and we'll send you a coupon code for <strong>20% off</strong> all Pro Add-on purchases.",
    1070         'google-calendar-events',
     1069                                        <?php echo wp_kses(
     1070        __(
     1071                "Enter your name and email and we'll send you a coupon code for <strong>20% off</strong> all Pro Add-on purchases.",
     1072                'google-calendar-events',
     1073        ),
     1074        [
     1075                'strong' => [],
     1076        ],
    10711077     ); ?>
    10721078                                </p>
    10731079
    10741080                                <p>
    1075                                         <label for="simcal-drip-field-email"><?php _e('Your Email', 'google-calendar-events'); ?></label><br />
     1081                                        <label for="simcal-drip-field-email"><?php esc_html_e('Your Email', 'google-calendar-events'); ?></label><br />
    10761082                                        <input type="email"
    10771083                                               id="simcal-drip-field-email"
    10781084                                               name="fields[email]"
    1079                                                value="<?php echo $current_user->user_email; ?>" />
     1085                                               value="<?php echo esc_attr($current_user->user_email); ?>" />
    10801086                                </p>
    10811087
    10821088                                <p>
    1083                                         <label for="simcal-drip-field-first_name"><?php _e('First Name', 'google-calendar-events'); ?></label><br />
     1089                                        <label for="simcal-drip-field-first_name"><?php esc_html_e('First Name', 'google-calendar-events'); ?></label><br />
    10841090                                        <input type="text"
    10851091                                               id="simcal-drip-field-first_name"
    10861092                                               name="fields[first_name]"
    1087                                                value="<?php echo $name; ?>" />
     1093                                               value="<?php echo esc_attr($name); ?>" />
    10881094                                </p>
    10891095                                <p class="textright">
    10901096                                        <a href="#"
    10911097                                           id="simcal-drip-signup"
    1092                                            class="button button-primary"><?php _e('Send me the coupon', 'google-calendar-events'); ?></a>
     1098                                           class="button button-primary"><?php esc_html_e('Send me the coupon', 'google-calendar-events'); ?></a>
    10931099                                </p>
    10941100                                <div class="textright">
    1095                                         <em><?php _e('No spam. Unsubscribe anytime.', 'google-calendar-events'); ?></em>
     1101                                        <em><?php esc_html_e('No spam. Unsubscribe anytime.', 'google-calendar-events'); ?></em>
    10961102                                        <br/>
    1097                                         <a href="<?php echo simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'sidebar-link'); ?>"
    1098                                            target="_blank"><?php _e('Just take me the add-ons', 'google-calendar-events'); ?></a>
     1103                                        <a href="<?php echo esc_url(simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'sidebar-link')); ?>"
     1104                                           target="_blank"><?php esc_html_e('Just take me the add-ons', 'google-calendar-events'); ?></a>
    10991105                                </div>
    11001106                        </div>
    11011107                        <div class="thank-you" style="display: none;">
    1102                                 <?php _e('Thank you!', 'google-calendar-events'); ?>
     1108                                <?php esc_html_e('Thank you!', 'google-calendar-events'); ?>
    11031109                        </div>
    11041110                        <div class="clear">
    … …  
    11211127                <div class="main">
    11221128                        <p class="heading centered">
    1123                                 <?php _e('Some of the features included with our premium add-ons', 'google-calendar-events'); ?>
     1129                                <?php esc_html_e('Some of the features included with our premium add-ons', 'google-calendar-events'); ?>
    11241130                        </p>
    11251131
    11261132                        <ul>
    1127                                 <li><div class="dashicons dashicons-yes"></div> <?php _e(
     1133                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
    11281134        'Display color coded events',
    11291135        'google-calendar-events',
    11301136    ); ?></li>
    1131                                 <li><div class="dashicons dashicons-yes"></div> <?php _e('Show week & day views', 'google-calendar-events'); ?></li>
    1132                                 <li><div class="dashicons dashicons-yes"></div> <?php _e('Fast view switching', 'google-calendar-events'); ?></li>
    1133                                 <li><div class="dashicons dashicons-yes"></div> <?php _e(
     1137                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
     1138        'Show week & day views',
     1139        'google-calendar-events',
     1140    ); ?></li>
     1141                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
     1142        'Fast view switching',
     1143        'google-calendar-events',
     1144    ); ?></li>
     1145                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
    11341146        'Event titles & start times in grid',
    11351147        'google-calendar-events',
    11361148    ); ?></li>
    1137                                 <li><div class="dashicons dashicons-yes"></div> <?php _e('Limit event display times', 'google-calendar-events'); ?></li>
    1138                                 <li><div class="dashicons dashicons-yes"></div> <?php _e(
     1149                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
     1150        'Limit event display times',
     1151        'google-calendar-events',
     1152    ); ?></li>
     1153                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
    11391154        'Display private calendar events',
    11401155        'google-calendar-events',
    11411156    ); ?></li>
    1142                                 <li><div class="dashicons dashicons-yes"></div> <?php _e(
     1157                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
    11431158        'Show attendees & RSVP status',
    11441159        'google-calendar-events',
    11451160    ); ?></li>
    1146                                 <li><div class="dashicons dashicons-yes"></div> <?php _e('Display attachments', 'google-calendar-events'); ?></li>
    1147                                 <li><div class="dashicons dashicons-yes"></div> <?php _e('Priority email support', 'google-calendar-events'); ?></li>
     1161                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
     1162        'Display attachments',
     1163        'google-calendar-events',
     1164    ); ?></li>
     1165                                <li><div class="dashicons dashicons-yes"></div> <?php esc_html_e(
     1166        'Priority email support',
     1167        'google-calendar-events',
     1168    ); ?></li>
    11481169                        </ul>
    11491170
    11501171                        <div class="centered">
    1151                                 <a href="<?php echo simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'sidebar-link'); ?>"
     1172                                <a href="<?php echo esc_url(simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'sidebar-link')); ?>"
    11521173                                   class="button-primary button-large" target="_blank">
    1153                                         <?php _e('Upgrade to Premium Now', 'google-calendar-events'); ?></a>
     1174                                        <?php esc_html_e('Upgrade to Premium Now', 'google-calendar-events'); ?></a>
    11541175                        </div>
    11551176                </div>
  • google-calendar-events/trunk/includes/functions/deprecated.php

    r2943704 r3805019  
    4040        if (empty($date)) {
    4141                $current_time = current_time('timestamp');
    42                 $timestamp = mktime(0, 0, 0, date('m', $current_time), date('d', $current_time), date('Y', $current_time));
     42                $timestamp = mktime(0, 0, 0, gmdate('m', $current_time), gmdate('d', $current_time), gmdate('Y', $current_time));
    4343        } else {
    4444                $date = explode('/', $date);
  • google-calendar-events/trunk/includes/ics-export.php

    r3632810 r3805019  
    8383                header('Content-Length: ' . strlen($ics));
    8484
     85                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ICS download body (text/calendar), not HTML.
    8586                echo $ics;
    8687                exit();
    … …  
    188189                        '">';
    189190
     191                $svg_allowed = self::get_svg_allowed_html();
     192
    190193                if ($show_ics_export) {
    191                         $export_url = esc_url(self::get_export_url($calendar_id));
    192                         $export_tooltip = esc_attr__(
    193                                 'By pressing this you will get an ICS file of this calendar.',
    194                                 'google-calendar-events',
    195                         );
    196 
     194                        $export_icon = self::render_icon('export');
    197195                        echo '<a href="' .
    198                                 $export_url .
     196                                esc_url(self::get_export_url($calendar_id)) .
    199197                                '" id="simcal-ics-export-' .
    200198                                esc_attr($uid) .
    … …  
    202200                                esc_attr((string) $calendar_id) .
    203201                                '" title="' .
    204                                 $export_tooltip .
     202                                esc_attr__('By pressing this you will get an ICS file of this calendar.', 'google-calendar-events') .
    205203                                '">';
    206                         echo self::render_icon('export');
     204                        echo wp_kses($export_icon, $svg_allowed);
    207205                        echo '<span class="simcal-calendar-action-label">' . esc_html__('Export', 'google-calendar-events') . '</span>';
    208206                        echo '</a>';
    … …  
    212210
    213211                if ($show_print) {
    214                         $print_tooltip = esc_attr__('Print a copy of this calendar view.', 'google-calendar-events');
    215 
     212                        $print_icon = self::render_icon('print');
    216213                        echo '<button type="button" id="simcal-print-' .
    217214                                esc_attr($uid) .
    … …  
    219216                                esc_attr((string) $calendar_id) .
    220217                                '" title="' .
    221                                 $print_tooltip .
     218                                esc_attr__('Print a copy of this calendar view.', 'google-calendar-events') .
    222219                                '">';
    223                         echo self::render_icon('print');
     220                        echo wp_kses($print_icon, $svg_allowed);
    224221                        echo '<span class="simcal-calendar-action-label">' . esc_html__('Print', 'google-calendar-events') . '</span>';
    225222                        echo '</button>';
    … …  
    257254
    258255                return isset($icons[$icon]) ? $icons[$icon] : '';
     256        }
     257
     258        /**
     259         * Allowed HTML for calendar action SVG icons.
     260         *
     261         * @since 4.3.2
     262         *
     263         * @return array
     264         */
     265        public static function get_svg_allowed_html()
     266        {
     267                return [
     268                        'svg' => [
     269                                'class' => true,
     270                                'xmlns' => true,
     271                                'width' => true,
     272                                'height' => true,
     273                                'viewbox' => true,
     274                                'fill' => true,
     275                                'stroke' => true,
     276                                'stroke-width' => true,
     277                                'stroke-linecap' => true,
     278                                'stroke-linejoin' => true,
     279                                'aria-hidden' => true,
     280                        ],
     281                        'path' => [
     282                                'd' => true,
     283                        ],
     284                        'polyline' => [
     285                                'points' => true,
     286                        ],
     287                        'line' => [
     288                                'x1' => true,
     289                                'y1' => true,
     290                                'x2' => true,
     291                                'y2' => true,
     292                        ],
     293                        'rect' => [
     294                                'x' => true,
     295                                'y' => true,
     296                                'width' => true,
     297                                'height' => true,
     298                        ],
     299                ];
    259300        }
    260301
  • google-calendar-events/trunk/includes/main.php

    r3632810 r3805019  
    271271                                add_action('admin_notices', function () {
    272272                                        echo '<div class="error"><p>' .
    273                                                 sprintf(
    274                                                         __(
    275                                                                 'The Simple Calendar plugin now includes the features previously provided by the Google Calendar OAuth Helper add-on. Please deactivate and remove the OAuth Helper add-on to avoid redundancy.',
    276                                                                 'google-calendar-events',
    277                                                         ),
    278                                                         simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'admin-notice'),
     273                                                esc_html__(
     274                                                        'The Simple Calendar plugin now includes the features previously provided by the Google Calendar OAuth Helper add-on. Please deactivate and remove the OAuth Helper add-on to avoid redundancy.',
     275                                                        'google-calendar-events',
    279276                                                ) .
    280277                                                '</p></div>';
  • google-calendar-events/trunk/includes/post-types.php

    r3717083 r3805019  
    413413
    414414                                                if ('after' == $pos) {
     415                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already-filtered post content; wp_kses_post would strip embeds.
    415416                                                        echo $the_content;
    416417                                                        simcal_print_calendar($id);
    417418                                                } elseif ('before' == $pos) {
    418419                                                        simcal_print_calendar($id);
     420                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already-filtered post content; wp_kses_post would strip embeds.
    419421                                                        echo $the_content;
    420422                                                } else {
     423                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already-filtered post content; wp_kses_post would strip embeds.
    421424                                                        echo $the_content;
    422425                                                }
  • google-calendar-events/trunk/includes/updates/update-v300.php

    r3551626 r3805019  
    374374        private function convert_legacy_range($date)
    375375        {
    376                 $date = empty($date) ? date('m/d/Y', time()) : $date;
     376                $date = empty($date) ? gmdate('m/d/Y', time()) : $date;
    377377                $timestamp = Carbon::createFromFormat('m/d/Y', $date)->getTimestamp();
    378                 return date('Y-m-d', $timestamp);
     378                return gmdate('Y-m-d', $timestamp);
    379379        }
    380380}
  • google-calendar-events/trunk/includes/vendor/autoload.php

    r3783403 r3805019  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInit10059a6994cc633857bdbfd53b252461::getLoader();
     22return ComposerAutoloaderInit5f373d91a51b0354e747a5e3eae25c43::getLoader();
  • google-calendar-events/trunk/includes/vendor/composer/autoload_real.php

    r3783403 r3805019  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit10059a6994cc633857bdbfd53b252461
     5class ComposerAutoloaderInit5f373d91a51b0354e747a5e3eae25c43
    66{
    77    private static $loader;
    … …  
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit10059a6994cc633857bdbfd53b252461', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit5f373d91a51b0354e747a5e3eae25c43', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit10059a6994cc633857bdbfd53b252461', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit5f373d91a51b0354e747a5e3eae25c43', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit10059a6994cc633857bdbfd53b252461::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit5f373d91a51b0354e747a5e3eae25c43::getInitializer($loader));
    3131
    3232        $loader->setClassMapAuthoritative(true);
  • google-calendar-events/trunk/includes/vendor/composer/autoload_static.php

    r3783403 r3805019  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit10059a6994cc633857bdbfd53b252461
     7class ComposerStaticInit5f373d91a51b0354e747a5e3eae25c43
    88{
    99    public static $classMap = array (
    … …  
    8989    {
    9090        return \Closure::bind(function () use ($loader) {
    91             $loader->classMap = ComposerStaticInit10059a6994cc633857bdbfd53b252461::$classMap;
     91            $loader->classMap = ComposerStaticInit5f373d91a51b0354e747a5e3eae25c43::$classMap;
    9292
    9393        }, null, ClassLoader::class);
  • google-calendar-events/trunk/includes/widgets/calendar.php

    r3551626 r3805019  
    7373        public function widget($args, $instance)
    7474        {
     75                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML wrappers provided by WordPress/theme.
    7576                echo $args['before_widget'];
    7677
    7778                if (!empty($instance['title'])) {
    78                         echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
     79                        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     80                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- before/after_title from theme; title escaped below.
     81                        echo $args['before_title'] . esc_html($title) . $args['after_title'];
    7982                }
    8083
    … …  
    8487                }
    8588
     89                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML wrappers provided by WordPress/theme.
    8690                echo $args['after_widget'];
    8791        }
    … …  
    132136
    133137                        <p>
    134                                 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'google-calendar-events'); ?></label>
     138                                <label for="<?php echo esc_attr(
     139        $this->get_field_id('title'),
     140    ); ?>"><?php esc_html_e('Title:', 'google-calendar-events'); ?></label>
    135141                                <br>
    136142                                <input type="text"
    137                                        name="<?php echo $this->get_field_name('title'); ?>"
    138                                        id="<?php echo $this->get_field_id('title'); ?>"
     143                                       name="<?php echo esc_attr($this->get_field_name('title')); ?>"
     144                                       id="<?php echo esc_attr($this->get_field_id('title')); ?>"
    139145                                       class="widefat simcal-field simcal-field-standard simcal-field-text"
    140                                        value="<?php echo $title; ?>">
     146                                       value="<?php echo esc_attr($title); ?>">
    141147                        </p>
    142148
    143149                        <p>
    144                                 <label for="<?php echo $this->get_field_id(
    145         'calendar_id',
    146     ); ?>"><?php _e('Calendar:', 'google-calendar-events'); ?></label>
     150                                <label for="<?php echo esc_attr(
     151        $this->get_field_id('calendar_id'),
     152    ); ?>"><?php esc_html_e('Calendar:', 'google-calendar-events'); ?></label>
    147153                                <br>
    148154                                <?php $multiselect = count($this->calendars) > 15 ? ' simcal-field-select-enhanced' : ''; ?>
    149                                 <select name="<?php echo $this->get_field_name('calendar_id'); ?>"
    150                                         id="<?php echo $this->get_field_id('calendar_id'); ?>"
    151                                                 class="simcal-field simcal-field-select<?php echo $multiselect; ?>"
    152                                                 data-noresults="<?php __('No calendars found.', 'google-calendar-events'); ?>">
     155                                <select name="<?php echo esc_attr($this->get_field_name('calendar_id')); ?>"
     156                                        id="<?php echo esc_attr($this->get_field_id('calendar_id')); ?>"
     157                                                class="simcal-field simcal-field-select<?php echo esc_attr($multiselect); ?>"
     158                                                data-noresults="<?php echo esc_attr__('No calendars found.', 'google-calendar-events'); ?>">
    153159                                                <?php foreach ($this->calendars as $id => $name): ?>
    154                                                         <option value="<?php echo $id; ?>" <?php selected($id, $calendar_id, true); ?>><?php echo $name; ?></option>
     160                                                        <option value="<?php echo esc_attr((string) $id); ?>" <?php selected($id, $calendar_id, true); ?>><?php echo esc_html(
     161        $name,
     162); ?></option>
    155163                                                <?php endforeach; ?>
    156164                                </select>
  • google-calendar-events/trunk/includes/wp-requirements.php

    r3551626 r3805019  
    1212 */
    1313
     14if (!defined('ABSPATH')) {
     15        exit();
     16}
     17
    1418if (!class_exists('SimCal_WP_Requirements')) {
    1519        class SimCal_WP_Requirements
    … …  
    9296                public function __construct($name, $plugin, $requirements)
    9397                {
    94                         $this->name = htmlspecialchars(strip_tags($name));
     98                        $this->name = htmlspecialchars(wp_strip_all_tags($name));
    9599                        $this->plugin = $plugin;
    96100                        $this->requirements = $requirements;
    … …  
    189193                                $notice = '<div class="error">' . "\n";
    190194                                $notice .= "\t" . '<p>' . "\n";
    191                                 $notice .= '<strong>' . sprintf('%s could not be activated.', $name) . '</strong><br>';
     195                                $notice .= '<strong>' . esc_html(sprintf('%s could not be activated.', $name)) . '</strong><br>';
    192196
    193197                                foreach ($failures as $requirement => $found) {
    … …  
    196200                                        if ('Extensions' == $requirement) {
    197201                                                if (is_array($found)) {
    198                                                         $notice .= sprintf('Required PHP Extension(s) not found: %s.', join(', ', $found)) . '<br>';
     202                                                        $notice .= esc_html(sprintf('Required PHP Extension(s) not found: %s.', join(', ', $found))) . '<br>';
    199203                                                }
    200204                                        } else {
    201205                                                $notice .=
    202                                                         sprintf('Required %1$s version: %2$s - Version found: %3$s', $requirement, $required, $found) . '<br>';
    203                                         }
    204                                 }
    205 
    206                                 $notice .= '<em>' . sprintf('Please update to meet %s requirements.', $name) . '</em>' . "\n";
     206                                                        esc_html(sprintf('Required %1$s version: %2$s - Version found: %3$s', $requirement, $required, $found)) .
     207                                                        '<br>';
     208                                        }
     209                                }
     210
     211                                $notice .= '<em>' . esc_html(sprintf('Please update to meet %s requirements.', $name)) . '</em>' . "\n";
    207212                                $notice .= "\t" . '</p>' . "\n";
    208213                                if ($message) {
    209                                         $notice .= $message;
     214                                        $notice .= wp_kses_post($message);
    210215                                }
    211216                                $notice .= '</div>';
    … …  
    220225                public function print_notice()
    221226                {
    222                         echo $this->notice;
     227                        echo wp_kses_post($this->notice);
    223228                }
    224229
  • google-calendar-events/trunk/readme.txt

    r3783403 r3805019  
    22Contributors: simplecalendar, rosinghal, pderksen, nickyoung87, nekojira, rosshanney
    33Tags: google calendar, outlook, ical, events, add to calendar
    4 Requires at least: 4.2
     4Requires at least: 5.3
    55Requires PHP: 8.1
    6 Tested up to: 7.0
    7 Stable tag: 4.3.2
     6Tested up to: 7.1
     7Stable tag: 4.3.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    220220
    221221== Changelog ==
     222
     223= 4.3.3 =
     224* Fix: An stored Cross-Site Scripting (XSS) vulnerability.
    222225
    223226= 4.3.2 =
  • google-calendar-events/trunk/third-party/symfony/polyfill-php80/PhpToken.php

    r3433589 r3805019  
    4646    public function getTokenName(): ?string
    4747    {
    48         if ('UNKNOWN' === $name = token_name($this->id)) {
    49             $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
     48        if ($this->id < 256) {
     49            return \chr($this->id & 0xff);
    5050        }
    51         return $name;
     51        return 'UNKNOWN' === ($name = token_name($this->id)) ? null : $name;
    5252    }
    5353    /**
    … …  
    8181        foreach ($tokens as $index => $token) {
    8282            if (\is_string($token)) {
    83                 $id = \ord($token);
     83                // b" is the only such token longer than one char
     84                $id = \ord($token[-1]);
    8485                $text = $token;
    8586            } else {
    … …  
    8889            $tokens[$index] = new static($id, $text, $line, $position);
    8990            $position += \strlen($text);
     91            $line += preg_match_all('/\r\n?|\n/', $text);
    9092        }
    9193        return $tokens;
  • google-calendar-events/trunk/third-party/vendor/autoload.php

    r3783403 r3805019  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInitc2fc2dc8d5563f0e93bfe8b7237df564::getLoader();
     22return ComposerAutoloaderInite4a25b7984e5e1f4f98762527a4da08b::getLoader();
  • google-calendar-events/trunk/third-party/vendor/composer/autoload_classmap.php

    r3783403 r3805019  
    5454    'SimpleCalendar\\plugin_deps\\Carbon\\Laravel\\ServiceProvider' => $baseDir . '/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php',
    5555    'SimpleCalendar\\plugin_deps\\Carbon\\LazyTranslator' => $baseDir . '/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php',
    56     'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\LazyMessageFormatter' => $baseDir . '/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php',
     56    'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\LazyMessageFormatter' => $baseDir . '/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php',
    5757    'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\MessageFormatterMapper' => $baseDir . '/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php',
    5858    'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractMacro' => $baseDir . '/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php',
    59     'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractReflectionMacro' => $baseDir . '/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php',
     59    'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractReflectionMacro' => $baseDir . '/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php',
    6060    'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\LazyMacro' => $baseDir . '/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php',
    6161    'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\Macro' => $baseDir . '/nesbot/carbon/src/Carbon/PHPStan/Macro.php',
  • google-calendar-events/trunk/third-party/vendor/composer/autoload_real.php

    r3783403 r3805019  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc2fc2dc8d5563f0e93bfe8b7237df564
     5class ComposerAutoloaderInite4a25b7984e5e1f4f98762527a4da08b
    66{
    77    private static $loader;
    … …  
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInitc2fc2dc8d5563f0e93bfe8b7237df564', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInite4a25b7984e5e1f4f98762527a4da08b', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInitc2fc2dc8d5563f0e93bfe8b7237df564', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInite4a25b7984e5e1f4f98762527a4da08b', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInitc2fc2dc8d5563f0e93bfe8b7237df564::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInite4a25b7984e5e1f4f98762527a4da08b::getInitializer($loader));
    3131
    3232        $loader->setClassMapAuthoritative(true);
    3333        $loader->register(true);
    3434
    35         $filesToLoad = \Composer\Autoload\ComposerStaticInitc2fc2dc8d5563f0e93bfe8b7237df564::$files;
     35        $filesToLoad = \Composer\Autoload\ComposerStaticInite4a25b7984e5e1f4f98762527a4da08b::$files;
    3636        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3737            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • google-calendar-events/trunk/third-party/vendor/composer/autoload_static.php

    r3783403 r3805019  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc2fc2dc8d5563f0e93bfe8b7237df564
     7class ComposerStaticInite4a25b7984e5e1f4f98762527a4da08b
    88{
    99    public static $files = array (
    … …  
    5959        'SimpleCalendar\\plugin_deps\\Carbon\\Laravel\\ServiceProvider' => __DIR__ . '/../..' . '/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php',
    6060        'SimpleCalendar\\plugin_deps\\Carbon\\LazyTranslator' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php',
    61         'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\LazyMessageFormatter' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php',
     61        'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\LazyMessageFormatter' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php',
    6262        'SimpleCalendar\\plugin_deps\\Carbon\\MessageFormatter\\MessageFormatterMapper' => __DIR__ . '/../..' . '/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php',
    6363        'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractMacro' => __DIR__ . '/../..' . '/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php',
    64         'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractReflectionMacro' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php',
     64        'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\AbstractReflectionMacro' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php',
    6565        'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\LazyMacro' => __DIR__ . '/../..' . '/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php',
    6666        'SimpleCalendar\\plugin_deps\\Carbon\\PHPStan\\Macro' => __DIR__ . '/../..' . '/nesbot/carbon/src/Carbon/PHPStan/Macro.php',
    … …  
    672672    {
    673673        return \Closure::bind(function () use ($loader) {
    674             $loader->classMap = ComposerStaticInitc2fc2dc8d5563f0e93bfe8b7237df564::$classMap;
     674            $loader->classMap = ComposerStaticInite4a25b7984e5e1f4f98762527a4da08b::$classMap;
    675675
    676676        }, null, ClassLoader::class);
Note: See TracChangeset for help on using the changeset viewer.