Skip to content

Conversation

@andyexeter
Copy link

Hey there,

Currently, when this plugin adds the WP_CACHE constant to wp-config.php it adds it right at the top of the file, just below the <?php or <? tag.

This is causing fatal errors for us because we use strict types across the board:

<?php

declare(strict_types=1);

The constant is being added above the declare statement, causing the following error:

PHP Fatal error:  strict_types declaration must be the very first statement in the script in /app/public/wp-config.php on line 5

This PR updates the regex used to place the constant below the declare statement if it is present.

@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 1.52%. Comparing base (5f6f522) to head (eb5176a).
⚠️ Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
PgCache_Environment.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             master   #1250   +/-   ##
========================================
  Coverage      1.52%   1.52%           
  Complexity    19723   19723           
========================================
  Files           634     634           
  Lines         98658   98658           
========================================
  Hits           1509    1509           
  Misses        97149   97149           

☔ 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.

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