| @@ -152,14 +152,8 @@ | ||
| 152 | 152 | * @param bool $redirect_to_dashboard Redirect to dashboard. |
| 153 | 153 | * @return bool|void |
| 154 | 154 | */ |
| 155 | 155 | public function dismissWizard( $redirect_to_dashboard = true ) { |
| 156 | - if ( ! current_user_can( 'manage_options' ) ) { | |
| 157 | - wp_die( esc_html__( 'You do not have permission to perform this action.', 'visualizer' ), '', array( 'response' => 403 ) ); | |
| 158 | - } | |
| 159 | - if ( false !== $redirect_to_dashboard ) { | |
| 160 | - check_admin_referer( 'visualizer_dismiss_wizard' ); | |
| 161 | - } | |
| 162 | 156 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 163 | 157 | $status = isset( $_REQUEST['status'] ) ? (int) $_REQUEST['status'] : 0; |
| 164 | 158 | update_option( 'visualizer_fresh_install', $status ); |
| 165 | 159 | delete_option( 'visualizer_wizard_data' ); |
| @@ -174,11 +168,8 @@ | ||
| 174 | 168 | * Setup wizard process. |
| 175 | 169 | */ |
| 176 | 170 | public function visualizer_wizard_step_process() { |
| 177 | 171 | check_ajax_referer( VISUALIZER_ABSPATH, 'security' ); |
| 178 | - if ( ! current_user_can( 'manage_options' ) ) { | |
| 179 | - wp_send_json( array( 'status' => 0 ), 403 ); | |
| 180 | - } | |
| 181 | 172 | $step = ! empty( $_POST['step'] ) ? sanitize_text_field( wp_unslash( $_POST['step'] ) ) : 1; |
| 182 | 173 | switch ( $step ) { |
| 183 | 174 | case 'step_2': |
| 184 | 175 | $this->setup_wizard_import_chart(); |
| @@ -242,9 +233,9 @@ | ||
| 242 | 233 | update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() ); |
| 243 | 234 | update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $series ); |
| 244 | 235 | update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, '' ); |
| 245 | 236 | |
| 246 | - $data = Visualizer_Module::decode_content( $data ); | |
| 237 | + $data = maybe_unserialize( $data ); | |
| 247 | 238 | $setting_series = array(); |
| 248 | 239 | $setting_slices = array(); |
| 249 | 240 | foreach ( $data as $s ) { |
| 250 | 241 | $setting_series[] = array( |