PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.1
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/Chart.php +17 -17 3.3.03.3.1 View file →
@@ -442,8 +442,9 @@
442 442 add_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, $default_type );
443 443 add_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 1 );
444 444 add_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
445 445 add_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
446 + add_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, '' );
446 447 add_post_meta(
447 448 $chart_id,
448 449 Visualizer_Plugin::CF_SETTINGS,
449 450 array(
@@ -1021,21 +1022,12 @@
1021 1022 * @access public
1022 1023 */
1023 1024 public function cloneChart() {
1024 1025 $chart_id = $success = false;
1025 - $nonce = wp_verify_nonce( filter_input( INPUT_GET, 'nonce' ), Visualizer_Plugin::ACTION_CLONE_CHART );
1026 + $nonce = isset( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'], Visualizer_Plugin::ACTION_CLONE_CHART );
1026 1027 $capable = current_user_can( 'edit_posts' );
1027 1028 if ( $nonce && $capable ) {
1028 - $chart_id = filter_input(
1029 - INPUT_GET,
1030 - 'chart',
1031 - FILTER_VALIDATE_INT,
1032 - array(
1033 - 'options' => array(
1034 - 'min_range' => 1,
1035 - ),
1036 - )
1037 - );
1029 + $chart_id = isset( $_GET['chart'] ) ? filter_var( $_GET['chart'], FILTER_VALIDATE_INT ) : '';
1038 1030 if ( $chart_id ) {
1039 1031 $chart = get_post( $chart_id );
1040 1032 $success = $chart && $chart->post_type === Visualizer_Plugin::CPT_VISUALIZER;
1041 1033 }
@@ -1050,14 +1042,17 @@
1050 1042 'post_status' => $chart->post_status,
1051 1043 'post_content' => $chart->post_content,
1052 1044 )
1053 1045 );
1054 - if ( $new_chart_id && ! is_wp_error( $new_chart_id ) ) {
1055 - add_post_meta( $new_chart_id, Visualizer_Plugin::CF_CHART_TYPE, get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true ) );
1056 - add_post_meta( $new_chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, get_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, true ) );
1057 - add_post_meta( $new_chart_id, Visualizer_Plugin::CF_SOURCE, get_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, true ) );
1058 - add_post_meta( $new_chart_id, Visualizer_Plugin::CF_SERIES, get_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, true ) );
1059 - add_post_meta( $new_chart_id, Visualizer_Plugin::CF_SETTINGS, get_post_meta( $chart_id, Visualizer_Plugin::CF_SETTINGS, true ) );
1046 + if ( is_wp_error( $new_chart_id ) ) {
1047 + do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Error while cloning chart %d = %s', $chart_id, print_r( $new_chart_id, true ) ), 'error', __FILE__, __LINE__ );
1048 + } else {
1049 + $post_meta = get_post_meta( $chart_id );
1050 + foreach ( $post_meta as $key => $value ) {
1051 + if ( strpos( $key, 'visualizer-' ) !== false ) {
1052 + add_post_meta( $new_chart_id, $key, maybe_unserialize( $value[0] ) );
1053 + }
1054 + }
1060 1055 $redirect = add_query_arg(
1061 1056 array(
1062 1057 'page' => 'visualizer',
1063 1058 'type' => filter_input( INPUT_GET, 'type' ),
@@ -1066,8 +1061,13 @@
1066 1061 admin_url( 'admin.php' )
1067 1062 );
1068 1063 }
1069 1064 }
1065 +
1066 + if ( defined( 'WP_TESTS_DOMAIN' ) ) {
1067 + wp_die();
1068 + }
1069 +
1070 1070 wp_redirect( $redirect );
1071 1071 exit;
1072 1072 }
1073 1073