get_site_options(); $ai_quota = (is_object($site_options) && isset($site_options->aiQuota)) ? $site_options->aiQuota : null; $is_preview = !$gated && $ai_quota !== null; $data = null; $err = null; if ($gated || $is_preview) { $resp = $client->get_plugin_images(array( 'page' => $page, 'perPage' => $perPage, 'filter' => $filter, )); if (is_wp_error($resp)) { $err = $resp->get_error_message(); } else { $data = $resp; } } AllAccessible_Debug::console('ImageManagerPage', array( 'gated' => $gated, 'filter' => $filter, 'page' => $page, 'per_page' => $perPage, 'is_error' => $err !== null, 'error' => $err, 'data_keys' => is_array($data) ? array_keys($data) : null, 'image_count' => is_array($data) && isset($data['images']) ? count($data['images']) : null, 'total' => is_array($data) && isset($data['total']) ? $data['total'] : null, )); ?>