Skip to content

Commit

Permalink
disable options autoload to prevent slowing down page loading when th…
Browse files Browse the repository at this point in the history
…ere are a lot of logs stored
  • Loading branch information
nk-o committed Apr 6, 2024
1 parent 1aa7933 commit 68a37b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/class-logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function store_log( $data ) {

array_unshift( $logs, $new_log );

update_option( 'redirect_txt_logs', $logs );
update_option( 'redirect_txt_logs', $logs, false );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions classes/class-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function update_rules( WP_REST_Request $req ) {
$new_rules = $req->get_param( 'rules' );

if ( isset( $new_rules ) ) {
update_option( 'redirect_txt_rules', sanitize_textarea_field( $new_rules ) );
update_option( 'redirect_txt_rules', sanitize_textarea_field( $new_rules ), false );
}

return $this->success( true );
Expand Down Expand Up @@ -118,7 +118,7 @@ public function update_settings( WP_REST_Request $req ) {

if ( is_array( $new_settings ) ) {
$current_settings = get_option( 'redirect_txt_settings', [] );
update_option( 'redirect_txt_settings', array_merge( $current_settings, $new_settings ) );
update_option( 'redirect_txt_settings', array_merge( $current_settings, $new_settings ), false );
}

return $this->success( true );
Expand Down

0 comments on commit 68a37b0

Please sign in to comment.