Seravo / wordpress

The WordPress project layout used by many of Seravo's customers, suitable also for local development with Vagrant and git deployment
https://seravo.com
GNU General Public License v3.0
104 stars 53 forks source link

Consider adding `WP_DEVELOPMENT_MODE` #214

Closed samikeijonen closed 6 months ago

samikeijonen commented 1 year ago

There has been some caching related changes in recent WP releases.

In short, when developing a site, theme.json and patterns are cached. This makes it annoying to develop since the changes are not seen right away.

When in DEV my suggestion is to add define( 'WP_DEVELOPMENT_MODE', 'all' );. Maybe in wp-config.php:

/**
 * For developers: show verbose debugging output if not in production.
 */
if ( 'production' === getenv('WP_ENV') ) {
  define('WP_DEBUG', false);
  define('WP_DEBUG_DISPLAY', false);
  define('WP_DEBUG_LOG', false);
  define('SCRIPT_DEBUG', false);
} else {
  define('WP_DEBUG', true);
  define('WP_DEBUG_DISPLAY', true);
  define('WP_DEBUG_LOG', '/data/log/php-error.log');
  define('SCRIPT_DEBUG', true);
  // Added in here.
  define('WP_DEVELOPMENT_MODE', 'all');
}
pekkakortelainen commented 11 months ago

Very good, makes perfect sense. wp-config.php is the correct place for this as we have that if statement already there checking the WP_ENV variable. This new addition would then affect staging environments as well, where caching is not desired either.

Would you mind creating a PR yourself?

samikeijonen commented 11 months ago

Sure, I can do PR next week.