diff --git a/CHANGELOG.md b/CHANGELOG.md index 8add758de..c3627f04f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##### [Version 3.9.1](https://github.com/Codeinwp/visualizer/compare/v3.9.0...v3.9.1) (2022-11-17) + +- Fixed PHP error when Polylang plugin is activated [#960](https://github.com/Codeinwp/visualizer/issues/960) + #### [Version 3.9.0](https://github.com/Codeinwp/visualizer/compare/v3.8.1...v3.9.0) (2022-11-10) - Fixed table chart decimal number issue Decimal Numbers are ignored and not displayed [#955](https://github.com/Codeinwp/visualizer/issues/955) diff --git a/classes/Visualizer/Module/Admin.php b/classes/Visualizer/Module/Admin.php index 94bcdb1ff..5418091fb 100644 --- a/classes/Visualizer/Module/Admin.php +++ b/classes/Visualizer/Module/Admin.php @@ -768,8 +768,8 @@ function setScreenOptions( $status, $option, $value ) { */ private function getDisplayFilters( &$query_args ) { $query = array(); - - if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { + global $sitepress; + if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { $current_lang = icl_get_current_language(); if ( in_array( $current_lang, array( 'all', icl_get_default_language() ), true ) ) { $query[] = array( @@ -1138,16 +1138,15 @@ public static function proFeaturesLocked() { * @return bool Default false */ public function addMultilingualSupport( $chart_id ) { + global $sitepress; if ( Visualizer_Module::is_pro() ) { return; } - if ( function_exists( 'icl_get_languages' ) ) { + if ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) { $language = icl_get_languages(); $current_lang = icl_get_current_language(); $default_lang = icl_get_default_language(); $post_info = wpml_get_language_information( null, $chart_id ); - - global $sitepress; $translations = array(); if ( ! empty( $post_info ) && ( $default_lang === $post_info['language_code'] ) ) { $trid = $sitepress->get_element_trid( $chart_id, 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); diff --git a/classes/Visualizer/Module/Chart.php b/classes/Visualizer/Module/Chart.php index 7115737bf..0dbf49aba 100644 --- a/classes/Visualizer/Module/Chart.php +++ b/classes/Visualizer/Module/Chart.php @@ -461,8 +461,8 @@ public function deleteChart() { } } if ( $success ) { - if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { - global $sitepress; + global $sitepress; + if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { $trid = $sitepress->get_element_trid( $chart_id, 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); $translations = $sitepress->get_element_translations( $trid ); if ( ! empty( $translations ) ) { diff --git a/classes/Visualizer/Module/Frontend.php b/classes/Visualizer/Module/Frontend.php index 226194f9f..412635a22 100644 --- a/classes/Visualizer/Module/Frontend.php +++ b/classes/Visualizer/Module/Frontend.php @@ -305,7 +305,8 @@ public function renderChart( $atts ) { $atts ); - if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { + global $sitepress; + if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { global $sitepress; $locale = icl_get_current_language(); $locale = strtolower( str_replace( '_', '-', $locale ) ); diff --git a/classes/Visualizer/Plugin.php b/classes/Visualizer/Plugin.php index 9ec645f50..d3d5c1bb4 100644 --- a/classes/Visualizer/Plugin.php +++ b/classes/Visualizer/Plugin.php @@ -28,7 +28,7 @@ class Visualizer_Plugin { const NAME = 'visualizer'; - const VERSION = '3.9.0'; + const VERSION = '3.9.1'; // custom post types const CPT_VISUALIZER = 'visualizer'; diff --git a/css/media.css b/css/media.css index 3c0e69604..c5dfa9822 100644 --- a/css/media.css +++ b/css/media.css @@ -1,5 +1,5 @@ /* - Version: 3.9.0 + Version: 3.9.1 */ #visualizer-library-view { padding: 30px 10px 10px 30px; diff --git a/cypress/integration/gutenberg-datatable/free-gutenberg-datatable.js b/cypress/integration/gutenberg-datatable/free-gutenberg-datatable.js index 4d5c5b4e1..5c50f31d6 100755 --- a/cypress/integration/gutenberg-datatable/free-gutenberg-datatable.js +++ b/cypress/integration/gutenberg-datatable/free-gutenberg-datatable.js @@ -18,7 +18,8 @@ describe('Test Free - gutenberg (datatable)', function() { it('Verify insertion of charts', function() { cy.visit('/wp-admin/post-new.php'); - cy.clear_welcome(); + // get rid of that irritating popup + cy.get('.edit-post-welcome-guide .components-modal__header button').click(); var charts = Array.from({ length: 1 }, function(_item, index) { return index + 1; diff --git a/cypress/integration/gutenberg/free-gutenberg.js b/cypress/integration/gutenberg/free-gutenberg.js index 9662c144f..1cb5d9a27 100755 --- a/cypress/integration/gutenberg/free-gutenberg.js +++ b/cypress/integration/gutenberg/free-gutenberg.js @@ -18,7 +18,8 @@ describe('Test Free - gutenberg', function() { it('Verify insertion of charts', function() { cy.visit('/wp-admin/post-new.php'); - cy.clear_welcome(); + // get rid of that irritating popup + cy.get('.edit-post-welcome-guide .components-modal__header button').click(); var charts = Array.from({ length: parseInt(Cypress.env('chart_types').free - 1) }, function(_item, index) { return index + 1; diff --git a/index.php b/index.php index 5b306b57b..8e292f221 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Visualizer: Tables and Charts for WordPress Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs/ 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. - Version: 3.9.0 + Version: 3.9.1 Author: Themeisle Author URI: http://themeisle.com Requires at least: 3.5 diff --git a/package.json b/package.json index 614484c56..b09461228 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "visualizer", - "version": "3.9.0", + "version": "3.9.1", "description": "Visualizer Lite", "repository": { "type": "git", diff --git a/readme.txt b/readme.txt index 35b65e508..1bf1d42c2 100755 --- a/readme.txt +++ b/readme.txt @@ -163,6 +163,13 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have ` == Changelog == +##### [Version 3.9.1](https://github.com/Codeinwp/visualizer/compare/v3.9.0...v3.9.1) (2022-11-17) + +- Fixed PHP error when Polylang plugin is activated [#960](https://github.com/Codeinwp/visualizer/issues/960) + + + + #### [Version 3.9.0](https://github.com/Codeinwp/visualizer/compare/v3.8.1...v3.9.0) (2022-11-10) - Fixed table chart decimal number issue Decimal Numbers are ignored and not displayed [#955](https://github.com/Codeinwp/visualizer/issues/955)