Changeset 2576103
- Timestamp:
- 08/01/2021 05:04:22 PM (5 years ago)
- File:
-
- 1 edited
-
thinktwit/trunk/thinktwit.php (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thinktwit/trunk/thinktwit.php
r2558190 r2576103 69 69 public function __construct() { 70 70 // 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'); 72 72 73 73 // Load jQuery … … 224 224 public function form($instance) { 225 225 // Set up some default widget settings 226 $defaults = array("title" => __("My Tweets", 'thinktwit'),226 $defaults = array("title" => esc_html__("My Tweets", 'thinktwit'), 227 227 "usernames" => THINKTWIT_USERNAMES, 228 228 "hashtags" => THINKTWIT_HASHTAGS, … … 260 260 <div> 261 261 <!-- 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> 263 263 264 264 <!-- 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> 266 266 267 267 <!-- 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> 269 269 270 270 <!-- HASHTAG FILTER --> … … 275 275 276 276 <!-- 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> 278 278 279 279 <!-- 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> 281 281 282 282 <!-- 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> 284 284 285 285 <!-- UPDATE FREQUENCY --> … … 334 334 335 335 <!-- 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> 337 337 338 338 <!-- OUTPUT DEBUG MESSAGES --> … … 350 350 351 351 <!-- 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> 353 353 354 354 <!-- 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> 356 356 357 357 <!-- 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> 359 359 360 360 <!-- 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> 362 362 363 363 <!-- 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> 365 365 366 366 <!-- 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> 368 368 369 369 <!-- 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> 371 371 372 372 <!-- 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> 374 374 375 375 <!-- 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> 377 377 378 378 <!-- 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> 380 380 381 381 <!-- 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> 383 383 </div> 384 384 </div> … … 410 410 $("#widget-thinktwit-<?php echo $id[2]; ?>-reset_settings").live("click", function() { 411 411 // 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); ?>"); 438 438 439 439 // Set live_update_cache readonly based upon current value of no_cache … … 463 463 if ($file == $this_plugin) { 464 464 // 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>"; 466 466 467 467 // Add it to the front of the links array … … 484 484 if ($file == $this_plugin) { 485 485 // 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>"; 489 489 } 490 490 … … 515 515 add_settings_section( 516 516 "general_settings", 517 __("General Settings", 'thinktwit'),517 esc_html__("General Settings", 'thinktwit'), 518 518 "ThinkTwit::admin_page_general_section_info", 519 519 "thinktwit" … … 522 522 add_settings_field( 523 523 "cleanup_period", 524 __("Cleanup period", 'thinktwit'),524 esc_html__("Cleanup period", 'thinktwit'), 525 525 "ThinkTwit::create_admin_page_cleanup_field", 526 526 "thinktwit", … … 530 530 add_settings_field( 531 531 "use_default_style", 532 __("Use default stylesheet", 'thinktwit'),532 esc_html__("Use default stylesheet", 'thinktwit'), 533 533 "ThinkTwit::create_admin_page_use_default_style_field", 534 534 "thinktwit", … … 538 538 add_settings_section( 539 539 "twitter_api_settings", 540 __("Twitter API Settings", 'thinktwit'),540 esc_html__("Twitter API Settings", 'thinktwit'), 541 541 "ThinkTwit::admin_page_twitter_section_info", 542 542 "thinktwit" … … 546 546 add_settings_field( 547 547 "consumer_key", 548 __("Consumer key", 'thinktwit'),548 esc_html__("Consumer key", 'thinktwit'), 549 549 "ThinkTwit::create_admin_page_key_field", 550 550 "thinktwit", … … 554 554 add_settings_field( 555 555 "consumer_secret", 556 __("Consumer secret", 'thinktwit'),556 esc_html__("Consumer secret", 'thinktwit'), 557 557 "ThinkTwit::create_admin_page_secret_field", 558 558 "thinktwit", … … 586 586 if (!is_array($settings)) { 587 587 $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'); 591 591 } else { // Otherwise get the stored values after checking they are set 592 592 // If the version is set then get it … … 603 603 } else { 604 604 // Otherwise set to none 605 $cache_names = __("none", 'thinktwit');605 $cache_names = esc_html__("none", 'thinktwit'); 606 606 } 607 607 608 608 // 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)) { 610 610 // Format the timestamps correctly 611 611 $last_cleanup = date('D F jS, Y H:i:s', $settings["last_cleanup"]); 612 612 } else { 613 613 // Otherwise set to never 614 $last_cleanup = __("never", 'thinktwit');614 $last_cleanup = esc_html__("never", 'thinktwit'); 615 615 } 616 616 617 617 // 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)) { 619 619 // Separate the Unix timestamp for easier disection 620 620 list($microSec, $timeStamp) = explode(" ", $settings["updated"]); … … 624 624 } else { 625 625 // Otherwise set to never 626 $updated = __("never", 'thinktwit');626 $updated = esc_html__("never", 'thinktwit'); 627 627 } 628 628 } … … 644 644 645 645 // If the cache is now empty 646 if (response == \"" . __("empty", 'thinktwit') . "\") {646 if (response == \"" . esc_html__("empty", 'thinktwit') . "\") { 647 647 // Disable the button 648 648 $('#clear_cache').attr('disabled','disabled'); … … 652 652 }); 653 653 </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>"; 660 660 echo "</tbody></table>"; 661 661 } … … 663 663 // Twitter section message for the admin page 664 664 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>"; 666 666 } 667 667 … … 679 679 $settings["version"] = ThinkTwit::get_version(); 680 680 $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'); 683 683 $settings["consumer_key"] = ""; 684 684 $settings["consumer_secret"] = ""; … … 753 753 // Return the remaining cache names (should be empty) 754 754 if (empty($cache_names)) { 755 return __("empty", 'thinktwit');755 return esc_html__("empty", 'thinktwit'); 756 756 } else { 757 757 return $cache_names; … … 1015 1015 1016 1016 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))); 1017 1023 } 1018 1024 … … 1538 1544 } else { 1539 1545 // 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>'); 1541 1547 } 1542 1548 }); … … 1713 1719 // If user wishes to output debug info then do so 1714 1720 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> "; 1724 1730 1725 1731 switch ($update_frequency) { 1726 1732 case -1: 1727 $output .= __("Live (uncached)", 'thinktwit');1733 $output .= esc_html__("Live (uncached)", 'thinktwit'); 1728 1734 break; 1729 1735 case 0: 1730 $output .= __("Live (cached)", 'thinktwit');1736 $output .= esc_html__("Live (cached)", 'thinktwit'); 1731 1737 break; 1732 1738 case 1: 1733 $output .= __("Hourly", 'thinktwit');1739 $output .= esc_html__("Hourly", 'thinktwit'); 1734 1740 break; 1735 1741 case 2: 1736 $output .= __("Every 2 hours", 'thinktwit');1742 $output .= esc_html__("Every 2 hours", 'thinktwit'); 1737 1743 break; 1738 1744 case 4: 1739 $output .= __("Every 4 hours", 'thinktwit');1745 $output .= esc_html__("Every 4 hours", 'thinktwit'); 1740 1746 break; 1741 1747 case 12: 1742 $output .= __("Every 12 hours", 'thinktwit');1748 $output .= esc_html__("Every 12 hours", 'thinktwit'); 1743 1749 break; 1744 1750 case 24: 1745 $output .= __("Every day", 'thinktwit');1751 $output .= esc_html__("Every day", 'thinktwit'); 1746 1752 break; 1747 1753 case 48: 1748 $output .= __("Every 2 days", 'thinktwit');1754 $output .= esc_html__("Every 2 days", 'thinktwit'); 1749 1755 break; 1750 1756 } 1751 1757 1752 1758 $output .= "</p>"; 1753 $output .= "<p><b>" . __("Show username:", 'thinktwit') . "</b> ";1759 $output .= "<p><b>" . esc_html__("Show username:", 'thinktwit') . "</b> "; 1754 1760 1755 1761 switch ($show_username) { 1756 1762 case "none": 1757 $output .= __("None", 'thinktwit');1763 $output .= esc_html__("None", 'thinktwit'); 1758 1764 break; 1759 1765 case "name": 1760 $output .= __("Name", 'thinktwit');1766 $output .= esc_html__("Name", 'thinktwit'); 1761 1767 break; 1762 1768 case "username": 1763 $output .= __("Username", 'thinktwit');1769 $output .= esc_html__("Username", 'thinktwit'); 1764 1770 break; 1765 1771 } 1766 1772 1767 1773 $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>"; 1788 1794 } 1789 1795 … … 1949 1955 1950 1956 // 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); 1956 1962 } else { 1957 1963 // Otherwise display an error and exit the call … … 2180 2186 // Sanitise text but preserving whitespace 2181 2187 private static function sanitise_text_preserve_whitespace($text) { 2188 // Replace spaces with =!=, then sanitise the input, and then replace the =!= with space again 2182 2189 return str_replace("=!=", " ", sanitize_text_field(str_replace(" ", "=!=", $text))); 2183 2190 }
Note: See TracChangeset
for help on using the changeset viewer.