Skip to content

Commit

Permalink
force sending the request for user details with the button
Browse files Browse the repository at this point in the history
  • Loading branch information
wordpressfan committed Jun 27, 2024
1 parent 75734be commit 26be399
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions inc/Engine/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,17 @@ public function customer_data() {

$data['license_type'] = rocket_get_license_type( $user );

$data['license_class'] = time() < $user->licence_expiration ? 'wpr-isValid' : 'wpr-isInvalid';
$data['license_expiration'] = date_i18n( get_option( 'date_format' ), (int) $user->licence_expiration );
$data['is_from_one_dot_com'] = (bool) $user->{'has_one-com_account'};
if ( ! empty( $user->licence_expiration ) ) {
$data['license_class'] = time() < $user->licence_expiration ? 'wpr-isValid' : 'wpr-isInvalid';
}

if ( ! empty( $user->licence_expiration ) ) {
$data['license_expiration'] = date_i18n( get_option( 'date_format' ), (int) $user->licence_expiration );
}

if ( isset( $user->{'has_one-com_account'} ) ) {
$data['is_from_one_dot_com'] = (bool) $user->{'has_one-com_account'};
}

return $data;
}
Expand Down
2 changes: 2 additions & 0 deletions inc/Engine/Admin/Settings/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public function refresh_customer_data() {
}

delete_transient( 'wp_rocket_customer_data' );
delete_transient( 'user_information_timeout_active' );
delete_transient( 'user_information_timeout' );

return wp_send_json_success( $this->page->customer_data() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private function delete_timeout_transients() {
* @return array|WP_Error
*/
private function send_remote_request( $api_url, $method, $params, $safe ) {
error_log( 'seding request to: ' . $api_url );
if ( ! $safe ) {
return wp_remote_request( $api_url, $params );
}
Expand Down

0 comments on commit 26be399

Please sign in to comment.