Skip to content

Commit

Permalink
Merge pull request #70 from CastosHQ/feature/fix-google-charts
Browse files Browse the repository at this point in the history
Fixed a bug related to loading Goole Charts
  • Loading branch information
jonathanbossenger authored Jun 23, 2020
2 parents 7dbdb17 + 93685d8 commit edf5f50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion php/classes/class-ssp-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,8 @@ private function generate_chart ( $type = '', $title = '', $columns = array(), $
?>
<script type="text/javascript">

google.charts.load('current', {packages: ['corechart']});

// Set a callback to run when the Google Visualization API is loaded
google.setOnLoadCallback(draw_chart_<?php echo $chartid; ?>);

Expand Down Expand Up @@ -1029,7 +1031,8 @@ public function admin_enqueue_scripts ( $hook = '' ) {
if( 'podcast_page_podcast_stats' == $hook || 'index.php' == $hook ) {

// Include Google Charts scripts
wp_enqueue_script( 'google-charts', "//www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}", array(), $this->_version, false );
wp_register_script( 'google-charts', "https://www.gstatic.com/charts/loader.js", array(), $this->_version, false );
wp_enqueue_script( 'google-charts' );

// Load custom scripts
wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version );
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: PodcastMotor, psykro, simondowdles, hlashbrooke, seriouspodcaster
Tags: seriously simple podcasting, stats, statistics, listeners, analytics, podcast, podcasting, ssp, free, add-ons, extensions, addons
Requires at least: 4.4
Tested up to: 5.3.2
Stable tag: 1.2.7
Stable tag: 1.2.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -78,6 +78,10 @@ Yes. This plugin uses the [Crawler Detect](https://github.com/JayBizzle/Crawler-

== Changelog ==

= 1.2.8 =
* 2020-06-19
* [FIX] Fixes a bug in the loading of the Google Charts libraries

= 1.2.7 =
* 2020-05-25
* [UPDATE] Updated crawler detect library to version 1.2.95
Expand Down
4 changes: 2 additions & 2 deletions seriously-simple-stats.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Plugin Name: Seriously Simple Stats
* Version: 1.2.7
* Version: 1.2.8
* Plugin URI: https://wordpress.org/plugins/seriously-simple-stats
* Description: Integrated analytics and stats tracking for Seriously Simple Podcasting.
* Author: Castos
Expand Down Expand Up @@ -29,7 +29,7 @@

require_once 'vendor/autoload.php';

define( 'SSP_STATS_VERSION', '1.2.7' );
define( 'SSP_STATS_VERSION', '1.2.8' );
define( 'SSP_STATS_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );

if ( ! function_exists( 'is_ssp_active' ) ) {
Expand Down

0 comments on commit edf5f50

Please sign in to comment.