*/ public static function products(): array { $products = apply_filters( 'aiou_license_products', array() ); $clean = array(); foreach ( is_array( $products ) ? $products : array() as $id => $product ) { if ( ! is_array( $product ) || empty( $product['render'] ) || ! is_callable( $product['render'] ) ) { continue; } $clean[ sanitize_key( (string) $id ) ] = array( 'name' => (string) ( $product['name'] ?? $id ), 'owner' => sanitize_key( (string) ( $product['owner'] ?? 'external' ) ), 'description' => (string) ( $product['description'] ?? '' ), 'render' => $product['render'], 'priority' => (int) ( $product['priority'] ?? 50 ), ); } return Sort::by_priority( $clean ); } /** * Render the screen. * * @return void */ public function render(): void { $products = self::products(); AdminShell::page_start( array( 'title' => __( 'License', 'all-in-one-utilities' ), 'description' => __( 'Activate each add-on\'s license to receive its signed updates in the Plugins screen. Every feature works without a license.', 'all-in-one-utilities' ), 'class' => 'aiou-license', ) ); if ( ! $products ) { echo '

' . esc_html__( 'None of the add-ons that need a license is active.', 'all-in-one-utilities' ) . '

'; } foreach ( $products as $id => $product ) { ?>