Plugin Directory

Changeset 3417427


Ignore:
Timestamp:
12/11/2025 01:47:32 PM (2 days ago)
Author:
domainsupport
Message:

Tagging version 2.5.5

Location:
options-for-twenty-seventeen
Files:
1 deleted
4 edited
3 copied

Legend:

Unmodified
Added
Removed
  • options-for-twenty-seventeen/tags/2.5.5/includes/class-ofts-common.php

    r2986658 r3417427  
    11<?php
    22/*
    3  * Version: 1.3.9
     3 * Version: 1.4.1
    44 */
    55
     
    4343        public static function plugin_text_domain() {
    4444
    45             return self::$plugin_text_domain;
     45            return 'options-for-twenty-seventeen';
    4646
    4747        }
     
    6161        public static function support_url() {
    6262
    63             return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/';
     63            return 'https://wordpress.org/support/plugin/' . 'options-for-twenty-seventeen' . '/';
    6464
    6565        }
     
    6767        public static function control_upgrade_text() {
    6868
    69             $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>';
     69/* translators: name of the plugin */
     70            $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name) . '</a>';
    7071
    7172            if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) {
     
    7374                if (!class_exists(self::$plugin_premium_class)) {
    7475
    75                     $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link()));
     76/* translators: link to the premium upgrade */
     77                    $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'options-for-twenty-seventeen'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link()));
    7678
    7779                }
     
    8587        public static function control_section_description() {
    8688
    87             $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url()));
     89/* translators: link to the plugin's support forum */
     90            $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'options-for-twenty-seventeen'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url()));
    8891
    8992            if (self::$plugin_premium_class) {
     
    9598                    if (!class_exists(self::$plugin_premium_class)) {
    9699
    97                         $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;
     100                        $section_description = '<strong>' . __('For even more options', 'options-for-twenty-seventeen') . '</strong>' . ' ' . $upgrade_text;
    98101
    99102                    } else {
    100103
    101                         $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;
     104                        $section_description = '<strong>' . __('To keep using premium options', 'options-for-twenty-seventeen') . '</strong>' . ' ' . $upgrade_text;
    102105
    103106                    }
     
    119122                $section_description .= ' ' . sprintf(
    120123                    wp_kses(
     124/* translators: link to plugin install page */
    121125                        __(
    122126                            '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.',
    123                             self::$plugin_text_domain
     127                            'options-for-twenty-seventeen'
    124128                        ),
    125129                        array('strong' => array(), 'a' => array('href' => array(), 'title' => array()))
     
    145149        public static function control_setting_upgrade_nag() {
    146150
    147             $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);
     151            $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'options-for-twenty-seventeen');
    148152
    149153            return $upgrade_nag;
     
    234238
    235239                $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix);
    236                 echo $generated_css;
     240                echo wp_kses($generated_css, 'strip');
    237241
    238242            } elseif ($mod) {
    239243
    240244                $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix);
    241                 echo $generated_css;
     245                echo wp_kses($generated_css, 'strip');
    242246
    243247            }
     
    249253            if (self::$plugin_premium_class) {
    250254
    251                 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/');
    252 
     255                if (isset($_SERVER['HTTP_HOST'])) {
     256
     257                    return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'options-for-twenty-seventeen' . '-upgrade/');
     258
     259                } else {
     260
     261                    return 'https://webd.uk/product/' . 'options-for-twenty-seventeen' . '-upgrade/';
     262
     263                }
    253264
    254265            } else {
     
    276287            $settings_links = array();
    277288
    278             $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';
     289            $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'options-for-twenty-seventeen')) . '">' . __('Settings', 'options-for-twenty-seventeen') . '</a>';
    279290
    280291            if (!get_option(self::$plugin_prefix . '_purchased')) {
     
    284295                    if (self::$plugin_upgrade) {
    285296
    286                         $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>';
     297/* translators: name of the plugin */
     298                        $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'options-for-twenty-seventeen') . '</a>';
    287299
    288300                    } else {
    289301
    290                         $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>';
     302/* translators: name of the plugin */
     303                        $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'options-for-twenty-seventeen'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'options-for-twenty-seventeen') . '</a>';
    291304
    292305                    }
     
    294307                } else {
    295308
    296                     $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>';
     309/* translators: name of the plugin */
     310                    $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name) : sprintf(__('Contribute to %s', 'options-for-twenty-seventeen'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'options-for-twenty-seventeen') : __('Support Us', 'options-for-twenty-seventeen')) . '</a>';
    297311
    298312                }
     
    300314                if ($premium) {
    301315
    302                     $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(&#39; <img src=&#34;/wp-admin/images/loading.gif&#34; style=&#34;float: none; width: auto; height: auto;&#34; />&#39;); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>';
    303 
    304                 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) {
    305 
    306                     $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>';
     316                    $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'options-for-twenty-seventeen')) . '" onclick="jQuery(this).append(&#39; <img src=&#34;/wp-admin/images/loading.gif&#34; style=&#34;float: none; width: auto; height: auto;&#34; />&#39;); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'options-for-twenty-seventeen') . '</a>';
     317
     318                } elseif (self::$plugin_trial && !is_plugin_active('options-for-twenty-seventeen' . '-premium/' . 'options-for-twenty-seventeen' . '-premium.php')) {
     319
     320/* translators: name of the plugin */
     321                    $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'options-for-twenty-seventeen') . '</a>';
    307322
    308323                }
     
    310325            } elseif ($premium) {
    311326
    312                 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';
     327                $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'options-for-twenty-seventeen') . '</strong>';
    313328
    314329            }
     
    320335        public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) {
    321336
    322             if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') {
    323 
    324                 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>';
    325                 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>';
     337            if ($plugin_file === 'options-for-twenty-seventeen' . '/' . 'options-for-twenty-seventeen' . '.php') {
     338
     339                $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'options-for-twenty-seventeen') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'options-for-twenty-seventeen') . '</a>';
     340/* translators: name of the plugin */
     341                $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'options-for-twenty-seventeen' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'options-for-twenty-seventeen'), self::$plugin_name)) . '">' . __('Review plugin', 'options-for-twenty-seventeen') . '</a>';
    326342
    327343            }
     
    357373?>
    358374
    359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    360 
    361 <p><strong><?php echo self::$plugin_name; ?></strong><br />
    362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p>
    363 
    364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p>
     375<div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice">
     376
     377<p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br />
     378<?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'options-for-twenty-seventeen'); ?></p>
     379
     380<p><a href="<?php
     381/* translators: name of the plugin */
     382echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></a></p>
    365383
    366384</div>
    367385
    368386<script type="text/javascript">
    369     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     387    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    370388        jQuery.ajax({
    371389            url: ajaxurl,
    372390            data: {
    373                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    374                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     391                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     392                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    375393            }
    376394        });
     
    380398<?php
    381399
    382                 } elseif (!class_exists(self::$plugin_premium_class) && time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) {
    383 
    384 ?>
    385 
    386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    387 
    388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br />
     400                } elseif (
     401                    !class_exists(self::$plugin_premium_class) &&
     402                    time() > (strtotime('+1 hour', filectime(__DIR__))) &&
     403                    get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()
     404                ) {
     405
     406?>
     407
     408<div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice">
     409
     410    <p style="font-size:15px;"><strong><?php
     411/* translators: name of the plugin */
     412printf(esc_html(__('Thank you for using %s plugin', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></strong></p>
    389413<?php
    390414
    391415                    if (self::$plugin_trial == true) {
    392416
    393                         _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);
     417?>
     418
     419    <p><?php echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'options-for-twenty-seventeen')); ?></p>
     420<?php
    394421
    395422                    } else {
    396423
    397                         echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name);
     424?>
     425
     426    <p>
     427        <?php
     428/* translators: name of the plugin */
     429                        echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>
     430    </p>
     431<?php
    398432
    399433                    }
    400434
    401 ?></p>
    402 
    403 <p><?php
     435?>
     436
     437    <p><?php
    404438
    405439                    if (self::$plugin_trial == true) {
     
    407441?>
    408442
    409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a>
    410 
     443        <a href="<?php echo esc_url(self::premium_link()); ?>"
     444           title="<?php
     445/* translators: name of the plugin */
     446echo esc_attr(sprintf(__('Try %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>"
     447           class="button-secondary">
     448           <?php echo esc_html(__('Try premium plugin free for 7 days', 'options-for-twenty-seventeen')); ?>
     449        </a>
    411450<?php
    412451
     
    414453
    415454?>
    416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p>
     455
     456        <a href="<?php echo esc_url(self::upgrade_link()); ?>"
     457           title="<?php
     458/* translators: name of the plugin */
     459echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>"
     460           class="button-primary">
     461           <?php echo esc_html(__('Upgrade now to premium plugin', 'options-for-twenty-seventeen')); ?>
     462        </a>
     463
     464    </p>
     465
     466    <hr style="margin:12px 0;">
     467
     468    <p>
     469        <strong>✨ Need help with your WordPress site?</strong>
     470        🚀 Slow, want new features, or need a glow-up?
     471        <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=options-for-twenty-seventeen" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a>
     472    </p>
    417473
    418474</div>
    419475
    420476<script type="text/javascript">
    421     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     477    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    422478        jQuery.ajax({
    423479            url: ajaxurl,
    424480            data: {
    425                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    426                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     481                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     482                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    427483            }
    428484        });
     
    434490                }
    435491
    436             } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) {
    437 
    438 ?>
    439 
    440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p>
    442 <?php
    443 
     492            } elseif (
     493                time() > (strtotime('+1 hour', filectime(__DIR__))) &&
     494                get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() &&
     495                !get_option(self::$plugin_prefix . '_donated')
     496            ) {
     497
     498?>
     499
     500<div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice">
     501<p><strong><?php
     502/* translators: name of the plugin */
     503printf(esc_html(__('Thank you for using %s plugin', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></strong></p>
     504<?php
     505
     506// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
    444507                do_action(self::$plugin_prefix . '_admin_notice_donate');
    445508
    446509?>
    447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p>
    448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p>
     510<p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'options-for-twenty-seventeen'); ?></p>
     511<p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php
     512/* translators: name of the plugin */
     513echo esc_attr(sprintf(__('Contribute to %s', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'options-for-twenty-seventeen')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'options-for-twenty-seventeen'); ?></a></p>
    449514</div>
    450515
    451516<script type="text/javascript">
    452     jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {
    453         if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {
    454             alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);
    455             jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {
    456                 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {
    457                     jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()
     517    jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() {
     518        if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'options-for-twenty-seventeen')); ?>)) {
     519            alert(<?php echo json_encode(__('Thank you!', 'options-for-twenty-seventeen')); ?>);
     520            jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() {
     521                jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() {
     522                    jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove()
    458523                });
    459524            });
     
    461526                url: ajaxurl,
    462527                data: {
    463                     action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
     528                    action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
    464529                    donated: 'true',
    465                     _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     530                    _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    466531                }
    467532            });
    468533        } else {
    469             window.location.assign('<?php echo self::upgrade_link(); ?>');
     534            window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>');
    470535        }
    471536    });
    472     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     537    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    473538        jQuery.ajax({
    474539            url: ajaxurl,
    475540            data: {
    476                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    477                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     541                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     542                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    478543            }
    479544        });
     
    509574                    is_admin() &&
    510575                    $pagenow === 'customize.php' &&
    511                     isset($_GET['theme']) &&
    512                     !in_array($_GET['theme'], $themes, true)
     576                    isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     577                    !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    513578                ) && !(
    514579                    !is_admin() &&
    515580                    $pagenow === 'index.php' &&
    516                     isset($_GET['customize_theme']) &&
    517                     isset($_GET['customize_changeset_uuid']) &&
    518                     !in_array($_GET['customize_theme'], $themes, true)
     581                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     582                    isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     583                    !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    519584                )
    520585            ) {
     
    530595                    is_admin() &&
    531596                    $pagenow === 'customize.php' &&
    532                     isset($_GET['theme']) &&
    533                     in_array($_GET['theme'], $themes, true)
     597                    isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     598                    in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    534599                ) || (
    535600                    !is_admin() &&
    536601                    $pagenow === 'index.php' &&
    537                     isset($_GET['customize_theme']) &&
    538                     isset($_GET['customize_changeset_uuid']) &&
    539                     in_array($_GET['customize_theme'], $themes, true)
     602                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     603                    isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     604                    in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    540605                ))
    541606            ) {
     
    549614                    !is_admin() &&
    550615                    $pagenow === 'index.php' &&
    551                     isset($_GET['customize_theme']) &&
    552                     isset($_GET['customize_changeset_uuid'])
     616                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     617                    isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    553618               
    554619            ) {
    555620
    556                 $child = wp_get_theme($_GET['customize_theme']);
     621                $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    557622
    558623                if (isset($child->template) && in_array($child->template, $themes, true)) {
     
    568633                is_admin() &&
    569634                ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') &&
    570                 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid']))
     635                (
     636                    isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     637                    (
     638                        isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing
     639                        isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing
     640                    )
     641                )
    571642            ) {
    572643
    573                 if (isset($_GET['theme'])) {
    574 
    575                     $child = wp_get_theme($_GET['theme']);
     644                if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     645
     646                    $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    576647
    577648                } else {
    578649
    579                     $child = wp_get_theme($_POST['customize_theme']);
     650                    $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing
    580651
    581652                }
     
    622693
    623694?>
    624 <span class="description customize-control-description"><?php echo $this->description; ?></span>
     695<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
    625696<?php
    626697
     
    647718?>
    648719        </ul>
    649         <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />
     720        <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />
    650721<?php
    651722
  • options-for-twenty-seventeen/tags/2.5.5/options-for-twenty-seventeen.php

    r3180351 r3417427  
    22/*
    33 * Plugin Name: Options for Twenty Seventeen
    4  * Version: 2.5.4
     4 * Version: 2.5.5
    55 * Plugin URI: https://webd.uk/product/options-for-twenty-seventeen-upgrade/
    66 * Description: Adds powerful customizer options to modify all aspects of the default WordPress theme Twenty Seventeen
    77 * Author: Webd Ltd
    88 * Author URI: https://webd.uk
     9 * License: GPLv2 or later
     10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    911 * Text Domain: options-for-twenty-seventeen
    1012 */
     
    2224    class options_for_twenty_seventeen_class {
    2325
    24         public static $version = '2.5.4';
     26        public static $version = '2.5.5';
    2527
    2628        function __construct() {
     
    6466
    6567            $wp_customize->add_section('theme_options', array(
    66                 'title'     => __('Theme Options', 'twentyseventeen'),
     68                'title'     => __('Theme Options', 'options-for-twenty-seventeen'),
    6769                'description'  => __('Use these options to customise the page layout and static front page sections.', 'options-for-twenty-seventeen') . ' ' . $section_description
    6870            ));
    6971
    7072            $wp_customize->add_control('page_layout', array(
    71                'label'           => __( 'Page Layout', 'twentyseventeen' ),
     73               'label'           => __( 'Page Layout', 'options-for-twenty-seventeen' ),
    7274               'section'         => 'theme_options',
    7375                'type'            => 'radio',
    74                 'description'     => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ),
     76                'description'     => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'options-for-twenty-seventeen' ),
    7577                'choices'         => array(
    76                     'one-column' => __( 'One Column', 'twentyseventeen' ),
    77                     'two-column' => __( 'Two Column', 'twentyseventeen' ),
     78                    'one-column' => __( 'One Column', 'options-for-twenty-seventeen' ),
     79                    'two-column' => __( 'Two Column', 'options-for-twenty-seventeen' ),
    7880                ),
    7981                'priority'   => 1
     
    16221624
    16231625            $control_label = __('Search / Archive Page Layout', 'options-for-twenty-seventeen');
    1624             $control_description = __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' );
     1626            $control_description = __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'options-for-twenty-seventeen' );
    16251627            oftsCommon::add_hidden_control($wp_customize, 'search_archive_page_layout', 'theme_options', $control_label, $control_description . ' ' . $upgrade_nag, 5);
    16261628
     
    17221724
    17231725            $control_label = __('Slider Cover', 'options-for-twenty-seventeen');
     1726/* translators: link to plugin installer */
    17241727            $control_description = sprintf(wp_kses(__('Replaces the cover image with a <a href="%s">Nivo</a>, Sliderspack or MetaSlider Slider. Remember to set "Image Size" to "Twenty-Seventeen-featured-image" in your slider settings for best results.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(admin_url('plugin-install.php?s=nivo-slider-lite&tab=search&type=term')));
    17251728            oftsCommon::add_hidden_control($wp_customize, 'nivo_slider_cover', 'ofts_header', $control_label, $control_description . ' ' . $upgrade_nag);
     
    17941797
    17951798            $control_label = __('Implement Yoast SEO Breadcrumbs', 'options-for-twenty-seventeen');
     1799/* translators: link to plugin installer */
    17961800            $control_description = sprintf(wp_kses(__('Inject <a href="%s">Yoast SEO</a> breadcrumbs above and / or below single post and page content.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(admin_url('plugin-install.php?s=wordpress-seo&tab=search&type=term')));
    17971801            oftsCommon::add_hidden_control($wp_customize, 'implement_yoast_breadcrumbs', 'ofts_content', $control_label, $control_description . ' ' . $upgrade_nag);
     
    18631867                ));
    18641868
     1869/* translators: link to plugin installer */
    18651870                oftsCommon::add_hidden_control($wp_customize, 'install_sidemenu', 'sidemenu', 'Install SideMenu', sprintf(wp_kses(__('Add a slide-in side menu and widget area to the site by <a href="%s">installing SideMenu plugin</a>.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(add_query_arg(array('s' => 'sidemenu+injects', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php')))));
    18661871
     
    20422047?>
    20432048#page {
    2044     <?php echo $mod; ?>
     2049    <?php echo wp_kses($mod, 'strip'); ?>
    20452050}
    20462051<?php
     
    22812286?>
    22822287.site-title {
    2283     font-size: <?php echo $mod / 3000 * 2; ?>rem;
     2288    font-size: <?php echo wp_kses($mod / 6000, 'strip'); ?>rem;
    22842289}
    22852290@media screen and (min-width: 48em) {
    22862291    .site-title {
    2287         font-size: <?php echo $mod / 1000; ?>rem;
     2292        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    22882293    }
    22892294}
     
    23022307?>
    23032308.site-description {
    2304     font-size: <?php echo $mod * 0.0008125; ?>rem;
     2309    font-size: <?php echo wp_kses($mod * 0.0008125, 'strip'); ?>rem;
    23052310}
    23062311@media screen and (min-width: 48em) {
    23072312    .site-description {
    2308         font-size: <?php echo $mod / 1000; ?>rem;
     2313        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    23092314    }
    23102315}
     
    23232328@media screen and (min-width: 48em) {
    23242329.twentyseventeen-front-page.has-header-image .custom-header-media:before, .twentyseventeen-front-page.has-header-video .custom-header-media:before, .home.blog.has-header-image .custom-header-media:before, .home.blog.has-header-video .custom-header-media:before {
    2325 height: <?php echo $mod; ?>%;
     2330height: <?php echo wp_kses($mod, 'strip'); ?>%;
    23262331}
    23272332}
     
    23442349?>
    23452350.custom-header-media:before {
    2346 background: linear-gradient(to bottom, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, 0) 0%, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, <?php echo $gradient_opacity; ?>) 75%, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, <?php echo $gradient_opacity; ?>) 100%);
     2351background: linear-gradient(to bottom, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, 0) 0%, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, <?php echo wp_kses($gradient_opacity, 'strip'); ?>) 75%, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, <?php echo wp_kses($gradient_opacity, 'strip'); ?>) 100%);
    23472352}
    23482353<?php
     
    23822387@media screen and (min-width: 48em) {
    23832388    .site-navigation-fixed.navigation-top {
    2384         width: <?php echo get_theme_mod('nav_bar_width'); ?>;
     2389        width: <?php echo wp_kses(get_theme_mod('nav_bar_width'), 'strip'); ?>;
    23852390        left: 50%;
    23862391        transform: translate(-50%, 0);
     
    24062411}
    24072412.navigation-top, .colors-dark .navigation-top, .colors-custom .navigation-top {
    2408 background-image: url("<?php echo $mod; ?>");
     2413background-image: url("<?php echo wp_kses($mod, 'strip'); ?>");
    24092414}
    24102415.navigation-top {
     
    24562461?>
    24572462.navigation-top {
    2458     font-size: <?php echo ($mod + 125) / 1000; ?>rem;
     2463    font-size: <?php echo wp_kses(($mod + 125) / 1000, 'strip'); ?>rem;
    24592464}
    24602465@media screen and (min-width: 48em) {
    24612466    .navigation-top {
    2462         font-size: <?php echo $mod / 1000; ?>rem;
     2467        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    24632468    }
    24642469}
     
    24762481@media screen and (min-width: 48em) {
    24772482    .main-navigation a {
    2478         padding-top: <?php echo $mod - 1; ?>px;
    2479         padding-bottom: <?php echo $mod - 1; ?>px;
     2483        padding-top: <?php echo wp_kses($mod - 1, 'strip'); ?>px;
     2484        padding-bottom: <?php echo wp_kses($mod - 1, 'strip'); ?>px;
    24802485    }
    24812486}
     
    25022507    .colors-dark .main-navigation li:hover, .colors-dark .main-navigation li.focus, .colors-dark .main-navigation li li:hover, .colors-dark .main-navigation li li.focus,
    25032508    .colors-custom .main-navigation li:hover, .colors-custom .main-navigation li.focus, .colors-custom .main-navigation li li:hover, .colors-custom .main-navigation li li.focus {
    2504         background-color: <?php echo $mod; ?>;
     2509        background-color: <?php echo wp_kses($mod, 'strip'); ?>;
    25052510    }
    25062511}
     
    25182523@media screen and (min-width: 48em) {
    25192524    .main-navigation ul ul, .colors-dark .main-navigation ul ul, .colors-custom .main-navigation ul ul {
    2520         background-color: <?php echo $background_color; ?>;
     2525        background-color: <?php echo wp_kses($background_color, 'strip'); ?>;
    25212526        border: none;
    25222527    }
     
    25602565?>
    25612566.navigation-top {
    2562     background-color: rgba(255, 255, 255, <?php echo $background_opacity; ?>);
    2563     border-top-color: rgba(238, 238, 238, <?php echo $background_opacity; ?>);
    2564     border-bottom-color: rgba(238, 238, 238, <?php echo $background_opacity; ?>);
     2567    background-color: rgba(255, 255, 255, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2568    border-top-color: rgba(238, 238, 238, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2569    border-bottom-color: rgba(238, 238, 238, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25652570}
    25662571.colors-dark .navigation-top, .colors-custom .navigation-top {
    2567     background-color: rgba(34, 34, 34, <?php echo $background_opacity; ?>);
    2568     border-top-color: rgba(51, 51, 51, <?php echo $background_opacity; ?>);
    2569     border-bottom-color: rgba(51, 51, 51, <?php echo $background_opacity; ?>);
     2572    background-color: rgba(34, 34, 34, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2573    border-top-color: rgba(51, 51, 51, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2574    border-bottom-color: rgba(51, 51, 51, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25702575}
    25712576<?php
     
    25802585?>
    25812586.colors-custom .navigation-top {
    2582     background-color: background: hsla(' . $hue . ', ' . $saturation . ', 100%, <?php echo $background_opacity; ?>);
    2583     border-top-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo $background_opacity; ?>);
    2584     border-bottom-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo $background_opacity; ?>);
     2587    background-color: background: hsla(' . $hue . ', ' . $saturation . ', 100%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2588    border-top-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2589    border-bottom-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25852590}
    25862591<?php
     
    25982603@media screen and (min-width: 48em) {
    25992604    .main-navigation ul ul, .colors-dark .main-navigation ul ul, .colors-custom .main-navigation ul ul {
    2600         background-color: <?php echo $mod; ?>;
     2605        background-color: <?php echo wp_kses($mod, 'strip'); ?>;
    26012606        border: none;
    26022607    }
     
    26582663@media screen and (min-width: 30em) {
    26592664    .page-one-column .panel-content .wrap {
    2660         max-width: <?php echo $mod; ?>;
     2665        max-width: <?php echo wp_kses($mod, 'strip'); ?>;
    26612666    }
    26622667}
     
    27072712@media screen and (min-width: 48em) {
    27082713    .site-content, .panel-content .wrap {
    2709         padding-top: <?php echo (($mod / 2) - 0.5); ?>em;
     2714        padding-top: <?php echo wp_kses((($mod / 2) - 0.5), 'strip'); ?>em;
    27102715    }
    27112716}
     
    27622767@media screen and (min-width: 48em) {
    27632768    .page.page-one-column .entry-header, .twentyseventeen-front-page.page-one-column .entry-header, .archive.page-one-column:not(.has-sidebar) .page-header {
    2764         margin-bottom: <?php echo (($mod / 2) - 0.5); ?>em;
     2769        margin-bottom: <?php echo wp_kses((($mod / 2) - 0.5), 'strip'); ?>em;
    27652770    }
    27662771}
     
    30193024                        'url'           => plugin_dir_url(__FILE__) . 'images/header.jpg',
    30203025                        'thumbnail_url' => plugin_dir_url(__FILE__) . 'images/header.jpg',
    3021                         'description'   => __( 'Default Header Image', 'twentyseventeen' ),
     3026                        'description'   => __( 'Default Header Image', 'options-for-twenty-seventeen' ),
    30223027                    ),
    30233028                )
     
    32033208    if (oftsCommon::is_theme_being_used('twentyseventeen')) {
    32043209
     3210// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    32053211        $options_for_twenty_seventeen_object = new options_for_twenty_seventeen_class();
    32063212
     
    32093215        if (is_admin()) {
    32103216
    3211             $themes = wp_get_themes();
    3212 
    3213             if (!isset($themes['twentyseventeen'])) {
     3217// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
     3218            $options_for_twenty_seventeen_themes = wp_get_themes();
     3219
     3220            if (!isset($options_for_twenty_seventeen_themes['twentyseventeen'])) {
    32143221
    32153222                add_action('admin_notices', 'ofts_wrong_theme_notice');
     
    32213228    }
    32223229
     3230// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
    32233231    function ofts_wrong_theme_notice() {
    32243232
     
    32303238<?php
    32313239        printf(
    3232             __('This plugin requires the default WordPress theme Twenty Seventeen to be active or live previewed in order to function. Your theme "%s" is not compatible.', 'options-for-twenty-seventeen'),
    3233             get_template()
     3240/* translators: theme slug */
     3241            esc_html(__('This plugin requires the default WordPress theme Twenty Seventeen to be active or live previewed in order to function. Your theme "%s" is not compatible.', 'options-for-twenty-seventeen')),
     3242            esc_html(get_template())
    32343243        );
    32353244?>
    32363245
    3237 <a href="<?php echo add_query_arg('search', 'twentyseventeen', admin_url('theme-install.php')); ?>" title="<?php esc_attr_e('Twenty Seventeen', 'options-for-twenty-seventeen'); ?>"><?php
     3246<a href="<?php echo esc_url(add_query_arg('search', 'twentyseventeen', admin_url('theme-install.php'))); ?>" title="<?php esc_attr_e('Twenty Seventeen', 'options-for-twenty-seventeen'); ?>"><?php
    32383247        esc_html_e('Please install and activate or live preview the Twenty Seventeen theme (or a child theme thereof)', 'options-for-twenty-seventeen');
    32393248?></a>.</p>
  • options-for-twenty-seventeen/tags/2.5.5/readme.txt

    r3412270 r3417427  
    66Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 2.5.4
     8Stable tag: 2.5.5
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    181181== Changelog ==
    182182
     183= 2.5.5 =
     184* General housekeeping preparing for "Plugin Check" code review
     185
    183186= 2.5.4 =
    184187* Remove Customizer CSS due to incompatible change introduced in WordPress v6.7
     
    718721== Upgrade Notice ==
    719722
    720 = 2.5.4 =
    721 * Remove Customizer CSS due to incompatible change introduced in WordPress v6.7
     723= 2.5.5 =
     724* General housekeeping preparing for "Plugin Check" code review
  • options-for-twenty-seventeen/trunk/includes/class-ofts-common.php

    r2986658 r3417427  
    11<?php
    22/*
    3  * Version: 1.3.9
     3 * Version: 1.4.1
    44 */
    55
     
    4343        public static function plugin_text_domain() {
    4444
    45             return self::$plugin_text_domain;
     45            return 'options-for-twenty-seventeen';
    4646
    4747        }
     
    6161        public static function support_url() {
    6262
    63             return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/';
     63            return 'https://wordpress.org/support/plugin/' . 'options-for-twenty-seventeen' . '/';
    6464
    6565        }
     
    6767        public static function control_upgrade_text() {
    6868
    69             $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>';
     69/* translators: name of the plugin */
     70            $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name) . '</a>';
    7071
    7172            if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) {
     
    7374                if (!class_exists(self::$plugin_premium_class)) {
    7475
    75                     $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link()));
     76/* translators: link to the premium upgrade */
     77                    $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'options-for-twenty-seventeen'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link()));
    7678
    7779                }
     
    8587        public static function control_section_description() {
    8688
    87             $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url()));
     89/* translators: link to the plugin's support forum */
     90            $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'options-for-twenty-seventeen'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url()));
    8891
    8992            if (self::$plugin_premium_class) {
     
    9598                    if (!class_exists(self::$plugin_premium_class)) {
    9699
    97                         $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;
     100                        $section_description = '<strong>' . __('For even more options', 'options-for-twenty-seventeen') . '</strong>' . ' ' . $upgrade_text;
    98101
    99102                    } else {
    100103
    101                         $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;
     104                        $section_description = '<strong>' . __('To keep using premium options', 'options-for-twenty-seventeen') . '</strong>' . ' ' . $upgrade_text;
    102105
    103106                    }
     
    119122                $section_description .= ' ' . sprintf(
    120123                    wp_kses(
     124/* translators: link to plugin install page */
    121125                        __(
    122126                            '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.',
    123                             self::$plugin_text_domain
     127                            'options-for-twenty-seventeen'
    124128                        ),
    125129                        array('strong' => array(), 'a' => array('href' => array(), 'title' => array()))
     
    145149        public static function control_setting_upgrade_nag() {
    146150
    147             $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);
     151            $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'options-for-twenty-seventeen');
    148152
    149153            return $upgrade_nag;
     
    234238
    235239                $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix);
    236                 echo $generated_css;
     240                echo wp_kses($generated_css, 'strip');
    237241
    238242            } elseif ($mod) {
    239243
    240244                $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix);
    241                 echo $generated_css;
     245                echo wp_kses($generated_css, 'strip');
    242246
    243247            }
     
    249253            if (self::$plugin_premium_class) {
    250254
    251                 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/');
    252 
     255                if (isset($_SERVER['HTTP_HOST'])) {
     256
     257                    return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'options-for-twenty-seventeen' . '-upgrade/');
     258
     259                } else {
     260
     261                    return 'https://webd.uk/product/' . 'options-for-twenty-seventeen' . '-upgrade/';
     262
     263                }
    253264
    254265            } else {
     
    276287            $settings_links = array();
    277288
    278             $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';
     289            $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'options-for-twenty-seventeen')) . '">' . __('Settings', 'options-for-twenty-seventeen') . '</a>';
    279290
    280291            if (!get_option(self::$plugin_prefix . '_purchased')) {
     
    284295                    if (self::$plugin_upgrade) {
    285296
    286                         $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>';
     297/* translators: name of the plugin */
     298                        $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'options-for-twenty-seventeen') . '</a>';
    287299
    288300                    } else {
    289301
    290                         $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>';
     302/* translators: name of the plugin */
     303                        $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'options-for-twenty-seventeen'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'options-for-twenty-seventeen') . '</a>';
    291304
    292305                    }
     
    294307                } else {
    295308
    296                     $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>';
     309/* translators: name of the plugin */
     310                    $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name) : sprintf(__('Contribute to %s', 'options-for-twenty-seventeen'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'options-for-twenty-seventeen') : __('Support Us', 'options-for-twenty-seventeen')) . '</a>';
    297311
    298312                }
     
    300314                if ($premium) {
    301315
    302                     $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(&#39; <img src=&#34;/wp-admin/images/loading.gif&#34; style=&#34;float: none; width: auto; height: auto;&#34; />&#39;); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>';
    303 
    304                 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) {
    305 
    306                     $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>';
     316                    $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'options-for-twenty-seventeen')) . '" onclick="jQuery(this).append(&#39; <img src=&#34;/wp-admin/images/loading.gif&#34; style=&#34;float: none; width: auto; height: auto;&#34; />&#39;); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'options-for-twenty-seventeen') . '</a>';
     317
     318                } elseif (self::$plugin_trial && !is_plugin_active('options-for-twenty-seventeen' . '-premium/' . 'options-for-twenty-seventeen' . '-premium.php')) {
     319
     320/* translators: name of the plugin */
     321                    $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'options-for-twenty-seventeen') . '</a>';
    307322
    308323                }
     
    310325            } elseif ($premium) {
    311326
    312                 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';
     327                $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'options-for-twenty-seventeen') . '</strong>';
    313328
    314329            }
     
    320335        public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) {
    321336
    322             if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') {
    323 
    324                 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>';
    325                 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>';
     337            if ($plugin_file === 'options-for-twenty-seventeen' . '/' . 'options-for-twenty-seventeen' . '.php') {
     338
     339                $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'options-for-twenty-seventeen') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'options-for-twenty-seventeen') . '</a>';
     340/* translators: name of the plugin */
     341                $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'options-for-twenty-seventeen' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'options-for-twenty-seventeen'), self::$plugin_name)) . '">' . __('Review plugin', 'options-for-twenty-seventeen') . '</a>';
    326342
    327343            }
     
    357373?>
    358374
    359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    360 
    361 <p><strong><?php echo self::$plugin_name; ?></strong><br />
    362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p>
    363 
    364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p>
     375<div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice">
     376
     377<p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br />
     378<?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'options-for-twenty-seventeen'); ?></p>
     379
     380<p><a href="<?php
     381/* translators: name of the plugin */
     382echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></a></p>
    365383
    366384</div>
    367385
    368386<script type="text/javascript">
    369     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     387    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    370388        jQuery.ajax({
    371389            url: ajaxurl,
    372390            data: {
    373                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    374                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     391                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     392                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    375393            }
    376394        });
     
    380398<?php
    381399
    382                 } elseif (!class_exists(self::$plugin_premium_class) && time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) {
    383 
    384 ?>
    385 
    386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    387 
    388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br />
     400                } elseif (
     401                    !class_exists(self::$plugin_premium_class) &&
     402                    time() > (strtotime('+1 hour', filectime(__DIR__))) &&
     403                    get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()
     404                ) {
     405
     406?>
     407
     408<div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice">
     409
     410    <p style="font-size:15px;"><strong><?php
     411/* translators: name of the plugin */
     412printf(esc_html(__('Thank you for using %s plugin', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></strong></p>
    389413<?php
    390414
    391415                    if (self::$plugin_trial == true) {
    392416
    393                         _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);
     417?>
     418
     419    <p><?php echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'options-for-twenty-seventeen')); ?></p>
     420<?php
    394421
    395422                    } else {
    396423
    397                         echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name);
     424?>
     425
     426    <p>
     427        <?php
     428/* translators: name of the plugin */
     429                        echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>
     430    </p>
     431<?php
    398432
    399433                    }
    400434
    401 ?></p>
    402 
    403 <p><?php
     435?>
     436
     437    <p><?php
    404438
    405439                    if (self::$plugin_trial == true) {
     
    407441?>
    408442
    409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a>
    410 
     443        <a href="<?php echo esc_url(self::premium_link()); ?>"
     444           title="<?php
     445/* translators: name of the plugin */
     446echo esc_attr(sprintf(__('Try %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>"
     447           class="button-secondary">
     448           <?php echo esc_html(__('Try premium plugin free for 7 days', 'options-for-twenty-seventeen')); ?>
     449        </a>
    411450<?php
    412451
     
    414453
    415454?>
    416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p>
     455
     456        <a href="<?php echo esc_url(self::upgrade_link()); ?>"
     457           title="<?php
     458/* translators: name of the plugin */
     459echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>"
     460           class="button-primary">
     461           <?php echo esc_html(__('Upgrade now to premium plugin', 'options-for-twenty-seventeen')); ?>
     462        </a>
     463
     464    </p>
     465
     466    <hr style="margin:12px 0;">
     467
     468    <p>
     469        <strong>✨ Need help with your WordPress site?</strong>
     470        🚀 Slow, want new features, or need a glow-up?
     471        <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=options-for-twenty-seventeen" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a>
     472    </p>
    417473
    418474</div>
    419475
    420476<script type="text/javascript">
    421     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     477    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    422478        jQuery.ajax({
    423479            url: ajaxurl,
    424480            data: {
    425                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    426                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     481                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     482                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    427483            }
    428484        });
     
    434490                }
    435491
    436             } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) {
    437 
    438 ?>
    439 
    440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice">
    441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p>
    442 <?php
    443 
     492            } elseif (
     493                time() > (strtotime('+1 hour', filectime(__DIR__))) &&
     494                get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() &&
     495                !get_option(self::$plugin_prefix . '_donated')
     496            ) {
     497
     498?>
     499
     500<div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice">
     501<p><strong><?php
     502/* translators: name of the plugin */
     503printf(esc_html(__('Thank you for using %s plugin', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></strong></p>
     504<?php
     505
     506// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
    444507                do_action(self::$plugin_prefix . '_admin_notice_donate');
    445508
    446509?>
    447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p>
    448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p>
     510<p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'options-for-twenty-seventeen'); ?></p>
     511<p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php
     512/* translators: name of the plugin */
     513echo esc_attr(sprintf(__('Contribute to %s', 'options-for-twenty-seventeen'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'options-for-twenty-seventeen')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'options-for-twenty-seventeen')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'options-for-twenty-seventeen'); ?></a></p>
    449514</div>
    450515
    451516<script type="text/javascript">
    452     jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {
    453         if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {
    454             alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);
    455             jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {
    456                 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {
    457                     jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()
     517    jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() {
     518        if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'options-for-twenty-seventeen')); ?>)) {
     519            alert(<?php echo json_encode(__('Thank you!', 'options-for-twenty-seventeen')); ?>);
     520            jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() {
     521                jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() {
     522                    jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove()
    458523                });
    459524            });
     
    461526                url: ajaxurl,
    462527                data: {
    463                     action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
     528                    action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
    464529                    donated: 'true',
    465                     _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     530                    _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    466531                }
    467532            });
    468533        } else {
    469             window.location.assign('<?php echo self::upgrade_link(); ?>');
     534            window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>');
    470535        }
    471536    });
    472     jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {
     537    jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() {
    473538        jQuery.ajax({
    474539            url: ajaxurl,
    475540            data: {
    476                 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',
    477                 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'
     541                action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler',
     542                _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>'
    478543            }
    479544        });
     
    509574                    is_admin() &&
    510575                    $pagenow === 'customize.php' &&
    511                     isset($_GET['theme']) &&
    512                     !in_array($_GET['theme'], $themes, true)
     576                    isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     577                    !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    513578                ) && !(
    514579                    !is_admin() &&
    515580                    $pagenow === 'index.php' &&
    516                     isset($_GET['customize_theme']) &&
    517                     isset($_GET['customize_changeset_uuid']) &&
    518                     !in_array($_GET['customize_theme'], $themes, true)
     581                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     582                    isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     583                    !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    519584                )
    520585            ) {
     
    530595                    is_admin() &&
    531596                    $pagenow === 'customize.php' &&
    532                     isset($_GET['theme']) &&
    533                     in_array($_GET['theme'], $themes, true)
     597                    isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     598                    in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    534599                ) || (
    535600                    !is_admin() &&
    536601                    $pagenow === 'index.php' &&
    537                     isset($_GET['customize_theme']) &&
    538                     isset($_GET['customize_changeset_uuid']) &&
    539                     in_array($_GET['customize_theme'], $themes, true)
     602                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     603                    isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     604                    in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    540605                ))
    541606            ) {
     
    549614                    !is_admin() &&
    550615                    $pagenow === 'index.php' &&
    551                     isset($_GET['customize_theme']) &&
    552                     isset($_GET['customize_changeset_uuid'])
     616                    isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     617                    isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    553618               
    554619            ) {
    555620
    556                 $child = wp_get_theme($_GET['customize_theme']);
     621                $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    557622
    558623                if (isset($child->template) && in_array($child->template, $themes, true)) {
     
    568633                is_admin() &&
    569634                ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') &&
    570                 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid']))
     635                (
     636                    isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     637                    (
     638                        isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing
     639                        isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing
     640                    )
     641                )
    571642            ) {
    572643
    573                 if (isset($_GET['theme'])) {
    574 
    575                     $child = wp_get_theme($_GET['theme']);
     644                if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     645
     646                    $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    576647
    577648                } else {
    578649
    579                     $child = wp_get_theme($_POST['customize_theme']);
     650                    $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing
    580651
    581652                }
     
    622693
    623694?>
    624 <span class="description customize-control-description"><?php echo $this->description; ?></span>
     695<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
    625696<?php
    626697
     
    647718?>
    648719        </ul>
    649         <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />
     720        <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />
    650721<?php
    651722
  • options-for-twenty-seventeen/trunk/options-for-twenty-seventeen.php

    r3180351 r3417427  
    22/*
    33 * Plugin Name: Options for Twenty Seventeen
    4  * Version: 2.5.4
     4 * Version: 2.5.5
    55 * Plugin URI: https://webd.uk/product/options-for-twenty-seventeen-upgrade/
    66 * Description: Adds powerful customizer options to modify all aspects of the default WordPress theme Twenty Seventeen
    77 * Author: Webd Ltd
    88 * Author URI: https://webd.uk
     9 * License: GPLv2 or later
     10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    911 * Text Domain: options-for-twenty-seventeen
    1012 */
     
    2224    class options_for_twenty_seventeen_class {
    2325
    24         public static $version = '2.5.4';
     26        public static $version = '2.5.5';
    2527
    2628        function __construct() {
     
    6466
    6567            $wp_customize->add_section('theme_options', array(
    66                 'title'     => __('Theme Options', 'twentyseventeen'),
     68                'title'     => __('Theme Options', 'options-for-twenty-seventeen'),
    6769                'description'  => __('Use these options to customise the page layout and static front page sections.', 'options-for-twenty-seventeen') . ' ' . $section_description
    6870            ));
    6971
    7072            $wp_customize->add_control('page_layout', array(
    71                'label'           => __( 'Page Layout', 'twentyseventeen' ),
     73               'label'           => __( 'Page Layout', 'options-for-twenty-seventeen' ),
    7274               'section'         => 'theme_options',
    7375                'type'            => 'radio',
    74                 'description'     => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ),
     76                'description'     => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'options-for-twenty-seventeen' ),
    7577                'choices'         => array(
    76                     'one-column' => __( 'One Column', 'twentyseventeen' ),
    77                     'two-column' => __( 'Two Column', 'twentyseventeen' ),
     78                    'one-column' => __( 'One Column', 'options-for-twenty-seventeen' ),
     79                    'two-column' => __( 'Two Column', 'options-for-twenty-seventeen' ),
    7880                ),
    7981                'priority'   => 1
     
    16221624
    16231625            $control_label = __('Search / Archive Page Layout', 'options-for-twenty-seventeen');
    1624             $control_description = __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' );
     1626            $control_description = __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'options-for-twenty-seventeen' );
    16251627            oftsCommon::add_hidden_control($wp_customize, 'search_archive_page_layout', 'theme_options', $control_label, $control_description . ' ' . $upgrade_nag, 5);
    16261628
     
    17221724
    17231725            $control_label = __('Slider Cover', 'options-for-twenty-seventeen');
     1726/* translators: link to plugin installer */
    17241727            $control_description = sprintf(wp_kses(__('Replaces the cover image with a <a href="%s">Nivo</a>, Sliderspack or MetaSlider Slider. Remember to set "Image Size" to "Twenty-Seventeen-featured-image" in your slider settings for best results.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(admin_url('plugin-install.php?s=nivo-slider-lite&tab=search&type=term')));
    17251728            oftsCommon::add_hidden_control($wp_customize, 'nivo_slider_cover', 'ofts_header', $control_label, $control_description . ' ' . $upgrade_nag);
     
    17941797
    17951798            $control_label = __('Implement Yoast SEO Breadcrumbs', 'options-for-twenty-seventeen');
     1799/* translators: link to plugin installer */
    17961800            $control_description = sprintf(wp_kses(__('Inject <a href="%s">Yoast SEO</a> breadcrumbs above and / or below single post and page content.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(admin_url('plugin-install.php?s=wordpress-seo&tab=search&type=term')));
    17971801            oftsCommon::add_hidden_control($wp_customize, 'implement_yoast_breadcrumbs', 'ofts_content', $control_label, $control_description . ' ' . $upgrade_nag);
     
    18631867                ));
    18641868
     1869/* translators: link to plugin installer */
    18651870                oftsCommon::add_hidden_control($wp_customize, 'install_sidemenu', 'sidemenu', 'Install SideMenu', sprintf(wp_kses(__('Add a slide-in side menu and widget area to the site by <a href="%s">installing SideMenu plugin</a>.', 'options-for-twenty-seventeen'), array('a' => array('href' => array()))), esc_url(add_query_arg(array('s' => 'sidemenu+injects', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php')))));
    18661871
     
    20422047?>
    20432048#page {
    2044     <?php echo $mod; ?>
     2049    <?php echo wp_kses($mod, 'strip'); ?>
    20452050}
    20462051<?php
     
    22812286?>
    22822287.site-title {
    2283     font-size: <?php echo $mod / 3000 * 2; ?>rem;
     2288    font-size: <?php echo wp_kses($mod / 6000, 'strip'); ?>rem;
    22842289}
    22852290@media screen and (min-width: 48em) {
    22862291    .site-title {
    2287         font-size: <?php echo $mod / 1000; ?>rem;
     2292        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    22882293    }
    22892294}
     
    23022307?>
    23032308.site-description {
    2304     font-size: <?php echo $mod * 0.0008125; ?>rem;
     2309    font-size: <?php echo wp_kses($mod * 0.0008125, 'strip'); ?>rem;
    23052310}
    23062311@media screen and (min-width: 48em) {
    23072312    .site-description {
    2308         font-size: <?php echo $mod / 1000; ?>rem;
     2313        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    23092314    }
    23102315}
     
    23232328@media screen and (min-width: 48em) {
    23242329.twentyseventeen-front-page.has-header-image .custom-header-media:before, .twentyseventeen-front-page.has-header-video .custom-header-media:before, .home.blog.has-header-image .custom-header-media:before, .home.blog.has-header-video .custom-header-media:before {
    2325 height: <?php echo $mod; ?>%;
     2330height: <?php echo wp_kses($mod, 'strip'); ?>%;
    23262331}
    23272332}
     
    23442349?>
    23452350.custom-header-media:before {
    2346 background: linear-gradient(to bottom, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, 0) 0%, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, <?php echo $gradient_opacity; ?>) 75%, rgba(<?php echo $r; ?>, <?php echo $g; ?>, <?php echo $b; ?>, <?php echo $gradient_opacity; ?>) 100%);
     2351background: linear-gradient(to bottom, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, 0) 0%, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, <?php echo wp_kses($gradient_opacity, 'strip'); ?>) 75%, rgba(<?php echo wp_kses($r, 'strip'); ?>, <?php echo wp_kses($g, 'strip'); ?>, <?php echo wp_kses($b, 'strip'); ?>, <?php echo wp_kses($gradient_opacity, 'strip'); ?>) 100%);
    23472352}
    23482353<?php
     
    23822387@media screen and (min-width: 48em) {
    23832388    .site-navigation-fixed.navigation-top {
    2384         width: <?php echo get_theme_mod('nav_bar_width'); ?>;
     2389        width: <?php echo wp_kses(get_theme_mod('nav_bar_width'), 'strip'); ?>;
    23852390        left: 50%;
    23862391        transform: translate(-50%, 0);
     
    24062411}
    24072412.navigation-top, .colors-dark .navigation-top, .colors-custom .navigation-top {
    2408 background-image: url("<?php echo $mod; ?>");
     2413background-image: url("<?php echo wp_kses($mod, 'strip'); ?>");
    24092414}
    24102415.navigation-top {
     
    24562461?>
    24572462.navigation-top {
    2458     font-size: <?php echo ($mod + 125) / 1000; ?>rem;
     2463    font-size: <?php echo wp_kses(($mod + 125) / 1000, 'strip'); ?>rem;
    24592464}
    24602465@media screen and (min-width: 48em) {
    24612466    .navigation-top {
    2462         font-size: <?php echo $mod / 1000; ?>rem;
     2467        font-size: <?php echo wp_kses($mod / 1000, 'strip'); ?>rem;
    24632468    }
    24642469}
     
    24762481@media screen and (min-width: 48em) {
    24772482    .main-navigation a {
    2478         padding-top: <?php echo $mod - 1; ?>px;
    2479         padding-bottom: <?php echo $mod - 1; ?>px;
     2483        padding-top: <?php echo wp_kses($mod - 1, 'strip'); ?>px;
     2484        padding-bottom: <?php echo wp_kses($mod - 1, 'strip'); ?>px;
    24802485    }
    24812486}
     
    25022507    .colors-dark .main-navigation li:hover, .colors-dark .main-navigation li.focus, .colors-dark .main-navigation li li:hover, .colors-dark .main-navigation li li.focus,
    25032508    .colors-custom .main-navigation li:hover, .colors-custom .main-navigation li.focus, .colors-custom .main-navigation li li:hover, .colors-custom .main-navigation li li.focus {
    2504         background-color: <?php echo $mod; ?>;
     2509        background-color: <?php echo wp_kses($mod, 'strip'); ?>;
    25052510    }
    25062511}
     
    25182523@media screen and (min-width: 48em) {
    25192524    .main-navigation ul ul, .colors-dark .main-navigation ul ul, .colors-custom .main-navigation ul ul {
    2520         background-color: <?php echo $background_color; ?>;
     2525        background-color: <?php echo wp_kses($background_color, 'strip'); ?>;
    25212526        border: none;
    25222527    }
     
    25602565?>
    25612566.navigation-top {
    2562     background-color: rgba(255, 255, 255, <?php echo $background_opacity; ?>);
    2563     border-top-color: rgba(238, 238, 238, <?php echo $background_opacity; ?>);
    2564     border-bottom-color: rgba(238, 238, 238, <?php echo $background_opacity; ?>);
     2567    background-color: rgba(255, 255, 255, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2568    border-top-color: rgba(238, 238, 238, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2569    border-bottom-color: rgba(238, 238, 238, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25652570}
    25662571.colors-dark .navigation-top, .colors-custom .navigation-top {
    2567     background-color: rgba(34, 34, 34, <?php echo $background_opacity; ?>);
    2568     border-top-color: rgba(51, 51, 51, <?php echo $background_opacity; ?>);
    2569     border-bottom-color: rgba(51, 51, 51, <?php echo $background_opacity; ?>);
     2572    background-color: rgba(34, 34, 34, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2573    border-top-color: rgba(51, 51, 51, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2574    border-bottom-color: rgba(51, 51, 51, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25702575}
    25712576<?php
     
    25802585?>
    25812586.colors-custom .navigation-top {
    2582     background-color: background: hsla(' . $hue . ', ' . $saturation . ', 100%, <?php echo $background_opacity; ?>);
    2583     border-top-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo $background_opacity; ?>);
    2584     border-bottom-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo $background_opacity; ?>);
     2587    background-color: background: hsla(' . $hue . ', ' . $saturation . ', 100%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2588    border-top-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
     2589    border-bottom-color: hsla(' . $hue . ', ' . $saturation . ', 93%, <?php echo wp_kses($background_opacity, 'strip'); ?>);
    25852590}
    25862591<?php
     
    25982603@media screen and (min-width: 48em) {
    25992604    .main-navigation ul ul, .colors-dark .main-navigation ul ul, .colors-custom .main-navigation ul ul {
    2600         background-color: <?php echo $mod; ?>;
     2605        background-color: <?php echo wp_kses($mod, 'strip'); ?>;
    26012606        border: none;
    26022607    }
     
    26582663@media screen and (min-width: 30em) {
    26592664    .page-one-column .panel-content .wrap {
    2660         max-width: <?php echo $mod; ?>;
     2665        max-width: <?php echo wp_kses($mod, 'strip'); ?>;
    26612666    }
    26622667}
     
    27072712@media screen and (min-width: 48em) {
    27082713    .site-content, .panel-content .wrap {
    2709         padding-top: <?php echo (($mod / 2) - 0.5); ?>em;
     2714        padding-top: <?php echo wp_kses((($mod / 2) - 0.5), 'strip'); ?>em;
    27102715    }
    27112716}
     
    27622767@media screen and (min-width: 48em) {
    27632768    .page.page-one-column .entry-header, .twentyseventeen-front-page.page-one-column .entry-header, .archive.page-one-column:not(.has-sidebar) .page-header {
    2764         margin-bottom: <?php echo (($mod / 2) - 0.5); ?>em;
     2769        margin-bottom: <?php echo wp_kses((($mod / 2) - 0.5), 'strip'); ?>em;
    27652770    }
    27662771}
     
    30193024                        'url'           => plugin_dir_url(__FILE__) . 'images/header.jpg',
    30203025                        'thumbnail_url' => plugin_dir_url(__FILE__) . 'images/header.jpg',
    3021                         'description'   => __( 'Default Header Image', 'twentyseventeen' ),
     3026                        'description'   => __( 'Default Header Image', 'options-for-twenty-seventeen' ),
    30223027                    ),
    30233028                )
     
    32033208    if (oftsCommon::is_theme_being_used('twentyseventeen')) {
    32043209
     3210// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    32053211        $options_for_twenty_seventeen_object = new options_for_twenty_seventeen_class();
    32063212
     
    32093215        if (is_admin()) {
    32103216
    3211             $themes = wp_get_themes();
    3212 
    3213             if (!isset($themes['twentyseventeen'])) {
     3217// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
     3218            $options_for_twenty_seventeen_themes = wp_get_themes();
     3219
     3220            if (!isset($options_for_twenty_seventeen_themes['twentyseventeen'])) {
    32143221
    32153222                add_action('admin_notices', 'ofts_wrong_theme_notice');
     
    32213228    }
    32223229
     3230// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
    32233231    function ofts_wrong_theme_notice() {
    32243232
     
    32303238<?php
    32313239        printf(
    3232             __('This plugin requires the default WordPress theme Twenty Seventeen to be active or live previewed in order to function. Your theme "%s" is not compatible.', 'options-for-twenty-seventeen'),
    3233             get_template()
     3240/* translators: theme slug */
     3241            esc_html(__('This plugin requires the default WordPress theme Twenty Seventeen to be active or live previewed in order to function. Your theme "%s" is not compatible.', 'options-for-twenty-seventeen')),
     3242            esc_html(get_template())
    32343243        );
    32353244?>
    32363245
    3237 <a href="<?php echo add_query_arg('search', 'twentyseventeen', admin_url('theme-install.php')); ?>" title="<?php esc_attr_e('Twenty Seventeen', 'options-for-twenty-seventeen'); ?>"><?php
     3246<a href="<?php echo esc_url(add_query_arg('search', 'twentyseventeen', admin_url('theme-install.php'))); ?>" title="<?php esc_attr_e('Twenty Seventeen', 'options-for-twenty-seventeen'); ?>"><?php
    32383247        esc_html_e('Please install and activate or live preview the Twenty Seventeen theme (or a child theme thereof)', 'options-for-twenty-seventeen');
    32393248?></a>.</p>
  • options-for-twenty-seventeen/trunk/readme.txt

    r3412270 r3417427  
    66Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 2.5.4
     8Stable tag: 2.5.5
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    181181== Changelog ==
    182182
     183= 2.5.5 =
     184* General housekeeping preparing for "Plugin Check" code review
     185
    183186= 2.5.4 =
    184187* Remove Customizer CSS due to incompatible change introduced in WordPress v6.7
     
    718721== Upgrade Notice ==
    719722
    720 = 2.5.4 =
    721 * Remove Customizer CSS due to incompatible change introduced in WordPress v6.7
     723= 2.5.5 =
     724* General housekeeping preparing for "Plugin Check" code review
Note: See TracChangeset for help on using the changeset viewer.