isset( $_GET[ $key ] ) && is_scalar( $_GET[ $key ] ) ? absint( $_GET[ $key ] ) : 0; $tab = isset( $_GET['reset-tab'] ) && is_string( $_GET['reset-tab'] ) ? sanitize_key( wp_unslash( $_GET['reset-tab'] ) ) : ''; // phpcs:enable if ( '' === $result ) { return; } $type = 'error'; $message = ''; switch ( $result ) { case 'imported': $type = 'success'; $message = sprintf( /* translators: %d: number of settings */ _n( 'Settings imported: %d value applied.', 'Settings imported: %d values applied.', $number( 'aiolos-imported' ), 'aiolos-checkout-for-woocommerce' ), $number( 'aiolos-imported' ) ); if ( $number( 'aiolos-skipped' ) ) { $message .= ' ' . sprintf( /* translators: %d: number of settings */ _n( '%d was skipped (a password or key, or not used by the plugins active here).', '%d were skipped (passwords and keys, or not used by the plugins active here).', $number( 'aiolos-skipped' ), 'aiolos-checkout-for-woocommerce' ), $number( 'aiolos-skipped' ) ); } if ( $number( 'aiolos-images' ) ) { $type = 'warning'; $message .= ' ' . __( 'The logo could not be brought over: choose it again in Design.', 'aiolos-checkout-for-woocommerce' ); } break; case 'reset': $tabs = Admin::tabs(); $type = 'success'; $message = sprintf( /* translators: %s: tab name */ __( '"%s" is back to its defaults.', 'aiolos-checkout-for-woocommerce' ), isset( $tabs[ $tab ] ) ? (string) $tabs[ $tab ]['label'] : $tab ); break; case 'no-file': $message = __( 'Choose an export file (.json) to import.', 'aiolos-checkout-for-woocommerce' ); break; case 'too-big': $message = __( 'This file is too big to be an Aiolos Checkout export.', 'aiolos-checkout-for-woocommerce' ); break; case 'invalid': $message = __( 'This file is not an Aiolos Checkout export. Nothing was changed.', 'aiolos-checkout-for-woocommerce' ); break; case 'invalid-tab': $message = __( 'That tab has no settings to reset.', 'aiolos-checkout-for-woocommerce' ); break; default: $message = __( 'Something went wrong. Nothing was changed.', 'aiolos-checkout-for-woocommerce' ); } printf( '
%3$s