get_bloginfo( 'name' ), 'legal_name' => get_bloginfo( 'name' ), 'business_url' => home_url(), 'industry' => 'general', 'description' => get_bloginfo( 'description' ), 'phone' => '', 'email' => get_option( 'admin_email' ), 'contact_url' => home_url( '/contact/' ), 'address' => '', 'city' => '', 'state' => '', 'zip' => '', 'country' => 'US', 'service_area' => '', 'pricing_summary' => '', 'primary_contact' => '', 'founded_on' => '', 'explicit_exclusions' => '', // Services / hours 'services' => '', 'hours' => '', // Q&A pairs — array of [ 'q' => '...', 'a' => '...' ] // Seeded from industry template on first save; user edits from then on. 'qa_pairs' => array(), // Feature toggles 'inject_jsonld' => true, 'inject_robots' => true, 'write_llms_txt' => true, 'write_agent_facts'=> true, // Pro license 'api_key' => '', 'license_status' => 'inactive', 'license_message' => '', 'license_checked_at' => '', 'license_renewal_date' => '', 'license_error_code' => '', 'license_last_sync_at' => '', 'license_last_sync_message' => '', 'license_features' => array(), 'pro_health_status' => '', 'pro_health_score' => '', 'pro_health_checked_at' => '', 'pro_health_issue_count' => 0, 'pro_health_top_issues' => array(), 'pro_health_recommendations' => array(), 'pro_health_last_error' => '', // Misc — free tier defaults to Organization schema and general industry 'schema_type' => 'Organization', 'last_written' => '', ); } // --------------------------------------------------------------------------- // Pro license check // --------------------------------------------------------------------------- /** * Returns true only when the stored license has been verified as active. */ function arscan_is_pro(): bool { wp_cache_delete( ARSCAN_OPTION_KEY, 'options' ); wp_cache_delete( 'alloptions', 'options' ); $s = get_option( ARSCAN_OPTION_KEY, array() ); return isset( $s['license_status'] ) && 'active' === $s['license_status']; } /** * Effective industry — returns the saved industry setting for all users. */ function arscan_effective_industry(): string { wp_cache_delete( ARSCAN_OPTION_KEY, 'options' ); $s = get_option( ARSCAN_OPTION_KEY, arscan_default_settings() ); return $s['industry'] ?? 'general'; } /** * Default schema type for a detected industry. */ function arscan_default_schema_type_for_industry( string $industry ): string { $map = array( 'dental' => 'MedicalBusiness', 'healthcare' => 'MedicalBusiness', 'personal_injury' => 'LegalService', 'family_law' => 'LegalService', 'criminal_law' => 'LegalService', 'general_law' => 'LegalService', 'restaurant' => 'Restaurant', 'real_estate' => 'RealEstateAgent', 'home_services' => 'HomeAndConstructionBusiness', 'financial' => 'FinancialService', 'saas' => 'SoftwareApplication', 'ecommerce' => 'Store', 'education' => 'EducationalOrganization', 'professional' => 'ProfessionalService', 'general' => 'LocalBusiness', ); return $map[ $industry ] ?? 'LocalBusiness'; } /** * Effective schema type — returns the industry-appropriate schema type for all users. */ function arscan_effective_schema_type(): string { wp_cache_delete( ARSCAN_OPTION_KEY, 'options' ); $s = get_option( ARSCAN_OPTION_KEY, arscan_default_settings() ); $schema = trim( (string) ( $s['schema_type'] ?? '' ) ); if ( '' !== $schema && 'Organization' !== $schema ) { return $schema; } return arscan_default_schema_type_for_industry( arscan_effective_industry() ); } function arscan_add_weekly_cron_schedule( array $schedules ): array { if ( ! isset( $schedules['weekly'] ) ) { $schedules['weekly'] = array( 'interval' => WEEK_IN_SECONDS, 'display' => __( 'Once Weekly', 'agentreadyscan' ), ); } return $schedules; } function arscan_run_weekly_license_recheck(): void { if ( ! class_exists( 'ARSCAN_License' ) ) { return; } wp_cache_delete( ARSCAN_OPTION_KEY, 'options' ); $settings = get_option( ARSCAN_OPTION_KEY, arscan_default_settings() ); $updated = ARSCAN_License::maybe_refresh_license_state( $settings, WEEK_IN_SECONDS, true ); if ( $updated !== $settings ) { update_option( ARSCAN_OPTION_KEY, $updated ); wp_cache_delete( ARSCAN_OPTION_KEY, 'options' ); wp_cache_delete( 'alloptions', 'options' ); } }