Get optimization statistics is a WordPress ability from Imagify — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Get optimization statistics
Read-onlyReturns aggregate optimization savings for both WordPress media and custom (non-Media-Library) folders.
Requires the Imagify plugin on WordPress 6.9+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). Most abilities are gated by the Imagify 'manage' capability, resolved through Imagify's own capability abstraction (honors the imagify_capacity filter and multisite network-admin logic; equivalent to manage_options by default); the bulk-optimize, generate-missing-nextgen, and restore-media abilities instead check the WordPress 'manage_options' capability directly.
What it does
This ability returns site-wide optimization statistics split into two groups: 'wp' (images optimized through the WordPress Media Library) and 'custom-folders' (images optimized from Imagify's custom folder feature). For each group it reports the count of optimized files, the count of files that errored, the total original and optimized size in bytes, and the overall savings percentage. Use it to summarize the impact Imagify has had on a site's image weight, or to check whether a bulk optimization run produced meaningful savings.
See it in action
You ask your AI assistant
"How much space has Imagify saved across my media library and custom folders?"
Returns
An object with 'wp' and 'custom-folders' sub-objects, each containing 'count_optimized', 'count_errors', 'original_size', 'optimized_size' (bytes), and 'savings_percent'.
Permission
The current user must have the Imagify 'manage' capability.
More Imagify abilities
Bulk optimize
Schedules a bulk image-optimization run across the WordPress media library or Imagify's custom folders.
Generate missing next-gen versions
Queues generation of missing WebP/AVIF versions for every already-optimized image on the site.
Get account status
Reports the connected Imagify account's plan, quota consumption, and API key validity.
Get media optimization status
Retrieves the optimization status and size metrics for a single media library attachment.
Get next-gen format coverage
Reports how many optimized images are still missing a next-gen (WebP/AVIF) version and which next-gen format is configured.
Get plugin settings
Returns Imagify's current configuration options, with the API key redacted.