Skip to content

Commit

Permalink
Replaced the usage of get_plugins() with file_exists() when check…
Browse files Browse the repository at this point in the history
…ing if a plugin version exists as the former can throw a warning.
  • Loading branch information
fajardoleo committed Nov 10, 2022
1 parent ae16b20 commit 7b29478
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -24886,9 +24886,7 @@ private function is_premium_version_installed() {
return $this->can_activate_theme( $this->get_premium_slug() );
}

$premium_plugin = get_plugins( '/' . dirname( $premium_plugin_basename ) );

return ! empty( $premium_plugin );
return file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_plugin_basename ) );
}

/**
Expand Down

0 comments on commit 7b29478

Please sign in to comment.