Hi. Can you tell me how to add a “nofollow” attribute to the link? I tried adding it in line 104 but it cause a fatal error! Maybe I put it in the wrong place? Great plugin – Thanks
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Not an error, I suppose. I just wanted to make the indicator on the home page be more informative.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>I’d Like there to be no title when I display tweets on my page. I have left the text boxes blank, but “Twitter Updates” still shows up. How do I remove this? Also, How do I change the size/style/color of the fonts? Thanks!
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Hello,
i am using this plugin since long and it works great for me…..so thanks for this absolutely wonderful plugin,
i have a suggestion/query about this plugin….i want functionality like next-previous tweets, by which user can display one latest tweet and clicking on next previous link, he/she can see his/her next/previous tweets….will you please consider this suggestion/query.
thanks….
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>When placed in the sidebar this widget does not display tweets.
Instead it shows the error message:
Error: Twitter did not respond. Please wait a few minutes and refresh this page.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>I’ve had this issue since day one of using this plugin, everything is up to date.
I’ve looked through the code and found where this is being controlled but can find no way to make the links appear on the same line as normal text. It’s also creating a break immediately after the @ for twitter users (obviously as they’re names are also links)
The website is here:
Any advice is much appreciated. I dont want to change plugins as I like this in all other aspects
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Oddly, it works fine on my local server, then gives me this error from the live server. Error: Twitter did not respond. Please wait a few minutes and refresh this page.
I’ve refreshed many times, and I’ve deactivated and re-activated, shut down other plugins.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Hello,
Is there a way to call this widget via shortcode in posts? Otherwise love this plugin, super easy and works great. Thanks.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>For some reason there is no space in between tweets, they are coming up right on top of each other on the right side of my site. I don’t see any settings or options to fix this and getting frustrated. Can be found here:
https://www.stupidlittleblog.com/wp/
Any help or suggestions would be appreciated.
Thanks!
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>i installed this plugin and did the widgets etc, it does not work.
]]>Hello,
I want to use this plugin. But how can i change the plugin background color?
Thx
]]>Now that the Wicket Twitter Widget is included with the Jetpack will this plugin continue to be updated. There was a new Jetpack just released with Twitter Widget updates but I don’t see anything here.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Shows Error… no tweets.
]]>This plugin has been extremely broken for a long time. I believe it’s not anything to do with WordPress, and more to do with the plugin.
The caching mechanism doesn’t work. The plugin is broken if you need to use a caching plugin to not bombard twitter with API calls.
]]>Error: Twitter did not respond. Please wait a few minutes and refresh this page.
]]>Can I manually call this in my sidebar.php?
]]>Downloaded Jetpack and am using this twitter widget with comicpress 2.9.x. In the sidebar, it lists my tweets but not the ones earlier today. There’s no bullet to indicate a new tweet, just one long paragraph.
the site is– https://quantumgumbo.com
The site is still a work in progress, want to tweak a few things and upload a few finished comics.
]]>I got this error message:
Fatal error: Cannot redeclare class Wickett_Twitter_Widget in (location) /wp-content/plugins/wickett-twitter-widget.php on line 273
]]>Hi, I just installed this plugin and set it to show the 5 most recent tweets. However, instead it’s just showing one tweet and splitting it into 5 lines. The line breaks come before links, and because of the way my theme is set up, the links have bullets appearing in front of them.
I’ve tried looking at the code for the plugin but can’t find the problem. Can someone please help? My site is https://sapac.org/blog. Here’s the code:
<?php
/*
Plugin Name: Wickett Twitter Widget
Plugin URI: https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
Description: Display the Twitter latest updates from a Twitter user inside your theme’s widgets. Customize the number of displayed Tweets, filter out replies, and include retweets.
Version: 1.0.5
Author: Automattic Inc.
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// inits json decoder/encoder object if not already available
global $wp_version;
if ( version_compare( $wp_version, ‘2.9’, ‘<‘ ) && !class_exists( ‘Services_JSON’ ) ) {
include_once( dirname( __FILE__ ) . ‘/class.json.php’ );
}
if ( !function_exists(‘wpcom_time_since’) ) :
/*
* Time since function taken from WordPress.com
*/
function wpcom_time_since( $original, $do_more = 0 ) {
// array of time period chunks
$chunks = array(
array(60 * 60 * 24 * 365 , ‘year’),
array(60 * 60 * 24 * 30 , ‘month’),
array(60 * 60 * 24 * 7, ‘week’),
array(60 * 60 * 24 , ‘day’),
array(60 * 60 , ‘hour’),
array(60 , ‘minute’),
);
$today = time();
$since = $today – $original;
for ($i = 0, $j = count($chunks); $i < $j; $i++) {
$seconds = $chunks[$i][0];
$name = $chunks[$i][1];
if (($count = floor($since / $seconds)) != 0)
break;
}
$print = ($count == 1) ? ‘1 ‘.$name : “$count {$name}s”;
if ($i + 1 < $j) {
$seconds2 = $chunks[$i + 1][0];
$name2 = $chunks[$i + 1][1];
// add second item if it’s greater than 0
if ( (($count2 = floor(($since – ($seconds * $count)) / $seconds2)) != 0) && $do_more )
$print .= ($count2 == 1) ? ‘, 1 ‘.$name2 : “, $count2 {$name2}s”;
}
return $print;
}
endif;
if ( !function_exists(‘http_build_query’) ) :
function http_build_query( $query_data, $numeric_prefix=”, $arg_separator=’&’ ) {
$arr = array();
foreach ( $query_data as $key => $val )
$arr[] = urlencode($numeric_prefix.$key) . ‘=’ . urlencode($val);
return implode($arr, $arg_separator);
}
endif;
class Wickett_Twitter_Widget extends WP_Widget {
function Wickett_Twitter_Widget() {
$widget_ops = array(‘classname’ => ‘widget_twitter’, ‘description’ => __( ‘Display your tweets from Twitter’) );
parent::WP_Widget(‘twitter’, __(‘Twitter’), $widget_ops);
}
function widget( $args, $instance ) {
extract( $args );
$account = trim( urlencode( $instance[‘account’] ) );
if ( empty($account) ) return;
$title = apply_filters(‘widget_title’, $instance[‘title’]);
if ( empty($title) ) $title = __( ‘Twitter Updates’ );
$show = absint( $instance[‘show’] ); // # of Updates to show
if ( $show > 200 ) // Twitter paginates at 200 max tweets. update() should not have accepted greater than 20
$show = 200;
$hidereplies = (bool) $instance[‘hidereplies’];
$include_retweets = (bool) $instance[‘includeretweets’];
echo “{$before_widget}{$before_title}” . esc_html($title) . “{$after_title}”;
if ( !$tweets = wp_cache_get( ‘widget-twitter-‘ . $this->number , ‘widget’ ) ) {
$params = array(
‘screen_name’=>$account, // Twitter account name
‘trim_user’=>true, // only basic user data (slims the result)
‘include_entities’=>false // as of Sept 2010 entities were not included in all applicable Tweets. regex still better
);
/**
* The exclude_replies parameter filters out replies on the server. If combined with count it only filters that number of tweets (not all tweets up to the requested count)
* If we are not filtering out replies then we should specify our requested tweet count
*/
if ( $hidereplies )
$params[‘exclude_replies’] = true;
else
$params[‘count’] = $show;
if ( $include_retweets )
$params[‘include_rts’] = true;
$twitter_json_url = esc_url_raw( ‘https://api.twitter.com/1/statuses/user_timeline.json?’ . http_build_query($params), array(‘http’, ‘https’) );
unset($params);
$response = wp_remote_get( $twitter_json_url, array( ‘User-Agent’ => ‘WordPress.com Twitter Widget’ ) );
$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 == $response_code ) {
$tweets = wp_remote_retrieve_body( $response );
$tweets = json_decode( $tweets, true );
$expire = 900;
if ( !is_array( $tweets ) || isset( $tweets[‘error’] ) ) {
$tweets = ‘error’;
$expire = 300;
}
} else {
$tweets = ‘error’;
$expire = 300;
wp_cache_add( ‘widget-twitter-response-code-‘ . $this->number, $response_code, ‘widget’, $expire);
}
wp_cache_add( ‘widget-twitter-‘ . $this->number, $tweets, ‘widget’, $expire );
}
if ( ‘error’ != $tweets ) :
$before_timesince = ‘ ‘;
if ( isset( $instance[‘beforetimesince’] ) && !empty( $instance[‘beforetimesince’] ) )
$before_timesince = esc_html($instance[‘beforetimesince’]);
$before_tweet = ”;
if ( isset( $instance[‘beforetweet’] ) && !empty( $instance[‘beforetweet’] ) )
$before_tweet = stripslashes(wp_filter_post_kses($instance[‘beforetweet’]));
echo ‘<ul class=”tweets”>’ . “\n”;
$tweets_out = 0;
foreach ( (array) $tweets as $tweet ) {
if ( $tweets_out >= $show )
break;
if ( empty( $tweet[‘text’] ) )
continue;
$text = make_clickable( esc_html( $tweet[‘text’] ) );
/*
* Create links from plain text based on Twitter patterns
* @link https://github.com/mzsanford/twitter-text-rb/blob/master/lib/regex.rb Official Twitter regex
*/
$text = preg_replace_callback(‘/(^|[^0-9A-Z&\/]+)(#|\xef\xbc\x83)([0-9A-Z_]*[A-Z_]+[a-z0-9_\xc0-\xd6\xd8-\xf6\xf8\xff]*)/iu’, array($this, ‘_wpcom_widget_twitter_hashtag’), $text);
$text = preg_replace_callback(‘/([^a-zA-Z0-9_]|^)([@\xef\xbc\xa0]+)([a-zA-Z0-9_]{1,20})(\/[a-zA-Z][a-zA-Z0-9\x80-\xff-]{0,79})?/u’, array($this, ‘_wpcom_widget_twitter_username’), $text);
if ( isset($tweet[‘id_str’]) )
$tweet_id = urlencode($tweet[‘id_str’]);
else
$tweet_id = urlencode($tweet[‘id’]);
echo ”
\n”;
unset($tweet_id);
$tweets_out++;
}
echo “\n”;
else :
if ( 401 == wp_cache_get( ‘widget-twitter-response-code-‘ . $this->number , ‘widget’ ) )
echo ‘<p>’ . esc_html( sprintf( __( ‘Error: Please make sure the Twitter account is public.’), ‘https://support.twitter.com/forums/10711/entries/14016’ ) ) . ‘</p>’;
else
echo ‘<p>’ . esc_html__(‘Error: Twitter did not respond. Please wait a few minutes and refresh this page.’) . ‘</p>’;
endif;
echo $after_widget;
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance[‘account’] = trim( strip_tags( stripslashes( $new_instance[‘account’] ) ) );
$instance[‘account’] = str_replace(‘https://twitter.com/’, ”, $instance[‘account’]);
$instance[‘account’] = str_replace(‘/’, ”, $instance[‘account’]);
$instance[‘account’] = str_replace(‘@’, ”, $instance[‘account’]);
$instance[‘account’] = str_replace(‘#!’, ”, $instance[‘account’]); // account for the Ajax URI
$instance[‘title’] = strip_tags(stripslashes($new_instance[‘title’]));
$instance[‘show’] = absint($new_instance[‘show’]);
$instance[‘hidereplies’] = isset($new_instance[‘hidereplies’]);
$instance[‘includeretweets’] = isset($new_instance[‘includeretweets’]);
$instance[‘beforetimesince’] = $new_instance[‘beforetimesince’];
wp_cache_delete( ‘widget-twitter-‘ . $this->number , ‘widget’ );
wp_cache_delete( ‘widget-twitter-response-code-‘ . $this->number, ‘widget’ );
return $instance;
}
function form( $instance ) {
//Defaults
$instance = wp_parse_args( (array) $instance, array(‘account’ => ”, ‘title’ => ”, ‘show’ => 5, ‘hidereplies’ => false) );
$account = esc_attr($instance[‘account’]);
$title = esc_attr($instance[‘title’]);
$show = absint($instance[‘show’]);
if ( $show < 1 || 20 < $show )
$show = 5;
$hidereplies = (bool) $instance[‘hidereplies’];
$include_retweets = (bool) $instance[‘includeretweets’];
$before_timesince = esc_attr($instance[‘beforetimesince’]);
echo ‘<p><label for=”‘ . $this->get_field_id(‘title’) . ‘”>’ . esc_html__(‘Title:’) . ‘
<input class=”widefat” id=”‘ . $this->get_field_id(‘title’) . ‘” name=”‘ . $this->get_field_name(‘title’) . ‘” type=”text” value=”‘ . $title . ‘” />
</label></p>
<p><label for=”‘ . $this->get_field_id(‘account’) . ‘”>’ . esc_html__(‘Twitter username:’) . ‘ ( ? )
<input class=”widefat” id=”‘ . $this->get_field_id(‘account’) . ‘” name=”‘ . $this->get_field_name(‘account’) . ‘” type=”text” value=”‘ . $account . ‘” />
</label></p>
<p><label for=”‘ . $this->get_field_id(‘show’) . ‘”>’ . esc_html__(‘Maximum number of tweets to show:’) . ‘
<select id=”‘ . $this->get_field_id(‘show’) . ‘” name=”‘ . $this->get_field_name(‘show’) . ‘”>’;
for ( $i = 1; $i <= 20; ++$i )
echo “<option value=’$i’ ” . ( $show == $i ? “selected=’selected'” : ” ) . “>$i</option>”;
echo ‘ </select>
</label></p>
<p><label for=”‘ . $this->get_field_id(‘hidereplies’) . ‘”><input id=”‘ . $this->get_field_id(‘hidereplies’) . ‘” class=”checkbox” type=”checkbox” name=”‘ . $this->get_field_name(‘hidereplies’) . ‘”‘;
if ( $hidereplies )
echo ‘ checked=”checked”‘;
echo ‘ /> ‘ . esc_html__(‘Hide replies’) . ‘</label></p>’;
echo ‘<p><label for=”‘ . $this->get_field_id(‘includeretweets’) . ‘”><input id=”‘ . $this->get_field_id(‘includeretweets’) . ‘” class=”checkbox” type=”checkbox” name=”‘ . $this->get_field_name(‘includeretweets’) . ‘”‘;
if ( $include_retweets )
echo ‘ checked=”checked”‘;
echo ‘ /> ‘ . esc_html__(‘Include retweets’) . ‘</label></p>’;
echo ‘<p><label for=”‘ . $this->get_field_id(‘beforetimesince’) . ‘”>’ . esc_html__(‘Text to display between tweet and timestamp:’) . ‘
<input class=”widefat” id=”‘ . $this->get_field_id(‘beforetimesince’) . ‘” name=”‘ . $this->get_field_name(‘beforetimesince’) . ‘” type=”text” value=”‘ . $before_timesince . ‘” />
</label></p>’;
}
/**
* Link a Twitter user mentioned in the tweet text to the user’s page on Twitter.
*
* @param array $matches regex match
* @return string Tweet text with inserted @user link
*/
function _wpcom_widget_twitter_username( $matches ) { // $matches has already been through wp_specialchars
return “$matches[1]@$matches[3]“;
}
/**
* Link a Twitter hashtag with a search results page on Twitter.com
*
* @param array $matches regex match
* @return string Tweet text with inserted #hashtag link
*/
function _wpcom_widget_twitter_hashtag( $matches ) { // $matches has already been through wp_specialchars
return “$matches[1]#$matches[3]“;
}
}
add_action( ‘widgets_init’, ‘wickett_twitter_widget_init’ );
function wickett_twitter_widget_init() {
register_widget(‘Wickett_Twitter_Widget’);
}
I want to remove the link from the title and create a separate custom text link below the tweets instead. Is this possible?
]]>It’s a shame private Twitter accounts aren’t supported.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>I would like to add a twitter logo in the title area instead of text
Bob
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>widget area with first use when wp-debug = true:
Notice: Undefined index: includeretweets in /httpdocs/wp-content/plugins/wickett-twitter-widget/wickett-twitter-widget.php on line 221
Notice: Undefined index: beforetimesince in /httpdocs/wp-content/plugins/wickett-twitter-widget/wickett-twitter-widget.php on line 222
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>after activation it does not show up as available widget.
Theme: Suffusion
Saying my posts are all from 40 years ago.
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>Hi all this is really nice and working full functional plugin for wordpress as I have made it work at my website
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>I have installed and activated this plugin, but in Appearance + Available Widgets the widget does not appear…
Any thoughts?
Best Regards,
Martin
]]>The following error shows up now I have upgraded to 3.0.3 – the correct username etc is in place, so not sure why it’s doing it.
“Error: Twitter did not respond. Please wait a few minutes and refresh this page.”
Any help would be greatly appreciated ??
]]>As in topic. Started within the last day or so. Did something possibly change at twitter?
https://www.ads-software.com/extend/plugins/wickett-twitter-widget/
]]>I have installed and activated this plugin, but in Appearance + Available Widgets the widget does not appear…
Any thoughts?
Best Regards,
Martin
]]>