PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.5
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.5
4.0.8 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 All 149 releases
← All changes | classes/Visualizer/Module/Admin.php +22 -113 3.10.13.7.5 View file →
@@ -53,9 +53,9 @@
53 53 parent::__construct( $plugin );
54 54 $this->_addAction( 'load-post.php', 'enqueueMediaScripts' );
55 55 $this->_addAction( 'load-post-new.php', 'enqueueMediaScripts' );
56 56 $this->_addAction( 'admin_footer', 'renderTemplates' );
57 - $this->_addAction( 'admin_enqueue_scripts', 'enqueueLibraryScripts', null, 0 );
57 + $this->_addAction( 'admin_enqueue_scripts', 'enqueueLibraryScripts', null, 8 );
58 58 $this->_addAction( 'admin_menu', 'registerAdminMenu' );
59 59 $this->_addFilter( 'media_view_strings', 'setupMediaViewStrings' );
60 60 $this->_addFilter( 'plugin_action_links', 'getPluginActionLinks', 10, 2 );
61 61 $this->_addFilter( 'plugin_row_meta', 'getPluginMetaLinks', 10, 2 );
@@ -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
@@ -366,9 +364,9 @@
366 364 'filters' => $chart_types,
367 365 'types' => array_keys( $chart_types ),
368 366 ),
369 367 'nonce' => wp_create_nonce(),
370 - 'buildurl' => esc_url( add_query_arg( 'action', Visualizer_Plugin::ACTION_CREATE_CHART, admin_url( 'admin-ajax.php' ) ) ),
368 + 'buildurl' => add_query_arg( 'action', Visualizer_Plugin::ACTION_CREATE_CHART, admin_url( 'admin-ajax.php' ) ),
371 369 );
372 370
373 371 return $strings;
374 372 }
@@ -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,
@@ -1015,30 +987,26 @@
1015 987 'language' => $this->get_language(),
1016 988 'map_api_key' => get_option( 'visualizer-map-api-key' ),
1017 989 'charts' => $charts,
1018 990 'urls' => array(
1019 - 'base' => esc_url( add_query_arg( array( 'vpage' => false, 'vaction' => false ) ) ),
1020 - 'create' => esc_url(
1021 - add_query_arg(
1022 - array(
1023 - 'action' => Visualizer_Plugin::ACTION_CREATE_CHART,
1024 - 'library' => 'yes',
1025 - 'type' => isset( $_GET['type'] ) ? $_GET['type'] : '',
1026 - 'chart-library' => isset( $_GET['chart-library'] ) ? $_GET['chart-library'] : '',
1027 - 'vaction' => false,
1028 - ),
1029 - $ajaxurl
1030 - )
991 + 'base' => add_query_arg( array( 'vpage' => false, 'vaction' => false ) ),
992 + 'create' => add_query_arg(
993 + array(
994 + 'action' => Visualizer_Plugin::ACTION_CREATE_CHART,
995 + 'library' => 'yes',
996 + 'type' => isset( $_GET['type'] ) ? $_GET['type'] : '',
997 + 'chart-library' => isset( $_GET['chart-library'] ) ? $_GET['chart-library'] : '',
998 + 'vaction' => false,
999 + ),
1000 + $ajaxurl
1031 1001 ),
1032 - 'edit' => esc_url(
1033 - add_query_arg(
1034 - array(
1035 - 'action' => Visualizer_Plugin::ACTION_EDIT_CHART,
1036 - 'library' => 'yes',
1037 - 'vaction' => false,
1038 - ),
1039 - $ajaxurl
1040 - )
1002 + 'edit' => add_query_arg(
1003 + array(
1004 + 'action' => Visualizer_Plugin::ACTION_EDIT_CHART,
1005 + 'library' => 'yes',
1006 + 'vaction' => false,
1007 + ),
1008 + $ajaxurl
1041 1009 ),
1042 1010 ),
1043 1011 'page_type' => 'library',
1044 1012 'is_front' => false,
@@ -1113,9 +1081,9 @@
1113 1081 esc_html__( 'Docs', 'visualizer' )
1114 1082 );
1115 1083 // flattr link
1116 1084 $plugin_meta[] = sprintf(
1117 - '<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>',
1085 + '<a style="color:red" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank">%s</a>',
1118 1086 esc_html__( 'Pro Addon', 'visualizer' )
1119 1087 );
1120 1088 }
1121 1089
@@ -1131,65 +1099,6 @@
1131 1099 if ( Visualizer_Module::is_pro() ) {
1132 1100 return true;
1133 1101 }
1134 1102 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 1103 }
1195 1104 }