Plugin Directory

Changeset 2576103


Ignore:
Timestamp:
08/01/2021 05:04:22 PM (5 years ago)
Author:
stephen.pickett
Message:

Minor tweak to 1.7.0 release to correct use of sanitisation and escape commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • thinktwit/trunk/thinktwit.php

    r2558190 r2576103  
    6969        public function __construct() {
    7070            // Set the description of the widget
    71             $widget_ops = array("description" => __("Outputs tweets from one or more Twitter users through the Widget interface, filtered on a particular #hashtag(s)"), 'thinktwit');
     71            $widget_ops = array("description" => esc_html__("Outputs tweets from one or more Twitter users through the Widget interface, filtered on a particular #hashtag(s)"), 'thinktwit');
    7272
    7373            // Load jQuery
     
    224224        public function form($instance) {
    225225            // Set up some default widget settings
    226             $defaults = array("title"              => __("My Tweets", 'thinktwit'),
     226            $defaults = array("title"              => esc_html__("My Tweets", 'thinktwit'),
    227227                              "usernames"          => THINKTWIT_USERNAMES,
    228228                              "hashtags"           => THINKTWIT_HASHTAGS,
     
    260260                <div>
    261261                    <!-- TITLE -->
    262                     <p><label for="<?php echo esc_attr($this->get_field_id("title")); ?>"><?php esc_html_e("Title:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("title")); ?>" name="<?php echo esc_attr($this->get_field_name("title")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["title"]); ?>" /></label></p>
     262                    <p><label for="<?php echo esc_attr($this->get_field_id("title")); ?>"><?php esc_html_e("Title:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("title")); ?>" name="<?php echo esc_attr($this->get_field_name("title")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance["title"]); ?>" /></label></p>
    263263
    264264                    <!-- USERNAMES -->
    265                     <p><label for="<?php echo esc_attr($this->get_field_id("usernames")); ?>"><?php esc_html_e("Twitter usernames (optional) separated by spaces:", 'thinktwit'); ?> <textarea rows="4" cols="40" class="widefat" id="<?php echo esc_attr($this->get_field_id("usernames")); ?>" name="<?php echo esc_attr($this->get_field_name("usernames")); ?>"><?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["usernames"]); ?></textarea></label></p>
     265                    <p><label for="<?php echo esc_attr($this->get_field_id("usernames")); ?>"><?php esc_html_e("Twitter usernames (optional) separated by spaces:", 'thinktwit'); ?> <textarea rows="4" cols="40" class="widefat" id="<?php echo esc_attr($this->get_field_id("usernames")); ?>" name="<?php echo esc_attr($this->get_field_name("usernames")); ?>"><?php echo ThinkTwit::escape_text_preserve_whitespace($instance["usernames"]); ?></textarea></label></p>
    266266
    267267                    <!-- HASHTAGS -->
    268                     <p><label for="<?php echo esc_attr($this->get_field_id("hashtags")); ?>"><?php esc_html_e("Twitter hashtags/keywords (optional) separated by spaces:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("hashtags")); ?>" name="<?php echo esc_attr($this->get_field_name("hashtags")); ?>"  type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["hashtags"]); ?>" /></label></p>
     268                    <p><label for="<?php echo esc_attr($this->get_field_id("hashtags")); ?>"><?php esc_html_e("Twitter hashtags/keywords (optional) separated by spaces:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("hashtags")); ?>" name="<?php echo esc_attr($this->get_field_name("hashtags")); ?>"  type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance["hashtags"]); ?>" /></label></p>
    269269                   
    270270                    <!-- HASHTAG FILTER -->
     
    275275                   
    276276                    <!-- USERNAME SUFFIX -->
    277                     <p><label for="<?php echo esc_attr($this->get_field_id("username_suffix")); ?>"><?php esc_html_e("Username suffix (e.g. \" said \"):", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("username_suffix")); ?>" name="<?php echo esc_attr($this->get_field_name("username_suffix")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["username_suffix"]); ?>" /></label></p>
     277                    <p><label for="<?php echo esc_attr($this->get_field_id("username_suffix")); ?>"><?php esc_html_e("Username suffix (e.g. \" said \"):", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("username_suffix")); ?>" name="<?php echo esc_attr($this->get_field_name("username_suffix")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance["username_suffix"]); ?>" /></label></p>
    278278
    279279                    <!-- TWEET LIMIT -->
    280                     <p><label for="<?php echo esc_attr($this->get_field_id("limit")); ?>"><?php esc_html_e("Max tweets to display:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("limit")); ?>" name="<?php echo esc_attr($this->get_field_name("limit")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["limit"]); ?>" /></label></p>
     280                    <p><label for="<?php echo esc_attr($this->get_field_id("limit")); ?>"><?php esc_html_e("Max tweets to display:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("limit")); ?>" name="<?php echo esc_attr($this->get_field_name("limit")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance["limit"]); ?>" /></label></p>
    281281                   
    282282                    <!-- MAX DAYS TO SHOW -->
    283                     <p><label for="<?php echo esc_attr($this->get_field_id("max_days")); ?>"><?php esc_html_e("Max days to display:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("max_days")); ?>" name="<?php echo esc_attr($this->get_field_name("max_days")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance["max_days"]); ?>" /></label></p>
     283                    <p><label for="<?php echo esc_attr($this->get_field_id("max_days")); ?>"><?php esc_html_e("Max days to display:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("max_days")); ?>" name="<?php echo esc_attr($this->get_field_name("max_days")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance["max_days"]); ?>" /></label></p>
    284284                   
    285285                    <!-- UPDATE FREQUENCY -->
     
    334334
    335335                    <!-- LIVE UPDATE FREQUENCY -->
    336                     <p><label for="<?php echo esc_attr($this->get_field_id("live_update_freq")); ?>"><?php esc_html_e("Live update frequency (in seconds, set to zero to turn off):", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("live_update_freq")); ?>" name="<?php echo esc_attr($this->get_field_name("live_update_freq")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['live_update_freq']); ?>" /></label></p>
     336                    <p><label for="<?php echo esc_attr($this->get_field_id("live_update_freq")); ?>"><?php esc_html_e("Live update frequency (in seconds, set to zero to turn off):", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("live_update_freq")); ?>" name="<?php echo esc_attr($this->get_field_name("live_update_freq")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['live_update_freq']); ?>" /></label></p>
    337337
    338338                    <!-- OUTPUT DEBUG MESSAGES -->
     
    350350                   
    351351                    <!-- TIME THIS HAPPENED -->
    352                     <p><label for="<?php echo esc_attr($this->get_field_id("time_this_happened")); ?>"><?php esc_html_e("Time prefix:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_this_happened")); ?>" name="<?php echo esc_attr($this->get_field_name("time_this_happened")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_this_happened']); ?>" /></label></p>
     352                    <p><label for="<?php echo esc_attr($this->get_field_id("time_this_happened")); ?>"><?php esc_html_e("Time prefix:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_this_happened")); ?>" name="<?php echo esc_attr($this->get_field_name("time_this_happened")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_this_happened']); ?>" /></label></p>
    353353                   
    354354                    <!-- WITHIN A MINUTE -->
    355                     <p><label for="<?php echo esc_attr($this->get_field_id("time_less_min")); ?>"><?php esc_html_e("Less than 59 seconds ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_less_min")); ?>" name="<?php echo esc_attr($this->get_field_name("time_less_min")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_less_min']); ?>" /></label></p>
     355                    <p><label for="<?php echo esc_attr($this->get_field_id("time_less_min")); ?>"><?php esc_html_e("Less than 59 seconds ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_less_min")); ?>" name="<?php echo esc_attr($this->get_field_name("time_less_min")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_less_min']); ?>" /></label></p>
    356356                   
    357357                    <!-- A MINUTE -->
    358                     <p><label for="<?php echo esc_attr($this->get_field_id("time_min")); ?>"><?php esc_html_e("Less than 1 minute 59 seconds ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_min")); ?>" name="<?php echo esc_attr($this->get_field_name("time_min")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_min']); ?>" /></label></p>
     358                    <p><label for="<?php echo esc_attr($this->get_field_id("time_min")); ?>"><?php esc_html_e("Less than 1 minute 59 seconds ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_min")); ?>" name="<?php echo esc_attr($this->get_field_name("time_min")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_min']); ?>" /></label></p>
    359359                   
    360360                    <!-- WITHIN AN HOUR -->
    361                     <p><label for="<?php echo esc_attr($this->get_field_id("time_more_mins")); ?>"><?php esc_html_e("Less than 50 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_more_mins")); ?>" name="<?php echo esc_attr($this->get_field_name("time_more_mins")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_more_mins']); ?>" /></label></p>
     361                    <p><label for="<?php echo esc_attr($this->get_field_id("time_more_mins")); ?>"><?php esc_html_e("Less than 50 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_more_mins")); ?>" name="<?php echo esc_attr($this->get_field_name("time_more_mins")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_more_mins']); ?>" /></label></p>
    362362                   
    363363                    <!-- AN HOUR -->
    364                     <p><label for="<?php echo esc_attr($this->get_field_id("time_1_hour")); ?>"><?php esc_html_e("Less than 89 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_1_hour")); ?>" name="<?php echo esc_attr($this->get_field_name("time_1_hour")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_1_hour']); ?>" /></label></p>
     364                    <p><label for="<?php echo esc_attr($this->get_field_id("time_1_hour")); ?>"><?php esc_html_e("Less than 89 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_1_hour")); ?>" name="<?php echo esc_attr($this->get_field_name("time_1_hour")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_1_hour']); ?>" /></label></p>
    365365                   
    366366                    <!-- 2 HOURS -->
    367                     <p><label for="<?php echo esc_attr($this->get_field_id("time_2_hours")); ?>"><?php esc_html_e("Less than 150 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_2_hours")); ?>" name="<?php echo esc_attr($this->get_field_name("time_2_hours")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_2_hours']); ?>" /></label></p>
     367                    <p><label for="<?php echo esc_attr($this->get_field_id("time_2_hours")); ?>"><?php esc_html_e("Less than 150 minutes ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_2_hours")); ?>" name="<?php echo esc_attr($this->get_field_name("time_2_hours")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_2_hours']); ?>" /></label></p>
    368368                   
    369369                    <!-- OTHER HOURS -->
    370                     <p><label for="<?php echo esc_attr($this->get_field_id("time_precise_hours")); ?>"><?php esc_html_e("Less than 23 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_precise_hours")); ?>" name="<?php echo esc_attr($this->get_field_name("time_precise_hours")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_precise_hours']); ?>" /></label></p>
     370                    <p><label for="<?php echo esc_attr($this->get_field_id("time_precise_hours")); ?>"><?php esc_html_e("Less than 23 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_precise_hours")); ?>" name="<?php echo esc_attr($this->get_field_name("time_precise_hours")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_precise_hours']); ?>" /></label></p>
    371371                   
    372372                    <!-- A DAY -->
    373                     <p><label for="<?php echo esc_attr($this->get_field_id("time_1_day")); ?>"><?php esc_html_e("Less than 36 hours:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_1_day")); ?>" name="<?php echo esc_attr($this->get_field_name("time_1_day")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_1_day']); ?>" /></label></p>
     373                    <p><label for="<?php echo esc_attr($this->get_field_id("time_1_day")); ?>"><?php esc_html_e("Less than 36 hours:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_1_day")); ?>" name="<?php echo esc_attr($this->get_field_name("time_1_day")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_1_day']); ?>" /></label></p>
    374374                   
    375375                    <!-- 2 DAYS -->
    376                     <p><label for="<?php echo esc_attr($this->get_field_id("time_2_days")); ?>"><?php esc_html_e("Less than 48 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_2_days")); ?>" name="<?php echo esc_attr($this->get_field_name("time_2_days")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_2_days']); ?>" /></label></p>
     376                    <p><label for="<?php echo esc_attr($this->get_field_id("time_2_days")); ?>"><?php esc_html_e("Less than 48 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_2_days")); ?>" name="<?php echo esc_attr($this->get_field_name("time_2_days")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_2_days']); ?>" /></label></p>
    377377                   
    378378                    <!-- OTHER DAYS -->
    379                     <p><label for="<?php echo esc_attr($this->get_field_id("time_many_days")); ?>"><?php esc_html_e("More than 48 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_many_days")); ?>" name="<?php echo esc_attr($this->get_field_name("time_many_days")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_many_days']); ?>" /></label></p>
     379                    <p><label for="<?php echo esc_attr($this->get_field_id("time_many_days")); ?>"><?php esc_html_e("More than 48 hours ago:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_many_days")); ?>" name="<?php echo esc_attr($this->get_field_name("time_many_days")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_many_days']); ?>" /></label></p>
    380380                   
    381381                    <!-- NO RECENT TWEETS -->
    382                     <p><label for="<?php echo esc_attr($this->get_field_id("time_no_recent")); ?>"><?php esc_html_e("No recent tweets:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_no_recent")); ?>" name="<?php echo esc_attr($this->get_field_name("time_no_recent")); ?>" type="text" value="<?php echo ThinkTwit::sanitise_text_preserve_whitespace($instance['time_no_recent']); ?>" /></label></p>
     382                    <p><label for="<?php echo esc_attr($this->get_field_id("time_no_recent")); ?>"><?php esc_html_e("No recent tweets:", 'thinktwit'); ?> <input class="widefat" id="<?php echo esc_attr($this->get_field_id("time_no_recent")); ?>" name="<?php echo esc_attr($this->get_field_name("time_no_recent")); ?>" type="text" value="<?php echo ThinkTwit::escape_text_preserve_whitespace($instance['time_no_recent']); ?>" /></label></p>
    383383                </div>
    384384            </div>
     
    410410                    $("#widget-thinktwit-<?php echo $id[2]; ?>-reset_settings").live("click", function() {       
    411411                        // Reset all of the values to their default
    412                         $("#widget-thinktwit-<?php echo $id[2]; ?>-usernames").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_USERNAMES); ?>");
    413                         $("#widget-thinktwit-<?php echo $id[2]; ?>-hashtags").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_HASHTAGS); ?>");
    414                         $("#widget-thinktwit-<?php echo $id[2]; ?>-hashtag_filter").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_HASHTAG_FILTER); ?>");
    415                         $("#widget-thinktwit-<?php echo $id[2]; ?>-username_suffix").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_USERNAME_SUFFIX); ?>");
    416                         $("#widget-thinktwit-<?php echo $id[2]; ?>-limit").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_LIMIT); ?>");
    417                         $("#widget-thinktwit-<?php echo $id[2]; ?>-max_days").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_MAX_DAYS); ?>");
    418                         $("#widget-thinktwit-<?php echo $id[2]; ?>-update_frequency").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_UPDATE_FREQUENCY); ?>");
    419                         $("#widget-thinktwit-<?php echo $id[2]; ?>-show_username").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_SHOW_USERNAME); ?>");
    420                         $("#widget-thinktwit-<?php echo $id[2]; ?>-show_avatar").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_SHOW_AVATAR); ?>");
    421                         $("#widget-thinktwit-<?php echo $id[2]; ?>-show_published").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_SHOW_PUBLISHED); ?>");
    422                         $("#widget-thinktwit-<?php echo $id[2]; ?>-show_follow").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_SHOW_FOLLOW); ?>");
    423                         $("#widget-thinktwit-<?php echo $id[2]; ?>-links_new_window").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_LINKS_NEW_WINDOW); ?>");
    424                         $("#widget-thinktwit-<?php echo $id[2]; ?>-no_cache").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_NO_CACHE); ?>");
    425                         $("#widget-thinktwit-<?php echo $id[2]; ?>-live_update_freq").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_LIVE_UPDATE_FREQ); ?>");
    426                         $("#widget-thinktwit-<?php echo $id[2]; ?>-debug").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_DEBUG); ?>");
    427                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_this_happened").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_THIS_HAPPENED); ?>");
    428                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_less_min").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_LESS_MIN); ?>");
    429                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_min").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_MIN); ?>");
    430                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_more_mins").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_MORE_MINS); ?>");
    431                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_1_hour").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_1_HOUR); ?>");
    432                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_2_hours").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_2_HOURS); ?>");
    433                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_precise_hours").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_PRECISE_HOURS); ?>");
    434                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_1_day").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_1_DAY); ?>");
    435                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_2_days").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_2_DAYS); ?>");
    436                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_many_days").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_MANY_DAYS); ?>");
    437                         $("#widget-thinktwit-<?php echo $id[2]; ?>-time_no_recent").val("<?php echo ThinkTwit::sanitise_text_preserve_whitespace(THINKTWIT_TIME_NO_RECENT); ?>");
     412                        $("#widget-thinktwit-<?php echo $id[2]; ?>-usernames").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_USERNAMES); ?>");
     413                        $("#widget-thinktwit-<?php echo $id[2]; ?>-hashtags").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_HASHTAGS); ?>");
     414                        $("#widget-thinktwit-<?php echo $id[2]; ?>-hashtag_filter").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_HASHTAG_FILTER); ?>");
     415                        $("#widget-thinktwit-<?php echo $id[2]; ?>-username_suffix").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_USERNAME_SUFFIX); ?>");
     416                        $("#widget-thinktwit-<?php echo $id[2]; ?>-limit").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_LIMIT); ?>");
     417                        $("#widget-thinktwit-<?php echo $id[2]; ?>-max_days").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_MAX_DAYS); ?>");
     418                        $("#widget-thinktwit-<?php echo $id[2]; ?>-update_frequency").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_UPDATE_FREQUENCY); ?>");
     419                        $("#widget-thinktwit-<?php echo $id[2]; ?>-show_username").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_SHOW_USERNAME); ?>");
     420                        $("#widget-thinktwit-<?php echo $id[2]; ?>-show_avatar").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_SHOW_AVATAR); ?>");
     421                        $("#widget-thinktwit-<?php echo $id[2]; ?>-show_published").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_SHOW_PUBLISHED); ?>");
     422                        $("#widget-thinktwit-<?php echo $id[2]; ?>-show_follow").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_SHOW_FOLLOW); ?>");
     423                        $("#widget-thinktwit-<?php echo $id[2]; ?>-links_new_window").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_LINKS_NEW_WINDOW); ?>");
     424                        $("#widget-thinktwit-<?php echo $id[2]; ?>-no_cache").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_NO_CACHE); ?>");
     425                        $("#widget-thinktwit-<?php echo $id[2]; ?>-live_update_freq").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_LIVE_UPDATE_FREQ); ?>");
     426                        $("#widget-thinktwit-<?php echo $id[2]; ?>-debug").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_DEBUG); ?>");
     427                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_this_happened").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_THIS_HAPPENED); ?>");
     428                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_less_min").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_LESS_MIN); ?>");
     429                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_min").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_MIN); ?>");
     430                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_more_mins").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_MORE_MINS); ?>");
     431                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_1_hour").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_1_HOUR); ?>");
     432                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_2_hours").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_2_HOURS); ?>");
     433                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_precise_hours").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_PRECISE_HOURS); ?>");
     434                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_1_day").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_1_DAY); ?>");
     435                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_2_days").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_2_DAYS); ?>");
     436                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_many_days").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_MANY_DAYS); ?>");
     437                        $("#widget-thinktwit-<?php echo $id[2]; ?>-time_no_recent").val("<?php echo ThinkTwit::escape_text_preserve_whitespace(THINKTWIT_TIME_NO_RECENT); ?>");
    438438                       
    439439                        // Set live_update_cache readonly based upon current value of no_cache
     
    463463            if ($file == $this_plugin) {
    464464                // Create and add the link to the settings page
    465                 $settings_link = "<a href=\"" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=thinktwit\">" . __("Settings", 'thinktwit') . "</a>";
     465                $settings_link = "<a href=\"" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=thinktwit\">" . esc_html__("Settings", 'thinktwit') . "</a>";
    466466               
    467467                // Add it to the front of the links array
     
    484484            if ($file == $this_plugin) {
    485485                // Create and add the links
    486                 $links[] = "<a href=\"" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=thinktwit\">" . __("Settings", 'thinktwit') . "</a>";
    487                 $links[] = "<a href=\"https://wordpress.org/support/plugin/thinktwit\">" . __("Support", 'thinktwit') . "</a>";
    488                 $links[] = "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B693F67QHAT8E\">" . __("Donate", 'thinktwit') . "</a>";
     486                $links[] = "<a href=\"" . get_bloginfo('wpurl') . "/wp-admin/options-general.php?page=thinktwit\">" . esc_html__("Settings", 'thinktwit') . "</a>";
     487                $links[] = "<a href=\"https://wordpress.org/support/plugin/thinktwit\">" . esc_html__("Support", 'thinktwit') . "</a>";
     488                $links[] = "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B693F67QHAT8E\">" . esc_html__("Donate", 'thinktwit') . "</a>";
    489489            }
    490490
     
    515515            add_settings_section(
    516516                "general_settings",
    517                 __("General Settings", 'thinktwit'),
     517                esc_html__("General Settings", 'thinktwit'),
    518518                "ThinkTwit::admin_page_general_section_info",
    519519                "thinktwit"
     
    522522            add_settings_field(
    523523                "cleanup_period",
    524                 __("Cleanup period", 'thinktwit'),
     524                esc_html__("Cleanup period", 'thinktwit'),
    525525                "ThinkTwit::create_admin_page_cleanup_field",
    526526                "thinktwit",
     
    530530            add_settings_field(
    531531                "use_default_style",
    532                 __("Use default stylesheet", 'thinktwit'),
     532                esc_html__("Use default stylesheet", 'thinktwit'),
    533533                "ThinkTwit::create_admin_page_use_default_style_field",
    534534                "thinktwit",
     
    538538            add_settings_section(
    539539                "twitter_api_settings",
    540                 __("Twitter API Settings", 'thinktwit'),
     540                esc_html__("Twitter API Settings", 'thinktwit'),
    541541                "ThinkTwit::admin_page_twitter_section_info",
    542542                "thinktwit"
     
    546546            add_settings_field(
    547547                "consumer_key",
    548                 __("Consumer key", 'thinktwit'),
     548                esc_html__("Consumer key", 'thinktwit'),
    549549                "ThinkTwit::create_admin_page_key_field",
    550550                "thinktwit",
     
    554554            add_settings_field(
    555555                "consumer_secret",
    556                 __("Consumer secret", 'thinktwit'),
     556                esc_html__("Consumer secret", 'thinktwit'),
    557557                "ThinkTwit::create_admin_page_secret_field",
    558558                "thinktwit",
     
    586586            if (!is_array($settings)) {
    587587                $version = ThinkTwit::get_version();
    588                 $cache_names = __("none", 'thinktwit');
    589                 $updated = __("never", 'thinktwit');
    590                 $last_cleanup = __("never", 'thinktwit');
     588                $cache_names = esc_html__("none", 'thinktwit');
     589                $updated = esc_html__("never", 'thinktwit');
     590                $last_cleanup = esc_html__("never", 'thinktwit');
    591591            } else { // Otherwise get the stored values after checking they are set
    592592                // If the version is set then get it
     
    603603                } else {
    604604                    // Otherwise set to none
    605                     $cache_names = __("none", 'thinktwit');
     605                    $cache_names = esc_html__("none", 'thinktwit');
    606606                }
    607607               
    608608                // If the last cleanup date is not never then format it appropriately
    609                 if (isset($settings["last_cleanup"]) && (strcmp($settings["last_cleanup"], __("never", 'thinktwit')) != 0)) {
     609                if (isset($settings["last_cleanup"]) && (strcmp($settings["last_cleanup"], esc_html__("never", 'thinktwit')) != 0)) {
    610610                    // Format the timestamps correctly
    611611                    $last_cleanup = date('D F jS, Y H:i:s', $settings["last_cleanup"]);
    612612                } else {
    613613                    // Otherwise set to never
    614                     $last_cleanup = __("never", 'thinktwit');
     614                    $last_cleanup = esc_html__("never", 'thinktwit');
    615615                }
    616616               
    617617                // If the last updated date is not never then format it appropriately
    618                 if (isset($settings["updated"]) && (strcmp($settings["updated"], __("never", 'thinktwit')) != 0)) {
     618                if (isset($settings["updated"]) && (strcmp($settings["updated"], esc_html__("never", 'thinktwit')) != 0)) {
    619619                    // Separate the Unix timestamp for easier disection
    620620                    list($microSec, $timeStamp) = explode(" ", $settings["updated"]);
     
    624624                } else {
    625625                    // Otherwise set to never
    626                     $updated = __("never", 'thinktwit');
     626                    $updated = esc_html__("never", 'thinktwit');
    627627                }
    628628            }
     
    644644                                   
    645645                                    // If the cache is now empty
    646                                     if (response == \"" . __("empty", 'thinktwit') . "\") {
     646                                    if (response == \"" . esc_html__("empty", 'thinktwit') . "\") {
    647647                                        // Disable the button
    648648                                        $('#clear_cache').attr('disabled','disabled');
     
    652652                        });
    653653                  </script>";
    654             echo "<p>" . __("The following static values are for information only:", 'thinktwit') . "</p>";
    655             echo "<table class=\"form-table\"><tbody><tr valign=\"top\"><th scope=\"row\">" . __("Version", 'thinktwit') . "</th><td>$version</td></tr>";
    656             echo "<tr valign=\"top\"><th scope=\"row\">" . __("Cache names", 'thinktwit') . "</th><td id=\"cache_names\">" . (empty($cache_names) ? __("empty", 'thinktwit') : $cache_names) . "</td></tr>";
    657             echo "<tr valign=\"top\"><th scope=\"row\"></th><td><button id=\"clear_cache\" " . (empty($cache_names) ? "disabled " : "") . "class=\"button button-primary\" onclick=\"return false;\">" . __("Clear Cache", 'thinktwit') . "</button></td></tr>";
    658             echo "<tr valign=\"top\"><th scope=\"row\">" . __("Last updated", 'thinktwit') . "</th><td>$updated</td></tr>";
    659             echo "<tr valign=\"top\"><th scope=\"row\">" . __("Last cleanup", 'thinktwit') . "</th><td>$last_cleanup</td></tr>";
     654            echo "<p>" . esc_html__("The following static values are for information only:", 'thinktwit') . "</p>";
     655            echo "<table class=\"form-table\"><tbody><tr valign=\"top\"><th scope=\"row\">" . esc_html__("Version", 'thinktwit') . "</th><td>$version</td></tr>";
     656            echo "<tr valign=\"top\"><th scope=\"row\">" . esc_html__("Cache names", 'thinktwit') . "</th><td id=\"cache_names\">" . (empty($cache_names) ? esc_html__("empty", 'thinktwit') : $cache_names) . "</td></tr>";
     657            echo "<tr valign=\"top\"><th scope=\"row\"></th><td><button id=\"clear_cache\" " . (empty($cache_names) ? "disabled " : "") . "class=\"button button-primary\" onclick=\"return false;\">" . esc_html__("Clear Cache", 'thinktwit') . "</button></td></tr>";
     658            echo "<tr valign=\"top\"><th scope=\"row\">" . esc_html__("Last updated", 'thinktwit') . "</th><td>$updated</td></tr>";
     659            echo "<tr valign=\"top\"><th scope=\"row\">" . esc_html__("Last cleanup", 'thinktwit') . "</th><td>$last_cleanup</td></tr>";
    660660            echo "</tbody></table>";
    661661        }
     
    663663        // Twitter section message for the admin page
    664664        public static function admin_page_twitter_section_info() {
    665             echo "<p>" . __("Enter your Twitter Application authentication settings below:", 'thinktwit') . "</p>";
     665            echo "<p>" . esc_html__("Enter your Twitter Application authentication settings below:", 'thinktwit') . "</p>";
    666666        }
    667667       
     
    679679                $settings["version"] = ThinkTwit::get_version();
    680680                $settings["cache_names"] = array();
    681                 $settings["updated"] = __("never", 'thinktwit');
    682                 $settings["last_cleanup"] = __("never", 'thinktwit');
     681                $settings["updated"] = esc_html__("never", 'thinktwit');
     682                $settings["last_cleanup"] = esc_html__("never", 'thinktwit');
    683683                $settings["consumer_key"] = "";
    684684                $settings["consumer_secret"] = "";
     
    753753            // Return the remaining cache names (should be empty)
    754754            if (empty($cache_names)) {
    755                 return __("empty", 'thinktwit');
     755                return esc_html__("empty", 'thinktwit');
    756756            } else {
    757757                return $cache_names;
     
    10151015           
    10161016            return $filename;
     1017        }
     1018       
     1019        // Escape text but preserving whitespace
     1020        private static function escape_text_preserve_whitespace($text) {
     1021            // Replace spaces with =!=, then escape the output, and then replace the =!= with space again
     1022            return str_replace("=!=", " ", esc_html(str_replace(" ", "=!=", $text)));
    10171023        }
    10181024       
     
    15381544                            } else {
    15391545                                // Output an error
    1540                                 jQuery(\"#" . $widget_id . "\").append('<p class=\"thinkTwitError\">" . __("Error: Unable to display tweets.", 'thinktwit') . "</p>');
     1546                                jQuery(\"#" . $widget_id . "\").append('<p class=\"thinkTwitError\">" . esc_html__("Error: Unable to display tweets.", 'thinktwit') . "</p>');
    15411547                            }
    15421548                        });
     
    17131719            // If user wishes to output debug info then do so
    17141720            if ($debug) {       
    1715                 $output .= "<p><b>" . __("Current date/time" . ":", 'thinktwit') . "</b> " . date('Y/m/d H:i:s e (P)', time()) . "</p>";
    1716                 $output .= "<p><b>" . __("Widget ID" . ":", 'thinktwit') . "</b> " . $widget_id . "</p>";
    1717                 $output .= "<p><b>" . __("Twitter usernames (optional) separated by spaces" . ":", 'thinktwit') . "</b> " . $usernames . "</p>";
    1718                 $output .= "<p><b>" . __("Twitter hashtags/keywords (optional) separated by spaces:", 'thinktwit') . "</b> " . $hashtags . "</p>";
    1719                 $output .= "<p><b>" . __("Filter by username and/or hashtag:", 'thinktwit') . "</b> " . ($hashtag_filter ? __("AND", 'thinktwit') : __("OR", 'thinktwit')) . "</p>";
    1720                 $output .= "<p><b>" . __("Username suffix (e.g. \" said \"):", 'thinktwit') . "</b> " . $username_suffix . "</p>";
    1721                 $output .= "<p><b>" . __("Max tweets to display:", 'thinktwit') . "</b> " . $limit . "</p>";
    1722                 $output .= "<p><b>" . __("Max days to display:", 'thinktwit') . "</b> " . $max_days . "</p>";
    1723                 $output .= "<p><b>" . __("Show username:", 'thinktwit') . "</b> ";
     1721                $output .= "<p><b>" . esc_html__("Current date/time" . ":", 'thinktwit') . "</b> " . date('Y/m/d H:i:s e (P)', time()) . "</p>";
     1722                $output .= "<p><b>" . esc_html__("Widget ID" . ":", 'thinktwit') . "</b> " . $widget_id . "</p>";
     1723                $output .= "<p><b>" . esc_html__("Twitter usernames (optional) separated by spaces" . ":", 'thinktwit') . "</b> " . $usernames . "</p>";
     1724                $output .= "<p><b>" . esc_html__("Twitter hashtags/keywords (optional) separated by spaces:", 'thinktwit') . "</b> " . $hashtags . "</p>";
     1725                $output .= "<p><b>" . esc_html__("Filter by username and/or hashtag:", 'thinktwit') . "</b> " . ($hashtag_filter ? esc_html__("AND", 'thinktwit') : esc_html__("OR", 'thinktwit')) . "</p>";
     1726                $output .= "<p><b>" . esc_html__("Username suffix (e.g. \" said \"):", 'thinktwit') . "</b> " . $username_suffix . "</p>";
     1727                $output .= "<p><b>" . esc_html__("Max tweets to display:", 'thinktwit') . "</b> " . $limit . "</p>";
     1728                $output .= "<p><b>" . esc_html__("Max days to display:", 'thinktwit') . "</b> " . $max_days . "</p>";
     1729                $output .= "<p><b>" . esc_html__("Show username:", 'thinktwit') . "</b> ";
    17241730
    17251731                switch ($update_frequency) {
    17261732                    case -1:
    1727                         $output .= __("Live (uncached)", 'thinktwit');
     1733                        $output .= esc_html__("Live (uncached)", 'thinktwit');
    17281734                        break;
    17291735                    case 0:
    1730                         $output .= __("Live (cached)", 'thinktwit');
     1736                        $output .= esc_html__("Live (cached)", 'thinktwit');
    17311737                        break;
    17321738                    case 1:
    1733                         $output .= __("Hourly", 'thinktwit');
     1739                        $output .= esc_html__("Hourly", 'thinktwit');
    17341740                        break;
    17351741                    case 2:
    1736                         $output .= __("Every 2 hours", 'thinktwit');
     1742                        $output .= esc_html__("Every 2 hours", 'thinktwit');
    17371743                        break;
    17381744                    case 4:
    1739                         $output .= __("Every 4 hours", 'thinktwit');
     1745                        $output .= esc_html__("Every 4 hours", 'thinktwit');
    17401746                        break;
    17411747                    case 12:
    1742                         $output .= __("Every 12 hours", 'thinktwit');
     1748                        $output .= esc_html__("Every 12 hours", 'thinktwit');
    17431749                        break;
    17441750                    case 24:
    1745                         $output .= __("Every day", 'thinktwit');
     1751                        $output .= esc_html__("Every day", 'thinktwit');
    17461752                        break;
    17471753                    case 48:
    1748                         $output .= __("Every 2 days", 'thinktwit');
     1754                        $output .= esc_html__("Every 2 days", 'thinktwit');
    17491755                        break;
    17501756                }
    17511757               
    17521758                $output .= "</p>";
    1753                 $output .= "<p><b>" . __("Show username:", 'thinktwit') . "</b> ";
     1759                $output .= "<p><b>" . esc_html__("Show username:", 'thinktwit') . "</b> ";
    17541760
    17551761                switch ($show_username) {
    17561762                    case "none":
    1757                         $output .= __("None", 'thinktwit');
     1763                        $output .= esc_html__("None", 'thinktwit');
    17581764                        break;
    17591765                    case "name":
    1760                         $output .= __("Name", 'thinktwit');
     1766                        $output .= esc_html__("Name", 'thinktwit');
    17611767                        break;
    17621768                    case "username":
    1763                         $output .= __("Username", 'thinktwit');
     1769                        $output .= esc_html__("Username", 'thinktwit');
    17641770                        break;
    17651771                }
    17661772               
    17671773                $output .= "</p>";
    1768                 $output .= "<p><b>" . __("Show username's avatar:", 'thinktwit') . "</b> " . ($show_avatar ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";
    1769                 $output .= "<p><b>" . __("Show when published:", 'thinktwit') . "</b> " . ($show_published ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";
    1770                 $output .= "<p><b>" . __("Show 'Follow @username' links:", 'thinktwit') . "</b> " . ($show_follow ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";
    1771                 $output .= "<p><b>" . __("Open links in new window:", 'thinktwit') . "</b> " . ($links_new_window ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";
    1772                 $output .= "<p><b>" . __("Prevent caching e.g. by WP Super Cache:", 'thinktwit') . "</b> " . ($no_cache ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";
    1773                 $output .= "<p><b>" . __("Live update frequency (in seconds, set to zero to turn off):", 'thinktwit') . "</b> " . $live_update_freq . "</p>";
    1774                 $output .= "<p><b>" . __("Output debug messages:", 'thinktwit') . "</b> " . ($debug ? __("Yes", 'thinktwit') : __("No", 'thinktwit')) . "</p>";     
    1775                 $output .= "<p><b>" . __("Username URL:", 'thinktwit') . "</b> " . $username_url . "</p>";
    1776                 $output .= "<p><b>" . __("Hashtag URL:", 'thinktwit') . "</b> " . $hashtag_url . "</p>";
    1777                 $output .= "<p><b>" . __("Time prefix:", 'thinktwit') . "</b> " . $time_settings[0] . "</p>";
    1778                 $output .= "<p><b>" . __("Less than 59 seconds ago:", 'thinktwit') . "</b> " . $time_settings[1] . "</p>";
    1779                 $output .= "<p><b>" . __("Less than 1 minute 59 seconds ago:", 'thinktwit') . "</b> " . $time_settings[2] . "</p>";
    1780                 $output .= "<p><b>" . __("Less than 50 minutes ago:", 'thinktwit') . "</b> " . $time_settings[3] . "</p>";
    1781                 $output .= "<p><b>" . __("Less than 89 minutes ago:", 'thinktwit') . "</b> " . $time_settings[4] . "</p>";
    1782                 $output .= "<p><b>" . __("Less than 150 minutes ago:", 'thinktwit') . "</b> " . $time_settings[5] . "</p>";
    1783                 $output .= "<p><b>" . __("Less than 23 hours ago:", 'thinktwit') . "</b> " . $time_settings[6] . "</p>";
    1784                 $output .= "<p><b>" . __("Less than 36 hours:", 'thinktwit') . "</b> " . $time_settings[7] . "</p>";
    1785                 $output .= "<p><b>" . __("Less than 48 hours ago:", 'thinktwit') . "</b> " . $time_settings[8] . "</p>";
    1786                 $output .= "<p><b>" . __("More than 48 hours ago:", 'thinktwit') . "</b> " . $time_settings[9] . "</p>";
    1787                 $output .= "<p><b>" . __("No recent tweets:", 'thinktwit') . "</b> " . $time_settings[10] . "</p>";
     1774                $output .= "<p><b>" . esc_html__("Show username's avatar:", 'thinktwit') . "</b> " . ($show_avatar ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";
     1775                $output .= "<p><b>" . esc_html__("Show when published:", 'thinktwit') . "</b> " . ($show_published ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";
     1776                $output .= "<p><b>" . esc_html__("Show 'Follow @username' links:", 'thinktwit') . "</b> " . ($show_follow ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";
     1777                $output .= "<p><b>" . esc_html__("Open links in new window:", 'thinktwit') . "</b> " . ($links_new_window ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";
     1778                $output .= "<p><b>" . esc_html__("Prevent caching e.g. by WP Super Cache:", 'thinktwit') . "</b> " . ($no_cache ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";
     1779                $output .= "<p><b>" . esc_html__("Live update frequency (in seconds, set to zero to turn off):", 'thinktwit') . "</b> " . $live_update_freq . "</p>";
     1780                $output .= "<p><b>" . esc_html__("Output debug messages:", 'thinktwit') . "</b> " . ($debug ? esc_html__("Yes", 'thinktwit') : esc_html__("No", 'thinktwit')) . "</p>";     
     1781                $output .= "<p><b>" . esc_html__("Username URL:", 'thinktwit') . "</b> " . $username_url . "</p>";
     1782                $output .= "<p><b>" . esc_html__("Hashtag URL:", 'thinktwit') . "</b> " . $hashtag_url . "</p>";
     1783                $output .= "<p><b>" . esc_html__("Time prefix:", 'thinktwit') . "</b> " . $time_settings[0] . "</p>";
     1784                $output .= "<p><b>" . esc_html__("Less than 59 seconds ago:", 'thinktwit') . "</b> " . $time_settings[1] . "</p>";
     1785                $output .= "<p><b>" . esc_html__("Less than 1 minute 59 seconds ago:", 'thinktwit') . "</b> " . $time_settings[2] . "</p>";
     1786                $output .= "<p><b>" . esc_html__("Less than 50 minutes ago:", 'thinktwit') . "</b> " . $time_settings[3] . "</p>";
     1787                $output .= "<p><b>" . esc_html__("Less than 89 minutes ago:", 'thinktwit') . "</b> " . $time_settings[4] . "</p>";
     1788                $output .= "<p><b>" . esc_html__("Less than 150 minutes ago:", 'thinktwit') . "</b> " . $time_settings[5] . "</p>";
     1789                $output .= "<p><b>" . esc_html__("Less than 23 hours ago:", 'thinktwit') . "</b> " . $time_settings[6] . "</p>";
     1790                $output .= "<p><b>" . esc_html__("Less than 36 hours:", 'thinktwit') . "</b> " . $time_settings[7] . "</p>";
     1791                $output .= "<p><b>" . esc_html__("Less than 48 hours ago:", 'thinktwit') . "</b> " . $time_settings[8] . "</p>";
     1792                $output .= "<p><b>" . esc_html__("More than 48 hours ago:", 'thinktwit') . "</b> " . $time_settings[9] . "</p>";
     1793                $output .= "<p><b>" . esc_html__("No recent tweets:", 'thinktwit') . "</b> " . $time_settings[10] . "</p>";
    17881794            }
    17891795
     
    19491955             
    19501956                // Output the feed
    1951                 echo ThinkTwit::parse_feed(ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_widget_id"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_usernames"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_hashtags"]),
    1952                   ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_hashtag_filter"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_username_suffix"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_limit"]),
    1953                   ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_max_days"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_update_frequency"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_show_username"]),
    1954                   ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_show_avatar"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_show_published"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_show_follow"]),
    1955                   ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_links_new_window"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_no_cache"]), ThinkTwit::sanitise_text_preserve_whitespace($_POST["thinktwit_debug"]), $time_settings);
     1957                echo ThinkTwit::parse_feed(ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_widget_id"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_usernames"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_hashtags"]),
     1958                  ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_hashtag_filter"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_username_suffix"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_limit"]),
     1959                  ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_max_days"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_update_frequency"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_show_username"]),
     1960                  ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_show_avatar"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_show_published"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_show_follow"]),
     1961                  ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_links_new_window"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_no_cache"]), ThinkTwit::escape_text_preserve_whitespace($_POST["thinktwit_debug"]), $time_settings);
    19561962            } else {
    19571963                // Otherwise display an error and exit the call
     
    21802186        // Sanitise text but preserving whitespace
    21812187        private static function sanitise_text_preserve_whitespace($text) {
     2188            // Replace spaces with =!=, then sanitise the input, and then replace the =!= with space again
    21822189            return str_replace("=!=", " ", sanitize_text_field(str_replace(" ", "=!=", $text)));
    21832190        }
Note: See TracChangeset for help on using the changeset viewer.