'Please enter API key.', 'type' => 'error' ); new Notifier_Admin_Notices($notices, true); wp_redirect(admin_url('admin.php?page=notifier')); die; } update_option('notifier_api_key', $api_key); delete_option('notifier_enabled_triggers'); $params = array( 'site_url' => site_url(), 'source' => 'wp' ); $response = Notifier::send_api_request( 'verify_api', $params, 'POST' ); if($response->error){ $notices[] = array( 'message' => $response->message, 'type' => 'error' ); new Notifier_Admin_Notices($notices, true); wp_redirect(admin_url('admin.php?page=notifier')); die; } update_option('notifier_api_activated', 'yes'); $notices[] = array( 'message' => $response->data, 'type' => 'success' ); new Notifier_Admin_Notices($notices, true); wp_redirect(admin_url('admin.php?page=notifier')); die; } }