Skip to content

Commit 1f18640

Browse files
authored
Merge pull request #66 from ProgressPlanner/filip/merge-options
Merge tracked options, dont replace
2 parents 823971e + f6cbdfa commit 1f18640

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/class-plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ public function update_tracked_options() {
156156
// Retrieve the existing option_optimizer data.
157157
$option_optimizer = get_option( 'option_optimizer', [ 'used_options' => [] ] );
158158

159-
$option_optimizer['used_options'] = $this->accessed_options;
159+
foreach ( $this->accessed_options as $option => $count ) {
160+
$option_optimizer['used_options'][ $option ] =
161+
( $option_optimizer['used_options'][ $option ] ?? 0 ) + $count;
162+
}
160163

161164
if ( $this->should_reset ) {
162165
$option_optimizer['used_options'] = [];

0 commit comments

Comments
 (0)