WP Statistics - Version 10.0.2

Version Description

  • Release Date: January 19, 2016
  • Added: Additional error checking on widget load so they will retry if there is a failure.
  • Fixed: Added code to flush out invalid widget order user meta.
  • Fixed: Include Fatal Error if corrupt data was passed to the ajax widget code.
Download this release

Release Info

Developer GregRoss
Plugin Icon 128x128 WP Statistics
Version 10.0.2
Comparing to
See all releases

Code changes from version 10.0.1 to 10.0.2

ajax.php CHANGED
@@ -216,6 +216,11 @@ function wp_statistics_get_widget_contents_callback() {
216
  }
217
  }
218
 
 
 
 
 
 
219
  $ISOCountryCode = $WP_Statistics->get_country_codes();
220
  $search_engines = wp_statistics_searchengine_list();
221
 
216
  }
217
  }
218
 
219
+ if( '' == $widget ) {
220
+ _e('No matching widget found!', 'wp_statistics');
221
+ wp_die();
222
+ }
223
+
224
  $ISOCountryCode = $WP_Statistics->get_country_codes();
225
  $search_engines = wp_statistics_searchengine_list();
226
 
assets/js/dashboard.js CHANGED
@@ -17,7 +17,13 @@ function wp_statistics_get_widget_contents( widget, container_id ) {
17
  datatype: 'json',
18
  })
19
  .always(function(result){
 
20
  jQuery("#" + container_id).html("").html(result);
 
 
 
 
 
21
  });
22
 
23
  }
17
  datatype: 'json',
18
  })
19
  .always(function(result){
20
+ // Take the returned result and add it to the DOM.
21
  jQuery("#" + container_id).html("").html(result);
22
+ })
23
+ .fail(function(result){
24
+ // If we failed for some reason, like a timeout, try again.
25
+ container.html(wp_statistics_loading_image);
26
+ wp_statistics_get_widget_contents( widget, coontaier_id );
27
  });
28
 
29
  }
assets/js/editor.js CHANGED
@@ -18,7 +18,13 @@ function wp_statistics_get_widget_contents( widget, container_id ) {
18
  datatype: 'json',
19
  })
20
  .always(function(result){
 
21
  jQuery("#" + container_id).html("").html(result);
 
 
 
 
 
22
  });
23
 
24
  }
18
  datatype: 'json',
19
  })
20
  .always(function(result){
21
+ // Take the returned result and add it to the DOM.
22
  jQuery("#" + container_id).html("").html(result);
23
+ })
24
+ .fail(function(result){
25
+ // If we failed for some reason, like a timeout, try again.
26
+ container.html(wp_statistics_loading_image);
27
+ wp_statistics_get_widget_contents( widget, coontaier_id );
28
  });
29
 
30
  }
assets/js/log.js CHANGED
@@ -17,7 +17,13 @@ function wp_statistics_get_widget_contents( widget, container_id ) {
17
  datatype: 'json',
18
  })
19
  .always(function(result){
 
20
  jQuery("#" + container_id).html("").html(result);
 
 
 
 
 
21
  });
22
 
23
  }
17
  datatype: 'json',
18
  })
19
  .always(function(result){
20
+ // Take the returned result and add it to the DOM.
21
  jQuery("#" + container_id).html("").html(result);
22
+ })
23
+ .fail(function(result){
24
+ // If we failed for some reason, like a timeout, try again.
25
+ container.html(wp_statistics_loading_image);
26
+ wp_statistics_get_widget_contents( widget, coontaier_id );
27
  });
28
 
29
  }
includes/log/log.php CHANGED
@@ -6,6 +6,13 @@
6
  $nag_html = '<div id="wps_nag" class="update-nag" style="width: 90%;"><div id="donate-text"><p>' . __('Have you thought about donating to WP Statistics?', 'wp_statistics') . ' <a href="http://wp-statistics.com/donate/" target="_blank">'.__('Donate Now!', 'wp_statistics').'</a></p></div><div id="donate-button"><a class="button-primary" id="wps_close_nag">' . __('Close', 'wp_statistics') . '</a></div></div>';
7
  }
8
 
 
 
 
 
 
 
 
9
  // Add the about box here as metaboxes added on the actual page load cannot be closed.
10
  add_meta_box( 'wps_about_postbox', sprintf(__('About WP Statistics Version %s', 'wp_statistics'), WP_STATISTICS_VERSION), 'wp_statistics_generate_overview_postbox_contents', $WP_Statistics->menu_slugs['overview'], 'side', null, array( 'widget' =>'about' ) );
11
 
6
  $nag_html = '<div id="wps_nag" class="update-nag" style="width: 90%;"><div id="donate-text"><p>' . __('Have you thought about donating to WP Statistics?', 'wp_statistics') . ' <a href="http://wp-statistics.com/donate/" target="_blank">'.__('Donate Now!', 'wp_statistics').'</a></p></div><div id="donate-button"><a class="button-primary" id="wps_close_nag">' . __('Close', 'wp_statistics') . '</a></div></div>';
7
  }
8
 
9
+ // WP Statistics 10.0 had a bug which could corrupt the metabox display if the user re-ordered the widgets. Check to see if the meta data is corrupt and if so delete it.
10
+ $widget_order = get_user_meta($WP_Statistics->user_id, 'meta-box-order_toplevel_page_wps_overview_page', true);
11
+
12
+ if( is_array( $widget_order ) && count( $widget_order ) > 2 ) {
13
+ delete_user_meta( $WP_Statistics->user_id, 'meta-box-order_toplevel_page_wps_overview_page');
14
+ }
15
+
16
  // Add the about box here as metaboxes added on the actual page load cannot be closed.
17
  add_meta_box( 'wps_about_postbox', sprintf(__('About WP Statistics Version %s', 'wp_statistics'), WP_STATISTICS_VERSION), 'wp_statistics_generate_overview_postbox_contents', $WP_Statistics->menu_slugs['overview'], 'side', null, array( 'widget' =>'about' ) );
18
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wp-statistics.com/donate/
4
  Tags: statistics, stats, visit, visitors, chart, browser, blog, today, yesterday, week, month, year, total, post, page, sidebar, summary, feedburner, hits, pagerank, google, alexa, live visit
5
  Requires at least: 3.0
6
  Tested up to: 4.4
7
- Stable tag: 10.0.1
8
  License: GPL3
9
 
10
  Complete statistics for your WordPress site.
@@ -238,6 +238,12 @@ If you still have issues open a new thread on the support forum and we'll try an
238
  The overview page has been completely rewritten! If you had set custom values for what widgets to display and in what order on your overview page you will have to re-select them using the "Screen Options" tab on the overview page and by dragging and dropping the widgets in to place.
239
 
240
  == Changelog ==
 
 
 
 
 
 
241
  = 10.0.1 =
242
  * Release Date: January 18, 2016
243
  * Fixed: If you re-ordered the widgets on the overview screen and then reloaded the page, all the widgets would disappear.
4
  Tags: statistics, stats, visit, visitors, chart, browser, blog, today, yesterday, week, month, year, total, post, page, sidebar, summary, feedburner, hits, pagerank, google, alexa, live visit
5
  Requires at least: 3.0
6
  Tested up to: 4.4
7
+ Stable tag: 10.0.2
8
  License: GPL3
9
 
10
  Complete statistics for your WordPress site.
238
  The overview page has been completely rewritten! If you had set custom values for what widgets to display and in what order on your overview page you will have to re-select them using the "Screen Options" tab on the overview page and by dragging and dropping the widgets in to place.
239
 
240
  == Changelog ==
241
+ = 10.0.2 =
242
+ * Release Date: January 19, 2016
243
+ * Added: Additional error checking on widget load so they will retry if there is a failure.
244
+ * Fixed: Added code to flush out invalid widget order user meta.
245
+ * Fixed: Include Fatal Error if corrupt data was passed to the ajax widget code.
246
+
247
  = 10.0.1 =
248
  * Release Date: January 18, 2016
249
  * Fixed: If you re-ordered the widgets on the overview screen and then reloaded the page, all the widgets would disappear.
wp-statistics.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Statistics
4
  Plugin URI: http://wp-statistics.com/
5
  Description: Complete statistics for your WordPress site.
6
- Version: 10.0.1
7
  Author: Mostafa Soufi & Greg Ross
8
  Author URI: http://wp-statistics.com/
9
  Text Domain: wp_statistics
@@ -12,7 +12,7 @@ License: GPL2
12
  */
13
 
14
  // These defines are used later for various reasons.
15
- define('WP_STATISTICS_VERSION', '10.0.1');
16
  define('WP_STATISTICS_MANUAL', 'manual/WP Statistics Admin Manual.');
17
  define('WP_STATISTICS_REQUIRED_PHP_VERSION', '5.3.0');
18
  define('WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION', WP_STATISTICS_REQUIRED_PHP_VERSION);
3
  Plugin Name: WP Statistics
4
  Plugin URI: http://wp-statistics.com/
5
  Description: Complete statistics for your WordPress site.
6
+ Version: 10.0.2
7
  Author: Mostafa Soufi & Greg Ross
8
  Author URI: http://wp-statistics.com/
9
  Text Domain: wp_statistics
12
  */
13
 
14
  // These defines are used later for various reasons.
15
+ define('WP_STATISTICS_VERSION', '10.0.2');
16
  define('WP_STATISTICS_MANUAL', 'manual/WP Statistics Admin Manual.');
17
  define('WP_STATISTICS_REQUIRED_PHP_VERSION', '5.3.0');
18
  define('WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION', WP_STATISTICS_REQUIRED_PHP_VERSION);