Repository navigation
feat(remote): GET /counts — WordPress's published counts per type and media, for a price before payment; /about names the capability - #58
Merged
Conversation
… media, for a price before payment; /about names the capability
# Conflicts: # includes/class-contentrain-bridge-remote.php
Member
Author
|
Code review (t3, head 2601293). Nothing blocking. Main (with #57) is already merged in, and OK
SHOULD (either here or in the 0.7.0 PR)
Either leave those out of |
…ordPress site-building types
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Gate item 10, S3 (Migrate's sitemap pricing, design
.internal/runs/2026-10-09/t8/sitemap-pricing-design.md). A site whose REST API is closed to readers (rest_blocked) can still be priced exactly, by Bridge, before payment. Migrate then recounts a Bridge site on what WordPress itself counts, not on a sitemap figure (S2b, the Migrate side, comes after Bridge 0.7.0).GET /contentrain-bridge/v1/counts:permitted: an application password of an administrator with the export capability, or the paired key). Never public.{ format: 'contentrain-bridge-counts@1', published: { <type>: n }, attachments: n }.publisheduseswp_count_posts(type)->publishover the same content types an export reads (Source::content_types()), sorted.attachmentsis the media count (inherit).GET /aboutnow carriescapabilities: ['counts'], so a reader can tell an older plugin without comparing versions. It still carries no site data.Merge with t3's robots toggle (wordpress-bridge#57): both touch
about(). Whichever merges second makes it'capabilities' => array( 'counts', 'robots_allow' ). t3 then writes the 0.7.0 bump + WP.org readme PR; ORK pushes the tag.Tests
tests/key.php(Docker acceptance):/aboutnames thecountscapability and carries no site data./countssigned out with no key → 401, never public./countswith the paired key → 200, and the numbers equalwp_count_postsper type and media.bridge_key_forbidden.Gate
Docker acceptance on
2601293(base main88b5e8e, unchanged since), under its own compose project (COMPOSE_PROJECT_NAME=t8s3, port 8194), with containers and volumes down afterwards:tests/run.sh(integration): 394 checks passed.tests/coverage.sh: coverage 57 checks,key.php51 checks (incl. the 4 above), the remote-export suite 80 checks.coverage-rawir.mjs, first failed withERR_MODULE_NOT_FOUND @contentrain/wp-import: the worktree had nonpm ci, an environment fault. Afternpm ciit was re-run on the same Docker output: RawIR parity 12/12, andverify-storepassed (contentrain validate: 10 models, 48 entries; canonical byte parity: 46 files; 16 documents with frontmatter).tests/check-plugin.sh: Plugin Check 0 errors, 26 warnings (not compared with main here; the 19 lines this PR adds add no new function calls besideswp_count_posts).npm test: 13/13.test:secrets: 86 files, 0 secrets (negative control passes).Reviewer: t3.
Update 2026-10-09 19:25: main merged (#57) + t3's SHOULD
2a712aa(feat(robots): the owner can let Contentrain Migrate read the site through robots.txt #57, robots toggle). No rebase. Inabout()the capabilities are nowarray( 'counts', 'robots_allow' )and therobotsstate is kept.tests/key.phpexpects both capabilities; README/aboutrow updated./countspublishedlists content types only.attachmentis left out (media isattachments), and so are WordPress's site-building types (wp_block,wp_template,wp_template_part,wp_navigation,wp_font_family,wp_font_face,wp_global_styles,nav_menu_item). That is the same list as migrate'sNOT_CONTENT_TYPES(packages/discover/src/credentials.ts:104), minuspost/page, which are content here. Pinned intests/key.php.2103eda(project t8s3, port 8194, down afterwards):