Skip to content

Commit

Permalink
Merge pull request #919 from humanmade/backport-912-to-v20-branch
Browse files Browse the repository at this point in the history
[Backport v20-branch] Disable loading column values in audit log by default
  • Loading branch information
mikelittle authored Dec 10, 2024
2 parents 75f7224 + f0148c2 commit d3dfd60
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inc/audit_log_to_cloudwatch/class-cloudwatch-driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ public function get_records( $args ) {
* @return array
*/
public function get_column_values( $column ) {

// By default we don't load the column values, as doing so is very slow and pages
// will likely timeout. The column values will still function, it's just that options
// in drop-downs will show _all_ values, not just the ones that exist in the db of
// audit logs.
if ( ! apply_filters( 'altis.cloud.audit_log_load_column_values', false ) ) {
return [];
}

$values = wp_cache_get( $column, 'stream_column_values' );
if ( $values === false ) {
$query = "stats distinct( $column ) by $column";
Expand Down

0 comments on commit d3dfd60

Please sign in to comment.