Commit Graph

93 Commits

Author SHA1 Message Date
Vladimir Bryzgalov 494061e39f feat(wpmc S4): TermMeta registers ACF main_page_alt on taxonomy town
Add acf-stubs.php + TestCase::setUp() require-after-Patchwork pattern so
acf_add_local_field_group is Patchwork-instrumented and re-interceptable
across FieldGroupTest and TermMetaTest in the same PHP process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:33:39 +05:00
Vladimir Bryzgalov b967a3a59f feat(wpmc S4): Helpers::index_town_alt_page_id reads ACF option 2026-05-16 19:22:59 +05:00
Vladimir Bryzgalov d724089b2d feat(wpmc S4): Helpers::page_unic_swap with per-request cache 2026-05-16 19:22:37 +05:00
Vladimir Bryzgalov d122bfacb5 feat(wpmc S4): Helpers::is_routable_path with page_no_rep exclusions 2026-05-16 19:22:01 +05:00
Vladimir Bryzgalov f4184a7777 feat(wpmc S4): Helpers::main_town_slug reads ACF option 2026-05-16 19:21:31 +05:00
Vladimir Bryzgalov 0565357b5e test(wpmc S4): WP_Query stub + wp_query globals cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:20:00 +05:00
Vladimir Bryzgalov 68db1256e7 docs(wpmc S4): implementation plan for URL router 2026-05-16 19:12:57 +05:00
Vladimir Bryzgalov 1ddbc55204 spec(wpmc S4): URL router design — legacy wp_query patch + ACF page_unic + 301 2026-05-13 23:13:54 +05:00
Vladimir Bryzgalov 259470ca63 refactor(wpmc S3): get_terms modern signature + REQUEST_URI cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:17:08 +05:00
Vladimir Bryzgalov 9b23f56e57 docs(wpmc): mark S3 done in README roadmap 2026-05-12 20:12:39 +05:00
Vladimir Bryzgalov d8b0d01f1c feat(wpmc S3): procedural wpmc_* API + smoke test
Also fixes PluginBootTest to be order-independent (reset booted flag)
and to expect ShortcodeDmr hook that boot() now wires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:11:47 +05:00
Vladimir Bryzgalov 3dbca34234 feat(wpmc S3): Plugin::boot() wires ShortcodeDmr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:10:42 +05:00
Vladimir Bryzgalov adbbd205a1 test(wpmc S3): lock per-request render cache for ShortcodeDmr 2026-05-12 20:07:30 +05:00
Vladimir Bryzgalov 9cacf18725 test(wpmc S3): ShortcodeDmr::render edge-case coverage 2026-05-12 20:07:18 +05:00
Vladimir Bryzgalov 0be1a5a08f feat(wpmc S3): ShortcodeDmr::render resolves text by current town 2026-05-12 20:07:01 +05:00
Vladimir Bryzgalov 464d254f1c test(wpmc S3): lock add_shortcode call in ShortcodeDmr::do_register 2026-05-12 20:06:07 +05:00
Vladimir Bryzgalov f68b30b4e6 feat(wpmc S3): ShortcodeDmr scaffold + register init hook 2026-05-12 20:05:50 +05:00
Vladimir Bryzgalov 22099cf1d6 feat(wpmc S3): Helpers::remove_domain_link via parse_url
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:04:10 +05:00
Vladimir Bryzgalov 11bd3a06b0 feat(wpmc S3): Helpers::alt_get_field with do_shortcode + filter
Implements alt_get_field(): applies wpmc_alt_get_field_post_id filter for
post_id remapping, guards against missing ACF, runs do_shortcode on string
results, passes arrays/null through unchanged.  4 new tests; full suite
22 tests / 58 assertions green.

Note: Brain Monkey FunctionStub::__construct calls function_exists()
internally; expect() calls must precede when('function_exists')->alias()
in each test to avoid the alias intercepting the stub-creation check and
causing eval redeclaration errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:02:57 +05:00
Vladimir Bryzgalov 1f343dfaf2 test(wpmc S3): current_town fallback + filter + memoization coverage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:58:42 +05:00
Vladimir Bryzgalov f81cefefbe feat(wpmc S3): Helpers::current_town URI-match path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:58:19 +05:00
Vladimir Bryzgalov 58838b0c19 feat(wpmc S3): Helpers::get_term_by_slug with per-request cache
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:56:54 +05:00
Vladimir Bryzgalov 176d8e0c0b feat(wpmc S3): Helpers scaffold + reset_cache wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:55:09 +05:00
Vladimir Bryzgalov 002ddde424 docs(wpmc S3): implementation plan for shortcode_dmr + helpers 2026-05-12 19:53:49 +05:00
Vladimir Bryzgalov 245c114ec3 spec(wpmc S3): design doc for shortcode_dmr + helpers 2026-05-12 19:36:00 +05:00
Vladimir Bryzgalov 12a271981a chore(wpmc S2): defensive defines + PostType::SLUG refs + stale comment
Wrap 4 define() calls with defined() || guards to survive double-load.
Replace hardcoded 'shortcode-town' strings in Taxonomy and FieldGroup
with PostType::SLUG. Update Activator comment to reflect S2 reality.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:02:14 +05:00
Vladimir Bryzgalov 38bb7dae55 feat(wpmc S2): make Plugin::boot() idempotent
Add private \$booted flag; guard skips all re-registration on subsequent
calls. TDD: RED (3x boot -> expectAdded->once() fails) then GREEN.
Drop deprecated setAccessible() call (no-op since PHP 8.1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:01:43 +05:00
Vladimir Bryzgalov bc16851b71 docs(wpmc): mark S1+S2 done in README roadmap 2026-05-12 17:55:58 +05:00
Vladimir Bryzgalov e2399e2360 feat(wpmc S2): Plugin::boot() wires Taxonomy + PostType + FieldGroup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:53:58 +05:00
Vladimir Bryzgalov f859385761 chore(wpmc S2): pin patchwork cache + tighten noop test guard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:52:34 +05:00
Vladimir Bryzgalov c1db5c7712 docs(wpmc S2): add implementation plan for taxonomy/CPT/ACF tasks 2026-05-12 17:49:09 +05:00
Vladimir Bryzgalov 519e436337 feat(wpmc S2): register ACF group list_shortcode for shortcode-town
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:47:57 +05:00
Vladimir Bryzgalov ded71e8fd0 test(wpmc S2): lock ACF-missing guard for FieldGroup
Add patchwork.json to enable function_exists shimming via Patchwork
(required so Brain Monkey can intercept the PHP internal).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:47:09 +05:00
Vladimir Bryzgalov 551f107344 feat(wpmc S2): FieldGroup::register() attaches acf/init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:45:51 +05:00
Vladimir Bryzgalov 054439aade test(wpmc S2): assert query_var=false in PostType test for parity 2026-05-12 17:44:31 +05:00
Vladimir Bryzgalov f95d09cc89 feat(wpmc S2): register CPT shortcode-town with required args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:36 +05:00
Vladimir Bryzgalov e0b87dde0c feat(wpmc S2): PostType::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:06 +05:00
Vladimir Bryzgalov cb9cbddce3 chore(wpmc S2): remove unused Brain\Monkey\Actions import 2026-05-12 17:40:58 +05:00
Vladimir Bryzgalov b06ea9e605 feat(wpmc S2): register taxonomy town with required args
Also stub translation functions in base TestCase so __() calls from
WPMultiCity namespace resolve correctly via Brain Monkey.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:37:29 +05:00
Vladimir Bryzgalov 53a784bbe8 feat(wpmc S2): Taxonomy::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:36:26 +05:00
Vladimir Bryzgalov 945ae898ac fix(wpmc S2): drop redundant Mockery::close from TestCase teardown
Brain\Monkey\tearDown() already calls Mockery::close internally;
calling it explicitly duplicates the close.
2026-05-12 17:34:47 +05:00
Vladimir Bryzgalov d98499dbb2 test(wpmc S2): setup PHPUnit + Brain Monkey + Mockery 2026-05-12 17:31:53 +05:00
Vladimir Bryzgalov fad5a7d03b chore: init wp-multi-city v0.1.0 with S1 skeleton + S2 design spec
S1 skeleton (cp-8ci, already done):
- wp-multi-city.php with header, constants, hooks bootstrap
- includes/class-plugin.php with PSR-4-ish autoloader, ACF dependency guard
- includes/class-activator.php placeholder
- composer.json (PHP 8.0, phpunit dev)
- README.md with roadmap
- uninstall.php placeholder

S2 design (cp-q7g):
- docs/superpowers/specs/2026-05-12-s2-taxonomy-cpt-acf-design.md
2026-05-12 17:21:08 +05:00