*/ private static $map = array( // Home Services 'general_contractor' => 'GeneralContractor', 'roofing' => 'RoofingContractor', 'plumbing' => 'Plumber', 'electrical' => 'Electrician', 'hvac' => 'HVACBusiness', 'painting' => 'HousePainter', 'locksmith' => 'Locksmith', 'moving' => 'MovingCompany', 'cleaning' => 'HomeAndConstructionBusiness', 'landscaping' => 'HomeAndConstructionBusiness', 'pest_control' => 'HomeAndConstructionBusiness', 'pool_service' => 'HomeAndConstructionBusiness', 'home_repair' => 'HomeAndConstructionBusiness', // Automotive 'auto_repair' => 'AutoRepair', 'auto_dealer' => 'AutoDealer', 'car_wash' => 'AutoWash', 'towing' => 'AutomotiveBusiness', // Food & Hospitality 'restaurant' => 'Restaurant', 'cafe' => 'CafeOrCoffeeShop', 'bar' => 'BarOrPub', 'bakery' => 'Bakery', 'catering' => 'FoodEstablishment', 'food_truck' => 'FoodEstablishment', 'fast_food' => 'FastFoodRestaurant', 'ice_cream' => 'IceCreamShop', 'winery' => 'Winery', 'brewery' => 'Brewery', // Accommodation & Travel 'hotel' => 'Hotel', 'motel' => 'Motel', 'hostel' => 'Hostel', 'bed_breakfast' => 'BedAndBreakfast', 'vacation_rental' => 'VacationRental', 'campground' => 'Campground', 'resort' => 'Resort', // Health & Medical 'dentist' => 'Dentist', 'physician' => 'Physician', 'pharmacy' => 'Pharmacy', 'hospital' => 'Hospital', 'emergency_service' => 'EmergencyService', 'chiropractor' => 'MedicalClinic', 'optometrist' => 'Optician', 'therapist' => 'MedicalClinic', 'medical_clinic' => 'MedicalClinic', 'nursing_home' => 'MedicalClinic', 'blood_bank' => 'MedicalClinic', // Beauty & Wellness 'hair_salon' => 'HairSalon', 'spa' => 'DaySpa', 'nail_salon' => 'NailSalon', 'gym' => 'ExerciseGym', 'yoga_studio' => 'SportsActivityLocation', 'beauty_salon' => 'BeautySalon', 'massage' => 'HealthAndBeautyBusiness', 'tattoo' => 'TattooParlor', // Legal & Financial 'attorney' => 'Attorney', 'accountant' => 'AccountingService', 'financial' => 'FinancialService', 'insurance' => 'InsuranceAgency', 'bank' => 'BankOrCreditUnion', 'mortgage' => 'FinancialService', // Real Estate 'real_estate' => 'RealEstateAgent', 'property_mgmt' => 'RealEstateAgent', // Retail 'store' => 'Store', 'clothing_store' => 'ClothingStore', 'shoe_store' => 'ShoeStore', 'book_store' => 'BookStore', 'electronics_store' => 'ElectronicsStore', 'furniture_store' => 'FurnitureStore', 'hardware_store' => 'HardwareStore', 'grocery_store' => 'GroceryStore', 'jewelry_store' => 'JewelryStore', 'toy_store' => 'ToyStore', 'pet_store' => 'PetStore', 'florist' => 'Florist', 'sporting_goods' => 'SportingGoodsStore', // Entertainment 'movie_theater' => 'MovieTheater', 'bowling_alley' => 'BowlingAlley', 'amusement_park' => 'AmusementPark', 'museum' => 'Museum', 'art_gallery' => 'ArtGallery', 'casino' => 'Casino', 'golf_course' => 'GolfCourse', 'stadium' => 'StadiumOrArena', 'comedy_club' => 'ComedyClub', 'night_club' => 'NightClub', 'music_venue' => 'MusicVenue', // Sports & Recreation 'sports_club' => 'SportsClub', 'sports_activity' => 'SportsActivityLocation', 'ski_resort' => 'SkiResort', 'tennis' => 'TennisComplex', 'bike_shop' => 'SportingGoodsStore', // Education & Training 'school' => 'School', 'preschool' => 'Preschool', 'university' => 'CollegeOrUniversity', 'tutoring' => 'EducationalOrganization', 'driving_school' => 'School', 'music_school' => 'School', 'language_school' => 'School', 'dance_studio' => 'School', 'dental_academy' => 'EducationalOrganization', // Pet Services 'veterinary' => 'VeterinaryCare', 'pet_grooming' => 'AnimalShelter', 'dog_daycare' => 'AnimalShelter', // Professional Services 'marketing_agency' => 'LocalBusiness', 'recruiting' => 'EmploymentAgency', 'travel_agency' => 'TravelAgency', 'shipping' => 'Service', 'architect' => 'Service', 'photographer' => 'Service', 'dei_coach' => 'Service', 'design_agency' => 'Service', 'printing_company' => 'LocalBusiness', // Religious Organization 'church' => 'Church', 'mosque' => 'Mosque', 'synagogue' => 'Synagogue', 'hindu_temple' => 'HinduTemple', 'buddhist_temple' => 'BuddhistTemple', 'general_religious' => 'PlaceOfWorship', // Childcare 'childcare_center' => 'ChildCare', 'daycare' => 'ChildCare', 'nursery' => 'ChildCare', 'afterschool' => 'ChildCare', 'babysitter' => 'ChildCare', // Fallback 'local_business' => 'LocalBusiness', // Added from the schema.org type audit: every remaining Organization/ // Place business type not already covered above, mechanically slugged // from the real schema.org type name. Kept 1:1 with // frontend/src/lib/site-types.ts and backend/src/lib/siteTypes.ts. 'auto_body_shop' => 'AutoBodyShop', 'auto_parts_store' => 'AutoPartsStore', 'auto_rental' => 'AutoRental', 'motorcycle_dealer' => 'MotorcycleDealer', 'motorcycle_repair' => 'MotorcycleRepair', 'tire_shop' => 'TireShop', 'gas_station' => 'GasStation', 'computer_store' => 'ComputerStore', 'convenience_store' => 'ConvenienceStore', 'department_store' => 'DepartmentStore', 'garden_store' => 'GardenStore', 'home_goods_store' => 'HomeGoodsStore', 'liquor_store' => 'LiquorStore', 'mens_clothing_store' => 'MensClothingStore', 'mobile_phone_store' => 'MobilePhoneStore', 'movie_rental_store' => 'MovieRentalStore', 'music_store' => 'MusicStore', 'office_equipment_store' => 'OfficeEquipmentStore', 'outlet_store' => 'OutletStore', 'pawn_shop' => 'PawnShop', 'shopping_center' => 'ShoppingCenter', 'wholesale_store' => 'WholesaleStore', 'bike_store' => 'BikeStore', 'hobby_shop' => 'HobbyShop', 'dry_cleaning_or_laundry' => 'DryCleaningOrLaundry', 'self_storage' => 'SelfStorage', 'recycling_center' => 'RecyclingCenter', 'covid_testing_facility' => 'CovidTestingFacility', 'diagnostic_lab' => 'DiagnosticLab', 'individual_physician' => 'IndividualPhysician', 'medical_business' => 'MedicalBusiness', 'medical_organization' => 'MedicalOrganization', 'physicians_office' => 'PhysiciansOffice', 'health_club' => 'HealthClub', 'public_swimming_pool' => 'PublicSwimmingPool', 'adult_entertainment' => 'AdultEntertainment', 'entertainment_business' => 'EntertainmentBusiness', 'internet_cafe' => 'InternetCafe', 'elementary_school' => 'ElementarySchool', 'high_school' => 'HighSchool', 'middle_school' => 'MiddleSchool', 'library' => 'Library', 'library_system' => 'LibrarySystem', 'legal_service' => 'LegalService', 'notary' => 'Notary', 'professional_service' => 'ProfessionalService', 'automated_teller' => 'AutomatedTeller', 'tourist_information_center' => 'TouristInformationCenter', 'distillery' => 'Distillery', 'government_office' => 'GovernmentOffice', 'police_station' => 'PoliceStation', 'fire_station' => 'FireStation', 'post_office' => 'PostOffice', 'search_rescue_organization' => 'SearchRescueOrganization', 'government_organization' => 'GovernmentOrganization', 'radio_station' => 'RadioStation', 'television_station' => 'TelevisionStation', 'news_media_organization' => 'NewsMediaOrganization', 'ngo' => 'NGO', 'funding_agency' => 'FundingAgency', 'funding_scheme' => 'FundingScheme', 'consortium' => 'Consortium', 'cooperative' => 'Cooperative', 'corporation' => 'Corporation', 'music_group' => 'MusicGroup', 'performing_group' => 'PerformingGroup', 'dance_group' => 'DanceGroup', 'theater_group' => 'TheaterGroup', 'sports_organization' => 'SportsOrganization', 'sports_team' => 'SportsTeam', 'political_party' => 'PoliticalParty', 'workers_union' => 'WorkersUnion', 'research_organization' => 'ResearchOrganization', 'research_project' => 'ResearchProject', 'archive_organization' => 'ArchiveOrganization', 'project' => 'Project', 'airline' => 'Airline', 'online_business' => 'OnlineBusiness', 'online_marketplace' => 'OnlineMarketplace', 'online_store' => 'OnlineStore', // Software / SaaS / App 'web_application' => 'WebApplication', 'mobile_application' => 'MobileApplication', 'software_application' => 'SoftwareApplication', 'web_api' => 'WebAPI', 'software_source_code' => 'SoftwareSourceCode', ); /** * Subtypes grouped by site type category slug. * * Determines which subtypes appear in the dropdown when a particular * site type is selected. Used by the settings page JS. * * @var array> slug → label */ private static $categories = array( 'home_services' => array( 'general_contractor' => 'General Contractor', 'roofing' => 'Roofing Contractor', 'plumbing' => 'Plumber', 'electrical' => 'Electrician', 'hvac' => 'HVAC / Heating & Cooling', 'painting' => 'Painter', 'locksmith' => 'Locksmith', 'moving' => 'Moving Company', 'cleaning' => 'Cleaning Service', 'landscaping' => 'Landscaping', 'pest_control' => 'Pest Control', 'pool_service' => 'Pool Service', 'home_repair' => 'Home Repair / Handyman', 'dry_cleaning_or_laundry' => 'Dry Cleaning / Laundry', 'self_storage' => 'Self Storage', 'recycling_center' => 'Recycling Center', ), 'restaurant_food' => array( 'restaurant' => 'Restaurant', 'cafe' => 'Café / Coffee Shop', 'bar' => 'Bar / Pub', 'bakery' => 'Bakery', 'catering' => 'Catering', 'food_truck' => 'Food Truck', 'fast_food' => 'Fast Food', 'ice_cream' => 'Ice Cream Shop', 'winery' => 'Winery', 'brewery' => 'Brewery', 'distillery' => 'Distillery', ), 'health_medical' => array( 'dentist' => 'Dentist', 'physician' => 'Physician / Medical Practice', 'pharmacy' => 'Pharmacy', 'hospital' => 'Hospital', 'emergency_service' => 'Emergency Service', 'chiropractor' => 'Chiropractor', 'optometrist' => 'Optometrist / Eye Care', 'therapist' => 'Therapist / Mental Health', 'medical_clinic' => 'Medical Clinic', 'covid_testing_facility' => 'COVID Testing Facility', 'diagnostic_lab' => 'Diagnostic Lab', 'individual_physician' => 'Individual Physician', 'medical_business' => 'Medical Business', 'medical_organization' => 'Medical Organization', 'physicians_office' => 'Physician\'s Office', ), 'beauty_wellness' => array( 'hair_salon' => 'Hair Salon / Barber', 'spa' => 'Day Spa', 'nail_salon' => 'Nail Salon', 'gym' => 'Gym / Fitness Center', 'yoga_studio' => 'Yoga / Pilates Studio', 'beauty_salon' => 'Beauty Salon', 'massage' => 'Massage Therapy', 'tattoo' => 'Tattoo Parlor', 'health_club' => 'Health Club', ), 'automotive' => array( 'auto_repair' => 'Auto Repair / Mechanic', 'auto_dealer' => 'Auto Dealer', 'car_wash' => 'Car Wash / Detailing', 'towing' => 'Towing Service', 'auto_body_shop' => 'Auto Body Shop', 'auto_parts_store' => 'Auto Parts Store', 'auto_rental' => 'Auto Rental', 'motorcycle_dealer' => 'Motorcycle Dealer', 'motorcycle_repair' => 'Motorcycle Repair', 'tire_shop' => 'Tire Shop', 'gas_station' => 'Gas Station', ), 'real_estate' => array( 'real_estate' => 'Real Estate Agent', 'property_mgmt' => 'Property Management', ), 'retail_store' => array( 'store' => 'General Retail Store', 'clothing_store' => 'Clothing Store', 'shoe_store' => 'Shoe Store', 'book_store' => 'Book Store', 'electronics_store'=> 'Electronics Store', 'furniture_store' => 'Furniture Store', 'hardware_store' => 'Hardware Store', 'grocery_store' => 'Grocery Store', 'jewelry_store' => 'Jewelry Store', 'toy_store' => 'Toy Store', 'pet_store' => 'Pet Store', 'florist' => 'Florist', 'sporting_goods' => 'Sporting Goods Store', 'computer_store' => 'Computer Store', 'convenience_store' => 'Convenience Store', 'department_store' => 'Department Store', 'garden_store' => 'Garden Store', 'home_goods_store' => 'Home Goods Store', 'liquor_store' => 'Liquor Store', 'mens_clothing_store' => 'Men\'s Clothing Store', 'mobile_phone_store' => 'Mobile Phone Store', 'movie_rental_store' => 'Movie Rental Store', 'music_store' => 'Music Store', 'office_equipment_store' => 'Office Equipment Store', 'outlet_store' => 'Outlet Store', 'pawn_shop' => 'Pawn Shop', 'shopping_center' => 'Shopping Center', 'wholesale_store' => 'Wholesale Store', 'bike_store' => 'Bike Store', 'hobby_shop' => 'Hobby Shop', ), 'accommodation' => array( 'hotel' => 'Hotel', 'motel' => 'Motel', 'hostel' => 'Hostel', 'bed_breakfast' => 'Bed & Breakfast', 'vacation_rental'=> 'Vacation Rental', 'campground' => 'Campground', 'resort' => 'Resort', 'tourist_information_center' => 'Tourist Information Center', ), 'entertainment' => array( 'movie_theater' => 'Movie Theater', 'bowling_alley' => 'Bowling Alley', 'amusement_park'=> 'Amusement Park', 'museum' => 'Museum', 'art_gallery' => 'Art Gallery', 'casino' => 'Casino', 'golf_course' => 'Golf Course', 'stadium' => 'Stadium / Arena', 'comedy_club' => 'Comedy Club', 'night_club' => 'Night Club', 'music_venue' => 'Music Venue', 'adult_entertainment' => 'Adult Entertainment', 'entertainment_business' => 'Entertainment Business', 'internet_cafe' => 'Internet Cafe', ), 'sports_recreation' => array( 'gym' => 'Gym / Fitness Center', 'sports_club' => 'Sports Club', 'sports_activity'=> 'Sports Activity Location', 'ski_resort' => 'Ski Resort', 'tennis' => 'Tennis Club', 'golf_course' => 'Golf Course', 'public_swimming_pool' => 'Public Swimming Pool', ), 'education_training' => array( 'school' => 'School', 'preschool' => 'Preschool', 'university' => 'College / University', 'tutoring' => 'Tutoring Center', 'driving_school' => 'Driving School', 'music_school' => 'Music School', 'language_school' => 'Language School', 'dance_studio' => 'Dance Studio', 'dental_academy' => 'Dental Academy / Dental School', 'elementary_school' => 'Elementary School', 'high_school' => 'High School', 'middle_school' => 'Middle School', 'library' => 'Library', 'library_system' => 'Library System', ), 'pet_services' => array( 'veterinary' => 'Veterinary / Animal Care', 'pet_store' => 'Pet Store', 'pet_grooming' => 'Pet Grooming', 'dog_daycare' => 'Dog Daycare / Boarding', ), 'professional_services' => array( 'attorney' => 'Attorney / Law Firm', 'accountant' => 'Accountant / CPA', 'financial' => 'Financial Services', 'insurance' => 'Insurance Agency', 'real_estate' => 'Real Estate Agent', 'bank' => 'Bank / Credit Union', 'mortgage' => 'Mortgage Lender', 'marketing_agency' => 'Marketing Agency', 'recruiting' => 'Recruitment / Staffing', 'travel_agency' => 'Travel Agency', 'architect' => 'Architect', 'photographer' => 'Photographer / Videographer', 'dei_coach' => 'DEI Coach / Consultant', 'design_agency' => 'Design Agency', 'printing_company' => 'Printing Company', 'legal_service' => 'Legal Service (Other)', 'notary' => 'Notary', 'professional_service' => 'Professional Service (Other)', 'automated_teller' => 'Automated Teller (ATM)', ), 'religious_org' => array( 'church' => 'Church', 'mosque' => 'Mosque', 'synagogue' => 'Synagogue', 'hindu_temple' => 'Hindu Temple', 'buddhist_temple' => 'Buddhist Temple', 'general_religious' => 'Other / General Religious Organization', ), 'childcare' => array( 'childcare_center' => 'Childcare Center', 'daycare' => 'Daycare', 'nursery' => 'Nursery', 'afterschool' => 'After-School Care', 'babysitter' => 'Babysitter / Nanny Service', ), 'general_local_business' => array( 'local_business' => 'Other Local Business', ), // These four previously had no subtype list at all: the subtype row // only showed for local-business categories. That restriction is // lifted (see has_subtypes() below and the settings/wizard JS), so // these now get their own subtype dropdown too. 'government' => array( 'government_office' => 'Government Office', 'police_station' => 'Police Station', 'fire_station' => 'Fire Station', 'post_office' => 'Post Office', 'search_rescue_organization' => 'Search & Rescue Organization', 'government_organization' => 'Other Government Organization', ), 'news_media' => array( 'news_media_organization' => 'News / Media Organization (General)', 'radio_station' => 'Radio Station', 'television_station' => 'Television Station', ), 'nonprofit' => array( 'ngo' => 'NGO', 'funding_agency' => 'Funding Agency', 'funding_scheme' => 'Funding Scheme', ), // Non-local organization types that don't fit any category above: // media/performance groups, sports organizations, and corporate/legal // structures. 'organizations_groups' => array( 'consortium' => 'Consortium', 'cooperative' => 'Cooperative', 'corporation' => 'Corporation', 'music_group' => 'Music Group', 'performing_group' => 'Performing Group', 'dance_group' => 'Dance Group', 'theater_group' => 'Theater Group', 'sports_organization' => 'Sports Organization', 'sports_team' => 'Sports Team', 'political_party' => 'Political Party', 'workers_union' => 'Workers Union', 'research_organization' => 'Research Organization', 'research_project' => 'Research Project', 'archive_organization' => 'Archive Organization', 'project' => 'Project', 'airline' => 'Airline', 'online_business' => 'Online Business (General)', 'online_marketplace' => 'Online Marketplace', 'online_store' => 'Online Store', ), // The "Software / SaaS / App" site type previously had no subtype list at // all, so it always resolved to the generic 'Organization' entity type // regardless of what the product actually is — a browser-based SaaS // dashboard and a native mobile app are different schema.org types. 'software_saas' => array( 'web_application' => 'Web Application (SaaS)', 'mobile_application' => 'Mobile App', 'software_application' => 'Software Application (general)', 'web_api' => 'API / Developer Platform', 'software_source_code' => 'Open Source / Developer Tool', ), ); /** * Resolve a subtype slug to the schema.org @type string. * * @param string $slug Subtype slug from plugin settings. * @return string Schema.org type string. */ public static function get_type( $slug ) { if ( empty( $slug ) || ! isset( self::$map[ $slug ] ) ) { return 'LocalBusiness'; } return self::$map[ $slug ]; } /** * Get schema.org type from plugin settings. * * @return string Schema.org type string. */ public static function get_type_from_settings() { $settings = get_option( 'schema_ai_settings', array() ); $slug = isset( $settings['business_subtype'] ) ? $settings['business_subtype'] : ''; return self::get_type( $slug ); } /** * Get all subtype options for a flat