Skip to content

Commit 6148667

Browse files
author
Marco Pereirinha
committed
Do not try to use WP_Error as plan stats
1 parent 33c46a8 commit 6148667

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

php/class-connect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public function history( $days = 1 ) {
447447
$plan = ! empty( $this->usage['plan'] ) ? $this->usage['plan'] : $this->credentials['cloud_name'];
448448
for ( $i = 1; $i <= $days; $i ++ ) {
449449
$date = date_i18n( 'd-m-Y', strtotime( '- ' . $i . ' days' ) );
450-
if ( ! isset( $history[ $plan ][ $date ] ) ) {
450+
if ( ! isset( $history[ $plan ][ $date ] ) || is_wp_error( $history[ $plan ][ $date ] ) ) {
451451
$history[ $plan ][ $date ] = $this->api->usage( $date );
452452
uksort(
453453
$history[ $plan ],

0 commit comments

Comments
 (0)