Skip to content

Commit

Permalink
Remove redundant response check in helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jom committed Jul 2, 2018
1 parent d110743 commit 235549c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions includes/helper/class-wp-job-manager-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,12 @@ public function check_for_updates( $check_for_updates_data ) {
// Set version variables.
foreach ( $this->get_installed_plugins() as $product_slug => $plugin_data ) {
$response = $this->get_plugin_version( $plugin_data['_filename'] );
if ( $response ) {
// If there is a new version, modify the transient to reflect an update is available.
if ( false !== $response
&& isset( $response['new_version'] )
&& version_compare( $response['new_version'], $plugin_data['Version'], '>' )
) {
$check_for_updates_data->response[ $plugin_data['_filename'] ] = (object) $response;
}
// If there is a new version, modify the transient to reflect an update is available.
if ( $response
&& isset( $response['new_version'] )
&& version_compare( $response['new_version'], $plugin_data['Version'], '>' )
) {
$check_for_updates_data->response[ $plugin_data['_filename'] ] = (object) $response;
}
}
return $check_for_updates_data;
Expand Down

0 comments on commit 235549c

Please sign in to comment.