Skip to content

Commit

Permalink
Trigger warning for alloptions fallback cache (#4740)
Browse files Browse the repository at this point in the history
  • Loading branch information
WPprodigy committed Aug 1, 2023
1 parent 69c9693 commit 5bf2210
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 001-core/options-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ 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 );

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

0 comments on commit 5bf2210

Please sign in to comment.