Twitter Widget Pro - Version 2.3.7

Version Description

Adds an option to clear update locks, which may fix the updating issue some people are having

Download this release

Release Info

Developer aaroncampbell
Plugin Icon wp plugin Twitter Widget Pro
Version 2.3.7
Comparing to
See all releases

Code changes from version 2.3.6 to 2.3.7

Files changed (2) hide show
  1. readme.txt +7 -1
  2. wp-twitter-widget.php +40 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
- Stable tag: 2.3.6
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
@@ -132,6 +132,9 @@ Aparently the database queries required to display the friends feed was causing
132
 
133
  == Upgrade Notice ==
134
 
 
 
 
135
  = 2.3.6 =
136
  Small fix for "invalid argument supplied for foreach" error that some people are getting
137
 
@@ -155,6 +158,9 @@ Fewer "could not connect to Twitter" messages, new links (reply, retweet, favori
155
 
156
  == Changelog ==
157
 
 
 
 
158
  = 2.3.6 =
159
  * Make sure we didn't get a string from json_decode()
160
 
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
+ Stable tag: 2.3.7
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
132
 
133
  == Upgrade Notice ==
134
 
135
+ = 2.3.7 =
136
+ Adds an option to clear update locks, which may fix the updating issue some people are having
137
+
138
  = 2.3.6 =
139
  Small fix for "invalid argument supplied for foreach" error that some people are getting
140
 
158
 
159
  == Changelog ==
160
 
161
+ = 2.3.7 =
162
+ * Add option to clear TLC update locks
163
+
164
  = 2.3.6 =
165
  * Make sure we didn't get a string from json_decode()
166
 
wp-twitter-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
- * Version: 2.3.6
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://bluedogwebservices.com/
9
  * License: GPLv2 or later
@@ -30,7 +30,7 @@
30
 
31
  require_once( 'tlc-transients.php' );
32
  require_once( 'xavisys-plugin-framework.php' );
33
- define( 'TWP_VERSION', '2.3.5' );
34
 
35
  /**
36
  * WP_Widget_Twitter_Pro is the class that handles the main widget.
@@ -205,6 +205,8 @@ class wpTwitterWidget extends XavisysPlugin {
205
  /**
206
  * Add filters and actions
207
  */
 
 
208
  add_action( 'widgets_init', array( $this, 'register' ), 11 );
209
  add_filter( 'widget_twitter_content', array( $this, 'linkTwitterUsers' ) );
210
  add_filter( 'widget_twitter_content', array( $this, 'linkUrls' ) );
@@ -238,12 +240,38 @@ class wpTwitterWidget extends XavisysPlugin {
238
  return $this->_slug;
239
  }
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  public function addOptionsMetaBoxes() {
242
  add_meta_box( $this->_slug . '-general-settings', __( 'General Settings', $this->_slug ), array( $this, 'generalSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
243
  add_meta_box( $this->_slug . '-defaults', __( 'Defaults', $this->_slug ), array( $this, 'defaultSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
244
  }
245
 
246
  public function generalSettingsMetaBox() {
 
247
  ?>
248
  <table class="form-table">
249
  <tr valign="top">
@@ -257,7 +285,16 @@ class wpTwitterWidget extends XavisysPlugin {
257
  <input class="checkbox" type="radio" value="http" id="twp_http_vs_https_http" name="twp[http_vs_https]"<?php checked( $this->_settings['twp']['http_vs_https'], 'http' ); ?> />
258
  <label for="twp_http_vs_https_http"><?php _e( 'Use Twitter API via HTTP', $this->_slug ); ?></label>
259
  <br />
260
- <small>Some servers seem to have issues connecting via HTTPS. If you're experiencing issues with your feed not updating, try setting this to HTTP</small>
 
 
 
 
 
 
 
 
 
261
  </td>
262
  </tr>
263
  </table>
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
+ * Version: 2.3.7
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://bluedogwebservices.com/
9
  * License: GPLv2 or later
30
 
31
  require_once( 'tlc-transients.php' );
32
  require_once( 'xavisys-plugin-framework.php' );
33
+ define( 'TWP_VERSION', '2.3.7' );
34
 
35
  /**
36
  * WP_Widget_Twitter_Pro is the class that handles the main widget.
205
  /**
206
  * Add filters and actions
207
  */
208
+ add_action( 'admin_init', array( $this, 'handle_actions' ) );
209
+ add_action( 'admin_notices', array( $this, 'show_messages' ) );
210
  add_action( 'widgets_init', array( $this, 'register' ), 11 );
211
  add_filter( 'widget_twitter_content', array( $this, 'linkTwitterUsers' ) );
212
  add_filter( 'widget_twitter_content', array( $this, 'linkUrls' ) );
240
  return $this->_slug;
241
  }
242
 
243
+ public function handle_actions() {
244
+ if ( empty( $_GET['action'] ) || empty( $_GET['page'] ) || $_GET['page'] != $this->_hook )
245
+ return;
246
+
247
+ if ( 'clear-locks' == $_GET['action'] ) {
248
+ check_admin_referer( 'clear-locks' );
249
+ $redirect_args = array( 'message' => strtolower( $_GET['action'] ) );
250
+ global $wpdb;
251
+ $locks_q = "DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE '_transient_tlc_up__twp%'";
252
+ $redirect_args['locks_cleared'] = $wpdb->query( $locks_q );
253
+ wp_safe_redirect( add_query_arg( $redirect_args, remove_query_arg( array( 'action', '_wpnonce' ) ) ) );
254
+ exit;
255
+ }
256
+ }
257
+
258
+ public function show_messages() {
259
+ if ( ! empty( $_GET['message'] ) && 'clear-locks' == $_GET['message'] ) {
260
+ if ( empty( $_GET['locks_cleared'] ) || 0 == $_GET['locks_cleared'] )
261
+ $msg = __( 'There were no locks to clear!', $this->_slug );
262
+ else
263
+ $msg = sprintf( _n( 'Successfully cleared %d lock.', 'Successfully cleared %d locks.', $_GET['locks_cleared'], $this->_slug ), $_GET['locks_cleared'] );
264
+ echo "<div class='updated'>" . esc_html( $msg ) . '</div>';
265
+ }
266
+ }
267
+
268
  public function addOptionsMetaBoxes() {
269
  add_meta_box( $this->_slug . '-general-settings', __( 'General Settings', $this->_slug ), array( $this, 'generalSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
270
  add_meta_box( $this->_slug . '-defaults', __( 'Defaults', $this->_slug ), array( $this, 'defaultSettingsMetaBox' ), 'xavisys-' . $this->_slug, 'main' );
271
  }
272
 
273
  public function generalSettingsMetaBox() {
274
+ $clear_locks_url = wp_nonce_url( add_query_arg( array( 'action' => 'clear-locks' ) ), 'clear-locks' );
275
  ?>
276
  <table class="form-table">
277
  <tr valign="top">
285
  <input class="checkbox" type="radio" value="http" id="twp_http_vs_https_http" name="twp[http_vs_https]"<?php checked( $this->_settings['twp']['http_vs_https'], 'http' ); ?> />
286
  <label for="twp_http_vs_https_http"><?php _e( 'Use Twitter API via HTTP', $this->_slug ); ?></label>
287
  <br />
288
+ <small><?php _e( "Some servers seem to have issues connecting via HTTPS. If you're experiencing issues with your feed not updating, try setting this to HTTP.", $this->_slug ); ?></small>
289
+ </td>
290
+ </tr>
291
+ <tr>
292
+ <th scope="row">
293
+ <?php _e( "Clear Update Locks:", $this->_slug );?>
294
+ </th>
295
+ <td>
296
+ <a href="<?php echo esc_url( $clear_locks_url ); ?>"><?php _e( 'Clear Update Locks', $this->_slug ); ?></a><br />
297
+ <small><?php _e( "A small perecntage of servers seem to have issues where an update lock isn't getting cleared. If you're experiencing issues with your feed not updating, try clearing the update locks.", $this->_slug ); ?></small>
298
  </td>
299
  </tr>
300
  </table>