bugd.one), onboarding notice and the test AJAX actions. * * @package Bugdone */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Admin UI. */ class Bugdone_Admin { const PAGE = 'bugdone'; const NONCE = 'bugdone_test_error'; const ACTION = 'bugdone_test_error'; const ACTION_WIDGET = 'bugdone_check_widget'; const ACTION_DISMISS = 'bugdone_dismiss_notice'; const NONCE_DISMISS = 'bugdone_dismiss_notice'; const DISMISS_META = 'bugdone_notice_dismissed'; // "Connect with bugd.one" (OAuth-style, see connect_start()). const ACTION_CONNECT = 'bugdone_connect'; const ACTION_CONNECT_CB = 'bugdone_connect_cb'; const ACTION_DISCONNECT = 'bugdone_disconnect'; const NONCE_CONNECT = 'bugdone_connect'; const NONCE_DISCONNECT = 'bugdone_disconnect'; const STATE_TRANSIENT = 'bugdone_connect_state_'; const RESULT_ARG = 'bugdone_connect'; // Setup assistant (step 3: apply the recommended settings). const ACTION_SETUP = 'bugdone_setup'; const NONCE_SETUP = 'bugdone_setup'; /** * Registers hooks. * * @return void */ public static function init() { add_action( 'admin_menu', array( __CLASS__, 'menu' ) ); add_action( 'admin_init', array( __CLASS__, 'register' ) ); add_action( 'admin_enqueue_scripts', array( __CLASS__, 'assets' ) ); add_action( 'admin_notices', array( __CLASS__, 'onboarding_notice' ) ); add_action( 'wp_ajax_' . self::ACTION, array( __CLASS__, 'ajax_test_error' ) ); add_action( 'wp_ajax_' . self::ACTION_WIDGET, array( __CLASS__, 'ajax_check_widget' ) ); add_action( 'wp_ajax_' . self::ACTION_DISMISS, array( __CLASS__, 'ajax_dismiss_notice' ) ); add_action( 'admin_post_' . self::ACTION_CONNECT, array( __CLASS__, 'connect_start' ) ); add_action( 'admin_post_' . self::ACTION_CONNECT_CB, array( __CLASS__, 'connect_callback' ) ); add_action( 'admin_post_' . self::ACTION_DISCONNECT, array( __CLASS__, 'disconnect' ) ); add_action( 'admin_post_' . self::ACTION_SETUP, array( __CLASS__, 'setup' ) ); add_filter( 'plugin_action_links_' . plugin_basename( BUGDONE_FILE ), array( __CLASS__, 'action_links' ) ); } /** * Adds the settings page. * * @return void */ public static function menu() { add_options_page( __( 'bugd.one', 'bugdone' ), __( 'bugd.one', 'bugdone' ), 'manage_options', self::PAGE, array( __CLASS__, 'render' ) ); } /** * Registers the option. * * @return void */ public static function register() { register_setting( 'bugdone_group', Bugdone_Settings::OPTION, array( 'type' => 'array', 'sanitize_callback' => array( 'Bugdone_Settings', 'sanitize' ), 'default' => Bugdone_Settings::defaults(), 'show_in_rest' => false, ) ); } /** * "Settings" link in the plugin list. * * @param array $links Existing links. * @return array */ public static function action_links( $links ) { array_unshift( $links, '' . esc_html__( 'Settings', 'bugdone' ) . '' ); return $links; } /** * URL of the settings page. * * @return string */ public static function settings_url() { return admin_url( 'options-general.php?page=' . self::PAGE ); } /** * Loads the (local) admin script and styles on the settings page only. * * @param string $hook Current admin page hook. * @return void */ public static function assets( $hook ) { if ( 'settings_page_' . self::PAGE !== $hook ) { return; } wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_style( 'bugdone-admin', plugins_url( 'assets/admin.css', BUGDONE_FILE ), array(), BUGDONE_VERSION ); wp_enqueue_script( 'bugdone-admin', plugins_url( 'assets/admin.js', BUGDONE_FILE ), array( 'wp-color-picker' ), BUGDONE_VERSION, true ); wp_localize_script( 'bugdone-admin', 'bugdoneAdmin', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'actions' => array( 'php' => self::ACTION, 'widget' => self::ACTION_WIDGET, ), 'nonce' => wp_create_nonce( self::NONCE ), 'sending' => __( 'Checking…', 'bugdone' ), 'failed' => __( 'The request failed. Please try again.', 'bugdone' ), 'unsavedHint' => __( 'You have unsaved changes. Save them first, then test.', 'bugdone' ), 'invalidField' => __( 'This key was not accepted – it must look like bk_live_….', 'bugdone' ), ) ); } /** * Dashboard URL on the configured bugd.one host. * * @param string $path Path with leading slash. * @return string */ private static function dashboard_url( $path ) { return Bugdone_Settings::host() . $path; } /** * Origin (scheme://host[:port]) of this site as a browser would send it. * * @return string */ private static function site_origin() { $parts = wp_parse_url( home_url() ); if ( ! is_array( $parts ) || empty( $parts['host'] ) ) { return ''; } $scheme = isset( $parts['scheme'] ) ? strtolower( $parts['scheme'] ) : 'https'; return $scheme . '://' . strtolower( $parts['host'] ) . ( isset( $parts['port'] ) ? ':' . (int) $parts['port'] : '' ); } /** * Dismissible notice while no publishable key is set (administrators only, not on the settings page). * * @return void */ public static function onboarding_notice() { if ( ! current_user_can( 'manage_options' ) || '' !== (string) Bugdone_Settings::value( 'publishable_key' ) ) { return; } if ( get_user_meta( get_current_user_id(), self::DISMISS_META, true ) ) { return; } $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( $screen && 'settings_page_' . self::PAGE === $screen->id ) { return; } wp_enqueue_script( 'bugdone-notice', plugins_url( 'assets/notice.js', BUGDONE_FILE ), array( 'jquery' ), BUGDONE_VERSION, true ); wp_localize_script( 'bugdone-notice', 'bugdoneNotice', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'action' => self::ACTION_DISMISS, 'nonce' => wp_create_nonce( self::NONCE_DISMISS ), ) ); ?>

→

__( 'You are not allowed to do this.', 'bugdone' ) ), 403 ); } $result = Bugdone_Reporter::send_test(); if ( $result['ok'] ) { wp_send_json_success( array( 'message' => $result['message'], 'link_url' => Bugdone_Settings::crashes_url( 'development' ), 'link_label' => __( 'View in dashboard', 'bugdone' ), ) ); } wp_send_json_error( array( 'message' => $result['message'] ) ); } /** * AJAX: checks the publishable key (and the allowed domains) against bugd.one from the server. * * @return void */ public static function ajax_check_widget() { check_ajax_referer( self::NONCE, 'nonce' ); if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( array( 'message' => __( 'You are not allowed to do this.', 'bugdone' ) ), 403 ); } $result = self::check_widget_key(); if ( $result['ok'] ) { wp_send_json_success( array( 'message' => $result['message'], 'link_url' => Bugdone_Settings::project_url(), 'link_label' => __( 'View in dashboard', 'bugdone' ), ) ); } wp_send_json_error( array( 'message' => $result['message'] ) ); } /** * Calls GET /api/widget-config like the widget does (X-API-Key + Origin of this site) and explains the answer. * The key is only sent in a header to the configured bugd.one host. * * @return array Keys: ok (bool), message (string). */ public static function check_widget_key() { $key = (string) Bugdone_Settings::value( 'publishable_key' ); if ( '' === $key ) { return array( 'ok' => false, 'message' => __( 'Please save a project key (bk_live_…) first.', 'bugdone' ), ); } if ( false !== get_transient( 'bugdone_widget_check_lock' ) ) { return array( 'ok' => false, 'message' => __( 'Please wait a few seconds before checking again.', 'bugdone' ), ); } set_transient( 'bugdone_widget_check_lock', 1, 5 ); $origin = self::site_origin(); $response = wp_remote_get( Bugdone_Settings::host() . '/api/widget-config', array( 'timeout' => 10, 'redirection' => 0, 'headers' => array( 'X-API-Key' => $key, 'Origin' => $origin, 'Accept' => 'application/json', 'User-Agent' => 'bugdone-wordpress/' . BUGDONE_VERSION, ), ) ); if ( is_wp_error( $response ) ) { return array( 'ok' => false, /* translators: %s: technical error message of the HTTP request. */ 'message' => sprintf( __( 'bugd.one could not be reached: %s', 'bugdone' ), $response->get_error_message() ), ); } $status = (int) wp_remote_retrieve_response_code( $response ); $data = json_decode( (string) wp_remote_retrieve_body( $response ), true ); $code = is_array( $data ) && isset( $data['code'] ) ? (string) $data['code'] : ''; if ( 200 === $status ) { $name = is_array( $data ) && isset( $data['project']['name'] ) && is_string( $data['project']['name'] ) ? Bugdone_Redact::truncate( sanitize_text_field( $data['project']['name'] ), 80 ) : ''; if ( '' !== $name ) { /* translators: %s: bugd.one project name. */ $message = sprintf( __( 'Key is valid – connected to project "%s".', 'bugdone' ), $name ); } else { $message = __( 'Key is valid – connected to bugd.one.', 'bugdone' ); } return array( 'ok' => true, 'message' => $message, ); } if ( 401 === $status || ( 403 === $status && 'invalid_api_key' === $code ) ) { $message = __( 'Key invalid – copy it again from bugd.one → Project → Settings.', 'bugdone' ); } elseif ( 403 === $status && 'origin_not_allowed' === $code ) { $parts = wp_parse_url( $origin ); /* translators: %s: domain of this website. */ $message = sprintf( __( 'Domain not allowed – add %s under "Allowed domains" in your bugd.one project settings.', 'bugdone' ), is_array( $parts ) && isset( $parts['host'] ) ? $parts['host'] : $origin ); } elseif ( 403 === $status ) { $message = __( 'bugd.one refused the request (plan limit or read-only project). Check your plan in the bugd.one dashboard.', 'bugdone' ); } elseif ( 429 === $status ) { $message = __( 'Too many requests or quota used up. Please try again later or check your plan in bugd.one.', 'bugdone' ); } else { /* translators: %d: HTTP status code. */ $message = sprintf( __( 'bugd.one answered with an unexpected status (HTTP %d).', 'bugdone' ), $status ); } return array( 'ok' => false, 'message' => $message, ); } /** * Whether one-click connect works here: the admin area must be on the same origin as the site, * because bugd.one only sends the one-time code back to admin-post.php on the site's own origin. * * @return bool */ public static function can_connect() { $site = self::site_origin(); $parts = wp_parse_url( admin_url() ); if ( '' === $site || ! is_array( $parts ) || empty( $parts['host'] ) ) { return false; } $scheme = isset( $parts['scheme'] ) ? strtolower( $parts['scheme'] ) : 'https'; $admin = $scheme . '://' . strtolower( $parts['host'] ) . ( isset( $parts['port'] ) ? ':' . (int) $parts['port'] : '' ); return $admin === $site; } /** * Step 1 of "Connect with bugd.one": remember a one-time state and send the administrator to the * bugd.one consent page. There they sign in, pick (or create) a project and confirm. * * @return void */ public static function connect_start() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You are not allowed to do this.', 'bugdone' ), '', array( 'response' => 403 ) ); } check_admin_referer( self::NONCE_CONNECT ); $state = bin2hex( random_bytes( 16 ) ); set_transient( self::STATE_TRANSIENT . get_current_user_id(), $state, 15 * MINUTE_IN_SECONDS ); $url = Bugdone_Settings::host() . '/connect/wordpress?' . http_build_query( array( 'state' => $state, 'redirect_uri' => admin_url( 'admin-post.php?action=' . self::ACTION_CONNECT_CB ), 'site' => self::site_origin(), 'site_name' => wp_strip_all_tags( get_bloginfo( 'name' ) ), ), '', '&', PHP_QUERY_RFC3986 ); // Redirect to the bugd.one consent page: allow exactly that host for wp_safe_redirect(). $bugdone_host = (string) wp_parse_url( Bugdone_Settings::host(), PHP_URL_HOST ); add_filter( 'allowed_redirect_hosts', static function ( $hosts ) use ( $bugdone_host ) { $hosts[] = $bugdone_host; return $hosts; } ); wp_safe_redirect( $url ); exit; } /** * Step 3 of "Connect with bugd.one": bugd.one sends the administrator back with a one-time code. * The code is exchanged server-to-server for the project key (and, if chosen, a new server key), * so no key ever passes through the browser. * * @return void */ public static function connect_callback() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You are not allowed to do this.', 'bugdone' ), '', array( 'response' => 403 ) ); } // Redirect target of the bugd.one consent page (OAuth-style): an external service cannot carry a // WordPress nonce. CSRF protection is the one-time `state` checked against the transient below. // phpcs:disable WordPress.Security.NonceVerification.Recommended $state_key = self::STATE_TRANSIENT . get_current_user_id(); $saved_state = get_transient( $state_key ); $given_state = isset( $_GET['state'] ) ? sanitize_text_field( wp_unslash( $_GET['state'] ) ) : ''; $cancelled = isset( $_GET['error'] ); $code = isset( $_GET['code'] ) ? sanitize_text_field( wp_unslash( $_GET['code'] ) ) : ''; // phpcs:enable WordPress.Security.NonceVerification.Recommended delete_transient( $state_key ); if ( ! is_string( $saved_state ) || '' === $saved_state || ! hash_equals( $saved_state, $given_state ) ) { self::connect_result( 'state_error' ); } if ( $cancelled ) { self::connect_result( 'cancelled' ); } if ( ! preg_match( '/^[a-f0-9]{64}$/', $code ) ) { self::connect_result( 'exchange_error' ); } $response = wp_remote_post( Bugdone_Settings::host() . '/api/v1/connect/exchange', array( 'timeout' => 15, 'headers' => array( 'Content-Type' => 'application/json' ), 'body' => wp_json_encode( array( 'code' => $code, 'site_origin' => self::site_origin(), ) ), ) ); if ( is_wp_error( $response ) ) { self::connect_result( 'exchange_error' ); } $status = (int) wp_remote_retrieve_response_code( $response ); if ( 409 === $status ) { self::connect_result( 'key_unavailable' ); } $data = json_decode( (string) wp_remote_retrieve_body( $response ), true ); if ( 200 !== $status || ! is_array( $data ) || ! isset( $data['project_key'] ) || ! is_string( $data['project_key'] ) || ! preg_match( '/^bk_live_[A-Za-z0-9_-]{12,150}$/', $data['project_key'] ) ) { self::connect_result( 'exchange_error' ); } $settings = Bugdone_Settings::get(); $settings['publishable_key'] = $data['project_key']; $settings['project_name'] = isset( $data['project_name'] ) && is_string( $data['project_name'] ) ? $data['project_name'] : ''; $settings['project_id'] = isset( $data['project_id'] ) && is_string( $data['project_id'] ) ? $data['project_id'] : ''; $settings['project_slug'] = isset( $data['project_slug'] ) && is_string( $data['project_slug'] ) ? $data['project_slug'] : ''; $with_server_key = isset( $data['server_key'] ) && is_string( $data['server_key'] ) && preg_match( '/^bk_server_[A-Za-z0-9_-]{12,150}$/', $data['server_key'] ); $old_key = (string) Bugdone_Settings::get()['publishable_key']; $switched_project = '' !== $old_key && $old_key !== $data['project_key']; $dropped_server_key = false; if ( $with_server_key ) { $settings['server_key'] = $data['server_key']; $settings['php_capture'] = 1; } elseif ( $switched_project && '' !== (string) $settings['server_key'] ) { // The stored server key belongs to the previous project: remove it, otherwise PHP errors and // WooCommerce logs would keep going to the old project. $settings['server_key_remove'] = 1; $dropped_server_key = true; } // Runs through Bugdone_Settings::sanitize() (register_setting), which validates both keys again. update_option( Bugdone_Settings::OPTION, $settings ); Bugdone_Settings::flush(); if ( $with_server_key ) { self::connect_result( 'connected_php' ); } self::connect_result( $dropped_server_key ? 'connected_server_key_removed' : 'connected' ); } /** * Removes both keys (the bugd.one project stays untouched). * * @return void */ public static function disconnect() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You are not allowed to do this.', 'bugdone' ), '', array( 'response' => 403 ) ); } check_admin_referer( self::NONCE_DISCONNECT ); $settings = Bugdone_Settings::get(); $settings['publishable_key'] = ''; $settings['project_name'] = ''; $settings['project_id'] = ''; $settings['project_slug'] = ''; $settings['server_key_remove'] = 1; update_option( Bugdone_Settings::OPTION, $settings ); Bugdone_Settings::flush(); self::connect_result( 'disconnected' ); } /** * Back to the settings page with the result of a connect step. * * @param string $result Result code (see connect_message()). * @return void */ private static function connect_result( $result ) { wp_safe_redirect( add_query_arg( self::RESULT_ARG, $result, self::settings_url() ) ); exit; } /** * Notice type and text for a connect result, or null for unknown codes. * * @param string $result Result code. * @return array{0:string,1:string}|null */ private static function connect_message( $result ) { switch ( $result ) { case 'connected': return array( 'success', __( 'Connected to bugd.one. The bug-report widget is now live on your site.', 'bugdone' ) ); case 'connected_php': return array( 'success', __( 'Connected to bugd.one. The bug-report widget is live and PHP errors are reported.', 'bugdone' ) ); case 'connected_server_key_removed': return array( 'warning', __( 'Connected to the new project. The server key of the previous project was removed: enter the server key of the new project to report PHP errors again.', 'bugdone' ) ); case 'disconnected': return array( 'success', __( 'Disconnected. The widget and error tracking are off until you connect again.', 'bugdone' ) ); case 'cancelled': return array( 'info', __( 'Connection cancelled. Nothing was changed.', 'bugdone' ) ); case 'state_error': return array( 'error', __( 'The connection request expired or was invalid. Please click “Connect with bugd.one” again.', 'bugdone' ) ); case 'key_unavailable': return array( 'warning', __( 'This project was created before one-click connect existed. Please copy its project key once by hand: bugd.one → your project → Settings.', 'bugdone' ) ); case 'setup_applied': return array( 'success', __( 'Recommended settings applied.', 'bugdone' ) ); case 'exchange_error': return array( 'error', __( 'bugd.one could not complete the connection. Please try again or enter the keys by hand below.', 'bugdone' ) ); } return null; } /** * Active page-cache plugin (to remind the administrator to purge it), or ''. * * @return string */ public static function detected_cache_plugin() { if ( defined( 'LSCWP_V' ) || defined( 'LSCWP_CONTENT_DIR' ) ) { return 'LiteSpeed Cache'; } if ( defined( 'WP_ROCKET_VERSION' ) ) { return 'WP Rocket'; } if ( defined( 'W3TC' ) || defined( 'W3TC_VERSION' ) ) { return 'W3 Total Cache'; } if ( defined( 'WPCACHEHOME' ) ) { return 'WP Super Cache'; } if ( class_exists( 'WpFastestCache' ) ) { return 'WP Fastest Cache'; } if ( defined( 'CACHE_ENABLER_VERSION' ) ) { return 'Cache Enabler'; } if ( defined( 'SG_CACHEPRESS_VERSION' ) ) { return 'SiteGround Optimizer'; } if ( defined( 'BREEZE_VERSION' ) ) { return 'Breeze'; } return ''; } /** * Notice after a connect step (?bugdone_connect=…) plus a cache reminder after connecting. * * @return void */ private static function render_connect_result() { // Display-only query arg set by connect_result(); no state change happens here. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $result = isset( $_GET[ self::RESULT_ARG ] ) ? sanitize_key( wp_unslash( $_GET[ self::RESULT_ARG ] ) ) : ''; $notice = '' === $result ? null : self::connect_message( $result ); if ( null === $notice ) { return; } ?>

403 ) ); } check_admin_referer( self::NONCE_SETUP ); $apply = isset( $_POST['bugdone_setup'] ) && 'apply' === sanitize_key( wp_unslash( $_POST['bugdone_setup'] ) ); $settings = Bugdone_Settings::get(); if ( $apply ) { $settings['widget_enabled'] = 1; $settings['js_capture'] = 1; $settings['js_http'] = 1; $settings['php_capture'] = 1; $settings['php_warnings'] = 0; if ( Bugdone_WooCommerce::active() ) { $settings['wc_logs'] = 1; $settings['wc_logs_shown'] = 1; } } $settings['setup_done'] = 1; // Runs through Bugdone_Settings::sanitize() (register_setting): both keys stay as they are. update_option( Bugdone_Settings::OPTION, $settings ); Bugdone_Settings::flush(); self::connect_result( $apply ? 'setup_applied' : 'setup_skipped' ); } /** * Name attribute of a settings field. * * @param string $key Setting key. * @return string */ private static function field( $key ) { return Bugdone_Settings::OPTION . '[' . $key . ']'; } /** * A checkbox row inside a fieldset (same markup as the trackd.one plugin). * * @param string $key Setting key. * @param string $label Label. * @param array $s Settings. * @param string $depends Optional: id of the parent checkbox (row is indented and dimmed while it is off). * @return void */ private static function checkbox( $key, $label, array $s, $depends = '' ) { printf( '', esc_attr( $key ), esc_attr( self::field( $key ) ), checked( ! empty( $s[ $key ] ), true, false ), esc_html( $label ), '' !== $depends ? ' class="bugd-sub" data-bugdone-depends="' . esc_attr( $depends ) . '"' : '' ); } /** * Long explanation, collapsed behind "More details". * * @param string $text Text (plain). * @return void */ private static function more( $text ) { printf( '
%1$s

%2$s

', esc_html__( 'More details', 'bugdone' ), esc_html( $text ) ); } /** * Badge for features that need the server key: "Server key" when it is stored, otherwise a link to the key field. * * @param bool $has_srv Whether a server key is stored. * @return void */ private static function server_key_badge( $has_srv ) { if ( $has_srv ) { echo '' . esc_html__( 'Server key', 'bugdone' ) . ''; return; } echo '' . esc_html__( 'Server key missing', 'bugdone' ) . ''; } /** * A feature chip in the status card. * * @param bool $on Active. * @param string $label Label. * @return void */ private static function chip( $on, $label ) { printf( '
  • %3$s (%4$s)
  • ', $on ? ' is-on' : '', $on ? 'dashicons-yes' : 'dashicons-minus', esc_html( $label ), esc_html( $on ? __( 'on', 'bugdone' ) : __( 'off', 'bugdone' ) ) ); } /** * Start of a tab panel. * * @param string $id Panel id (without "bugd-tab-"). * @param string $label Tab label (for aria). * @return void */ private static function panel_open( $id, $label ) { printf( '
    ', esc_attr( $id ), esc_attr( $label ) ); } /** * Renders the settings page: status card, setup assistant (first start), tabs (Connection · Error tracking · * Bug-report widget · Privacy · Advanced) in one form, sticky save bar. Same structure as the trackd.one plugin. * Without JavaScript all sections are shown one below the other. * * @return void */ public static function render() { if ( ! current_user_can( 'manage_options' ) ) { return; } $s = Bugdone_Settings::get(); $invalid = Bugdone_Settings::take_invalid(); $has_pub = '' !== (string) $s['publishable_key']; $has_srv = '' !== (string) $s['server_key']; $has_wc = Bugdone_WooCommerce::active(); // A rejected publishable key is shown again (the stored value stays unchanged). $pub_shown = isset( $invalid['publishable_key'] ) ? (string) $invalid['publishable_key'] : (string) $s['publishable_key']; $pub_invalid = isset( $invalid['publishable_key'] ); $srv_invalid = ! empty( $invalid['server_key'] ); $environment_auto = 'production' === ( function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production' ) ? 'production' : 'development'; $can_connect = self::can_connect(); $connect_url = wp_nonce_url( admin_url( 'admin-post.php?action=' . self::ACTION_CONNECT ), self::NONCE_CONNECT ); $disconnect_url = wp_nonce_url( admin_url( 'admin-post.php?action=' . self::ACTION_DISCONNECT ), self::NONCE_DISCONNECT ); $project_name = (string) $s['project_name']; $tabs = array( 'connection' => array( __( 'Connection', 'bugdone' ), 'dashicons-admin-links' ), 'tracking' => array( __( 'Error tracking', 'bugdone' ), 'dashicons-warning' ), 'widget' => array( __( 'Bug-report widget', 'bugdone' ), 'dashicons-format-chat' ), 'privacy' => array( __( 'Privacy', 'bugdone' ), 'dashicons-shield' ), 'advanced' => array( __( 'Advanced', 'bugdone' ), 'dashicons-admin-generic' ), ); ?>

      $step ) : ?>
    1. ()

    ' . esc_html__( 'privacy policy guide', 'bugdone' ) . '' ); ?>