plugin updates

This commit is contained in:
Tony Volpe
2024-11-15 13:53:04 -05:00
parent 1293d604ca
commit 0238f0c4ca
2009 changed files with 163492 additions and 89543 deletions

View File

@@ -40,7 +40,30 @@ function update_imagify_user( $data ) {
* @return object
*/
function get_imagify_user() {
return imagify()->get_user();
$user = get_transient( 'imagify_user_cache' );
if ( false !== $user ) {
return $user;
}
$user = imagify()->get_user();
// Fill user object with missed details before saving the transient.
if ( is_wp_error( $user ) ) {
$user->id = 0;
$user->email = '';
$user->plan_id = 0;
$user->plan_label = '';
$user->quota = 0;
$user->extra_quota = 0;
$user->extra_quota_consumed = 0;
$user->consumed_current_month_quota = 0;
$user->next_date_update = null;
$user->is_active = false;
$user->is_monthly = false;
}
set_transient( 'imagify_user_cache', $user, 5 * MINUTE_IN_SECONDS );
return $user;
}
/**