Skip to content

Commit eb0bc30

Browse files
authored
Merge pull request #210 from Codeinwp/development
Improved compatibility with various theme and plugins. Fix for chart type selection when creation from media popup.
2 parents 720dc81 + 74611d9 commit eb0bc30

22 files changed

+2485
-4148
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dist
1717
artifact
1818
composer.json
1919
composer.lock
20+
package-lock.json
2021
key.enc
2122
vendor/phpoffice/phpexcel/Examples
2223
vendor/phpoffice/phpexcel/unitTests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ artifact
66
vendor
77
composer.lock
88
bin/
9+
package-lock.json

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ php:
55
- '5.6'
66
- '5.5'
77
- '5.4'
8-
- '5.3'
98
sudo: false
10-
dist: precise
119
matrix:
10+
fast_finish: true
1211
include:
1312
- php: '5.6'
1413
install: true
1514
before_script: chmod +x bin/wraith.sh
1615
env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
1716
script: "./bin/wraith.sh"
17+
- php: '5.3'
18+
dist: precise
1819
branches:
1920
except:
2021
- "/^*-v[0-9]/"

classes/Visualizer/Module/Admin.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,32 @@ public function __construct( Visualizer_Plugin $plugin ) {
6060
$this->_addFilter( 'plugin_action_links', 'getPluginActionLinks', 10, 2 );
6161
$this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
6262
$this->_addFilter( 'visualizer_get_chart_counts', 'getChartCountsByTypeAndMeta' );
63+
$this->_addFilter( 'visualizer_feedback_review_trigger', 'feedbackReviewTrigger' );
64+
}
65+
66+
/**
67+
* Whether to show the feedback review or not.
68+
*
69+
* @access public
70+
*/
71+
public function feedbackReviewTrigger( $dumb ) {
72+
$query = new WP_Query(
73+
array(
74+
'posts_per_page' => 50,
75+
'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
76+
'fields' => 'ids',
77+
'update_post_meta_cache' => false,
78+
'update_post_term_cache' => false,
79+
)
80+
);
81+
82+
if ( $query->have_posts() && $query->post_count > 0 ) {
83+
return array(
84+
'heading' => __( 'Some title from visualizer', 'visualizer' ),
85+
'msg' => __( 'Some msg from visualizer', 'visualizer' ),
86+
);
87+
}
88+
return false;
6389
}
6490

6591
/**

classes/Visualizer/Module/Chart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function renderChartPages() {
261261
}
262262
// dispatch pages
263263
$this->_chart = get_post( $chart_id );
264-
$tab = isset( $_GET['tab'] ) || empty( $_GET['tab'] ) ? $_GET['tab'] : 'visualizer';
264+
$tab = isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ? $_GET['tab'] : 'visualizer';
265265
switch ( $tab ) {
266266
case 'settings':
267267
// changed by Ash/Upwork

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '3.0.0';
31+
const VERSION = '3.0.1';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Page/Data.php

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ protected function _renderSidebarContent() {
6969
?>
7070
<span id="visualizer-chart-id" data-id="<?php echo $this->chart->ID; ?>"></span>
7171
<iframe id="thehole" name="thehole"></iframe>
72-
<ul class="group-wrapper full-height">
73-
<li class="group group-category open" id="vz-chart-source">
74-
<div class="group-header">
75-
<h2 class="group-title main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
72+
<ul class="viz-group-wrapper full-height">
73+
<li class="viz-group viz-group-category open" id="vz-chart-source">
74+
<div class="viz-group-header">
75+
<h2 class="viz-group-title viz-main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
7676
</div>
77-
<ul class="group-content">
78-
<ul class="group-wrapper">
79-
<li class="group">
80-
<h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
81-
<div class="group-content">
82-
<p class="group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
83-
<p class="group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
77+
<ul class="viz-group-content">
78+
<ul class="viz-group-wrapper">
79+
<li class="viz-group">
80+
<h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
81+
<div class="viz-group-content">
82+
<p class="viz-group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
83+
<p class="viz-group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
8484
<form id="vz-csv-file-form" action="<?php echo $upload_link; ?>" method="post"
8585
target="thehole" enctype="multipart/form-data">
8686
<input type="hidden" id="remote-data" name="remote_data">
@@ -92,16 +92,16 @@ protected function _renderSidebarContent() {
9292
</form>
9393
</div>
9494
</li>
95-
<li class="group visualizer-import-url">
96-
<h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
97-
<ul class="group-content">
98-
<li class="subsection">
99-
<span class="section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
95+
<li class="viz-group visualizer-import-url">
96+
<h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
97+
<ul class="viz-group-content">
98+
<li class="viz-subsection">
99+
<span class="viz-section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
100100

101-
<div class="section-items">
102-
<p class="group-description"><?php _e( 'You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?> </p>
103-
<p class="group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
104-
<p class="group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
101+
<div class="viz-section-items section-items">
102+
<p class="viz-group-description"><?php _e( 'You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?> </p>
103+
<p class="viz-group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
104+
<p class="viz-group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
105105
<form id="vz-one-time-import" action="<?php echo $upload_link; ?>" method="post"
106106
target="thehole" enctype="multipart/form-data">
107107
<div class="remote-file-section">
@@ -115,22 +115,22 @@ class="visualizer-input">
115115
</form>
116116
</div>
117117
</li>
118-
<li class="subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
119-
<span class="section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
118+
<li class="viz-subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
119+
<span class="viz-section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
120120
<span
121121
class="dashicons dashicons-lock"></span></span>
122-
<div class="section-items">
123-
<p class="group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
124-
<p class="group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
125-
<p class="group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.', 'visualizer' ); ?></p>
122+
<div class="viz-section-items section-items">
123+
<p class="viz-group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
124+
<p class="viz-group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
125+
<p class="viz-group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.', 'visualizer' ); ?></p>
126126
<form id="vz-schedule-import" action="<?php echo $upload_link; ?>" method="post"
127127
target="thehole" enctype="multipart/form-data">
128128
<div class="remote-file-section">
129129
<input type="url" id="vz-schedule-url" name="remote_data"
130130
value="<?php echo get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ); ?>"
131131
placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
132132
class="visualizer-input visualizer-remote-url">
133-
<p class="group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
133+
<p class="viz-group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
134134
<select name="vz-import-time" id="vz-import-time"
135135
class="visualizer-select">
136136
<?php
@@ -159,13 +159,13 @@ class="visualizer-select">
159159
</li>
160160
</ul>
161161
</li>
162-
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
163-
<h2 class="group-title sub-group"
162+
<li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
163+
<h2 class="viz-group-title viz-sub-group"
164164
data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
165165
class="dashicons dashicons-lock"></span></h2>
166-
<div class="group-content edit-data-content">
166+
<div class="viz-group-content edit-data-content">
167167
<div>
168-
<p class="group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
168+
<p class="viz-group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
169169
<form>
170170
<select name="vz-import-from-chart" id="chart-id" class="visualizer-select">
171171
<?php
@@ -201,12 +201,12 @@ class="dashicons dashicons-lock"></span></h2>
201201
</div>
202202
</li>
203203

204-
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
205-
<h2 class="group-title sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
204+
<li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
205+
<h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
206206
class="dashicons dashicons-lock"></span></h2>
207-
<div class="group-content edit-data-content">
207+
<div class="viz-group-content edit-data-content">
208208
<div>
209-
<p class="group-description"><?php _e( 'You can import here data from WordPress', 'visualizer' ); ?></p>
209+
<p class="viz-group-description"><?php _e( 'You can import here data from WordPress', 'visualizer' ); ?></p>
210210
<input type="button" id="filter-chart-button" class="button button-primary "
211211
value="<?php _e( 'Create Filters', 'visualizer' ); ?>" data-current="chart"
212212
data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>"
@@ -216,18 +216,18 @@ class="dashicons dashicons-lock"></span></h2>
216216
</div>
217217
</li>
218218

219-
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
220-
<h2 class="group-title sub-group visualizer-editor-tab"
219+
<li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
220+
<h2 class="viz-group-title viz-sub-group visualizer-editor-tab"
221221
data-current="chart"><?php _e( 'Add data manually', 'visualizer' ); ?><span
222222
class="dashicons dashicons-lock"></span></h2>
223223
<form id="editor-form" action="<?php echo $upload_link; ?>" method="post" target="thehole">
224224
<input type="hidden" id="chart-data" name="chart_data">
225225
<input type="hidden" id="chart-data-src" name="chart_data_src">
226226
</form>
227227

228-
<div class="group-content edit-data-content">
228+
<div class="viz-group-content edit-data-content">
229229
<div>
230-
<p class="group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
230+
<p class="viz-group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
231231
<input type="button" id="editor-chart-button" class="button button-primary "
232232
value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart"
233233
data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
@@ -240,13 +240,13 @@ class="dashicons dashicons-lock"></span></h2>
240240
</ul>
241241
</li>
242242
</ul>
243-
<li class="group group-category bottom-fixed sidebar-footer-link" id="vz-chart-settings">
243+
<li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-settings">
244244
<h2><span class="dashicons dashicons-admin-tools"></span><?php _e( 'Advanced', 'visualizer' ); ?></h2>
245-
<div class="group-header">
245+
<div class="viz-group-header">
246246
<button class="customize-section-back" tabindex="0"></button>
247-
<h3 class="group-title main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
247+
<h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
248248
</div>
249-
<ul class="group-content">
249+
<ul class="viz-group-content">
250250
<form id="settings-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() ); ?>"
251251
method="post">
252252
<?php echo $this->sidebar; ?>
@@ -256,7 +256,7 @@ class="dashicons dashicons-lock"></span></h2>
256256

257257
<?php $this->getPermissionsLink( $this->chart->ID ); ?>
258258

259-
<li class="group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
259+
<li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
260260
</ul>
261261
<?php
262262
// changed by Ash/Upwork
@@ -276,13 +276,13 @@ private function getPermissionsLink( $id ) {
276276
}
277277
}
278278
?>
279-
<li class="group group-category bottom-fixed sidebar-footer-link" id="vz-chart-permissions">
279+
<li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-permissions">
280280
<h2><span class="dashicons dashicons-admin-users"></span><?php _e( 'Permissions', 'visualizer' ); ?></h2>
281-
<div class="group-header">
281+
<div class="viz-group-header">
282282
<button class="customize-section-back" tabindex="0"></button>
283-
<h3 class="group-title main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
283+
<h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
284284
</div>
285-
<ul class="group-content">
285+
<ul class="viz-group-content">
286286
<form id="permissions-form" target="thehole" action="
287287
<?php
288288
echo add_query_arg(

0 commit comments

Comments
 (0)