Skip to content

Site: English version, PHP and statuses guides, per-page share images - #14

Merged
developing-off merged 3 commits into
mainfrom
seo/english-site
Nov 6, 2026
Merged

developing-off merged 3 commits into
mainfrom
seo/english-site

Conversation

@developing-off

@developing-off developing-off commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #9, closes #10, closes #11.

English version (#9)

  • en/ contains the home page and the 8 carrier pages, written for English searches ("Yalidine API for Node.js and PHP", etc.), not translated word for word.
  • Every page, FR and EN, has the same three hreflang links (fr, en, x-default → FR), plus og:locale and og:locale:alternate, and a FR / EN button in the navigation.
  • build-site.sh publishes en/, and sitemap.xml now lists the xhtml:link alternates (22 URLs).
  • The 404 page is bilingual.

Docs on the site (#10)

  • php/ ↔ en/php/: the PHP / Laravel guide (from docs/guide-php.md).
  • statuts/ ↔ en/statuses/: the 7 unified statuses, models, error codes, the ShippingProvider interface and client construction (from docs/CONTRACT.md).
  • Each carrier page, FR and EN, gets a native status → unified status table, taken from docs/PROVIDERS.md. ZRExpress is marked as a draft, as in the source.
  • Site links to guide-php.md and CONTRACT.md now point to these pages. PROVIDERS.md and ZREXPRESS.md stay on GitHub because they are contributor docs.

Share images (#11)

  • scripts/og/generate.mjs uses headless Chrome to generate one 1200×630 image per page and language (21 images in assets/og/, about 2 MB), with no npm dependencies.
  • og:image and twitter:image now point to these images. The FR home page keeps assets/og.png.

CI

  • scripts/check-site.mjs checks the built site: canonical URL = own URL, hreflang targets exist and point back, share images exist, and every relative link and asset resolves. Locally: 22 pages OK.

To check after merging

  • Search Console: the sitemap is re-read automatically. The "International targeting / hreflang" report should not show any errors.
  • Facebook Sharing Debugger / LinkedIn Post Inspector on a carrier page, to see the new image.

🤖 Generated with Claude Code


Summary by cubic

Adds an English version of the website, publishes the PHP guide and unified statuses as web pages, and generates one share image per page and language. Closes #9, #10, and #11.

New Features

  • en/ mirrors the home page and 8 carrier pages, written for English searches; every page pairs with its French version via reciprocal hreflang links and a FR/EN nav switch, and sitemap.xml lists all 22 URLs.
  • php/ and statuts/ (plus English variants) bring guide-php.md and CONTRACT.md onto the site; each carrier page gains a native → unified status table.
  • scripts/og/generate.mjs renders one 1200×630 image per page and language with headless Chrome and no npm dependencies.
  • scripts/check-site.mjs runs in CI and validates canonicals, reciprocal hreflang, share images, and relative links in the built site.

Bug Fixes

  • Corrects code examples across FR and EN pages against packages/ts and packages/php: webhook secret handling, ClientOptions wrapping, status tables with exact mapper keys, and try-block SDK calls.
  • The Maystro webhook example now treats the event only as a signal and re-reads the order with track(), so a forged event cannot set a status.
  • Hardens the scripts: check-site requires exactly the fr/en/x-default alternates and checks 404.html; og/generate rejects unknown keys; build-site rewrites sitemap alternates to SITE_URL and rejects backslashes in it.

Written for commit 394c4df. Summary will update on new commits.

View guided diff Turn on auto-fix

English version (#9)
- en/ mirrors the home page and the 8 carrier pages, written for English
  searches; every page carries reciprocal hreflang (fr, en, x-default)
  and an FR/EN switch in the navigation.
- build-site.sh publishes en/ and writes the hreflang alternates into
  sitemap.xml; the 404 page is bilingual.

Docs on the site (#10)
- php/ and en/php/: the PHP / Laravel guide (from docs/guide-php.md).
- statuts/ and en/statuses/: unified statuses, models and error codes
  (from docs/CONTRACT.md).
- Each carrier page gets a native → unified status table (from
  docs/PROVIDERS.md); site links to guide-php.md and CONTRACT.md now
  point to these pages.

Share images (#11)
- scripts/og/generate.mjs renders one 1200x630 image per page and
  language into assets/og/ with headless Chrome; og:image and
  twitter:image use them.

CI: scripts/check-site.mjs checks canonicals, reciprocal hreflang,
share images and relative links in the built site.

Closes #9, closes #10, closes #11

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Deploying dz-delivery with  Cloudflare Pages  Cloudflare Pages

Latest commit: 394c4df
Status: ✅  Deploy successful!
Preview URL: https://a31d4700.dz-delivery.pages.dev
Branch Preview URL: https://seo-english-site.dz-delivery.pages.dev

View logs

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 49 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread php/index.html Resolved
Comment thread en/maystro/index.html Resolved
Comment thread en/noest/index.html Resolved
Comment thread en/php/index.html Resolved
Comment thread en/zrexpress/index.html Resolved
Comment thread scripts/og/generate.mjs Resolved
Comment thread en/ecotrack/index.html Resolved
Comment thread en/ecotrack/index.html Resolved
Comment thread scripts/og/generate.mjs Resolved
Comment thread scripts/check-site.mjs Resolved
Pages (FR and EN), checked against packages/ts and packages/php:
- Maystro webhook example checks a URL secret with hash_equals before
  reading the body (Maystro does not sign requests).
- ZRExpressProvider examples wrap options in ClientOptions::fromArray().
- Carrier pages and FAQ: the shared interface does not mean every
  carrier supports every operation (NOT_SUPPORTED, link to the matrix).
- Home matrix and notes: Maystro track/cancelParcel and Yalidine/Maystro
  listParcels are supported; MDM orderId filtering is per page in the
  SDK (use allPages).
- NoEST status table lists the exact keys instead of wildcards the
  mappers do not implement.
- Statuses page: Yalidine origin option, PHP interface imports,
  provider-specific credential transport.
- Examples: quantity on every product line, [] fallback for the Laravel
  config, ISO string for updatedSince, SDK calls inside try blocks.

Scripts:
- check-site requires exactly fr/en/x-default alternates pointing to
  built pages, resolves folder links to index.html (a directory no
  longer passes as a file), and checks links in 404.html.
- build-site rewrites sitemap alternates to SITE_URL.
- og/generate rejects unknown keys and lists the unknown status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 27 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="index.html">

<violation number="1" location="index.html:843">
P2: This table incorrectly documents Maystro webhook support: `mapMaystroStatus` only maps a webhook payload’s status and does not provide or verify a Maystro webhook endpoint. Describe it as status mapping instead, so integrators do not assume Maystro webhooks are supported by the SDK.</violation>
</file>

<file name="en/php/index.html">

<violation number="1" location="en/php/index.html:582">
P2: The webhook secret is carried in the query string, making it likely to leak through access logs and proxy tracing; anyone who obtains it can forge `OrderStatusChanged` requests. Use a non-logged authentication mechanism (for example a provider-supported header/signature) or protect a random path with equivalent server-side controls, and document the required configuration.</violation>
</file>

<file name="scripts/build-site.sh">

<violation number="1" location="scripts/build-site.sh:76">
P2: This substitution can abort the build for `SITE_URL` values that pass the validator, because `sed` interprets backslash sequences in the replacement. Escape the replacement value or reject backslashes (and other control characters) during origin validation.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread index.html Resolved
Comment thread en/php/index.html

<span class="c-cmt">// Shared secret: register the URL as /maystro-webhook.php?key=&lt;MAYSTRO_WEBHOOK_SECRET&gt;</span>
<span class="c-var">$secret</span> = (<span class="c-type">string</span>) <span class="c-fn">getenv</span>(<span class="c-str">&#x27;MAYSTRO_WEBHOOK_SECRET&#x27;</span>);
<span class="c-var">$given</span> = (<span class="c-type">string</span>) (<span class="c-var">$_GET</span>[<span class="c-str">&#x27;key&#x27;</span>] ?? <span class="c-str">&#x27;&#x27;</span>);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The webhook secret is carried in the query string, making it likely to leak through access logs and proxy tracing; anyone who obtains it can forge OrderStatusChanged requests. Use a non-logged authentication mechanism (for example a provider-supported header/signature) or protect a random path with equivalent server-side controls, and document the required configuration.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At en/php/index.html, line 582:

<comment>The webhook secret is carried in the query string, making it likely to leak through access logs and proxy tracing; anyone who obtains it can forge `OrderStatusChanged` requests. Use a non-logged authentication mechanism (for example a provider-supported header/signature) or protect a random path with equivalent server-side controls, and document the required configuration.</comment>

<file context>
@@ -576,6 +577,14 @@ <h2 id="maystro-webhooks-title">7. Maystro webhooks</h2>
 
+<span class="c-cmt">// Shared secret: register the URL as /maystro-webhook.php?key=&lt;MAYSTRO_WEBHOOK_SECRET&gt;</span>
+<span class="c-var">$secret</span> = (<span class="c-type">string</span>) <span class="c-fn">getenv</span>(<span class="c-str">&#x27;MAYSTRO_WEBHOOK_SECRET&#x27;</span>);
+<span class="c-var">$given</span>  = (<span class="c-type">string</span>) (<span class="c-var">$_GET</span>[<span class="c-str">&#x27;key&#x27;</span>] ?? <span class="c-str">&#x27;&#x27;</span>);
+<span class="c-key">if</span> (<span class="c-var">$secret</span> === <span class="c-str">&#x27;&#x27;</span> || !<span class="c-fn">hash_equals</span>(<span class="c-var">$secret</span>, <span class="c-var">$given</span>)) {
+    <span class="c-fn">http_response_code</span>(<span class="c-num">401</span>);
</file context>

Comment thread scripts/build-site.sh Resolved
- Maystro webhook example (FR/EN): keep the URL secret check, but treat
  the event only as a signal and read the order back with track(), so a
  forged event cannot set a status; document keeping the query string
  out of logs.
- Home page: mapMaystroStatus is described as converting a pushed status
  code, not as SDK webhook support.
- build-site.sh rejects backslashes and control characters in SITE_URL,
  which is also used as a sed replacement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="php/index.html">

<violation number="1" location="php/index.html:610">
P2: The new lookup runs without validating `$orderId` or catching `ShippingError`, so a malformed or stale `OrderStatusChanged` payload produces an uncaught 500 instead of a deliberate webhook response. Reject missing IDs and handle provider failures before acknowledging the event.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread php/index.html

<span class="c-cmt">// Ne faites pas confiance au statut reçu : relisez la commande chez Maystro.</span>
<span class="c-var">$maystro</span> = <span class="c-type">ClientFactory</span>::<span class="c-fn">create</span>(<span class="c-str">&#x27;maystro&#x27;</span>, [<span class="c-str">&#x27;apiToken&#x27;</span> =&gt; <span class="c-fn">getenv</span>(<span class="c-str">&#x27;MAYSTRO_API_TOKEN&#x27;</span>)]);
<span class="c-var">$parcel</span> = <span class="c-var">$maystro</span>-&gt;<span class="c-fn">track</span>(<span class="c-var">$orderId</span>)-&gt;<span class="c-var">parcel</span>; <span class="c-cmt">// accepte l&#x27;UUID de la commande</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new lookup runs without validating $orderId or catching ShippingError, so a malformed or stale OrderStatusChanged payload produces an uncaught 500 instead of a deliberate webhook response. Reject missing IDs and handle provider failures before acknowledging the event.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At php/index.html, line 610:

<comment>The new lookup runs without validating `$orderId` or catching `ShippingError`, so a malformed or stale `OrderStatusChanged` payload produces an uncaught 500 instead of a deliberate webhook response. Reject missing IDs and handle provider failures before acknowledging the event.</comment>

<file context>
@@ -604,13 +604,16 @@ <h2 id="maystro-webhooks-title">7. Webhooks Maystro</h2>
-    <span class="c-cmt">// mettre à jour votre commande dont carrier_id = $orderId ...</span>
+    <span class="c-cmt">// Ne faites pas confiance au statut reçu : relisez la commande chez Maystro.</span>
+    <span class="c-var">$maystro</span> = <span class="c-type">ClientFactory</span>::<span class="c-fn">create</span>(<span class="c-str">&#x27;maystro&#x27;</span>, [<span class="c-str">&#x27;apiToken&#x27;</span> =&gt; <span class="c-fn">getenv</span>(<span class="c-str">&#x27;MAYSTRO_API_TOKEN&#x27;</span>)]);
+    <span class="c-var">$parcel</span> = <span class="c-var">$maystro</span>-&gt;<span class="c-fn">track</span>(<span class="c-var">$orderId</span>)-&gt;<span class="c-var">parcel</span>;  <span class="c-cmt">// accepte l&#x27;UUID de la commande</span>
+
+    <span class="c-cmt">// mettre à jour votre commande dont carrier_id = $orderId avec $parcel-&gt;status ...</span>
</file context>

@developing-off
developing-off merged commit 620524c into main Nov 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant