Twitter Widget Pro - Version 2.0.4

Version Description

  • Added twitterwidget-title and twitterwidget-rss classes to the title and rss links for separate styling
  • Removed the optional anonymous statistics collection. Nothing is ever collected anymore.
Download this release

Release Info

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

Code changes from version 2.0.3 to 2.0.4

languages/twitter-widget-pro.pot CHANGED
@@ -7,7 +7,7 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
10
- "POT-Creation-Date: 2009-09-27 22:49+0000\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -20,7 +20,7 @@ msgstr ""
20
  msgid "Follow a Twitter Feed"
21
  msgstr ""
22
 
23
- #: wp-twitter-widget.php:46 wp-twitter-widget.php:449
24
  msgid "Twitter Widget Pro"
25
  msgstr ""
26
 
@@ -190,38 +190,6 @@ msgid_plural "about %s seconds ago"
190
  msgstr[0] ""
191
  msgstr[1] ""
192
 
193
- #: wp-twitter-widget.php:465
194
- msgid "Twitter Widget Pro Options"
195
- msgstr ""
196
-
197
- #: wp-twitter-widget.php:471
198
- msgid "Click for Help!"
199
- msgstr ""
200
-
201
- #: wp-twitter-widget.php:472
202
- msgid "System Information:"
203
- msgstr ""
204
-
205
- #: wp-twitter-widget.php:477
206
- msgid "I agree to send anonymous system information"
207
- msgstr ""
208
-
209
- #: wp-twitter-widget.php:479
210
- msgid ""
211
- "You can help by sending anonymous system information that will help Xavisys "
212
- "make better decisions about new features."
213
- msgstr ""
214
-
215
- #: wp-twitter-widget.php:480
216
- msgid ""
217
- "The information will be sent anonymously, but a unique identifier will be "
218
- "sent to prevent duplicate entries from the same installation."
219
- msgstr ""
220
-
221
- #: wp-twitter-widget.php:486
222
- msgid "Update Options &raquo;"
223
- msgstr ""
224
-
225
- #: wp-twitter-widget.php:579
226
  msgid "Settings"
227
  msgstr ""
7
  msgstr ""
8
  "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
10
+ "POT-Creation-Date: 2009-10-27 19:37+0000\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
20
  msgid "Follow a Twitter Feed"
21
  msgstr ""
22
 
23
+ #: wp-twitter-widget.php:46
24
  msgid "Twitter Widget Pro"
25
  msgstr ""
26
 
190
  msgstr[0] ""
191
  msgstr[1] ""
192
 
193
+ #: wp-twitter-widget.php:476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  msgid "Settings"
195
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: aaroncampbell
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40xavisys%2ecom&item_name=Twitter%20Widget%20Pro&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: twitter, widget, feed
5
  Requires at least: 2.8
6
- Tested up to: 2.8.4
7
- Stable tag: 2.0.3
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
10
 
@@ -50,6 +50,10 @@ No. This error occurs because the plugin requires PHP 5 and you're running PHP
50
 
51
  == Changelog ==
52
 
 
 
 
 
53
  = 2.0.3 =
54
  * Removed some whitespace that was messing up styling for some people
55
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40xavisys%2ecom&item_name=Twitter%20Widget%20Pro&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: twitter, widget, feed
5
  Requires at least: 2.8
6
+ Tested up to: 2.9
7
+ Stable tag: 2.0.4
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
10
 
50
 
51
  == Changelog ==
52
 
53
+ = 2.0.4 =
54
+ * Added twitterwidget-title and twitterwidget-rss classes to the title and rss links for separate styling
55
+ * Removed the optional anonymous statistics collection. Nothing is ever collected anymore.
56
+
57
  = 2.0.3 =
58
  * Removed some whitespace that was messing up styling for some people
59
 
wp-twitter-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://xavisys.com/wordpress-twitter-widget/
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.0.3
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://xavisys.com/
9
  * Text Domain: twitter-widget-pro
@@ -173,10 +173,10 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
173
  $icon = get_option('siteurl').'/wp-includes/images/rss.png';
174
  }
175
  $feedUrl = $this->_getFeedUrl($instance, 'rss', false);
176
- $args['before_title'] .= "<a class='twitterwidget' href='{$feedUrl}' title='" . attribute_escape(__('Syndicate this content', 'twitter-widget-pro')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='{$icon}' alt='RSS' /></a> ";
177
  }
178
  $twitterLink = 'http://twitter.com/' . $instance['username'];
179
- $args['before_title'] .= "<a class='twitterwidget' href='{$twitterLink}' title='" . attribute_escape("Twitter: {$instance['username']}") . "'>";
180
  $args['after_title'] = '</a>' . $args['after_title'];
181
  if (empty($instance['title'])) {
182
  $instance['title'] = "Twitter: {$instance['username']}";
@@ -203,7 +203,9 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
203
  <span class="entry-content"><?php echo apply_filters( 'widget_twitter_content', $tweet->text ); ?></span>
204
  <span class="entry-meta">
205
  <span class="time-meta">
206
- <a href="http://twitter.com/<?php echo $tweet->user->screen_name; ?>/statuses/<?php echo $tweet->id; ?>"><?php echo $tweet->ago; ?></a>
 
 
207
  </span>
208
  <span class="from-meta">
209
  <?php echo sprintf(__('from %s', 'twitter-widget-pro'), str_replace('&', '&amp;', $tweet->source)); ?>
@@ -213,7 +215,9 @@ class WP_Widget_Twitter_Pro extends WP_Widget {
213
  $rtLinkText = sprintf( __('in reply to %s', 'twitter-widget-pro'), $tweet->in_reply_to_screen_name );
214
  echo <<<replyTo
215
  <span class="in-reply-to-meta">
216
- <a href="http://twitter.com/{$tweet->in_reply_to_screen_name}/statuses/{$tweet->in_reply_to_status_id}" class="reply-to">{$rtLinkText}</a>
 
 
217
  </span>
218
  replyTo;
219
  } ?>
@@ -385,7 +389,9 @@ replyTo;
385
  */
386
  private function _getProfileImage($user) {
387
  return <<<profileImage
388
- <a title="{$user->name}" href="http://twitter.com/{$user->screen_name}"><img alt="{$user->name}" src="{$user->profile_image_url}" /></a>
 
 
389
  profileImage;
390
  }
391
  }
@@ -422,10 +428,7 @@ class wpTwitterWidget
422
  /**
423
  * Add filters and actions
424
  */
425
- add_action( 'admin_menu', array($this,'admin_menu') );
426
  add_filter( 'init', array( $this, 'init_locale') );
427
- add_filter( 'admin_init', array( $this, 'registerSettings') );
428
- add_filter( 'admin_init', array( $this, 'sendSysInfo') );
429
  add_action( 'widgets_init', array($this, 'register') );
430
  add_filter( 'widget_twitter_content', array($this, 'linkTwitterUsers') );
431
  add_filter( 'widget_twitter_content', array($this, 'linkUrls') );
@@ -435,53 +438,11 @@ class wpTwitterWidget
435
  add_action ( 'in_plugin_update_message-'.plugin_basename ( __FILE__ ) , array ( $this , '_changelog' ), null, 2 );
436
  }
437
 
438
- public function registerSettings() {
439
- register_setting( 'twitter_widget_pro_options', 'twitter_widget_pro' );
440
- }
441
-
442
- public function admin_menu() {
443
- add_options_page(__('Twitter Widget Pro', 'twitter-widget-pro'), __('Twitter Widget Pro', 'twitter-widget-pro'), 'manage_options', 'TwitterWidgetPro', array($this, 'options'));
444
- }
445
-
446
  public function init_locale() {
447
  $lang_dir = basename(dirname(__FILE__)) . '/languages';
448
  load_plugin_textdomain('twitter-widget-pro', 'wp-content/plugins/' . $lang_dir, $lang_dir);
449
  }
450
 
451
- /**
452
- * This is used to display the options page for this plugin
453
- */
454
- public function options() {
455
- //Get our options
456
- $this->_getSettings();
457
- ?>
458
- <div class="wrap">
459
- <h2><?php _e('Twitter Widget Pro Options', 'twitter-widget-pro') ?></h2>
460
- <form action="options.php" method="post" id="wp_twitter_widget_pro">
461
- <?php settings_fields( 'twitter_widget_pro_options' ); ?>
462
- <table class="form-table">
463
- <tr valign="top">
464
- <th scope="row">
465
- <a title="<?php _e('Click for Help!', 'twitter-widget-pro'); ?>" href="#" onclick="jQuery('#twp_user_agreed_to_send_system_information_help').toggle(); return false;"><?php _e('System Information:', 'twitter-widget-pro') ?></a>
466
- </th>
467
- <td>
468
- <input type="hidden" name="twitter_widget_pro[user_agreed_to_send_system_information]" value="false" />
469
- <label for="twp_user_agreed_to_send_system_information"><input type="checkbox" name="twitter_widget_pro[user_agreed_to_send_system_information]" value="true" id="twp_user_agreed_to_send_system_information"<?php checked('true', $this->_settings['user_agreed_to_send_system_information']); ?> /> <?php _e('I agree to send anonymous system information', 'twitter-widget-pro'); ?></label><br />
470
- <small id="twp_user_agreed_to_send_system_information_help" style="display:none;">
471
- <?php _e('You can help by sending anonymous system information that will help Xavisys make better decisions about new features.', 'twitter-widget-pro'); ?><br />
472
- <?php _e('The information will be sent anonymously, but a unique identifier will be sent to prevent duplicate entries from the same installation.', 'twitter-widget-pro'); ?>
473
- </small>
474
- </td>
475
- </tr>
476
- </table>
477
- <p class="submit">
478
- <input type="submit" name="Submit" value="<?php _e('Update Options &raquo;', 'twitter-widget-pro'); ?>" />
479
- </p>
480
- </form>
481
- </div>
482
- <?php
483
- }
484
-
485
  public function _changelog ($pluginData, $newPluginData) {
486
  $url = "{$this->_reposUrl}/{$newPluginData->slug}/tags/{$newPluginData->new_version}/upgrade.html";
487
  $response = wp_remote_get ( $url );
@@ -505,62 +466,6 @@ class wpTwitterWidget
505
  profileImage;
506
  }
507
 
508
- /**
509
- * if user agrees to send system information and the last sent info is
510
- * outdated then send the stats
511
- */
512
- public function sendSysInfo() {
513
- $this->_getSettings();
514
- if ($this->_settings['user_agreed_to_send_system_information'] == 'true') {
515
- $lastSent = get_option('twp-sysinfo');
516
- $sysinfo = $this->_get_sysinfo();
517
- if (serialize($lastSent) != serialize($sysinfo)) {
518
- $params = array(
519
- 'method' => 'POST',
520
- 'blocking' => false,
521
- 'body' => $sysinfo,
522
- );
523
- $resp = wp_remote_request( 'http://xavisys.com/plugin-info.php', $params );
524
- update_option( 'twp-sysinfo', $sysinfo );
525
- }
526
- }
527
- }
528
-
529
- private function _get_sysinfo() {
530
- global $wpdb;
531
- $pluginData = get_plugin_data(__FILE__);
532
- $s = array();
533
- $s['plugin'] = $pluginData['Name'];
534
- $s['id'] = $this->_get_id($pluginData['Name']);
535
- $s['version'] = $pluginData['Version'];
536
-
537
- $s['php_version'] = phpversion();
538
- $s['mysql_version'] = @mysql_get_server_info($wpdb->dbh);
539
- $s['server_software'] = $_SERVER["SERVER_SOFTWARE"];
540
- $s['memory_limit'] = ini_get('memory_limit');
541
-
542
- return $s;
543
- }
544
-
545
- private function _get_id($name) {
546
- $this->_getSettings();
547
- if ( empty($this->_settings['sysinfo-id']) ) {
548
- $this->_settings['sysinfo-id'] = sha1( get_bloginfo('url') . $name );
549
- $this->_updateSettings();
550
- }
551
- return $this->_settings['sysinfo-id'];
552
- }
553
-
554
- private function _updateSettings() {
555
- update_option('twitter_widget_pro', $this->_settings);
556
- }
557
- private function _getSettings() {
558
- $defaults = array(
559
- );
560
- $this->_settings = get_option('twitter_widget_pro');
561
- $this->_settings = wp_parse_args($this->_settings, $defaults);
562
- }
563
-
564
  public function addSettingLink( $links, $file ){
565
  if ( empty($this->_pluginBasename) ) {
566
  $this->_pluginBasename = plugin_basename(__FILE__);
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://xavisys.com/wordpress-twitter-widget/
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.0.4
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://xavisys.com/
9
  * Text Domain: twitter-widget-pro
173
  $icon = get_option('siteurl').'/wp-includes/images/rss.png';
174
  }
175
  $feedUrl = $this->_getFeedUrl($instance, 'rss', false);
176
+ $args['before_title'] .= "<a class='twitterwidget twitterwidget-rss' href='{$feedUrl}' title='" . attribute_escape(__('Syndicate this content', 'twitter-widget-pro')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='{$icon}' alt='RSS' /></a> ";
177
  }
178
  $twitterLink = 'http://twitter.com/' . $instance['username'];
179
+ $args['before_title'] .= "<a class='twitterwidget twitterwidget-title' href='{$twitterLink}' title='" . attribute_escape("Twitter: {$instance['username']}") . "'>";
180
  $args['after_title'] = '</a>' . $args['after_title'];
181
  if (empty($instance['title'])) {
182
  $instance['title'] = "Twitter: {$instance['username']}";
203
  <span class="entry-content"><?php echo apply_filters( 'widget_twitter_content', $tweet->text ); ?></span>
204
  <span class="entry-meta">
205
  <span class="time-meta">
206
+ <a href="http://twitter.com/<?php echo $tweet->user->screen_name; ?>/statuses/<?php echo $tweet->id; ?>">
207
+ <?php echo $tweet->ago; ?>
208
+ </a>
209
  </span>
210
  <span class="from-meta">
211
  <?php echo sprintf(__('from %s', 'twitter-widget-pro'), str_replace('&', '&amp;', $tweet->source)); ?>
215
  $rtLinkText = sprintf( __('in reply to %s', 'twitter-widget-pro'), $tweet->in_reply_to_screen_name );
216
  echo <<<replyTo
217
  <span class="in-reply-to-meta">
218
+ <a href="http://twitter.com/{$tweet->in_reply_to_screen_name}/statuses/{$tweet->in_reply_to_status_id}" class="reply-to">
219
+ {$rtLinkText}
220
+ </a>
221
  </span>
222
  replyTo;
223
  } ?>
389
  */
390
  private function _getProfileImage($user) {
391
  return <<<profileImage
392
+ <a title="{$user->name}" href="http://twitter.com/{$user->screen_name}">
393
+ <img alt="{$user->name}" src="{$user->profile_image_url}" />
394
+ </a>
395
  profileImage;
396
  }
397
  }
428
  /**
429
  * Add filters and actions
430
  */
 
431
  add_filter( 'init', array( $this, 'init_locale') );
 
 
432
  add_action( 'widgets_init', array($this, 'register') );
433
  add_filter( 'widget_twitter_content', array($this, 'linkTwitterUsers') );
434
  add_filter( 'widget_twitter_content', array($this, 'linkUrls') );
438
  add_action ( 'in_plugin_update_message-'.plugin_basename ( __FILE__ ) , array ( $this , '_changelog' ), null, 2 );
439
  }
440
 
 
 
 
 
 
 
 
 
441
  public function init_locale() {
442
  $lang_dir = basename(dirname(__FILE__)) . '/languages';
443
  load_plugin_textdomain('twitter-widget-pro', 'wp-content/plugins/' . $lang_dir, $lang_dir);
444
  }
445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  public function _changelog ($pluginData, $newPluginData) {
447
  $url = "{$this->_reposUrl}/{$newPluginData->slug}/tags/{$newPluginData->new_version}/upgrade.html";
448
  $response = wp_remote_get ( $url );
466
  profileImage;
467
  }
468
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  public function addSettingLink( $links, $file ){
470
  if ( empty($this->_pluginBasename) ) {
471
  $this->_pluginBasename = plugin_basename(__FILE__);