settings = $settings; } public function shortcode() { return '[careback]'; } /** * Each readiness item the Setup screen shows, done or not (an item that is * only a note counts as not done). * * @return array */ public function checklist() { return array_map( static function ( $item ) { return 'done' === $item['state']; }, $this->readiness() ); } /** * The readiness list with its tags (N-124): Setup_Steps::readiness(). * * @param string|null $woo_state Where WooCommerce's own withdrawal form stands; read when null. * @return array */ public function readiness( $woo_state = null ) { return ( new Setup_Steps( $this->settings ) )->readiness( $woo_state ); } public function render() { if ( ! current_user_can( 'manage_woocommerce' ) ) { return; } // The steps, the readiness list and the support report (design §3.0). $steps = new Setup_Steps( $this->settings ); ?>
render_top(); ?>

render_steps( $this->shortcode() ); ?> render_readiness(); ?>


render_track_section(); ?>
render_report(); ?>
settings; $enabled = ! empty( $settings->get( 'track_enabled' ) ); // The resolved map, not the raw setting: a fresh install has working // defaults and must not be told its statuses are unmapped. $mapped = Track_Stage_Policy::order_map( $settings ); $track_url = add_query_arg( 'desk', 'track', admin_url( 'admin.php?page=careback-settings' ) ); $labels = array( 'track' => __( 'The tracking page is enabled', 'careback' ), 'mapped' => __( 'Your order statuses are mapped to steps', 'careback' ), 'carrier' => __( 'A carrier tracking link is configured', 'careback' ), ); $checklist = array( 'track' => $enabled, 'mapped' => ! empty( $mapped ), // The list the tracking settings save (04 §11.4). 'carrier' => Track_Carriers::has_link( $settings ), ); ?>

    $label ) : ?>

$files Handle => file name in assets/css. * @return string */ public static function preview_stylesheets( array $files ) { $styles = new \WP_Styles(); $handles = array(); foreach ( $files as $handle => $file ) { $styles->add( (string) $handle, CAREBACK_URL . 'assets/css/' . $file, $handles, CAREBACK_VERSION ); $handles = array( (string) $handle ); } ob_start(); $styles->do_items( array_keys( $files ) ); return (string) ob_get_clean(); } /** * A self-contained HTML document rendering the portal's first step exactly as * a customer sees it, with the merchant's current texts, reasons and the * portal's stylesheet (linked as a file, with the preview's own). Rendered * inside an