Version Description
- Properly registering settings, should fix problem with WPMU
Download this release
Release Info
Developer | aaroncampbell |
Plugin | Twitter Widget Pro |
Version | 1.4.7 |
Comparing to | |
See all releases |
Code changes from version 1.4.6 to 1.4.7
- readme.txt +5 -2
- upgrade.html +1 -1
- wp-twitter-widget.php +40 -34
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¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
|
4 |
Tags: twitter, widget, feed
|
5 |
Requires at least: 2.7
|
6 |
-
Tested up to: 2.8.
|
7 |
-
Stable tag: 1.4.
|
8 |
|
9 |
A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
|
10 |
|
@@ -46,6 +46,9 @@ Aparently the database queries required to display the friends feed was causing
|
|
46 |
|
47 |
== Changelog ==
|
48 |
|
|
|
|
|
|
|
49 |
= 1.4.6 =
|
50 |
* Added ability to hide @replies from your widget
|
51 |
|
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¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
|
4 |
Tags: twitter, widget, feed
|
5 |
Requires at least: 2.7
|
6 |
+
Tested up to: 2.8.2
|
7 |
+
Stable tag: 1.4.7
|
8 |
|
9 |
A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
|
10 |
|
46 |
|
47 |
== Changelog ==
|
48 |
|
49 |
+
= 1.4.7 =
|
50 |
+
* Properly registering settings, should fix problem with WPMU
|
51 |
+
|
52 |
= 1.4.6 =
|
53 |
* Added ability to hide @replies from your widget
|
54 |
|
upgrade.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<p><a href="http://wordpress.org/extend/plugins/twitter-widget-pro/changelog/">Change Log</a></p>
|
2 |
<ul style="list-style: disc inside; padding: 5px 0 0 15px; font-weight: normal;">
|
3 |
-
<li>
|
4 |
</ul>
|
1 |
<p><a href="http://wordpress.org/extend/plugins/twitter-widget-pro/changelog/">Change Log</a></p>
|
2 |
<ul style="list-style: disc inside; padding: 5px 0 0 15px; font-weight: normal;">
|
3 |
+
<li>Properly registers settings, should fix problem with WPMU</li>
|
4 |
</ul>
|
wp-twitter-widget.php
CHANGED
@@ -3,14 +3,12 @@
|
|
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: 1.4.
|
7 |
* Author: Aaron D. Campbell
|
8 |
* Author URI: http://xavisys.com/
|
9 |
* Text Domain: twitter-widget-pro
|
10 |
*/
|
11 |
|
12 |
-
define('TWP_VERSION', '1.4.6');
|
13 |
-
|
14 |
/* Copyright 2006 Aaron D. Campbell (email : wp_plugins@xavisys.com)
|
15 |
|
16 |
This program is free software; you can redistribute it and/or modify
|
@@ -37,6 +35,11 @@ class wpTwitterWidgetException extends Exception {}
|
|
37 |
|
38 |
class wpTwitterWidget
|
39 |
{
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Plugin file to test against on plugins page
|
42 |
*
|
@@ -63,6 +66,10 @@ class wpTwitterWidget
|
|
63 |
}
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
66 |
public function admin_menu() {
|
67 |
add_options_page(__('Twitter Widget Pro', 'twitter-widget-pro'), __('Twitter Widget Pro', 'twitter-widget-pro'), 'manage_options', 'TwitterWidgetPro', array($this, 'options'));
|
68 |
}
|
@@ -77,12 +84,12 @@ class wpTwitterWidget
|
|
77 |
*/
|
78 |
public function options() {
|
79 |
//Get our options
|
80 |
-
$
|
81 |
?>
|
82 |
<div class="wrap">
|
83 |
<h2><?php _e('Twitter Widget Pro Options', 'twitter-widget-pro') ?></h2>
|
84 |
<form action="options.php" method="post" id="wp_twitter_widget_pro">
|
85 |
-
<?php
|
86 |
<table class="form-table">
|
87 |
<tr valign="top">
|
88 |
<th scope="row">
|
@@ -92,7 +99,7 @@ class wpTwitterWidget
|
|
92 |
</th>
|
93 |
<td>
|
94 |
<input type="hidden" name="twitter_widget_pro[user_agreed_to_send_system_information]" value="false" />
|
95 |
-
<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', $
|
96 |
<small id="twp_user_agreed_to_send_system_information_help" style="display:none;">
|
97 |
<?php _e('You can help by sending anonymous system information that will help Xavisys make better decisions about new features.', 'twitter-widget-pro'); ?><br />
|
98 |
<?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'); ?>
|
@@ -103,8 +110,6 @@ class wpTwitterWidget
|
|
103 |
<p class="submit">
|
104 |
<input type="submit" name="Submit" value="<?php _e('Update Options »', 'twitter-widget-pro'); ?>" />
|
105 |
</p>
|
106 |
-
<input type="hidden" name="action" value="update" />
|
107 |
-
<input type="hidden" name="page_options" value="twitter_widget_pro" />
|
108 |
</form>
|
109 |
</div>
|
110 |
<?php
|
@@ -628,31 +633,13 @@ profileImage;
|
|
628 |
return sprintf($messages[$key], $count);
|
629 |
}
|
630 |
|
631 |
-
public function activatePlugin() {
|
632 |
-
// If the wga-id has not been generated, generate one and store it.
|
633 |
-
$id = $this->get_id();
|
634 |
-
$o = get_option('twitter_widget_pro');
|
635 |
-
if (!isset($o['user_agreed_to_send_system_information'])) {
|
636 |
-
$o['user_agreed_to_send_system_information'] = 'true';
|
637 |
-
update_option('twitter_widget_pro', $o);
|
638 |
-
}
|
639 |
-
}
|
640 |
-
|
641 |
-
public function get_id() {
|
642 |
-
$id = get_option('twitter_widget_pro-id');
|
643 |
-
if ($id === false) {
|
644 |
-
$id = sha1( get_bloginfo('url') . mt_rand() );
|
645 |
-
update_option('twitter_widget_pro-id', $id);
|
646 |
-
}
|
647 |
-
return $id;
|
648 |
-
}
|
649 |
/**
|
650 |
* if user agrees to send system information and the last sent info is
|
651 |
* outdated then send the stats
|
652 |
*/
|
653 |
public function sendSysInfo() {
|
654 |
-
$
|
655 |
-
if ($
|
656 |
$lastSent = get_option('twp-sysinfo');
|
657 |
$sysinfo = $this->_get_sysinfo();
|
658 |
if (serialize($lastSent) != serialize($sysinfo)) {
|
@@ -667,13 +654,13 @@ profileImage;
|
|
667 |
}
|
668 |
}
|
669 |
|
670 |
-
private function _get_sysinfo()
|
671 |
-
{
|
672 |
global $wpdb;
|
|
|
673 |
$s = array();
|
674 |
-
$s['plugin'] = '
|
675 |
-
$s['id'] = $this->
|
676 |
-
$s['version'] =
|
677 |
|
678 |
$s['php_version'] = phpversion();
|
679 |
$s['mysql_version'] = @mysql_get_server_info($wpdb->dbh);
|
@@ -683,6 +670,25 @@ profileImage;
|
|
683 |
return $s;
|
684 |
}
|
685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
public function addSettingLink( $links, $file ){
|
687 |
if ( empty($this->_pluginBasename) ) {
|
688 |
$this->_pluginBasename = plugin_basename(__FILE__);
|
@@ -704,6 +710,7 @@ $wpTwitterWidget = new wpTwitterWidget();
|
|
704 |
*/
|
705 |
add_action( 'admin_menu', array($wpTwitterWidget,'admin_menu') );
|
706 |
add_filter( 'init', array( $wpTwitterWidget, 'init_locale') );
|
|
|
707 |
add_filter( 'admin_init', array( $wpTwitterWidget, 'sendSysInfo') );
|
708 |
add_action( 'widgets_init', array($wpTwitterWidget, 'register') );
|
709 |
add_filter( 'widget_twitter_content', array($wpTwitterWidget, 'linkTwitterUsers') );
|
@@ -711,4 +718,3 @@ add_filter( 'widget_twitter_content', array($wpTwitterWidget, 'linkUrls') );
|
|
711 |
add_filter( 'widget_twitter_content', array($wpTwitterWidget, 'linkHashtags') );
|
712 |
add_filter( 'widget_twitter_content', 'convert_chars' );
|
713 |
add_filter( 'plugin_action_links', array($wpTwitterWidget, 'addSettingLink'), 10, 2 );
|
714 |
-
register_activation_hook(__FILE__, array($wpTwitterWidget,'activatePlugin'));
|
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: 1.4.7
|
7 |
* Author: Aaron D. Campbell
|
8 |
* Author URI: http://xavisys.com/
|
9 |
* Text Domain: twitter-widget-pro
|
10 |
*/
|
11 |
|
|
|
|
|
12 |
/* Copyright 2006 Aaron D. Campbell (email : wp_plugins@xavisys.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
35 |
|
36 |
class wpTwitterWidget
|
37 |
{
|
38 |
+
/**
|
39 |
+
* @var array Plugin settings
|
40 |
+
*/
|
41 |
+
private $_settings;
|
42 |
+
|
43 |
/**
|
44 |
* Plugin file to test against on plugins page
|
45 |
*
|
66 |
}
|
67 |
}
|
68 |
|
69 |
+
public function registerSettings() {
|
70 |
+
register_setting( 'twitter_widget_pro_options', 'twitter_widget_pro' );
|
71 |
+
}
|
72 |
+
|
73 |
public function admin_menu() {
|
74 |
add_options_page(__('Twitter Widget Pro', 'twitter-widget-pro'), __('Twitter Widget Pro', 'twitter-widget-pro'), 'manage_options', 'TwitterWidgetPro', array($this, 'options'));
|
75 |
}
|
84 |
*/
|
85 |
public function options() {
|
86 |
//Get our options
|
87 |
+
$this->_getSettings();
|
88 |
?>
|
89 |
<div class="wrap">
|
90 |
<h2><?php _e('Twitter Widget Pro Options', 'twitter-widget-pro') ?></h2>
|
91 |
<form action="options.php" method="post" id="wp_twitter_widget_pro">
|
92 |
+
<?php settings_fields( 'twitter_widget_pro_options' ); ?>
|
93 |
<table class="form-table">
|
94 |
<tr valign="top">
|
95 |
<th scope="row">
|
99 |
</th>
|
100 |
<td>
|
101 |
<input type="hidden" name="twitter_widget_pro[user_agreed_to_send_system_information]" value="false" />
|
102 |
+
<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 />
|
103 |
<small id="twp_user_agreed_to_send_system_information_help" style="display:none;">
|
104 |
<?php _e('You can help by sending anonymous system information that will help Xavisys make better decisions about new features.', 'twitter-widget-pro'); ?><br />
|
105 |
<?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'); ?>
|
110 |
<p class="submit">
|
111 |
<input type="submit" name="Submit" value="<?php _e('Update Options »', 'twitter-widget-pro'); ?>" />
|
112 |
</p>
|
|
|
|
|
113 |
</form>
|
114 |
</div>
|
115 |
<?php
|
633 |
return sprintf($messages[$key], $count);
|
634 |
}
|
635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
/**
|
637 |
* if user agrees to send system information and the last sent info is
|
638 |
* outdated then send the stats
|
639 |
*/
|
640 |
public function sendSysInfo() {
|
641 |
+
$this->_getSettings();
|
642 |
+
if ($this->_settings['user_agreed_to_send_system_information'] == 'true') {
|
643 |
$lastSent = get_option('twp-sysinfo');
|
644 |
$sysinfo = $this->_get_sysinfo();
|
645 |
if (serialize($lastSent) != serialize($sysinfo)) {
|
654 |
}
|
655 |
}
|
656 |
|
657 |
+
private function _get_sysinfo() {
|
|
|
658 |
global $wpdb;
|
659 |
+
$pluginData = get_plugin_data(__FILE__);
|
660 |
$s = array();
|
661 |
+
$s['plugin'] = $pluginData['Name'];
|
662 |
+
$s['id'] = $this->_get_id($pluginData['Name']);
|
663 |
+
$s['version'] = $pluginData['Version'];
|
664 |
|
665 |
$s['php_version'] = phpversion();
|
666 |
$s['mysql_version'] = @mysql_get_server_info($wpdb->dbh);
|
670 |
return $s;
|
671 |
}
|
672 |
|
673 |
+
private function _get_id($name) {
|
674 |
+
$this->_getSettings();
|
675 |
+
if ( empty($this->_settings['sysinfo-id']) ) {
|
676 |
+
$this->_settings['sysinfo-id'] = sha1( get_bloginfo('url') . $name );
|
677 |
+
$this->_updateSettings();
|
678 |
+
}
|
679 |
+
return $this->_settings['sysinfo-id'];
|
680 |
+
}
|
681 |
+
|
682 |
+
private function _updateSettings() {
|
683 |
+
update_option('twitter_widget_pro', $this->_settings);
|
684 |
+
}
|
685 |
+
private function _getSettings() {
|
686 |
+
$defaults = array(
|
687 |
+
);
|
688 |
+
$this->_settings = get_option('twitter_widget_pro');
|
689 |
+
$this->_settings = wp_parse_args($this->_settings, $defaults);
|
690 |
+
}
|
691 |
+
|
692 |
public function addSettingLink( $links, $file ){
|
693 |
if ( empty($this->_pluginBasename) ) {
|
694 |
$this->_pluginBasename = plugin_basename(__FILE__);
|
710 |
*/
|
711 |
add_action( 'admin_menu', array($wpTwitterWidget,'admin_menu') );
|
712 |
add_filter( 'init', array( $wpTwitterWidget, 'init_locale') );
|
713 |
+
add_filter( 'admin_init', array( $wpTwitterWidget, 'registerSettings') );
|
714 |
add_filter( 'admin_init', array( $wpTwitterWidget, 'sendSysInfo') );
|
715 |
add_action( 'widgets_init', array($wpTwitterWidget, 'register') );
|
716 |
add_filter( 'widget_twitter_content', array($wpTwitterWidget, 'linkTwitterUsers') );
|
718 |
add_filter( 'widget_twitter_content', array($wpTwitterWidget, 'linkHashtags') );
|
719 |
add_filter( 'widget_twitter_content', 'convert_chars' );
|
720 |
add_filter( 'plugin_action_links', array($wpTwitterWidget, 'addSettingLink'), 10, 2 );
|
|