Skip to content

REST API: Introduce a controller for searching across post types - #19

Closed
danielbachhuber wants to merge 14 commits into
WordPress:5.0from
danielbachhuber:39965-search-controller
Closed

REST API: Introduce a controller for searching across post types#19
danielbachhuber wants to merge 14 commits into
WordPress:5.0from
danielbachhuber:39965-search-controller

Conversation

@danielbachhuber

Copy link
Copy Markdown
Member

@danielbachhuber

Copy link
Copy Markdown
Member Author

🚢

@danielbachhuber
danielbachhuber deleted the 39965-search-controller branch October 17, 2018 17:02
danfarrow pushed a commit to danfarrow/wordpress-develop that referenced this pull request Sep 10, 2021
Co-authored-by: Kelly Dwan <ryelle@users.noreply.github.com>
blitzy Bot pushed a commit to Blitzy-Sandbox/blitzy-wordpress that referenced this pull request Jul 8, 2026
Resolves all 24 findings from the FINAL full-project review (docs/index.md
boundary). Every fix preserves byte-identical functional output, public APIs,
hook contracts, REST routes/schemas, and enqueue semantics (minimal-diff,
evidence-first).

Code fixes (implemented):
- F-005 (CRITICAL, #3): cache-first/batch-primed prepare_item_for_response in
  class-wp-rest-posts-controller.php matching the passing sibling controllers;
  fixed a discovered attachment cache-key collision by scoping the media slice
  under object_type 'attachment-media' (281 posts + 129 attachment tests pass).
- F-006 (WordPress#12): registered-handle memoization (get_registered_handles,
  count-snapshot self-healing) in class-wp-dependencies.php (340 tests pass).
- F-003 (WordPress#9): WP_Metadata_Lazyloader $settings expanded to 'post'/'user'
  (additive; reachable via queue_objects()).
- Observability (CRITICAL, #1): install_mu_plugins() wires server-timing.php +
  clear-cache.php into the benchmark runtime in run-baseline.sh/run-optimized.sh.
- Reproducibility (CRITICAL, #2): committed representative raw inputs
  (before/after JSON) + fail-loud missing-baseline guard in
  generate-diff-report.js; report regenerates byte-identically.
- Quality gate (CRITICAL, WordPress#5): refactored two no-nested-ternary JS-lint errors
  into a formatSignificantLabel() helper (the alleged PHPStan error was
  empirically non-reproducible; composer phpstan is green).
- KPI 3 (WordPress#6): clarified the admin.test.js instrument as runtime browser-measured
  gzipped transfer (PerformanceResourceTiming.transferSize); honestly NOT met
  (17.97%), delivered via F-007 conditional loading.
- Accessibility (WordPress#21): prefers-reduced-motion accommodation in the reveal.js deck
  (Rule-4 verbatim settings preserved).

Documented Rule-2 deviations (files intentionally unchanged, with rationale):
- WordPress#4 F-009 webpack splitting (DEV-03): admin JS is Grunt-uglified; webpack emits
  only 4 independent media bundles; splitChunks would break the enqueue graph for
  zero KPI benefit. development.js split-disable is correct.
- WordPress#7 default-filters.php (DEV-04): AAP target mandates "465 registrations
  preserved"; deferral violates hook-contract preservation.
- WordPress#8 class-wp-query.php (DEV-05): memoization/priming is pre-existing WP 6.1+
  baseline; F-002 delivered in composed meta-query/wpdb/meta classes.
- WordPress#10 general-template.php, WordPress#11 script-loader.php, WordPress#13 ajax-actions.php (DEV-06):
  no byte-identical-safe, evidence-backed seam at each file's own layer.

Documentation honesty rebuild (WordPress#14-WordPress#17, WordPress#19, Rules 1-3):
- Rebuilt decision-log-and-traceability.md from git-diff ground truth (correct
  10-controller list, accurate per-feature counts, DEV-01..DEV-10, 100%
  traceability); corrected project-guide.md, technical-specifications.md,
  index.md, performance-dashboard.md, and the deck to reflect the actual
  implemented state and baseline-parity gate status.

Scope accounting (WordPress#20): three added test files + signatures.php test-alignment
(F-003, DEV-10) accounted in traceability §4.3.

Build discipline (WordPress#18): grunt build --dev succeeds and dirties zero tracked
files (compiled outputs are gitignored).

Test evidence (WordPress#19): PHPStan green; PHPCS 0 errors / 0 new warnings (BASE-parity
proven); JS lint green; full PHPUnit suite 28994 tests with only 8 pre-existing
environmental tzdata failures (deprecated zones absent from container tzdata),
all in unchanged files and baseline-identical.
blitzy Bot pushed a commit to blitzy-research/wordpress-develop that referenced this pull request Aug 8, 2026
…workstreams

Addresses all 51 findings from code review o006 (34 numbered, 11 module,
6 security). Two of the six binding targets now pass and every unmet target
improved; the four that remain short are documented against the AAP sections
that exclude the work required to close them.

Implemented, not merely disclosed:

* wp-settings.php: defer the two admin-only files the plan mandates off the
  front-end path. wp-admin/includes/plugin.php is required only when a plugin
  is active or is_admin(); WP_Site_Health is instantiated only for admin, cron
  and WP-CLI. 6,533 lines stop being tokenized on every front-end request, and
  the Site Health class map entry stops being a zero-delta entry. (WordPress#13, A2)
* capabilities.php: deliver the map_meta_cap() memoization the plan prescribes
  and the previous round withdrew. Branch-scoped to the four post arms, keyed on
  every input that can change the result including the post type's cap object,
  bypassed when a non-core map_meta_cap callback is present, and the filter still
  runs on every call. Measured -8.8% cold / -8.0% warm over 7/7 interleaved
  rounds. (WordPress#12)
* autoload.php: is_readable() replaces file_exists() at both guards so an
  existing-but-unreadable file degrades instead of raising an uncatchable
  E_COMPILE_ERROR; the path-confinement pattern is anchored with \z so a value
  carrying a trailing newline cannot pass a guard advertised as canonical;
  CompileError is re-raised while any other Error is reported under WP_DEBUG
  through wp_trigger_error(). (WordPress#15, WordPress#16, WordPress#17, S2, S3)
* formatting.php: scope the emoji gate to the front end, the only context the
  plan measured, pass the context to the filter, and restore trunk's $printed
  ordering. (WordPress#20, WordPress#21, C1)
* script-loader.php: publish the documented one-line rollback for the Command
  Palette gate and name both consequences - wp.commands/wp.coreCommands
  undefined and the Ctrl+K button absent - in the predicate's docblock.
  (WordPress#18, WordPress#19, B1)
* class-wp-object-cache.php: stop stats() emitting an advisory paragraph on the
  default path, so its public output matches trunk exactly. (WordPress#23, WordPress#22, D1)
* Gruntfile.js: move verify:build-guards out of every production build into
  precommit and prerelease, and classify ENOENT at both host-php spawn sites.
  (WordPress#24, WordPress#25)
* server-timing.php: refuse to serve the reset endpoint when the pre-existing
  unauthenticated clear-cache.php is provisioned beside it. (WordPress#29, S5)
* admin.test.js / utils.js: collect JavaScript by Content-Type as well as by
  .js pathname, which was under-counting by ~99,019 gzipped bytes in both arms
  whenever CONCATENATE_SCRIPTS is active. (WordPress#30, WordPress#31)
* generate-autoload-classmap.php: @return never on the fail-closed exit.
  Clears the one PHPStan error the file had. (WordPress#28)
* build-guards.test.js: prettier-clean. (WordPress#33)

New committed coverage for behaviour that shipped with none - 34 cases:
tests/phpunit/tests/dependencies/commandPalette.php (7),
tests/phpunit/tests/formatting/emojiGate.php (6),
tests/phpunit/tests/cache/objectCacheGroupStats.php (8),
tests/phpunit/tests/user/mapMetaCapMemoization.php (13). (B2, C2, D1)

docs/performance-optimization-report.md rewritten against a fresh before/after
pair captured under one interpreter regime with 40 samples per metric per
scenario over 18 scenarios. Every stale artifact reference, blob id and digest
is replaced; the ephemeral self-check machinery is replaced with in-tree
re-runnable commands; the emoji, files-loaded, byte-size, PHPStan/PHPCS
coverage and 216-construct claims are corrected; a Security invariants section
records Gate 7 and findings S1, S4 and S6; and a before/after loading-flow
diagram is added. (WordPress#1-WordPress#11, WordPress#14, WordPress#26, WordPress#27, WordPress#31, WordPress#32, WordPress#34, A1, A3, C3, H1, S1, S4, S6)

Verification: PHPUnit 29,165 single-site and 29,957 multisite with 0 failures
and 0 errors, warning and skip counts identical to the pre-change baseline;
QUnit 456/456; E2E exit 0; performance suite 820 passed in both arms and
compare-results.js exit 0; PHPStan exit 0 over 1,414 files; PHPCS exit 0;
production and dev builds clean with no drift and build/ byte-identical to src/.
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.

1 participant