Commit Graph

43 Commits

Author SHA1 Message Date
Vladimir Bryzgalov 949fb19e95 fix(wpmc 1.0.1): remove __() from labels (no translations, fixes WP 6.7 notice)
Replace all __('...', 'wp-multi-city') calls in CPT, taxonomy, ACF field group,
and options page label arrays with literal Russian strings. The plugin ships no
.mo translation files, so wrapping labels in __() was YAGNI and triggered the
WP 6.7+ _load_textdomain_just_in_time notice.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:01:11 +05:00
Vladimir Bryzgalov 19409ac062 feat(wpmc 1.0.1): wpmc_main_town_slug procedural wrapper
Add wpmc_main_town_slug() wrapper function to wpmc-functions.php, delegating
to Helpers::main_town_slug(). The function was documented in the Hook API
README but was missing from the codebase.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:01:05 +05:00
Vladimir Bryzgalov 25d50912f6 feat(wpmc S7): Plugin::register_update_checker wires PUC v5.6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:20:31 +05:00
Vladimir Bryzgalov c264bc433a feat(wpmc S7): vendor Plugin Update Checker v5.6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 12:15:44 +05:00
Vladimir Bryzgalov dfcadc5339 fix(wpmc S5): wrap Redirect get_permalink + safe rest_url replacement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:40:46 +05:00
Vladimir Bryzgalov 2d3b52e928 feat(wpmc S5): Plugin::boot wires TitleFilter + LinkFilter + RestUrlFilter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:35:52 +05:00
Vladimir Bryzgalov f05ae24882 feat(wpmc S5): RestUrlFilter forces HTTPS + preserves HTTP_HOST
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:35:23 +05:00
Vladimir Bryzgalov 6fe73465be feat(wpmc S5): LinkFilter::add_town_prefix path-only + full URL handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:33:59 +05:00
Vladimir Bryzgalov b7fb46ea38 feat(wpmc S5): LinkFilter scaffold + register 3 URL filters
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:33:39 +05:00
Vladimir Bryzgalov ca8a0a8b43 feat(wpmc S5): TitleFilter hooks the_title + single_cat_title do_shortcode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:31:34 +05:00
Vladimir Bryzgalov a835ba3662 feat(wpmc S5): Helpers::without_url_filters bypass counter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:31:00 +05:00
Vladimir Bryzgalov 3da1db1ccc feat(wpmc S4): Plugin::boot wires OptionsPage + TermMeta + Router + Redirect
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 20:05:43 +05:00
Vladimir Bryzgalov eb84bb8274 feat(wpmc S4): Redirect class 301s on page_unic clone access
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 20:03:04 +05:00
Vladimir Bryzgalov 004a8517e4 feat(wpmc S4): Router::route internal page + page_unic swap 2026-05-16 19:59:00 +05:00
Vladimir Bryzgalov 9af4c2976e feat(wpmc S4): Router::route root URL uses main_page_alt term meta 2026-05-16 19:58:04 +05:00
Vladimir Bryzgalov d30a039a73 feat(wpmc S4): Router scaffold + query_vars filter for town 2026-05-16 19:57:12 +05:00
Vladimir Bryzgalov fc21fd1f06 feat(wpmc S4): OptionsPage::do_register registers routing field group
Also: add acf_add_options_page to acf-stubs.php; add translation-function
stubs to acf-stubs.php; fix TestCase::tearDown to call Patchwork::restoreAll()
in a finally block so that when('function_exists') routes are always cleaned up
even when Mockery::close() throws InvalidCountException.
2026-05-16 19:54:23 +05:00
Vladimir Bryzgalov 79de284f53 feat(wpmc S4): OptionsPage scaffold + main_town_slug filter wiring 2026-05-16 19:39:18 +05:00
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 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 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 0be1a5a08f feat(wpmc S3): ShortcodeDmr::render resolves text by current town 2026-05-12 20:07:01 +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 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 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 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 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 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 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 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 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