diff --git a/CHANGELOG.md b/CHANGELOG.md index fcdc0b4ee..7f2112511 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##### [Version 3.11.1](https://github.com/Codeinwp/visualizer/compare/v3.11.0...v3.11.1) (2024-05-14) + +- Fixed the permissions of the plans + #### [Version 3.11.0](https://github.com/Codeinwp/visualizer/compare/v3.10.15...v3.11.0) (2024-05-13) #### Enhancements diff --git a/classes/Visualizer/Module.php b/classes/Visualizer/Module.php index 41c8b41f3..c77cfc129 100644 --- a/classes/Visualizer/Module.php +++ b/classes/Visualizer/Module.php @@ -738,11 +738,20 @@ public static function can_show_feature( $feature ) { * Gets the features for the provided license type. */ public static final function get_features_for_license( $plan ) { + $is_new_personal = apply_filters( 'visualizer_is_new_personal', false ); switch ( $plan ) { case 1: - return array( 'import-wp', 'import-wc-report', 'import-file', 'import-url' ); + $features = array( 'import-wp', 'import-wc-report', 'import-file', 'import-url' ); + if ( ! $is_new_personal ) { + $features[] = 'db-query'; + } + return $features; case 2: - return array( 'db-query', 'schedule-chart', 'chart-permissions', 'import-chart', 'data-filter-configuration', 'frontend-actions' ); + $features = array( 'schedule-chart', 'chart-permissions', 'import-chart', 'data-filter-configuration', 'frontend-actions' ); + if ( $is_new_personal ) { + $features[] = 'db-query'; + } + return $features; } } diff --git a/classes/Visualizer/Module/Sources.php b/classes/Visualizer/Module/Sources.php index 211710422..34968e2f6 100644 --- a/classes/Visualizer/Module/Sources.php +++ b/classes/Visualizer/Module/Sources.php @@ -139,9 +139,14 @@ public function addProUpsell( $old, $feature = null ) { ( in_array( $feature, $pro_features, true ) && ! Visualizer_Module::is_pro() ) ) { $msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' ); - if ( in_array( $feature, $biz_features, true ) ) { - $msg = sprintf( __( 'Upgrade to %s plan to activate this feature!', 'visualizer' ), 'Developer' ); + $plus_msg = sprintf( __( 'Upgrade to %s plan to activate this feature!', 'visualizer' ), 'Plus' ); + if ( in_array( $feature, $biz_features, true ) && Visualizer_Module::is_pro() ) { + $msg = $plus_msg; } + if ( in_array( $feature, [ 'db-query', 'chart-permissions' ], true ) ) { + $msg = $plus_msg; + } + $return = '
'; $return .= '
'; $return .= '
'; diff --git a/classes/Visualizer/Plugin.php b/classes/Visualizer/Plugin.php index ba7410087..49517b512 100644 --- a/classes/Visualizer/Plugin.php +++ b/classes/Visualizer/Plugin.php @@ -28,7 +28,7 @@ class Visualizer_Plugin { const NAME = 'visualizer'; - const VERSION = '3.11.0'; + const VERSION = '3.11.1'; // custom post types const CPT_VISUALIZER = 'visualizer'; diff --git a/css/media.css b/css/media.css index 2f56c4589..9ce24b9b1 100644 --- a/css/media.css +++ b/css/media.css @@ -1,5 +1,5 @@ /* - Version: 3.11.0 + Version: 3.11.1 */ #visualizer-library-view { padding: 30px 10px 10px 30px; diff --git a/index.php b/index.php index 5d582ce16..c98ccde74 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.11.0 + Version: 3.11.1 Author: Themeisle Author URI: http://themeisle.com Requires at least: 5.2 diff --git a/js/frame.js b/js/frame.js index 062daf55f..95abd0ed7 100644 --- a/js/frame.js +++ b/js/frame.js @@ -8,8 +8,11 @@ (function ($) { $(window).on('load', function(){ - // scroll to the selected chart type. - $('#chart-select').scrollIntoView(); + let chart_select = $('#chart-select'); + if(chart_select.length > 0){ + // scroll to the selected chart type. + $('#chart-select')[0].scrollIntoView(); + } }); $(document).ready(function () { @@ -154,7 +157,7 @@ /** * Initialize/Update the available chart list based on their supported renderer libraries. - * + * * @returns {void} */ function init_available_chart_list() { @@ -172,7 +175,7 @@ const rendererTypesMapping = JSON.parse( rendererTypesMappingData ); document.querySelectorAll('input.type-radio').forEach( chartTypeRadio => { - + // Init the lib based on the default selected chart type. if ( chartTypeRadio.checked ) { const chartType = chartTypeRadio.value; @@ -201,14 +204,14 @@ } }); }); - + // Update the chart list on user interaction. rendererSelect.addEventListener('change', (event) => { disable_renderer_select_placeholder(); toggle_renderer_type( event.target.value ); toggle_chart_types_by_render( event.target.value ); }); - + } /** @@ -223,9 +226,9 @@ /** * Toggle the renderer type class based on the given renderer type. - * + * * The class is used to style the chart type picker based on the given renderer library. - * + * * @param {('GoogleCharts' | 'ChartJS' | 'DataTable')} rendererType The renderer type to toggle the class. */ function toggle_renderer_type( rendererType ) { @@ -233,14 +236,14 @@ if ( ! typePicker ) { return; } - + typePicker.classList.remove('lib-GoogleCharts', 'lib-ChartJS', 'lib-DataTable'); typePicker.classList.add(`lib-${rendererType}`); } /** * Toggle chart types based on the given renderer type. - * + * * @param {('GoogleCharts' | 'ChartJS' | 'DataTable')} rendererType The renderer type to filter the chart types. */ function toggle_chart_types_by_render( rendererType ) { @@ -786,11 +789,11 @@ if( chartTypes ) { document.querySelector('.push-right[type=submit]')?.addEventListener('click', async function (event) { if ( typeof window.tiTrk !== 'undefined' ) { - event.preventDefault(); + event.preventDefault(); try { const formData = new FormData(document.querySelector('#viz-types-form')); const savedData = Object.fromEntries(formData); - + tiTrk?.with('visualizer')?.add({ feature: 'chart-create', featureComponent: 'saved-data', @@ -800,7 +803,7 @@ }, groupId }); - + // Do not make the user to wait too long for the event to be uploaded. const timer = new Promise((resolve) => setTimeout(resolve, 500)); await Promise.race([timer, tiTrk?.uploadEvents()]); diff --git a/package.json b/package.json index 3623ea883..476d19d1c 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "visualizer", - "version": "3.11.0", + "version": "3.11.1", "description": "Visualizer Lite", "repository": { "type": "git", diff --git a/readme.txt b/readme.txt index d2239f8be..b29e3a214 100755 --- a/readme.txt +++ b/readme.txt @@ -25,23 +25,23 @@ The plugin uses the Google Visualization API, DataTables.net, and ChartJS librar ### Why You’ll Love Visualizer ### -* Diverse Chart Options: Begin with essential chart types like line, pie, bar, and table in the free version. Elevate your data presentation with advanced chart types such as scatter, area, and geo available in the Pro version. The free version offers a comprehensive range of options that are perfect for various visualization needs. +- **Diverse Chart Options:** Begin with essential chart types like line, pie, bar, and table in the free version. Elevate your data presentation with advanced chart types such as scatter, area, and geo available in the Pro version. The free version offers a comprehensive range of options that are perfect for various visualization needs. -* Flexible Data Source Options: Visualizer Free supports a variety of accessible data input methods to suit your specific needs: +- **Flexible Data Source Options:**Visualizer Free supports a variety of accessible data input methods to suit your specific needs: -* Import Data from Files: Upload CSV files directly into Visualizer. This feature is ideal for those who prepare data in spreadsheet tools like Microsoft Excel or Google Sheets, allowing for quick and easy data visualization. +- **Import Data from Files:** Upload CSV files directly into Visualizer. This feature is ideal for those who prepare data in spreadsheet tools like Microsoft Excel or Google Sheets, allowing for quick and easy data visualization. -* Import Data from URLs: Keep your charts updated by importing data dynamically from external sources in CSV or JSON formats via URLs. This powerful feature is essential for displaying real-time or frequently updated data, reducing the need for manual updates. +- **Import Data from URLs:** Keep your charts updated by importing data dynamically from external sources in CSV or JSON formats via URLs. This powerful feature is essential for displaying real-time or frequently updated data, reducing the need for manual updates. -* Manual Data Entry: Input data manually for quick visualization tasks or when dealing with smaller data sets. This method provides ultimate control over the content and structure of your charts, making it simple to tailor data presentation directly within the plugin interface. +- **Manual Data Entry:** Input data manually for quick visualization tasks or when dealing with smaller data sets. This method provides ultimate control over the content and structure of your charts, making it simple to tailor data presentation directly within the plugin interface. -* Ultimate Responsiveness: Crafted using HTML5/SVG technology, Visualizer charts ensure flawless functionality across all devices. This commitment to responsiveness guarantees that your data is not only accessible but also optimally displayed on desktops, tablets, and smartphones, enhancing user interaction and engagement. +- **Ultimate Responsiveness:** Crafted using HTML5/SVG technology, Visualizer charts ensure flawless functionality across all devices. This commitment to responsiveness guarantees that your data is not only accessible but also optimally displayed on desktops, tablets, and smartphones, enhancing user interaction and engagement. -* Data Table Capabilities: In addition to our responsive charts and graphs, you can also add responsive tables to your posts and pages and customize them to your liking. Visualizer Pro lets you enhance them with features such as sorting capabilities, pagination, and search functions. From pricing tables to product tables, the possibilities are vast and customizable to meet any data presentation need. +- **Data Table Capabilities:** In addition to our responsive charts and graphs, you can also add responsive tables to your posts and pages and customize them to your liking. Visualizer Pro lets you enhance them with features such as sorting capabilities, pagination, and search functions. From pricing tables to product tables, the possibilities are vast and customizable to meet any data presentation need. -* Seamless Integration and Compatibility: Whether you're using the Gutenberg editor or other page builders, Visualizer integrates effortlessly into your WordPress environment. This seamless compatibility allows for straightforward chart insertion and management. +- **Seamless Integration and Compatibility:** Whether you're using the Gutenberg editor or other page builders, Visualizer integrates effortlessly into your WordPress environment. This seamless compatibility allows for straightforward chart insertion and management. -* Flexible and Customizable: Make the charts and tables truly your own. Visualizer offers an extensive set of configuration options to perfectly match the look and feel of your website. Utilize Google Chart Tools with their default settings for simplicity, or dive into customization if your site’s style requires a unique approach. Every chart and table exposes numerous options that customize its appearance and functionality, ensuring your visualizations integrate seamlessly into your pages. +- **Flexible and Customizable:** Make the charts and tables truly your own. Visualizer offers an extensive set of configuration options to perfectly match the look and feel of your website. Utilize Google Chart Tools with their default settings for simplicity, or dive into customization if your site’s style requires a unique approach. Every chart and table exposes numerous options that customize its appearance and functionality, ensuring your visualizations integrate seamlessly into your pages. These versatile data handling capabilities ensure that Visualizer Free is equipped to meet a wide range of data visualization requirements right out of the box. Perfect for bloggers, educators, small businesses, and more, Visualizer helps you turn raw data into compelling, interactive charts that engage and inform your audience. @@ -54,19 +54,19 @@ These versatile data handling capabilities ensure that Visualizer Free is equipp ### ✨ YOU SHOULD USE VISUALIZER IF: ### -* You Own a Personal or Small Business Website: You need a straightforward, powerful tool to enhance your website's visual appeal with interactive charts and tables. Visualizer makes complex data understandable and engaging. +- **You Own a Personal or Small Business Website:** You need a straightforward, powerful tool to enhance your website's visual appeal with interactive charts and tables. Visualizer makes complex data understandable and engaging. -* You Run an Educational or Financial Institution: For organizations that require regular reporting and data display, Visualizer offers comprehensive options for creating dynamic and informative charts and tables. This helps in better data analysis and presentation, aiding in decision-making and reporting. +- **You Run an Educational or Financial Institution:** For organizations that require regular reporting and data display, Visualizer offers comprehensive options for creating dynamic and informative charts and tables. This helps in better data analysis and presentation, aiding in decision-making and reporting. -* You Aim to Enhance SEO and User Engagement: Using Visualizer’s interactive and responsive charts can significantly improve user engagement, keeping visitors on your site longer, which can positively impact your SEO rankings. +- **You Aim to Enhance SEO and User Engagement:** Using Visualizer’s interactive and responsive charts can significantly improve user engagement, keeping visitors on your site longer, which can positively impact your SEO rankings. -* You are a Non-Profit Organizations: Non-profits can use Visualizer to display the impact of their initiatives through data. Create pie charts to show the distribution of spending or line charts to track donation trends over time, which can be powerful visuals for fundraising campaigns and annual reports. +- **You are a Non-Profit Organizations:** Non-profits can use Visualizer to display the impact of their initiatives through data. Create pie charts to show the distribution of spending or line charts to track donation trends over time, which can be powerful visuals for fundraising campaigns and annual reports. -* You are Financial Advisors and Economists: Visualizer allows for detailed financial reporting and economic analyses with advanced chart types like candlestick and radar charts. These tools can be used to depict stock performances, economic cycles, or budget allocations, providing clients with clear insights into financial matters. +- **You are Financial Advisors and Economists:** Visualizer allows for detailed financial reporting and economic analyses with advanced chart types like candlestick and radar charts. These tools can be used to depict stock performances, economic cycles, or budget allocations, providing clients with clear insights into financial matters. -* Regardless of Industry: With over 30,000 happy active users and 160+ 5-star ratings, Visualizer has been employed across a broad range of industries, including healthcare, marketing, education, and finance, demonstrating its versatility and effectiveness in any field. +- **Regardless of Industry:** With over 30,000 happy active users and 160+ 5-star ratings, Visualizer has been employed across a broad range of industries, including healthcare, marketing, education, and finance, demonstrating its versatility and effectiveness in any field. -Types of charts you can create with Visualizer: Visualizer WordPress graph and charts plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, bar charts, pie charts, table charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps. +**Types of charts you can create with Visualizer:** Visualizer WordPress graph and charts plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, bar charts, pie charts, table charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps. - **Table:** Tables are extremely useful tools for displaying organized data. We use the datatable library to offer you endless customization options for any table needs you might have. [Click here to see demo](https://demo.themeisle.com/visualizer/table-chart/). - **Pie Chart:** Pie charts are simple visualizations that allow you to easily illustrate the proportion of your data to your users. [Click here to see demo](https://demo.themeisle.com/visualizer/pie-chart/). @@ -226,6 +226,13 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have ` == Changelog == +##### [Version 3.11.1](https://github.com/Codeinwp/visualizer/compare/v3.11.0...v3.11.1) (2024-05-14) + +- Fixed the permissions of the plans + + + + #### [Version 3.11.0](https://github.com/Codeinwp/visualizer/compare/v3.10.15...v3.11.0) (2024-05-13) #### Enhancements diff --git a/tests/e2e/specs/upsell.spec.js b/tests/e2e/specs/upsell.spec.js index 1e671cac1..9e63ffb3e 100644 --- a/tests/e2e/specs/upsell.spec.js +++ b/tests/e2e/specs/upsell.spec.js @@ -70,7 +70,7 @@ test.describe( 'Upsell', () => { expect( searchParams.get('utm_campaign') ).toBe('db-query'); await page.frameLocator('iframe').getByRole('heading', { name: /Import from database/ }).click(); - await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade to Developer plan to activate this feature!'); + await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade to Plus plan to activate this feature!'); await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade Now'); await page.frameLocator('iframe').getByRole('link', { name: 'Settings' }).click(); @@ -90,7 +90,7 @@ test.describe( 'Upsell', () => { searchParams = new URLSearchParams(href); expect( searchParams.get('utm_campaign') ).toBe('chart-permissions'); await page.frameLocator('iframe').getByRole('heading', { name: /Permissions/ }).click(); - await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade to Developer plan to activate this feature!'); + await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade to Plus plan to activate this feature!'); await expect(page.frameLocator('iframe').locator('#vz-db-wizard')).toContainText('Upgrade Now'); });