Skip to content

Commit

Permalink
Modified performance hints data clearing methods :closes: #6878
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Aug 29, 2024
1 parent 30fb031 commit 600754f
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions inc/Engine/Common/PerformanceHints/Admin/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public function __construct( array $factories ) {
* @return void
*/
public function truncate_tables() {
if ( empty( $this->factories ) ) {
return;
}

$this->delete_rows();
}

Expand Down Expand Up @@ -68,10 +64,6 @@ private function delete_rows() {
* @return void
*/
public function delete_post( $post_id ) {
if ( empty( $this->factories ) ) {
return;
}

$url = get_permalink( $post_id );

if ( false === $url ) {
Expand All @@ -89,10 +81,6 @@ public function delete_post( $post_id ) {
* @return void
*/
public function delete_term( $term_id ) {
if ( empty( $this->factories ) ) {
return;
}

$url = get_term_link( (int) $term_id );

if ( is_wp_error( $url ) ) {
Expand Down Expand Up @@ -172,6 +160,10 @@ public function truncate_on_update( $new_version, $old_version ) {
return;
}

if ( empty( $this->factories ) ) {
return;
}

$this->truncate_tables();
}

Expand Down

0 comments on commit 600754f

Please sign in to comment.