| @@ -73,10 +73,8 @@ | ||
| 73 | 73 | $this->_addAction( 'visualizer_chart_schedules_spl', 'addSplChartSchedules', null, 10, 3 ); |
| 74 | 74 | |
| 75 | 75 | $this->_addAction( 'admin_init', 'init' ); |
| 76 | 76 | |
| 77 | - $this->_addAction( 'visualizer_chart_languages', 'addMultilingualSupport' ); | |
| 78 | - | |
| 79 | 77 | if ( defined( 'TI_CYPRESS_TESTING' ) ) { |
| 80 | 78 | $this->load_cypress_hooks(); |
| 81 | 79 | } |
| 82 | 80 | |
| @@ -722,17 +720,14 @@ | ||
| 722 | 720 | } |
| 723 | 721 | #toplevel_page_visualizer ul.wp-submenu li.wp-first-item + li + li + li > a:hover { |
| 724 | 722 | box-shadow: inherit; |
| 725 | 723 | } |
| 726 | - #toplevel_page_visualizer ul.wp-submenu li.wp-first-item + li + li + li + li { | |
| 727 | - display: none; | |
| 728 | - } | |
| 729 | 724 | </style> |
| 730 | 725 | <script type="text/javascript"> |
| 731 | 726 | jQuery( document ).ready( function() { |
| 732 | 727 | jQuery( '#toplevel_page_visualizer' ).on( 'click', 'li:not(.wp-submenu-head, .wp-first-item):eq(2)', function( e ) { |
| 733 | 728 | e.preventDefault(); |
| 734 | - window.open( '<?php echo tsdk_utmify( 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/', 'toplevel' ); ?>', '_blank' ); | |
| 729 | + window.open( 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing', '_blank' ); | |
| 735 | 730 | } ); |
| 736 | 731 | } ); |
| 737 | 732 | </script> |
| 738 | 733 | <?php |
| @@ -770,24 +765,8 @@ | ||
| 770 | 765 | * Adds the display filters to be used in the meta_query while displaying the charts. |
| 771 | 766 | */ |
| 772 | 767 | private function getDisplayFilters( &$query_args ) { |
| 773 | 768 | $query = array(); |
| 774 | - global $sitepress; | |
| 775 | - if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { | |
| 776 | - $current_lang = icl_get_current_language(); | |
| 777 | - if ( in_array( $current_lang, array( 'all', icl_get_default_language() ), true ) ) { | |
| 778 | - $query[] = array( | |
| 779 | - 'key' => 'chart_lang', | |
| 780 | - 'compare' => 'NOT EXISTS', | |
| 781 | - ); | |
| 782 | - } else { | |
| 783 | - $query[] = array( | |
| 784 | - 'key' => 'chart_lang', | |
| 785 | - 'value' => $current_lang, | |
| 786 | - 'compare' => '=', | |
| 787 | - ); | |
| 788 | - } | |
| 789 | - } | |
| 790 | 769 | |
| 791 | 770 | // add chart type filter to the query arguments |
| 792 | 771 | $type = filter_input( INPUT_GET, 'type' ); |
| 793 | 772 | if ( $type && in_array( $type, Visualizer_Plugin::getChartTypes(), true ) ) { |
| @@ -885,9 +864,9 @@ | ||
| 885 | 864 | |
| 886 | 865 | $this->getDisplayFilters( $query_args ); |
| 887 | 866 | |
| 888 | 867 | // Added by Ash/Upwork |
| 889 | - $filterByMeta = ! empty( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 868 | + $filterByMeta = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING ); | |
| 890 | 869 | if ( $filterByMeta ) { |
| 891 | 870 | $query = array( |
| 892 | 871 | 'key' => Visualizer_Plugin::CF_SETTINGS, |
| 893 | 872 | 'value' => $filterByMeta, |
| @@ -988,15 +967,8 @@ | ||
| 988 | 967 | $css .= $arguments[0]; |
| 989 | 968 | $settings = $arguments[1]; |
| 990 | 969 | } |
| 991 | 970 | |
| 992 | - if ( isset( $settings['controls']['ui']['labelStacking'] ) ) { | |
| 993 | - unset( $settings['controls']['ui']['labelStacking'] ); | |
| 994 | - } | |
| 995 | - if ( isset( $settings['controls']['ui']['orientation'] ) ) { | |
| 996 | - unset( $settings['controls']['ui']['orientation'] ); | |
| 997 | - } | |
| 998 | - | |
| 999 | 971 | // add chart to the array |
| 1000 | 972 | $charts[ $id ] = array( |
| 1001 | 973 | 'id' => $chart->ID, |
| 1002 | 974 | 'type' => $type, |
| @@ -1113,9 +1085,9 @@ | ||
| 1113 | 1085 | esc_html__( 'Docs', 'visualizer' ) |
| 1114 | 1086 | ); |
| 1115 | 1087 | // flattr link |
| 1116 | 1088 | $plugin_meta[] = sprintf( |
| 1117 | - '<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>', | |
| 1089 | + '<a style="color:red" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank">%s</a>', | |
| 1118 | 1090 | esc_html__( 'Pro Addon', 'visualizer' ) |
| 1119 | 1091 | ); |
| 1120 | 1092 | } |
| 1121 | 1093 | |
| @@ -1131,65 +1103,6 @@ | ||
| 1131 | 1103 | if ( Visualizer_Module::is_pro() ) { |
| 1132 | 1104 | return true; |
| 1133 | 1105 | } |
| 1134 | 1106 | return 'yes' === get_option( 'visualizer-new-user', 'yes' ) ? false : true; |
| 1135 | - } | |
| 1136 | - | |
| 1137 | - /** | |
| 1138 | - * Multilingual Support. | |
| 1139 | - * | |
| 1140 | - * @param int $chart_id Chart ID. | |
| 1141 | - * @return bool Default false | |
| 1142 | - */ | |
| 1143 | - public function addMultilingualSupport( $chart_id ) { | |
| 1144 | - global $sitepress; | |
| 1145 | - if ( Visualizer_Module::is_pro() ) { | |
| 1146 | - return; | |
| 1147 | - } | |
| 1148 | - if ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) { | |
| 1149 | - $language = icl_get_languages(); | |
| 1150 | - $current_lang = icl_get_current_language(); | |
| 1151 | - $default_lang = icl_get_default_language(); | |
| 1152 | - $post_info = wpml_get_language_information( null, $chart_id ); | |
| 1153 | - $translations = array(); | |
| 1154 | - if ( ! empty( $post_info ) && ( $default_lang === $post_info['language_code'] ) ) { | |
| 1155 | - $trid = $sitepress->get_element_trid( $chart_id, 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); | |
| 1156 | - $translations = $sitepress->get_element_translations( $trid ); | |
| 1157 | - } | |
| 1158 | - if ( empty( $translations ) ) { | |
| 1159 | - return; | |
| 1160 | - } | |
| 1161 | - ?> | |
| 1162 | - <hr><div class="visualizer-languages-list only-pro"> | |
| 1163 | - <?php | |
| 1164 | - foreach ( $language as $lang ) { | |
| 1165 | - $lang_code = $lang['code']; | |
| 1166 | - if ( $current_lang !== $lang_code ) { | |
| 1167 | - ?> | |
| 1168 | - <a href="javascript:;"> | |
| 1169 | - <img src="<?php echo esc_url( $lang['country_flag_url'] ); ?>" alt="<?php echo esc_attr( $lang['translated_name'] ); ?>"> | |
| 1170 | - </a> | |
| 1171 | - <?php | |
| 1172 | - } | |
| 1173 | - } | |
| 1174 | - ?> | |
| 1175 | - <a href="<?php echo tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'wpml-support', 'visualizer_render_char' ); ?>"target="_blank"><?php esc_html_e( 'Upgrade to PRO to active this translation for charts', 'visualizer' ); ?></a> | |
| 1176 | - </div> | |
| 1177 | - <?php | |
| 1178 | - } | |
| 1179 | - } | |
| 1180 | - | |
| 1181 | - /** | |
| 1182 | - * Check chart is enabled or not. | |
| 1183 | - * | |
| 1184 | - * @param string $type Chart ID. | |
| 1185 | - * | |
| 1186 | - * @return bool Default false | |
| 1187 | - */ | |
| 1188 | - public static function checkChartStatus( $type ) { | |
| 1189 | - $types = self::_getChartTypesLocalized( false, false, false, true ); | |
| 1190 | - if ( isset( $types[ $type ] ) ) { | |
| 1191 | - return ! empty( $types[ $type ]['enabled'] ); | |
| 1192 | - } | |
| 1193 | - return false; | |
| 1194 | 1107 | } |
| 1195 | 1108 | } |