Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disable loading column values in audit log by default #912

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading