PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.0.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.0.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
← All changes | classes/Visualizer/Render/Sidebar.php +9 -101 3.1.33.0.2 View file →
@@ -83,24 +83,8 @@
83 83 */
84 84 protected $_alignments;
85 85
86 86 /**
87 - * Whether this chart supports animation or not.
88 - *
89 - * @access protected
90 - * @var bool
91 - */
92 - protected $_supportsAnimation = true;
93 -
94 - /**
95 - * Which library does this this chart implement?
96 - *
97 - * @access protected
98 - * @var string
99 - */
100 - protected $_library = null;
101 -
102 - /**
103 87 * Constructor.
104 88 *
105 89 * @since 1.0.0
106 90 *
@@ -131,10 +115,8 @@
131 115 '' => '',
132 116 '1' => esc_html__( 'Yes', 'visualizer' ),
133 117 '0' => esc_html__( 'No', 'visualizer' ),
134 118 );
135 -
136 - $this->hooks();
137 119 }
138 120
139 121 /**
140 122 * Renders chart title settings.
@@ -174,9 +156,9 @@
174 156 self::_renderGroupEnd();
175 157
176 158 self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) );
177 159 self::_renderSectionStart();
178 - self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( 'Configure the graph by providing configuration variables right from the %1$sGoogle Visualization API%2$s. You can refer to to some examples %3$shere%4$s.', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/gallery/?#configuration-options" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', '</a>' ) . '</span>' );
160 + self::_renderSectionDescription( __( 'Configure the graph by providing configuration variables right from the','visualizer' ) . ' <a href="https://developers.google.com/chart/interactive/docs/reference" target="_blank">Google Visualization</a> API.' );
179 161
180 162 $example = '
181 163 {
182 164 "vAxis": {
@@ -192,10 +174,9 @@
192 174 esc_html__( 'Configuration', 'visualizer' ),
193 175 'manual',
194 176 $this->manual,
195 177 sprintf(
196 - esc_html__( 'One per line in valid JSON (key:value) format e.g. %s', 'visualizer' ),
197 - '<br><code>' . $example . '</code>'
178 + esc_html__( 'One per line in valid JSON (key:value) format e.g. %s', 'visualizer' ), '<br><code>' . $example . '</code>'
198 179 ),
199 180 '',
200 181 array( 'rows' => 5 )
201 182 );
@@ -210,10 +191,8 @@
210 191 *
211 192 * @access protected
212 193 */
213 194 protected function _renderActionSettings() {
214 - global $wp_version;
215 - $disable_actions = version_compare( $wp_version, '4.7.0', '<' );
216 195 self::_renderSectionStart( esc_html__( 'Actions', 'visualizer' ), false );
217 196 self::_renderCheckboxItem(
218 197 esc_html__( 'Print', 'visualizer' ),
219 198 'actions[]',
@@ -218,10 +197,9 @@
218 197 esc_html__( 'Print', 'visualizer' ),
219 198 'actions[]',
220 199 isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false,
221 200 'print',
222 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable printing the chart/data.', 'visualizer' ),
223 - $disable_actions
201 + esc_html__( 'To enable printing the data.', 'visualizer' )
224 202 );
225 203 self::_renderCheckboxItem(
226 204 esc_html__( 'CSV', 'visualizer' ),
227 205 'actions[]',
@@ -226,20 +204,19 @@
226 204 esc_html__( 'CSV', 'visualizer' ),
227 205 'actions[]',
228 206 isset( $this->actions ) && in_array( 'csv;application/csv', $this->actions ) ? true : false,
229 207 'csv;application/csv',
230 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' ),
231 - $disable_actions
208 + esc_html__( 'To enable downloading the data as a CSV.', 'visualizer' )
232 209 );
233 210
234 - $disabled = ! self::is_excel_enabled();
211 + $disabled = ! ( class_exists( 'PHPExcel' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) );
235 212 self::_renderCheckboxItem(
236 213 esc_html__( 'Excel', 'visualizer' ),
237 214 'actions[]',
238 215 isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false,
239 216 'xls;application/vnd.ms-excel',
240 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : ( $disabled ? '<span class="viz-section-error">' . esc_html__( 'Enable the ZIP and XML extensions to use this setting.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as an Excel spreadsheet.', 'visualizer' ) ),
241 - $disable_actions || $disabled
217 + $disabled ? '<span class="viz-section-error">' . esc_html__( 'Enable the ZIP and XML extensions to use this setting.', 'visualizer' ) . '</span>' : esc_html__( 'To enable downloading the data as an Excel spreadsheet.', 'visualizer' ),
218 + $disabled
242 219 );
243 220 self::_renderCheckboxItem(
244 221 esc_html__( 'Copy', 'visualizer' ),
245 222 'actions[]',
@@ -244,27 +221,14 @@
244 221 esc_html__( 'Copy', 'visualizer' ),
245 222 'actions[]',
246 223 isset( $this->actions ) && in_array( 'copy', $this->actions ) ? true : false,
247 224 'copy',
248 - $disable_actions ? '<span class="viz-section-error">' . esc_html__( 'Upgrade to at least WordPress 4.7 to use this.', 'visualizer' ) . '</span>' : esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' ),
249 - $disable_actions
225 + esc_html__( 'To enable copying the data to the clipboard.', 'visualizer' )
250 226 );
251 227 self::_renderSectionEnd();
252 228 }
253 229
254 230 /**
255 - * Checks if the Excel module can be enabled.
256 - */
257 - private static function is_excel_enabled() {
258 - $vendor_file = VISUALIZER_ABSPATH . '/vendor/autoload.php';
259 - if ( is_readable( $vendor_file ) ) {
260 - include_once( $vendor_file );
261 - }
262 -
263 - return class_exists( 'PhpOffice\PhpSpreadsheet\Spreadsheet' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && extension_loaded( 'fileinfo' ) && version_compare( PHP_VERSION, '5.6.0', '>' );
264 - }
265 -
266 - /**
267 231 * Renders chart general settings group.
268 232 *
269 233 * @since 1.0.0
270 234 *
@@ -341,61 +305,12 @@
341 305
342 306 self::_renderSectionStart( esc_html__( 'Tooltip', 'visualizer' ), false );
343 307 $this->_renderTooltipSettigns();
344 308 self::_renderSectionEnd();
345 -
346 - $this->_renderAnimationSettings();
347 -
348 309 self::_renderGroupEnd();
349 310 }
350 311
351 312 /**
352 - * Renders animation settings section.
353 - *
354 - * @access protected
355 - */
356 - protected function _renderAnimationSettings() {
357 - if ( ! $this->_supportsAnimation ) {
358 - return;
359 - }
360 -
361 - self::_renderSectionStart( esc_html__( 'Animation', 'visualizer' ), false );
362 -
363 - self::_renderCheckboxItem(
364 - esc_html__( 'Animate on startup', 'visualizer' ),
365 - 'animation[startup]',
366 - isset( $this->animation['startup'] ) ? $this->animation['startup'] : 0,
367 - true,
368 - esc_html__( 'Determines if the chart will animate on the initial draw.', 'visualizer' )
369 - );
370 -
371 - self::_renderTextItem(
372 - esc_html__( 'Duration', 'visualizer' ),
373 - 'animation[duration]',
374 - isset( $this->animation['duration'] ) ? $this->animation['duration'] : 0,
375 - esc_html__( 'The duration of the animation, in milliseconds', 'visualizer' ),
376 - 0,
377 - 'number'
378 - );
379 -
380 - self::_renderSelectItem(
381 - esc_html__( 'Easing', 'visualizer' ),
382 - 'animation[easing]',
383 - isset( $this->animation['easing'] ) ? $this->animation['easing'] : null,
384 - array(
385 - 'linear' => esc_html__( 'Constant speed', 'visualizer' ),
386 - 'in' => esc_html__( 'Start slow and speed up', 'visualizer' ),
387 - 'out' => esc_html__( 'Start fast and slow down', 'visualizer' ),
388 - 'inAndOut' => esc_html__( 'Start slow, speed up, then slow down', 'visualizer' ),
389 - ),
390 - esc_html__( 'The easing function applied to the animation.', 'visualizer' )
391 - );
392 -
393 - self::_renderSectionEnd();
394 -
395 - }
396 -
397 - /**
398 313 * Renders tooltip settings section.
399 314 *
400 315 * @since 1.4.0
401 316 *
@@ -747,9 +662,9 @@
747 662 protected static function _renderCheckboxItem( $title, $name, $value, $default, $desc, $disabled = false ) {
748 663 echo '<div class="viz-section-item">';
749 664 echo '<a class="more-info" href="javascript:;">[?]</a>';
750 665 echo '<b>', $title, '</b>';
751 - echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ( $value == $default ? 'checked' : '' ), ' ', ( $disabled ? 'disabled=disabled' : '' ), '>';
666 + echo '<input type="checkbox" class="control-check" value="', $default, '" name="', $name, '" ', ($value == $default ? 'checked' : ''), ' ', ($disabled ? 'disabled=disabled' : ''), '>';
752 667 echo '<p class="viz-section-description">', $desc, '</p>';
753 668 echo '</div>';
754 669 }
755 670
@@ -768,14 +683,7 @@
768 683 echo '<b>', $title, '</b>';
769 684 echo '<textarea class="control-text" ', $attributes, ' name="', $name, '" placeholder="', $placeholder, '">', $value, '</textarea>';
770 685 echo '<p class="viz-section-description">', $desc, '</p>';
771 686 echo '</div>';
772 - }
773 -
774 - /**
775 - * Returns the library this chart implements.
776 - */
777 - public function getLibrary() {
778 - return $this->_library;
779 687 }
780 688
781 689 }