Skip to content

Commit e0755a3

Browse files
committed
Merge pull request #50 from Codeinwp/development
Development
2 parents fb82639 + 65eb150 commit e0755a3

File tree

9 files changed

+28
-29
lines changed

9 files changed

+28
-29
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) {
343343
if ( $plugin_file == plugin_basename( VISUALIZER_BASEFILE ) ) {
344344
// knowledge base link
345345
$plugin_meta[] = sprintf(
346-
'<a href="https://github.com/madpixelslabs/visualizer/wiki" target="_blank">%s</a>',
346+
'<a href="https://github.com/codeinwp/visualizer/wiki" target="_blank">%s</a>',
347347
esc_html__( 'Knowledge Base', Visualizer_Plugin::NAME )
348348
);
349349
// flattr link
350350
$plugin_meta[] = sprintf(
351-
'<a href="http://flattr.com/thing/2574985/WordPress-Visualizer" target="_blank">%s</a>',
352-
esc_html__( 'Donate', Visualizer_Plugin::NAME )
351+
'<a style="color:red" href="https://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/" target="_blank">%s</a>',
352+
esc_html__( 'Pro Addon', Visualizer_Plugin::NAME )
353353
);
354354
}
355355

classes/Visualizer/Module/Chart.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -420,19 +420,7 @@ private function _handleSettingsPage() {
420420
* @access public
421421
*/
422422
public function renderFlattrScript() {
423-
echo <<<EOL
424-
<script type="text/javascript">
425-
/* <![CDATA[ */
426-
(function() {
427-
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
428-
s.type = 'text/javascript';
429-
s.async = true;
430-
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
431-
t.parentNode.insertBefore(s, t);
432-
})();
433-
/* ]]> */
434-
</script>
435-
EOL;
423+
echo '';
436424
}
437425

438426
/**

classes/Visualizer/Module/Frontend.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function renderChart( $atts ) {
100100
'class' => false, // chart class
101101
'series' => false, // series filter hook
102102
'data' => false, // data filter hook
103+
'settings' => false, // data filter hook
103104
), $atts );
104105

105106
// if empty id or chart does not exists, then return empty string
@@ -124,6 +125,11 @@ public function renderChart( $atts ) {
124125
if ( !empty( $atts['series'] ) ) {
125126
$series = apply_filters( $atts['series'], $series, $chart->ID, $type );
126127
}
128+
// handle settings filter hooks
129+
$settings = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $settings, $chart->ID, $type );
130+
if ( !empty( $atts['settings'] ) ) {
131+
$settings = apply_filters( $atts['settings'], $settings, $chart->ID, $type );
132+
}
127133

128134
// handle data filter hooks
129135
$data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( $chart->post_content ), $chart->ID, $type );

classes/Visualizer/Plugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class Visualizer_Plugin {
3131

3232
const NAME = 'visualizer';
33-
const VERSION = '1.4.2.3';
33+
const VERSION = '1.5';
3434

3535
// custom post types
3636
const CPT_VISUALIZER = 'visualizer';
@@ -54,6 +54,7 @@ class Visualizer_Plugin {
5454
const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class';
5555
const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
5656
const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
57+
const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings';
5758

5859
// Added by Ash/Upwork
5960
const PRO_TEASER_URL = "http://www.google.com";

classes/Visualizer/Render/Page.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ protected function _renderSidebar() {
7676
echo '<a id="rate-link" href="http://wordpress.org/support/view/plugin-reviews/visualizer" target="_blank">';
7777
esc_html_e( 'Rate it on WordPress.org', Visualizer_Plugin::NAME );
7878
echo '</a>';
79-
echo '<div id="flattr">';
80-
echo '<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://wordpress.org/plugins/visualizer/"></a>';
81-
echo '</div>';
8279
echo '</div>';
8380
echo '</div>';
8481
}

classes/Visualizer/Source.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,20 @@ public function getRawData() {
119119
*/
120120
protected function _normalizeData( $data ) {
121121
// normalize values
122+
//print_r($data);
122123
foreach ( $this->_series as $i => $series ) {
123124
// if no value exists for the seires, then add null
124125
if ( !isset( $data[$i] ) ) {
125126
$data[$i] = null;
126127
}
127128

128-
if ( is_null( $data[$i] ) ) {
129+
if ( is_null( $data[$i] ) && !is_numeric($data[$i])) {
129130
continue;
130131
}
131132

132133
switch ( $series['type'] ) {
133134
case 'number':
134-
$data[$i] = !empty( $data[$i] ) ? floatval( $data[$i] ) : null;
135+
$data[$i] = ( is_numeric($data[$i]) ) ? floatval( $data[$i] ) : null;
135136
break;
136137
case 'boolean':
137138
$data[$i] = !empty( $data[$i] ) ? filter_validate( $data[$i], FILTER_VALIDATE_BOOLEAN ) : null;
@@ -149,7 +150,6 @@ protected function _normalizeData( $data ) {
149150
break;
150151
}
151152
}
152-
153153
return $data;
154154
}
155155

classes/Visualizer/Source/Csv.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public function fetch() {
133133

134134
// fetch data
135135
while ( ( $data = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE ) ) !== false ) {
136+
136137
$this->_data[] = $this->_normalizeData( $data );
137138
}
138139

index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
/*
3-
Plugin Name: WordPress Visualizer
4-
Plugin URI: https://github.com/madpixelslabs/visualizer
3+
Plugin Name: Visualizer: Charts and Graphs
4+
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs/
55
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
6-
Version: 1.4.4
7-
Author: Madpixels
8-
Author URI: http://madpixels.net
9-
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
6+
Version: 1.5
7+
Author: Themeisle
8+
Author URI: http://themeisle.com
109
License: GPL v2.0 or later
1110
License URI: http://www.opensource.org/licenses/gpl-license.php
1211
*/
12+
1313

1414
// +----------------------------------------------------------------------+
1515
// | Copyright 2013 Madpixels (email : [email protected]) |

readme.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
5858

5959
== Changelog ==
6060

61+
= 1.5 =
62+
* Added support for live editor
63+
* Added support for importing data from other charts
64+
* Added filter for chart settings
65+
* Fixed bug when zero was not working on the charts
66+
6167
= 1.4.2.3 =
6268
* Implemented ability to edit horizontal and vertical axis number format for bar and column charts
6369

0 commit comments

Comments
 (0)