Skip to content

Commit ec7e151

Browse files
committed
fixed travis and improved design of the sidebar
1 parent 41d5da1 commit ec7e151

File tree

10 files changed

+92
-106
lines changed

10 files changed

+92
-106
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// +----------------------------------------------------------------------+
1919
// | Author: Eugene Manuilov <[email protected]> |
2020
// +----------------------------------------------------------------------+
21-
2221
/**
2322
* The module for all admin stuff.
2423
*
@@ -418,7 +417,7 @@ public function renderLibraryPage() {
418417
*
419418
* @access public
420419
*
421-
* @param array $links The array of original action links.
420+
* @param array $links The array of original action links.
422421
* @param string $file The plugin basename.
423422
*
424423
* @return array Updated array of action links.
@@ -445,7 +444,7 @@ public function getPluginActionLinks( $links, $file ) {
445444
*
446445
* @access public
447446
*
448-
* @param array $plugin_meta The array of a plugin meta links.
447+
* @param array $plugin_meta The array of a plugin meta links.
449448
* @param string $plugin_file The plugin's basename.
450449
*
451450
* @return array Updated array of plugin meta links.

classes/Visualizer/Module/Chart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function renderChartPages() {
247247
wp_register_script( 'visualizer-preview', VISUALIZER_ABSURL . 'js/preview.js', array( 'wp-color-picker', 'visualizer-render' ), Visualizer_Plugin::VERSION, true );
248248

249249
// added by Ash/Upwork
250-
if ( defined( 'Visualizer_Pro' ) ) {
250+
if ( VISUALIZER_PRO ) {
251251
global $Visualizer_Pro;
252252
$Visualizer_Pro->_addScriptsAndStyles();
253253
}
@@ -340,7 +340,7 @@ private function _handleDataPage() {
340340
) );
341341

342342
// Added by Ash/Upwork
343-
if ( defined( 'Visualizer_Pro' ) ) {
343+
if ( VISUALIZER_PRO ) {
344344
global $Visualizer_Pro;
345345
$Visualizer_Pro->_enqueueScriptsAndStyles( $data );
346346
}
@@ -415,7 +415,7 @@ private function _handleDataAndSettingsPage() {
415415
$render->button = esc_attr__( 'Insert Chart', 'visualizer' );
416416
}
417417

418-
if ( defined( 'Visualizer_Pro' ) ) {
418+
if ( VISUALIZER_PRO ) {
419419
global $Visualizer_Pro;
420420
$Visualizer_Pro->_enqueueScriptsAndStyles( $data );
421421
}

classes/Visualizer/Module/Sources.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function filterChartData( $data, $chart_id ) {
133133
* @return string The new html code.
134134
*/
135135
public function addProUpsell( $old ) {
136-
if ( defined( 'Visualizer_Pro' ) ) {
136+
if ( VISUALIZER_PRO ) {
137137
remove_filter( 'visualizer_pro_upsell', 'addProUpsell', 10, 1 );
138138
return;
139139
}

classes/Visualizer/Render/Library.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,16 @@ private function _renderSidebar() {
195195
$checked = apply_filters( 'visualizer_logger_flag', false );
196196
$checked = ( $checked === false ) ? '' : 'checked';
197197
echo '<div id="visualizer-sidebar">';
198-
echo '<div class="visualizer-sidebar-box">';
199-
echo '<h3>' . __( 'Gain more editing power', 'visualizer' ) . '</h3><ul>';
200-
echo '<li>' . __( 'Spreadsheet like editor', 'visualizer' ) . '</li>';
201-
echo '<li>' . __( 'Import from other charts', 'visualizer' ) . '</li>';
202-
echo '<li>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li>';
203-
echo '<li>' . __( '3 more chart types', 'visualizer' ) . '</li></ul>';
204-
echo '<a href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a>';
205-
echo '</div>';
198+
if ( ! VISUALIZER_PRO ) {
199+
echo '<div class="visualizer-sidebar-box">';
200+
echo '<h3>' . __( 'Gain more editing power', 'visualizer' ) . '</h3><ul>';
201+
echo '<li>' . __( 'Spreadsheet like editor', 'visualizer' ) . '</li>';
202+
echo '<li>' . __( 'Import from other charts', 'visualizer' ) . '</li>';
203+
echo '<li>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li>';
204+
echo '<li>' . __( '3 more chart types', 'visualizer' ) . '</li></ul>';
205+
echo '<a href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a>';
206+
echo '</div>';
207+
}
206208
echo '<div class="visualizer-sidebar-box visualizer-tracking">';
207209
echo '<label class="visualizer-switch">';
208210
echo '<input type="checkbox" ' . $checked . ' >';

classes/Visualizer/Render/Page/Data.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
3939
*/
4040
protected function _renderContent() {
4141
// Added by Ash/Upwork
42-
if ( defined( 'Visualizer_Pro' ) ) {
42+
if ( VISUALIZER_PRO ) {
4343
global $Visualizer_Pro;
4444
$Visualizer_Pro->_addEditor();
4545
}
@@ -76,7 +76,7 @@ protected function _renderSidebarContent() {
7676
<h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
7777
<div class="group-content">
7878
<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>
79-
<p class="group-description"><?php 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>
79+
<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>
8080
<form id="vz-csv-file-form" action="<?php echo $upload_link ?>" method="post"
8181
target="thehole" enctype="multipart/form-data">
8282
<input type="hidden" id="remote-data" name="remote_data">
@@ -96,6 +96,7 @@ protected function _renderSidebarContent() {
9696

9797
<div class="section-items">
9898
<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>
99+
<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>
99100
<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>
100101
<form id="vz-one-time-import" action="<?php echo $upload_link ?>" method="post"
101102
target="thehole" enctype="multipart/form-data">
@@ -153,7 +154,7 @@ class="dashicons dashicons-lock"></span></h2>
153154
<select name="vz-import-from-chart" id="chart-id" class="visualizer-select">
154155
<?php
155156
$fetch_link = add_query_arg( array(
156-
'action' => defined( 'Visualizer_Pro' ) ? Visualizer_Pro::ACTION_FETCH_DATA : '',
157+
'action' => ( VISUALIZER_PRO ) ? Visualizer_Pro::ACTION_FETCH_DATA : '',
157158
'nonce' => wp_create_nonce(),
158159
), admin_url( 'admin-ajax.php' ) );
159160

classes/Visualizer/Render/Page/Types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function _renderSidebar() {}
9090
* @access protected
9191
*/
9292
protected function _renderToolbar() {
93-
if ( defined( 'Visualizer_Pro' ) ) {
93+
if ( VISUALIZER_PRO ) {
9494
global $Visualizer_Pro;
9595
}
9696
echo '<input type="submit" class="button button-primary button-large push-right" value="', esc_attr__( 'Next', 'visualizer' ), '">';

classes/Visualizer/Render/Page/Update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function _toHTML() {
5252
echo '}';
5353

5454
// added by Ash/Upwork
55-
if ( defined( 'Visualizer_Pro' ) ) {
55+
if ( VISUALIZER_PRO ) {
5656
global $Visualizer_Pro;
5757
$Visualizer_Pro->_addUpdateHook( $this->series, $this->data );
5858
}

css/frame.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ div.group-content {
186186

187187
.group-description {
188188
margin: 0;
189-
padding: 5px ;
189+
padding: 5px;
190190
color: #555;
191-
text-align: left;
192191
font-size: 12px;
192+
text-align: left;
193193
}
194194

195195
div.group-content .group-description {
196-
padding: 0;
196+
padding: 5px;
197197
font-family: "Montserrat",sans-serif;
198198
font-weight: 300;
199199
}

index.php

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,20 @@
1313
License URI: http://www.opensource.org/licenses/gpl-license.php
1414
*/
1515

16-
17-
// +----------------------------------------------------------------------+
18-
// | Copyright 2013 Madpixels (email : [email protected]) |
19-
// +----------------------------------------------------------------------+
20-
// | This program is free software; you can redistribute it and/or modify |
21-
// | it under the terms of the GNU General Public License, version 2, as |
22-
// | published by the Free Software Foundation. |
23-
// | |
24-
// | This program is distributed in the hope that it will be useful, |
25-
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
26-
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
27-
// | GNU General Public License for more details. |
28-
// | |
29-
// | You should have received a copy of the GNU General Public License |
30-
// | along with this program; if not, write to the Free Software |
31-
// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
32-
// | MA 02110-1301 USA |
33-
// +----------------------------------------------------------------------+
34-
// | Author: Eugene Manuilov <[email protected]> |
35-
// +----------------------------------------------------------------------+
36-
// prevent direct access to the plugin folder
16+
// Prevent direct access to the plugin folder.
3717
if ( ! defined( 'ABSPATH' ) ) {
3818
header( 'HTTP/1.0 404 Not Found', true, 404 );
3919
exit;
4020
}
41-
4221
// don't load the plugin, if it has been already loaded
4322
if ( class_exists( 'Visualizer_Plugin', false ) ) {
4423
return;
4524
}
46-
4725
// Added by Ash/Upwork
4826
if ( class_exists( 'Visualizer_Pro', false ) ) {
49-
define( 'Visualizer_Pro', true );
27+
define( 'VISUALIZER_PRO', true );
28+
} else {
29+
defined( 'VISUALIZER_PRO' ) || define( 'VISUALIZER_PRO', false );
5030
}
5131
// Added by Ash/Upwork
5232
/**
@@ -56,6 +36,7 @@
5636
* @since 1.0.0
5737
*
5838
* @param string $class The class name to autoload.
39+
*
5940
* @return boolean Returns TRUE if the class is located. Otherwise FALSE.
6041
*/
6142
function visualizer_autoloader( $class ) {
@@ -65,6 +46,7 @@ function visualizer_autoloader( $class ) {
6546
$filename = dirname( __FILE__ ) . str_replace( '_', DIRECTORY_SEPARATOR, "_classes_{$class}.php" );
6647
if ( is_readable( $filename ) ) {
6748
require $filename;
49+
6850
return true;
6951
}
7052
}
@@ -83,22 +65,17 @@ function visualizer_launch() {
8365
define( 'VISUALIZER_BASEFILE', __FILE__ );
8466
define( 'VISUALIZER_ABSURL', plugins_url( '/', __FILE__ ) );
8567
define( 'VISUALIZER_ABSPATH', dirname( __FILE__ ) );
86-
8768
if ( ! defined( 'VISUALIZER_CSV_DELIMITER' ) ) {
8869
define( 'VISUALIZER_CSV_DELIMITER', ',' );
8970
}
90-
9171
if ( ! defined( 'VISUALIZER_CSV_ENCLOSURE' ) ) {
9272
define( 'VISUALIZER_CSV_ENCLOSURE', '"' );
9373
}
94-
9574
// instantiate the plugin
9675
$plugin = Visualizer_Plugin::instance();
97-
9876
// set general modules
9977
$plugin->setModule( Visualizer_Module_Setup::NAME );
10078
$plugin->setModule( Visualizer_Module_Sources::NAME );
101-
10279
$plugin->setModule( Visualizer_Module_Chart::NAME );
10380
if ( is_admin() ) {
10481
// set admin modules
@@ -113,8 +90,8 @@ function visualizer_launch() {
11390
ThemeIsle_SDK_Loader::init_product( VISUALIZER_BASEFILE );
11491
}
11592
}
93+
11694
// register autoloader function
11795
spl_autoload_register( 'visualizer_autoloader' );
118-
11996
// launch the plugin
12097
visualizer_launch();

0 commit comments

Comments
 (0)