Skip to content

Align schema implementation scope with Southern Destinations plan (Yoast graph-first P1)#1148

Draft
Copilot wants to merge 4 commits into
developfrom
copilot/implement-schema-plan
Draft

Align schema implementation scope with Southern Destinations plan (Yoast graph-first P1)#1148
Copilot wants to merge 4 commits into
developfrom
copilot/implement-schema-plan

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

  • Review issue Update the JSON-LD schema output class integrating with Yoast SEO #1143 and the Southern Destinations schema implementation plan
  • Audit existing legacy schema classes, metabox configs, and field meta keys
  • Create includes/classes/schema/class-lsx-to-schema-helpers.php
  • Create includes/classes/schema/pieces/class-lsx-to-schema-trip.php
  • Create includes/classes/schema/pieces/class-lsx-to-schema-accommodation.php
  • Create includes/classes/schema/pieces/class-lsx-to-schema-destination.php
  • Update includes/classes/legacy/class-schema.php
  • Add tests/php/TestSchemaHelpers.php
  • Run helper tests (25/25 pass via PHP CLI)
  • Address code review: variadic apply_filters stub, WPSEO_Schema_IDs constant guard, official rating types filter, JSON_HEX_TAG/HEX_AMP XSS hardening
Original prompt

Please review my schema plan. I would like you to implement that in a new branch off of develop.

This is the github issue, but the description is slightly incorrect.
#1143

Created from VS Code.

Copilot AI changed the title [WIP] Implement schema plan from issue 1143 Align schema implementation scope with Southern Destinations plan (Yoast graph-first P1) May 20, 2026
Copilot AI requested a review from krugazul May 20, 2026 14:22
@krugazul krugazul marked this pull request as ready for review May 20, 2026 14:55
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copilot AI and others added 2 commits May 20, 2026 15:13
…_Schema_IDs guard, rating types filter, JSON_HEX_TAG XSS fix)

Agent-Logs-Url: https://github.com/lightspeedwp/tour-operator/sessions/b934cfdf-1393-4723-a8df-38b309b434d4

Co-authored-by: krugazul <1805603+krugazul@users.noreply.github.com>
@krugazul krugazul marked this pull request as draft May 25, 2026 13:39
@krugazul
Copy link
Copy Markdown
Collaborator

Schema.org Audit — Graph Pieces vs. Spec

Reviewed the three schema pieces against the official specs at schema.org/Trip, schema.org/Accommodation, and schema.org/TouristDestination.


Trip (class-lsx-to-schema-trip.php)

Property Status Issue Recommended Fix
slogan ❌ Invalid slogan belongs to Organization/Brand — not Trip or Thing Move to additionalProperty or alternateName
duration ❌ Invalid duration is a property of Event/MediaObject, not Trip Always use additionalProperty
fromLocation ❌ Invalid Does not exist on Trip Rename to tripOrigin (the correct schema.org property)
toLocation ❌ Invalid Does not exist on Trip Move destination into the itinerary property (Place | ItemList) or drop
@type: 'Trip' ⚠️ Sub-optimal A more specific child type exists Use TouristTrip (schema.org subtype, used in official examples)
subTrip items typed as Trip ⚠️ Sub-optimal Consistency Type as TouristTrip too
itinerary, offers, provider, subTrip, name, description, image, url, mainEntityOfPage, additionalProperty ✅ Valid

Accommodation (class-lsx-to-schema-accommodation.php)

Property Status Issue Recommended Fix
slogan ❌ Invalid Not a property of Accommodation, Place, or Thing Remove or use additionalProperty
checkinTime ❌ Invalid Property of LodgingBusiness, not Accommodation Change @type (see note below)
checkoutTime ❌ Invalid Property of LodgingBusiness, not Accommodation Change @type (see note below)
availableLanguage ❌ Invalid Property of ContactPoint/LodgingBusiness, not Accommodation Change @type (see note below)
starRating ❌ Invalid Property of LodgingBusiness, not Accommodation Change @type (see note below)
offers ⚠️ Warning Not listed for Accommodation Change @type (see note below)
numberOfRooms, address, geo, containedInPlace, additionalProperty, name, description, image, url ✅ Valid

Root fix: Change @type from 'Accommodation' to 'LodgingBusiness'. LodgingBusiness inherits from both Place (giving address, geo, containedInPlace) and LocalBusiness (giving checkinTime, checkoutTime, availableLanguage, starRating, offers, numberOfRooms). All currently-invalid properties become valid with this single change.


TouristDestination (class-lsx-to-schema-destination.php)

Property Status Issue Recommended Fix
slogan ❌ Invalid Not a property of TouristDestination, Place, or Thing Remove or use additionalProperty
safetyConsideration ❌ Invalid Property of Product/WebContent — not Place or TouristDestination Move to additionalProperty
touristType, containedInPlace, containsPlace, address, geo, additionalProperty, name, description, image, url, mainEntityOfPage ✅ Valid

Summary of required fixes

Fix type Changes
Rename property Trip: fromLocationtripOrigin
Remove / demote to additionalProperty slogan (all 3 pieces), duration on Trip (remove direct property — the additionalProperty fallback already handles it), toLocation on Trip, safetyConsideration on Destination
Change @type Trip: 'Trip''TouristTrip' (+ subTrip items); Accommodation: 'Accommodation''LodgingBusiness' (resolves 5 invalid properties at once)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants