Skip to content

Feature/update deps 2026 04 20#26

Merged
gin0115 merged 2 commits intomasterfrom
feature/update-deps-2026-04-20
Apr 21, 2026
Merged

Feature/update deps 2026 04 20#26
gin0115 merged 2 commits intomasterfrom
feature/update-deps-2026-04-20

Conversation

@gin0115
Copy link
Copy Markdown
Contributor

@gin0115 gin0115 commented Apr 21, 2026

This pull request updates the CI workflows, documentation, and configuration to support newer versions of WordPress (6.6–6.9) and PHP (8.0–8.4), while also adding new documentation for advanced enqueue features and introducing Scrutinizer CI for code quality analysis. The most important changes are grouped below:

CI/CD Workflow Updates:

  • Migrated GitHub Actions workflows to test against WordPress versions 6.6, 6.7, 6.8, and 6.9, each supporting PHP 8.0–8.4, and updated dependencies and MySQL service to use MySQL 8.4. Old workflows for WP 5.9–6.1 have been replaced/renamed accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Added a new workflow for WP 6.9 with updated dependency installation, test execution, and Codecov coverage upload.

Documentation Improvements:

  • Updated the README.md to reflect the new supported versions, add workflow badges for the new test suites, and bump the release version to 1.5.0. [1] [2]
  • Expanded documentation to cover new features in v1.5.0, including async/defer script strategies (now using WP’s dependency-aware API), script translations, inline scripts/styles, register-only assets, and block editor integration methods (for_block, for_block_editor, for_block_style, and block_json). [1] [2]

Code Quality and Analysis:

  • Added a .scrutinizer.yml configuration to enable Scrutinizer CI for PHP code quality checks, including analysis, duplication detection, and code style configuration.

These changes modernize the package’s compatibility and CI coverage, improve documentation for advanced usage, and enhance code quality monitoring.

gin0115 added 2 commits April 21, 2026 09:53
Dep + tooling alignment:
- PHP >= 8.0, phpunit ^8|^9, phpstan ^2.0 at level max, phpstan-wordpress ^2, WPCS 3.x.
- phpunit-polyfills widened to ^1 || ^2 || ^4; symfony/var-dumper + css-selector + dom-crawler unpinned.
- Drop the WP 5.9/6.0/6.1 workflows; add WP_6_6..WP_6_9 workflows using codecov/codecov-action@v4 with the CODECOV_TOKEN secret.
- Add .scrutinizer.yml and tests/.env. Suppress the WP 6.8 wp_is_block_theme early-call notice in tests/wp-config.php.
- Tighten phpcs.xml (PSR12 file header exclude) and phpstan.neon.dist (drop bleedingEdge + bootstrapFiles).

HTTP layer swap:
- does_file_exist() and latest_version() use wp_remote_head() instead of raw curl / get_headers(). Consolidates two HTTP round trips into one, makes the network layer filterable via pre_http_request, and is fully mockable from the test suite.

defer() / async() repurposed:
- Use wp_script_add_data( $handle, 'strategy', 'defer'|'async' ) (WP 6.3+) instead of splatting attributes through the script_loader_tag filter. Dep-aware ordering, same rendered attribute at the browser.

New features:
- translations( string $domain, ?string $path = null )   -> wp_set_script_translations()
- with_code( string $code, string $position = 'after' )  -> wp_add_inline_script()
- with_style( string $css )                              -> wp_add_inline_style()
- for_block_editor( bool = true )                        -> enqueue_block_editor_assets hook
- for_block_style( string $block_name )                  -> wp_enqueue_block_style()
- register_only( bool = true )                           -> skip wp_enqueue_* call
- block_json( string $path )                             -> register_block_type_from_metadata()

All setters are additive/fluent; no BC break on existing public API.

Tests:
- 48 tests, 126 assertions covering every new setter (unit) and every new code path in register(), register_script(), register_style() (integration against $wp_scripts / $wp_styles / WP_Block_Type_Registry / has_filter).
- 100% statement + method coverage on src/Enqueue.php.
- Existing async/defer tests updated to assert on the new $strategy property.

README rewritten for the new surface: Packagist/GitHub/WP-matrix/codecov/Scrutinizer badge layout, sections for Script Translations / Inline Snippets / Inline Styles / Register Only / Block Editor Assets / Block Styles / Block JSON, expanded Public Methods block, full 1.5.0 changelog, updated PHP Scoper wp-core-function list.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (640af40) to head (0a68715).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff               @@
##             master       #26       +/-   ##
==============================================
+ Coverage     86.11%   100.00%   +13.88%     
- Complexity       52        67       +15     
==============================================
  Files             1         1               
  Lines           144       203       +59     
==============================================
+ Hits            124       203       +79     
+ Misses           20         0       -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gin0115 gin0115 merged commit 8a56852 into master Apr 21, 2026
22 of 23 checks passed
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