Skip to content
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
10 changes: 10 additions & 0 deletions src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ public function init() {
*/
public function pre_set_transient( $transient ) {
if ( property_exists( $transient, 'checked' ) && ! empty( $transient->checked ) ) {
// Use the checked version as fallback when product_version is not yet set
// (e.g. pre_set_transient fires before the init hook).
if ( empty( $this->integration->product_version ) && isset( $transient->checked[ $this->integration->product_file ] ) ) {
$this->integration->product_version = $transient->checked[ $this->integration->product_file ];
}

if ( empty( $this->integration->product_version ) ) {
return $transient;
}

$response = $this->integration->client->updates();

if ( ! is_wp_error( $response ) && ! empty( $response['updates'] ) ) {
Expand Down
Loading