PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.9
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/Render/Layout.php +10 -119 3.10.113.7.9 View file →
@@ -104,9 +104,9 @@
104 104 </tr>
105 105 </thead>
106 106 <tfoot>
107 107 </tfoot>
108 - <tbody>
108 + <tbody>
109 109 <?php
110 110 foreach ( $results as $result ) {
111 111 echo '<tr>';
112 112 foreach ( $result as $r ) {
@@ -138,9 +138,8 @@
138 138 admin_url( 'admin-ajax.php' )
139 139 )
140 140 );
141 141
142 - $is_wc_source = get_post_meta( $id, Visualizer_Plugin::CF_IS_WOOCOMMERCE_SOURCE, true );
143 142 $url = get_post_meta( $id, Visualizer_Plugin::CF_JSON_URL, true );
144 143 $root = get_post_meta( $id, Visualizer_Plugin::CF_JSON_ROOT, true );
145 144 $paging = get_post_meta( $id, Visualizer_Plugin::CF_JSON_PAGING, true );
146 145 $headers = get_post_meta( $id, Visualizer_Plugin::CF_JSON_HEADERS, true );
@@ -171,13 +170,11 @@
171 170 id="vz-import-json-url"
172 171 name="url"
173 172 value="<?php echo esc_url( $url ); ?>"
174 173 placeholder="<?php esc_html_e( 'Please enter the URL', 'visualizer' ); ?>"
175 - class="visualizer-input json-form-element"
176 - <?php echo $is_wc_source ? 'readonly' : ''; ?>
177 - >
174 + class="visualizer-input json-form-element">
178 175 <button class="button button-secondary button-small" id="visualizer-json-fetch"><?php esc_html_e( 'Fetch Endpoint', 'visualizer' ); ?></button>
179 -
176 +
180 177 <div class="visualizer-json-subform">
181 178 <h3 class="viz-substep <?php echo $headers_open ? 'open' : ''; ?>"><?php _e( 'Headers', 'visualizer' ); ?></h3>
182 179 <div class="json-wizard-headers">
183 180 <div class="json-wizard-header">
@@ -198,9 +195,9 @@
198 195 id="vz-import-json-username"
199 196 name="username"
200 197 value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'username', $headers['auth'] ) ? $headers['auth']['username'] : '' ); ?>"
201 198 placeholder="<?php esc_html_e( 'Username/Access Key', 'visualizer' ); ?>"
202 - class="json-form-element">
199 + class="json-form-element">
203 200 &
204 201 <input
205 202 type="password"
206 203 id="vz-import-json-password"
@@ -206,9 +203,9 @@
206 203 id="vz-import-json-password"
207 204 name="password"
208 205 value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'password', $headers['auth'] ) ? $headers['auth']['password'] : '' ); ?>"
209 206 placeholder="<?php esc_html_e( 'Password/Secret Key', 'visualizer' ); ?>"
210 - class="json-form-element">
207 + class="json-form-element">
211 208 </div>
212 209 </div>
213 210 <div class="json-wizard-header">
214 211 <div></div>
@@ -419,9 +416,9 @@
419 416 }
420 417 ?>
421 418 </tr>
422 419 </thead>
423 - <tbody>
420 + <tbody>
424 421 <tr>
425 422 <th><?php _e( 'Data Type', 'visualizer' ); ?></th>
426 423 <?php
427 424 $index = 0;
@@ -672,14 +669,9 @@
672 669 )
673 670 );
674 671
675 672 // this will allow us to open the correct source tab by default.
676 - $source_of_chart = strtolower( get_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, true ) );
677 - // Import from woocommerce report.
678 - $is_woocommerce_source = strtolower( get_post_meta( $chart_id, Visualizer_Plugin::CF_IS_WOOCOMMERCE_SOURCE, true ) );
679 - if ( ! empty( $is_woocommerce_source ) ) {
680 - $source_of_chart .= '_wc';
681 - }
673 + $source_of_chart = strtolower( get_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, true ) );
682 674 // both import from wp and import from db have the same source so we need to differentiate.
683 675 $filter_config = get_post_meta( $chart_id, Visualizer_Plugin::CF_FILTER_CONFIG, true );
684 676 // if filter config is present, then its import from wp.
685 677 if ( ! empty( $filter_config ) ) {
@@ -871,13 +863,9 @@
871 863 </form>
872 864 <input type="button" id="existing-chart" class="button button-primary"
873 865 value="<?php _e( 'Import Chart', 'visualizer' ); ?>"
874 866 data-viz-link="<?php echo $fetch_link; ?>">
875 - <?php
876 - if ( ! Visualizer_Module_Admin::proFeaturesLocked() ) {
877 - echo apply_filters( 'visualizer_pro_upsell', '', 'import-chart' );
878 - }
879 - ?>
867 + <?php echo apply_filters( 'visualizer_pro_upsell', '' ); ?>
880 868 </div>
881 869 </div>
882 870 </li>
883 871
@@ -924,8 +912,9 @@
924 912 </select>
925 913
926 914 <input type="button" id="filter-chart-button" class="button button-secondary show-chart-toggle" value="<?php echo $bttn_label; ?>" data-current="chart" data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>" data-t-chart="<?php echo $bttn_label; ?>">
927 915 <input type="button" id="db-filter-save-button" class="button button-primary" value="<?php _e( 'Save Schedule', 'visualizer' ); ?>">
916 + <?php echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' ); ?>
928 917 </form>
929 918 <?php echo apply_filters( 'visualizer_pro_upsell', '', 'import-wp' ); ?>
930 919 </div>
931 920 </div>
@@ -930,107 +919,9 @@
930 919 </div>
931 920 </div>
932 921 </li>
933 922
934 - <!-- import from WooCommerce -->
935 923 <?php
936 - if ( class_exists( 'WooCommerce', false ) ) :
937 - $wc_source = strtolower( get_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_WOOCOMMERCE_SOURCE, true ) );
938 - $wc_source_list = apply_filters(
939 - 'visualizer_woocommerce_report_endpoints',
940 - array(
941 - array(
942 - 'name' => esc_html__( 'Sales', 'visualizer' ),
943 - 'endpoint' => esc_attr( 'sales' ),
944 - ),
945 - array(
946 - 'name' => esc_html__( 'Top Sellers', 'visualizer' ),
947 - 'endpoint' => esc_attr( 'top_sellers' ),
948 - ),
949 - array(
950 - 'name' => esc_html__( 'Coupons Totals', 'visualizer' ),
951 - 'endpoint' => esc_attr( 'coupons/totals' ),
952 - ),
953 - array(
954 - 'name' => esc_html__( 'Customers Totals', 'visualizer' ),
955 - 'endpoint' => esc_attr( 'customers/totals' ),
956 - ),
957 - array(
958 - 'name' => esc_html__( 'Orders Totals', 'visualizer' ),
959 - 'endpoint' => esc_attr( 'orders/totals' ),
960 - ),
961 - array(
962 - 'name' => esc_html__( 'Products Totals', 'visualizer' ),
963 - 'endpoint' => esc_attr( 'products/totals' ),
964 - ),
965 - array(
966 - 'name' => esc_html__( 'Reviews Totals', 'visualizer' ),
967 - 'endpoint' => esc_attr( 'reviews/totals' ),
968 - ),
969 - )
970 - );
971 - ?>
972 - <li class="viz-group visualizer_woocommerce_source<?php echo 'visualizer_source_json_wc' === $source_of_chart ? ' open' : ''; ?> <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'import-wc-report' ); ?> ">
973 - <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WooCommerce Reports', 'visualizer' ); ?><span class="dashicons dashicons-lock"></span></h2>
974 - <div class="viz-group-content edit-data-content">
975 - <div>
976 - <p class="viz-group-description"><?php _e( 'You can choose here to import/synchronize your chart data with a WooCommerce report API. For more info check <a href="https://woocommerce.github.io/woocommerce-rest-api-docs/?shell#reports" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
977 - <form id="vz-import-woo-report" action="<?php echo $upload_link; ?>" method="post" target="thehole" enctype="multipart/form-data">
978 - <div class="remote-file-section">
979 - <?php
980 - $bttn_label = 'visualizer_source_json_wc' === $source_of_chart ? __( 'Modify Parameters', 'visualizer' ) : __( 'Create Parameters', 'visualizer' );
981 - ?>
982 - <p class="viz-group-description"><?php _e( 'How often do you want to check the URL', 'visualizer' ); ?></p>
983 - <select name="time" id="vz-woo-time" class="visualizer-select json-form-element" data-chart="<?php echo $chart_id; ?>">
984 - <?php
985 - $hours = get_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_SCHEDULE, true );
986 - $schedules = apply_filters(
987 - 'visualizer_chart_schedules', array(
988 - '-1' => __( 'One-time', 'visualizer' ),
989 - ),
990 - 'json',
991 - $chart_id
992 - );
993 - foreach ( $schedules as $num => $name ) {
994 - // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
995 - $extra = $num == $hours ? 'selected' : '';
996 - ?>
997 - <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
998 - <?php
999 - }
1000 - do_action( 'visualizer_chart_schedules_spl', 'json', $chart_id, 1 );
1001 - ?>
1002 - </select>
1003 - <p class="viz-group-description"><?php _e( 'Select report endpoint', 'visualizer' ); ?></p>
1004 - <select name="vz_woo_source" id="vz-woo-source" class="visualizer-select json-form-element" data-chart="<?php echo $chart_id; ?>">
1005 - <option value=""></option>
1006 - <?php
1007 - if ( ! empty( $wc_source_list ) ) {
1008 - foreach ( $wc_source_list as $api ) {
1009 - if ( isset( $api['name'] ) && $api['endpoint'] ) {
1010 - echo sprintf( '<option value="%2$s" %3$s>%1$s</option>', $api['name'], $api['endpoint'], selected( $wc_source, $api['endpoint'], false ) ); // phpcs:ignore
1011 - }
1012 - }
1013 - }
1014 - ?>
1015 - </select>
1016 - </div>
1017 -
1018 - <input type="button" id="woo-chart-button" class="button button-secondary show-chart-toggle"
1019 - value="<?php echo $bttn_label; ?>" data-current="chart"
1020 - data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>"
1021 - data-t-chart="<?php echo $bttn_label; ?>"
1022 - <?php empty( $wc_source ) ? 'disabled' : ''; ?>
1023 - >
1024 - <input type="button" id="woo-chart-save-button" class="button button-primary "
1025 - value="<?php _e( 'Save Schedule', 'visualizer' ); ?>" <?php empty( $wc_source ) ? 'disabled' : ''; ?>>
1026 - </form>
1027 - <?php echo apply_filters( 'visualizer_pro_upsell', '', 'import-wc-report' ); ?>
1028 - </div>
1029 - </div>
1030 - </li>
1031 - <?php endif; ?>
1032 - <?php
1033 924 $save_query = esc_url(
1034 925 add_query_arg(
1035 926 array(
1036 927 'action' => Visualizer_Plugin::ACTION_SAVE_DB_QUERY,
@@ -1124,9 +1015,9 @@
1124 1015 <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
1125 1016 <?php } ?>
1126 1017 <?php
1127 1018 if ( ! Visualizer_Module_Admin::proFeaturesLocked() ) {
1128 - echo apply_filters( 'visualizer_pro_upsell', '', 'manual-data' );
1019 + echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' );
1129 1020 }
1130 1021 ?>
1131 1022 </form>
1132 1023 </div>