Rotating Tweets (Twitter widget and shortcode) - Version 1.9.10

Version Description

  • [Bugfix] Remove "Trying to access array offset on value of type bool / null" error

=

Download this release

Release Info

Developer mpntod
Plugin Icon wp plugin Rotating Tweets (Twitter widget and shortcode)
Version 1.9.10
Comparing to
See all releases

Code changes from version 1.9.9 to 1.9.10

Files changed (2) hide show
  1. readme.txt +7 -4
  2. rotatingtweets.php +12 -3
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mpntod
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle,multilingual,responsive,page builder,do not track,dnt
5
  Requires at least: 3.2
6
- Tested up to: 5.2
7
- Stable tag: 1.9.9
8
  Requires PHP: 5.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -192,10 +192,13 @@ into your CSS - changing `123px;` to the width you're aiming at - either via [ad
192
  You can do this by going to the `rotatingtweets/css` directory, opening `rotatingtweets-sample.css` and copying its contents (modifying the link to the bird graphic to match your site) into [additional CSS](https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress) (the preferred approach from Wordpress 4.7 onwards) on the [Appearance Customize Screen](https://codex.wordpress.org/Appearance_Customize_Screen) page. Alternatively rename `rotatingtweets-sample.css` to `rotatingtweets.css` and put it in the `wp-content/uploads/` directory. Or copy the CSS into your own template files. Any of these approaches will display a Twitter bird to the left of your tweets.
193
 
194
  == Upgrade notice ==
195
- = 1.9.9 =
196
- * [Security Update] Adds `rel='noopener'` to `_blank` links
197
 
198
  == Changelog ==
 
 
 
199
  = 1.9.9 =
200
  * [Security Update] Adds `rel='noopener'` to `_blank` links
201
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle,multilingual,responsive,page builder,do not track,dnt
5
  Requires at least: 3.2
6
+ Tested up to: 6.1
7
+ Stable tag: 1.9.10
8
  Requires PHP: 5.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
192
  You can do this by going to the `rotatingtweets/css` directory, opening `rotatingtweets-sample.css` and copying its contents (modifying the link to the bird graphic to match your site) into [additional CSS](https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress) (the preferred approach from Wordpress 4.7 onwards) on the [Appearance Customize Screen](https://codex.wordpress.org/Appearance_Customize_Screen) page. Alternatively rename `rotatingtweets-sample.css` to `rotatingtweets.css` and put it in the `wp-content/uploads/` directory. Or copy the CSS into your own template files. Any of these approaches will display a Twitter bird to the left of your tweets.
193
 
194
  == Upgrade notice ==
195
+ = 1.9.10 =
196
+ * [Bugfix] Remove "Trying to access array offset on value of type bool / null" error
197
 
198
  == Changelog ==
199
+ = 1.9.10 =
200
+ * [Bugfix] Remove "Trying to access array offset on value of type bool / null" error
201
+
202
  = 1.9.9 =
203
  * [Security Update] Adds `rel='noopener'` to `_blank` links
204
 
rotatingtweets.php CHANGED
@@ -2,14 +2,14 @@
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
- Version: 1.9.9
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
9
  Author URI: http://www.martintod.org.uk
10
  License: GPL2
11
  */
12
- /* Copyright 2014 Martin Tod email : martin@martintod.org.uk)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
@@ -583,6 +583,7 @@ function rotatingtweets_display_shortcode( $atts, $content=null, $code="", $prin
583
  */
584
  $args = shortcode_atts( array(
585
  'screen_name' => '',
 
586
  'url' => 'http://twitter.com/twitter',
587
  'include_rts' => FALSE,
588
  'only_rts' => FALSE,
@@ -639,6 +640,14 @@ function rotatingtweets_display_shortcode( $atts, $content=null, $code="", $prin
639
  'show_line_breaks'=>FALSE
640
  ), $atts, 'rotatingtweets' ) ;
641
  extract($args);
 
 
 
 
 
 
 
 
642
  if(empty($screen_name) && empty($search) && !empty($url) && empty($collection)):
643
  $screen_name = rotatingtweets_link_to_screenname($url);
644
  $args['screen_name'] = $screen_name;
@@ -701,7 +710,7 @@ function rotatingtweets_settings_check() {
701
  $msgString = __('Please update <a href="%2$s">your settings for Rotating Tweets</a>. The Twitter API <a href="%1$s">changed on June 11, 2013</a> and new settings are needed for Rotating Tweets to continue working.','rotatingtweets');
702
  // add_settings_error( 'rotatingtweets_settings_needed', esc_attr('rotatingtweets_settings_needed'), sprintf($msgString,'https://dev.twitter.com/calendar',$optionslink), 'error');
703
  echo "<div class='error'><p><strong>".sprintf($msgString,'https://dev.twitter.com/blog/api-v1-is-retired',$optionslink)."</strong></p></div>";
704
- elseif($error[0]['code'] == 32 ):
705
  // add_settings_error( 'rotatingtweets_settings_needed', esc_attr('rotatingtweets_settings_needed'), sprintf(__('Please update <a href="%1$s">your settings for Rotating Tweets</a>. Currently Twitter cannot authenticate you with the details you have given.','rotatingtweets'),$optionslink), 'error');
706
  echo "<div class='error'><p><strong>".sprintf(__('Please update <a href="%1$s">your settings for Rotating Tweets</a>. Currently Rotating Tweets cannot authenticate you with Twitter using the details you have given.','rotatingtweets'),$optionslink)."</strong></p></div>";
707
  endif;
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
+ Version: 1.9.10
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
9
  Author URI: http://www.martintod.org.uk
10
  License: GPL2
11
  */
12
+ /* Copyright 2020 Martin Tod email : martin@martintod.org.uk)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
583
  */
584
  $args = shortcode_atts( array(
585
  'screen_name' => '',
586
+ 'user_meta_screen_name' => '',
587
  'url' => 'http://twitter.com/twitter',
588
  'include_rts' => FALSE,
589
  'only_rts' => FALSE,
640
  'show_line_breaks'=>FALSE
641
  ), $atts, 'rotatingtweets' ) ;
642
  extract($args);
643
+ if(empty($screen_name) && !empty($user_meta_screen_name)):
644
+ $screen_name = get_user_meta( get_current_user_id() , $user_meta_screen_name, true );
645
+ $args['screen_name'] = $screen_name;
646
+ // if(WP_DEBUG) {
647
+ echo "<!-- Variable $user_meta_screen_name => $screen_name -->";
648
+ // }
649
+ // get_post_meta( get_the_ID(), 'thumb', true );
650
+ endif;
651
  if(empty($screen_name) && empty($search) && !empty($url) && empty($collection)):
652
  $screen_name = rotatingtweets_link_to_screenname($url);
653
  $args['screen_name'] = $screen_name;
710
  $msgString = __('Please update <a href="%2$s">your settings for Rotating Tweets</a>. The Twitter API <a href="%1$s">changed on June 11, 2013</a> and new settings are needed for Rotating Tweets to continue working.','rotatingtweets');
711
  // add_settings_error( 'rotatingtweets_settings_needed', esc_attr('rotatingtweets_settings_needed'), sprintf($msgString,'https://dev.twitter.com/calendar',$optionslink), 'error');
712
  echo "<div class='error'><p><strong>".sprintf($msgString,'https://dev.twitter.com/blog/api-v1-is-retired',$optionslink)."</strong></p></div>";
713
+ elseif( is_array($error) && ($error[0]['code'] == 32 )):
714
  // add_settings_error( 'rotatingtweets_settings_needed', esc_attr('rotatingtweets_settings_needed'), sprintf(__('Please update <a href="%1$s">your settings for Rotating Tweets</a>. Currently Twitter cannot authenticate you with the details you have given.','rotatingtweets'),$optionslink), 'error');
715
  echo "<div class='error'><p><strong>".sprintf(__('Please update <a href="%1$s">your settings for Rotating Tweets</a>. Currently Rotating Tweets cannot authenticate you with Twitter using the details you have given.','rotatingtweets'),$optionslink)."</strong></p></div>";
716
  endif;