Skip to content

Upgrade build tooling and add PHPCS integration - #55

Merged
lihsaa591 merged 7 commits into
masterfrom
chore/build-tooling-and-phpcs
Sep 25, 2026
Merged

lihsaa591 merged 7 commits into
masterfrom
chore/build-tooling-and-phpcs

Conversation

@lihsaa591

Copy link
Copy Markdown
Contributor

Summary

Fixes the broken build toolchain and adds WordPress Coding Standards (PHPCS) tooling for the Radiate theme. This mirrors the same work already done on Accelerate/Accelerate Pro and Radiate Pro, applying the same fixes up front.

Changes

Area Change Why
package.json grunt 0.4.5 → ^1.6.3 Years-out-of-date pin; kept in step with the pro theme and current npm/Node
package.json grunt-contrib-compress ^1.2.0 → ^2.0.0, grunt-contrib-jshint ~1.0.0 → ^3.2.0 Kept in step with the grunt 1.x upgrade; each verified by running its task before/after
package.json grunt-wp-i18n ~0.5.4 → ^1.0.4 Old version's bundled makepot.php calls the removed PHP 8 function create_function(), fatal-erroring grunt makepot
package.json engines.node/engines.npm >=0.8.0/>=1.1.0 → >=20.0.0/>=9.0.0 2014-era values, no longer meaningful; >=20 specifically because grunt-wp-i18n@1.0.4's locked node-wp-i18n@1.2.8 → glob@11.1.0 requires Node 20 or ≥22
Gruntfile.js compress task now excludes package-lock.json, vendor/, composer.json, composer.lock, phpcs.xml.dist, dist/** These would otherwise be archived straight into the release zip
Gruntfile.js makepot task now sets potComments explicitly grunt-wp-i18n@1.0.4's default comment template leaks a literal <!=...=!> placeholder into the .pot header when not overridden — an upstream bug
.npmrc (new) omit=optional Without it, npm install silently skips all devDependencies (where the whole Grunt toolchain lives) whenever the shell has NODE_ENV=production set — grunt never gets installed
.gitignore Added /vendor/ Composer's dev dependencies shouldn't be tracked
composer.json, phpcs.xml.dist (new) WordPress + PHPCompatibility ruleset, testVersion 7.4-, composer phpcs / composer phpcbf scripts No coding-standards tooling existed in the repo
.github/workflows/phpcs.yml (new) Runs PHPCS on PR, scoped to added/copied/modified/renamed PHP files only (not deleted) ~551 pre-existing errors/84 warnings across untouched legacy files — full-repo linting would block on unrelated debt, and including deleted files would fail the job on any PR that removes a PHP file. Backlog cleanup is a separate follow-up
languages/radiate.pot Regenerated via npm run build on the fixed toolchain Output of the now-working build, not a manual edit

QA / Test steps

Toolchain (no WordPress needed):

  1. git clone this branch fresh, cd into it.
  2. Run npm install with no flags.
    • Expected: completes with no error, and node_modules/.bin/grunt exists.
  3. Run npm run build.
    • Expected: makepot and compress both run and finish with Done., exit code 0. No create_function() PHP fatal error.
  4. Open languages/radiate.pot and check the first 2 lines.
    • Expected: # Copyright (C) <year> ThemeGrill / # This file is distributed under the GNU General Public License, version 3 (GPLv3). — plain text, no <!= or =!> characters.
  5. Run unzip -l dist/radiate.zip | tail -5.
    • Expected: file count matches the theme's actual file set (82 at time of writing) — no vendor/, composer.json, composer.lock, or phpcs.xml.dist entries.
  6. Run composer install && composer phpcs.
    • Expected: PHPCS runs against the new phpcs.xml.dist ruleset (will report the pre-existing backlog — that's expected and out of scope for this PR).

Theme behavior in WordPress (manual — do this before merging):

  1. Take dist/radiate.zip from step 3 above (or activate the theme directory directly) and activate Radiate on a WordPress install.
  2. Visit the homepage, a blog archive, and a single post — confirm layout, fonts, and icons render as before. No theme PHP, template, or JS source was touched by this PR.
  3. If translations are in use, confirm Loco Translate (or similar) can still read languages/radiate.pot without errors.

Changelog entry

Fix - Updated build tooling; npm install and grunt makepot no longer fail on modern Node/PHP.

🤖 Generated with Claude Code

lihsaa591 and others added 4 commits September 22, 2026 13:31
Bumps grunt and grunt-contrib-* packages so npm install no longer
fails, fixes compress excluding composer/vendor files from the release
zip, and fixes makepot which was fatal-erroring on PHP 8 due to the
removed create_function().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds composer.json/phpcs.xml.dist with the WordPress + PHPCompatibility
(7.4) ruleset, and a PR workflow that lints changed PHP files only
(added/copied/modified/renamed, not deleted), so new code is held to
standard without blocking on the existing backlog or failing on PRs
that delete PHP files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lihsaa591 lihsaa591 self-assigned this Sep 22, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tg-autopilot

Copy link
Copy Markdown

Build for 44b12cf0 is ready 🛎️

⬇️ Download radiate.zip (692K)

Installs directly via Plugins → Add New → Upload Plugin.
Link expires in 30 days · updated Sep 22, 2026 1:44 PM +0545

A later push only rebuilds this if its commit message includes #build-zip.

lihsaa591 and others added 2 commits September 22, 2026 14:43
style.css declares Requires PHP: 5.6, but testVersion was set to
7.4- -- silently raising the theme's real compatibility contract
without that being a deliberate product decision. Set to 5.6- to
match what's actually declared; bumping the real minimum is a
separate call for the team to make, not something to smuggle into
tooling setup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-and-phpcs

# Conflicts:
#	.npmrc
#	package-lock.json
#	package.json
@lihsaa591
lihsaa591 merged commit d90947d into master Sep 25, 2026
2 checks passed
@lihsaa591
lihsaa591 deleted the chore/build-tooling-and-phpcs branch September 25, 2026 03:20
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