Google Analytics for WordPress by MonsterInsights - Version 2.9.5

Version Description

  • Fixed a bug with the included RSS, which came up when multiple Yoast plugins were installed.
Download this release

Release Info

Developer joostdevalk
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 2.9.5
Comparing to
See all releases

Code changes from version 2.9.4 to 2.9.5

Files changed (2) hide show
  1. googleanalytics.php +48 -46
  2. readme.txt +5 -2
googleanalytics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Analytics for WordPress
4
  Plugin URI: http://yoast.com/wordpress/analytics/
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
- Version: 2.9.4
8
  Requires at least: 2.6
9
  Author URI: http://yoast.com/
10
  License: GPL
@@ -642,54 +642,56 @@ if ($options['rsslinktagging']) {
642
  add_filter ( 'the_permalink_rss', array('GA_Filter','rsslinktagger'), 99 );
643
  }
644
 
645
- function yst_text_limit( $text, $limit, $finish = ' […]') {
646
- if( strlen( $text ) > $limit ) {
647
- $text = substr( $text, 0, $limit );
648
- $text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) );
649
- $text .= $finish;
 
 
 
650
  }
651
- return $text;
652
- }
653
 
654
- function yst_db_widget($image = 'normal', $num = 3, $excerptsize = 250, $showdate = true) {
655
- require_once(ABSPATH.WPINC.'/rss.php');
656
- if ( $rss = fetch_rss( 'http://feeds2.feedburner.com/joostdevalk' ) ) {
657
- echo '<div class="rss-widget">';
658
- if ($image != 'small') {
659
- echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
660
- } else {
661
- echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img width="80" src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
662
- }
663
- echo '<ul>';
664
- if (!is_numeric($num)) {
665
- $num = 3;
666
- }
667
- $rss->items = array_slice( $rss->items, 0, $num );
668
- foreach ( (array) $rss->items as $item ) {
669
- echo '<li>';
670
- echo '<a class="rsswidget" href="'.clean_url( $item['link'], $protocolls=null, 'display' ).'">'. htmlentities($item['title']) .'</a> ';
671
- if ($showdate)
672
- echo '<span class="rss-date">'. date('F j, Y', strtotime($item['pubdate'])) .'</span>';
673
- echo '<div class="rssSummary">'. yst_text_limit($item['summary'],$excerptsize) .'</div>';
674
- echo '</li>';
675
- }
676
- echo '</ul>';
677
- echo '<div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
678
- echo '<a href="http://feeds2.feedburner.com/joostdevalk"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
679
- if ($image != 'small') {
680
- echo ' &nbsp; &nbsp; &nbsp; ';
681
- } else {
682
- echo '<br/>';
 
 
 
 
683
  }
684
- echo '<a href="http://yoast.com/email-blog-updates/"><img src="http://cdn.yoast.com/email_sub.png" alt=""/> Subscribe by email</a>';
685
- echo '</div>';
686
- echo '</div>';
687
  }
 
 
 
 
 
 
688
  }
689
-
690
- function yst_widget_setup() {
691
- wp_add_dashboard_widget( 'yst_db_widget' , 'The Latest news from Yoast' , 'yst_db_widget');
692
- }
693
-
694
- add_action('wp_dashboard_setup', 'yst_widget_setup');
695
  ?>
4
  Plugin URI: http://yoast.com/wordpress/analytics/
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
+ Version: 2.9.5
8
  Requires at least: 2.6
9
  Author URI: http://yoast.com/
10
  License: GPL
642
  add_filter ( 'the_permalink_rss', array('GA_Filter','rsslinktagger'), 99 );
643
  }
644
 
645
+ if (!function_exists('yst_db_widget')) {
646
+ function yst_text_limit( $text, $limit, $finish = ' [&hellip;]') {
647
+ if( strlen( $text ) > $limit ) {
648
+ $text = substr( $text, 0, $limit );
649
+ $text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) );
650
+ $text .= $finish;
651
+ }
652
+ return $text;
653
  }
 
 
654
 
655
+ function yst_db_widget($image = 'normal', $num = 3, $excerptsize = 250, $showdate = true) {
656
+ require_once(ABSPATH.WPINC.'/rss.php');
657
+ if ( $rss = fetch_rss( 'http://feeds2.feedburner.com/joostdevalk' ) ) {
658
+ echo '<div class="rss-widget">';
659
+ if ($image != 'small') {
660
+ echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
661
+ } else {
662
+ echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img width="80" src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
663
+ }
664
+ echo '<ul>';
665
+ if (!is_numeric($num)) {
666
+ $num = 3;
667
+ }
668
+ $rss->items = array_slice( $rss->items, 0, $num );
669
+ foreach ( (array) $rss->items as $item ) {
670
+ echo '<li>';
671
+ echo '<a class="rsswidget" href="'.clean_url( $item['link'], $protocolls=null, 'display' ).'">'. htmlentities($item['title']) .'</a> ';
672
+ if ($showdate)
673
+ echo '<span class="rss-date">'. date('F j, Y', strtotime($item['pubdate'])) .'</span>';
674
+ echo '<div class="rssSummary">'. yst_text_limit($item['summary'],$excerptsize) .'</div>';
675
+ echo '</li>';
676
+ }
677
+ echo '</ul>';
678
+ echo '<div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
679
+ echo '<a href="http://feeds2.feedburner.com/joostdevalk"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
680
+ if ($image != 'small') {
681
+ echo ' &nbsp; &nbsp; &nbsp; ';
682
+ } else {
683
+ echo '<br/>';
684
+ }
685
+ echo '<a href="http://yoast.com/email-blog-updates/"><img src="http://cdn.yoast.com/email_sub.png" alt=""/> Subscribe by email</a>';
686
+ echo '</div>';
687
+ echo '</div>';
688
  }
 
 
 
689
  }
690
+
691
+ function yst_widget_setup() {
692
+ wp_add_dashboard_widget( 'yst_db_widget' , 'The Latest news from Yoast' , 'yst_db_widget');
693
+ }
694
+
695
+ add_action('wp_dashboard_setup', 'yst_widget_setup');
696
  }
 
 
 
 
 
 
697
  ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: joostdevalk
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.2
6
- Tested up to: 2.8
7
- Stable tag: 2.9.4
8
 
9
  The Google Analytics for WordPress plugin automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
@@ -29,6 +29,9 @@ This section describes how to install the plugin and get it working.
29
 
30
  == Changelog ==
31
 
 
 
 
32
  = 2.9.4 =
33
  * Changed to the new Changelog design.
34
  * Removed pre 2.6 compatibility code, plugin now requires WP 2.6 or higher.
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.2
6
+ Tested up to: 2.8.1
7
+ Stable tag: 2.9.5
8
 
9
  The Google Analytics for WordPress plugin automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 2.9.5 =
33
+ * Fixed a bug with the included RSS, which came up when multiple Yoast plugins were installed.
34
+
35
  = 2.9.4 =
36
  * Changed to the new Changelog design.
37
  * Removed pre 2.6 compatibility code, plugin now requires WP 2.6 or higher.