Skip to content

Commit

Permalink
Conditionally trigger warning for alloptions fallback (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
WPprodigy authored Aug 8, 2023
1 parent 6269b96 commit a594f43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 001-core/options-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ function pre_wp_load_alloptions_protections( $pre_loaded_alloptions, $force_cach
$add_result = wp_cache_add( 'alloptions', $alloptions, 'options' );

if ( false === $add_result && false === wp_cache_get( 'alloptions', 'options', true ) ) {
trigger_error( 'VIP: Saving to alloptions fallback cache.', E_USER_WARNING );
if ( defined( 'WPCOM_IS_VIP_ENV' ) && true === constant( 'WPCOM_IS_VIP_ENV' ) ) {
trigger_error( 'VIP: Saving to alloptions fallback cache.', E_USER_WARNING );
}

// Prevent memory issues in case something is looping over thousands of subsites.
if ( count( $fallback_cache ) > 10 ) {
Expand Down

0 comments on commit a594f43

Please sign in to comment.