Skip to content

Translation Events: Retire the standalone GitHub repository#731

Open
obenland wants to merge 7 commits into
WordPress:trunkfrom
obenland:update/translation-events-retire-github-sync
Open

Translation Events: Retire the standalone GitHub repository#731
obenland wants to merge 7 commits into
WordPress:trunkfrom
obenland:update/translation-events-retire-github-sync

Conversation

@obenland

Copy link
Copy Markdown
Member

What

Makes this repository the canonical home of the Translation Events plugin, so that https://github.com/WordPress/wporg-gp-translation-events can be retired and we no longer have to sync changes between the two repositories.

Plugin sync

  • Syncs the plugin to the current trunk of the standalone repository. This includes refactors that had not yet been synced over (removal of Event_Repository_Cached/Event_Repository_Interface, new Events_Query_Result, check_is_new_contributor() visibility change). All meta-side commits were verified to already be present in the standalone repository, so nothing is lost in either direction.
  • Brings the plugin in line with this repository's root PHPCS ruleset, with no ruleset changes: multi-class files were split up one class per file (the four Event exception classes, Event_Start_Date/Event_End_Date, Stats_Row/Event_Stats), plus a handful of style fixes (blank line after file comments, reversed implode() arguments, deprecated imagedestroy() call, use ( spacing).
  • Removes the WPORG_TRANSLATION_EVENTS_TESTS env var. It only skipped the one-time v3_set_is_new_contributor() backfill during tests, which is a no-op on a fresh test database anyway.

Tests

The PHPUnit suite comes along and now runs on PHPUnit 11 under wp-env, following the same conventions as the Plugin Directory and Theme Directory suites:

  • Test files renamed to Class_Name.php (PHPUnit ≥ 10 discovers tests by class-name-matching file names) and de-namespaced, with the shared base class imported as use Wporg\Tests\Base_Test as TestCase — the pattern WPCS's FileName sniff recognizes for test classes.
  • Base_Test gained a getAnnotations() shim: WordPress Core's test framework predates PHPUnit 10 and otherwise falls back to PHPUnit\Util\Test::parseTestMethodAnnotations(), which no longer exists. That is the framework's only PHPUnit 9 API touchpoint at runtime; none of these tests use annotation-based expectations.
  • New environments/translate/.wp-env.test.json test environment (GlotPress from source, since the suite needs GP_UnitTestCase) with an after-start-test.sh that installs PHPUnit 11 the same way the Theme Directory one does, plus translate:test / translate:test:env npm scripts matching plugins:test / themes:test.
  • A Translation Events entry in the Unit Tests workflow, identical in shape to the existing entries.

Development environment

  • The plugin is now part of the environments/translate dev stack, including creating its database tables in after-start.sh (the plugin only creates them when is_admin() is true).
  • README rewritten to point at the existing environments for development and testing.

Not carried over

  • .github/workflows/, composer.json/composer.lock, bin/install-wp-tests.sh, phpcs.xml, package-lock.json — all replaced by this repository's existing tooling.

Verification

  • Full suite green in the test environment exactly as CI runs it, on PHPUnit 11.5.56: OK (94 tests, 388 assertions). The 10 non-failing PHPUnit deprecations come from Core's own checkRequirements() docblock annotation, same as the Theme Directory suite.
  • phpcs over the whole plugin directory is clean against the unmodified root ruleset.

Note

While validating the CI approach I noticed the existing WP: Handbook Plugin job currently reports No tests executed! and still passes — wp-env's bundled PHPUnit 10 doesn't pick up its kebab-case test files. Pre-existing and out of scope here, but worth a follow-up.

Once this lands, the standalone repository can be archived.

🤖 Generated with Claude Code

obenland and others added 7 commits July 22, 2026 19:05
Syncs the plugin to the current trunk of
https://github.com/WordPress/wporg-gp-translation-events and brings over
its PHPUnit suite, so the standalone repository can be retired and no
longer needs to be kept in sync.

The suite runs on PHPUnit 11 in a new environments/translate test
environment, following the same conventions as the Plugin Directory and
Theme Directory suites, and the plugin is now part of the translate
dev stack. Multi-class files were split up so the plugin lints clean
against the root PHPCS ruleset without any ruleset changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The effective one is directly above the __() call, where gettext
tooling picks it up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fixes indentation depths that did not match their openers, strips
trailing whitespace, collapses multiple blank lines, and applies the
auto-fixable WordPress-standard alignment fixes. Whitespace-only:
git diff -w is empty.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All files added in this PR now pass phpcs --standard=WordPress with no
exclusions; the only remaining output is the Capabilities.Unknown
warnings for the plugin's own registered capabilities, whose designed
remedy is the ruleset property the root ruleset already applies.

- Documents every new file: file, class, property, and function doc
  comments across the plugin includes, the test suite, and the theme.
- Renames single-class files to the class- prefix convention and the
  four camelCase exception classes to WordPress-style names
  (Invalid_Start etc.).
- Replaces the short ternaries in the event form block with explicit
  ternaries. The old expressions echoed "1" into the markup when a
  field was editable; now nothing is echoed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Converts space indentation to tabs and strips trailing whitespace, so
the stylesheet passes the WordPress standard. Whitespace-only change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The example block in src/ was never wired up: the only reference to its
build/ output is in src/blocks/example/index.php, which nothing loads.
With it gone, package.json (whose only purpose was building it) and the
.gitignore for build/ have no reason to exist either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
phpcs-branch.php runs phpcs on a temp copy named <basename>.test.php in
the repo root, so path-sensitive sniffs act on the temp path: the
FileName sniff reports "index.php.test.php" as an invalid file name
(surfacing as a false positive whenever line 1 of a file changes), and
ruleset exclude-patterns never match modified files. Feed the temp copy
to phpcs on stdin with --stdin-path so sniffs see the real path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@obenland
obenland marked this pull request as ready for review July 23, 2026 01:21
Copilot AI review requested due to automatic review settings July 23, 2026 01:21

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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.

2 participants