| @@ -174,9 +174,9 @@ | ||
| 174 | 174 | self::_renderGroupEnd(); |
| 175 | 175 | |
| 176 | 176 | self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) ); |
| 177 | 177 | 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>' ); | |
| 178 | + self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( 'Configure the graph by providing configuration variables right from the %1$sGoogle Visualization API%2$s', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/gallery/?#configuration-options" target="_blank">', '</a>' ) . '</span>' ); | |
| 179 | 179 | |
| 180 | 180 | $example = ' |
| 181 | 181 | { |
| 182 | 182 | "vAxis": { |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | esc_html__( 'Print', 'visualizer' ), |
| 219 | 219 | 'actions[]', |
| 220 | 220 | isset( $this->actions ) && in_array( 'print', $this->actions ) ? true : false, |
| 221 | 221 | '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' ), | |
| 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 data.', 'visualizer' ), | |
| 223 | 223 | $disable_actions |
| 224 | 224 | ); |
| 225 | 225 | self::_renderCheckboxItem( |
| 226 | 226 | esc_html__( 'CSV', 'visualizer' ), |
| @@ -230,9 +230,9 @@ | ||
| 230 | 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 | 231 | $disable_actions |
| 232 | 232 | ); |
| 233 | 233 | |
| 234 | - $disabled = ! self::is_excel_enabled(); | |
| 234 | + $disabled = ! ( class_exists( 'PHPExcel' ) && extension_loaded( 'zip' ) && extension_loaded( 'xml' ) && version_compare( PHP_VERSION, '5.2.0', '>' ) ); | |
| 235 | 235 | self::_renderCheckboxItem( |
| 236 | 236 | esc_html__( 'Excel', 'visualizer' ), |
| 237 | 237 | 'actions[]', |
| 238 | 238 | isset( $this->actions ) && in_array( 'xls;application/vnd.ms-excel', $this->actions ) ? true : false, |
| @@ -251,20 +251,8 @@ | ||
| 251 | 251 | self::_renderSectionEnd(); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
| 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 | 255 | * Renders chart general settings group. |
| 268 | 256 | * |
| 269 | 257 | * @since 1.0.0 |
| 270 | 258 | * |
| @@ -362,9 +350,9 @@ | ||
| 362 | 350 | |
| 363 | 351 | self::_renderCheckboxItem( |
| 364 | 352 | esc_html__( 'Animate on startup', 'visualizer' ), |
| 365 | 353 | 'animation[startup]', |
| 366 | - isset( $this->animation['startup'] ) ? $this->animation['startup'] : 0, | |
| 354 | + $this->animation['startup'], | |
| 367 | 355 | true, |
| 368 | 356 | esc_html__( 'Determines if the chart will animate on the initial draw.', 'visualizer' ) |
| 369 | 357 | ); |
| 370 | 358 | |