ui = $ui; $this->license = $license; } public function slug(): string { return 'license'; } public function label(): string { return __( 'License', 'acez-seo' ); } public function icon(): string { return 'license'; } public function enqueue(): void { } public function handles_form_key( string $raw_tab ): bool { // The 'license' form key is retired — the key form lives in the Pro // addon now (its own admin-post action), this tab is display-only. return false; } /** @return array */ public function save( string $raw_tab ): array { return array(); } public function render(): void { $license = $this->license->get(); $status = (string) $license['status']; // The Pro addon is detected by its HOOKS/constant only — the base // plugin never references Pro classes (addon convention). $pro_active = false !== has_action( 'admin_post_acez_seo_pro_license' ); // Status labels for the states the filter contract knows today // ('active'/'expired'/'invalid' come from the Pro side, later from // the license server); an unknown status renders verbatim rather // than lying with a mapped label. $status_labels = array( LicenseRepository::STATUS_FREE => __( 'Free version', 'acez-seo' ), LicenseRepository::STATUS_SAVED => __( 'Key saved', 'acez-seo' ), 'active' => __( 'Pro active', 'acez-seo' ), 'expired' => __( 'License expired', 'acez-seo' ), 'invalid' => __( 'Invalid key', 'acez-seo' ), ); $status_on = in_array( $status, array( LicenseRepository::STATUS_SAVED, 'active' ), true ); echo '

' . esc_html__( 'Plugin and license information.', 'acez-seo' ) . '

'; $this->ui->card_open( __( 'Plugin information', 'acez-seo' ), 'license', '', 'license-info' ); echo ''; printf( '', esc_html__( 'Version', 'acez-seo' ), esc_html( ACEZ_SEO_VERSION ) ); if ( defined( 'ACEZ_SEO_PRO_VERSION' ) ) { printf( '', esc_html__( 'Pro version (addon)', 'acez-seo' ), esc_html( (string) constant( 'ACEZ_SEO_PRO_VERSION' ) ) ); } printf( '', esc_html__( 'Free version license', 'acez-seo' ), 'GPL-2.0-or-later' ); printf( '', esc_html__( 'Status', 'acez-seo' ), $status_on ? 'acez-seo-badge--on' : 'acez-seo-badge--off', esc_html( $status_labels[ $status ] ?? $status ) ); echo '
%1$sAcez SEO AI %2$s
%1$sAcez SEO AI Pro %2$s
%1$s%2$s
%1$s%3$s
'; if ( $pro_active ) { // Signpost only — the free tab stays passive info, all license // MANAGEMENT (key, buyer, expiry) lives on the Pro page. printf( '

%2$s

', esc_url( add_query_arg( array( 'page' => 'acez-seo-license' ), admin_url( 'admin.php' ) ) ), esc_html__( 'Manage license →', 'acez-seo' ) ); } else { echo '

' . esc_html__( 'The free version is fully functional. In the future, a license key will unlock Pro features (including a redirect manager, content analysis, and bulk AI generation).', 'acez-seo' ) . '

'; printf( '

%2$s

', esc_url( ProProductLink::url() ), esc_html__( 'See Acez SEO AI Pro →', 'acez-seo' ) ); } $this->ui->card_close(); } }