> $cards Cards already collected. * @param string $page The `registry_page` being rendered. * @return array> */ public static function cards( array $cards, string $page ): array { if ( ! in_array( $page, self::PAGES, true ) || ! Promotions::enabled() ) { return $cards; } $cards[] = array( 'class' => 'aiou-family-card', 'render' => array( self::class, 'render_family' ), ); $cards[] = array( 'class' => 'aiou-review-card', 'render' => array( self::class, 'render_review' ), ); return $cards; } /** * The add-ons in the family card: Pro, the Woo Add-on (on stores only), * Tools and Chat, each with a one-line pitch. * * @return array */ private static function addon_items(): array { $products = AboutScreen::products(); $pitches = array( 'pro' => array( 'dashicons-star-filled', __( 'Two-factor login, SMTP, a custom login URL and branded emails, in the tabs you already use.', 'all-in-one-utilities' ) ), 'woo' => array( 'dashicons-cart', __( 'Cart rules, checkout fields, abandoned carts and reward points for your store.', 'all-in-one-utilities' ) ), 'tools' => array( 'dashicons-admin-tools', __( 'Roll plugins back, back up before every update, and download any plugin as a ZIP.', 'all-in-one-utilities' ) ), 'chat' => array( 'dashicons-format-chat', __( 'Ask what any setting does and where to find it, from one chat screen.', 'all-in-one-utilities' ) ), ); $family = array(); foreach ( $pitches as $id => $pitch ) { if ( empty( $products[ $id ] ) || ( 'woo' === $id && ! class_exists( 'WooCommerce' ) ) ) { continue; } $family[ $id ] = array( 'name' => (string) $products[ $id ]['short'], 'pitch' => $pitch[1], 'icon' => $pitch[0], 'status' => (string) ( $products[ $id ]['status'] ?? 'missing' ), ); } return $family; } /** * Print the family card. * * @return void */ public static function render_family(): void { $about = admin_url( 'admin.php?page=' . Menu::SLUG . '-about' ); $family = self::addon_items(); $all_on = ! array_filter( $family, static fn( array $item ): bool => 'active' !== $item['status'] ); ?>

> $banners Banners so far. * @param string $page The `registry_page` being rendered, or 'tools'. * @return array> */ public static function bottom_banners( array $banners, string $page ): array { if ( ! in_array( $page, array( 'default', 'tools', 'pages' ), true ) ) { return $banners; } if ( ! defined( 'AIOU_PRO_VERSION' ) ) { $banners[] = array( 'owner' => 'pro', 'title' => __( 'Upgrade to All-in-One Utilities Pro', 'all-in-one-utilities' ), 'body' => __( 'Adds Pro sections to the Settings tabs you already use -- more control over users, security, the admin area, email and content.', 'all-in-one-utilities' ), 'tags' => array( __( 'Users', 'all-in-one-utilities' ), __( 'Security', 'all-in-one-utilities' ), __( 'Login & admin', 'all-in-one-utilities' ), __( 'Email', 'all-in-one-utilities' ), __( 'Performance & developer', 'all-in-one-utilities' ), ), 'features' => array( __( 'Two-factor authentication', 'all-in-one-utilities' ), __( 'Custom login URL', 'all-in-one-utilities' ), __( 'SMTP', 'all-in-one-utilities' ), __( 'Branded HTML email templates', 'all-in-one-utilities' ), __( 'Bulk role assignment', 'all-in-one-utilities' ), __( 'Code snippets', 'all-in-one-utilities' ), ), 'cta_label' => __( "See what's in Pro", 'all-in-one-utilities' ), 'cta_url' => admin_url( 'admin.php?page=aiou-about#pro' ), ); } if ( class_exists( 'WooCommerce' ) && ! defined( 'AIOU_WOO_VERSION' ) ) { $banners[] = array( 'owner' => 'woo', 'title' => __( 'Get the All-in-One Utilities Woo Add-on', 'all-in-one-utilities' ), 'body' => __( 'Store tools for WooCommerce, on their own "WooCommerce" page with a tab for each feature.', 'all-in-one-utilities' ), 'tags' => array( __( 'Cart & checkout', 'all-in-one-utilities' ), __( 'Products & shop', 'all-in-one-utilities' ), __( 'Customers & orders', 'all-in-one-utilities' ), __( 'Maintenance', 'all-in-one-utilities' ), ), 'features' => array( __( 'Cart rules: order limits, quantities, notices, automatic coupons', 'all-in-one-utilities' ), __( 'Checkout fields', 'all-in-one-utilities' ), __( 'Abandoned cart recovery', 'all-in-one-utilities' ), __( 'reCAPTCHA on login, registration and checkout', 'all-in-one-utilities' ), __( 'Back-in-stock alerts and low stock digest', 'all-in-one-utilities' ), __( 'Reward points for visits and purchases', 'all-in-one-utilities' ), ), 'cta_label' => __( "See what's in the add-on", 'all-in-one-utilities' ), 'cta_url' => admin_url( 'admin.php?page=aiou-about#woo' ), ); } return $banners; } }