onik/lens-wp
Composer 安装命令:
composer require onik/lens-wp
包简介
ONIK Lens WordPress Plugin — optimizes images and YouTube embeds via the ONIK Lens CDN.
README 文档
README
Boost your Google PageSpeed score and pass Core Web Vitals — without touching a single file in your Media Library.
ONIK Lens optimizes every image and YouTube embed on your site and serves them through the ONIK Lens CDN. Modern formats (AVIF/WebP), tailored sizes (mobile & desktop), and delivery from an edge node closest to the visitor.
Why ONIK Lens?
Slow images are the primary reason WordPress sites fail Core Web Vitals like Largest Contentful Paint (LCP). Many image optimization techniques permanently convert your media. ONIK Lens takes a different approach: your original files stay completely untouched. Optimization happens on our edge nodes, saving your server's CPU, disk space, and bandwidth.
Key Features
- Instant results — activate and your images are immediately served in the right format, at the right size (mobile or desktop), and from the edge.
- Modern Formats AVIF, WebP, JPEG — Automatically uses the most efficient format supported by your visitor's browser
- Lightweight & fast — no image processing on your server, no bloated libraries, no background jobs. All the heavy lifting is offloaded to the edge so your server stays fast and lean.
- Non-destructive — your WordPress Media Library is never modified; uninstall by simply deactivating the plugin
- Works everywhere — optimizes images in media, theme assets, Sliders, page builders (Elementor, Divi, Beaver Builder, and more), and any HTML on the page
- Full Control of Lazy Load & Sizing — Configure lazy loading per CSS selector, control how many images load eagerly above the fold, and fine-tune responsive
srcsetbreakpoints to match your design — all from the settings panel. - YouTube Facade — Replaces YouTube embeds with a lightweight screenshot placeholder. The player only loads on click, eliminating the ~500 KB embed penalty on first load — and passing Google Lighthouse's "Facade your YouTube embeds" recommendation.
- Site Preloads for LCP — Inject
<link rel="preload">hints for your most critical above-the-fold assets to directly improve your Largest Contentful Paint (LCP) score.
Requirements
- WordPress 6.0+
- PHP 8.1+
- An ONIK Lens account ($20 CAD/month, included with ONIK Monitoring, 30-day free trial without account or credit card)
Installation
Install in the WordPress Admin
- Download the latest release.
- In your WordPress admin, go to Plugins → Add New → Upload Plugin.
- Select the downloaded ZIP file and click Install Now.
- Click Activate Plugin.
Install via Composer
If you manage your WordPress installation with Composer (e.g. Bedrock or a custom stack):
composer require onik/lens-wp
The plugin will be installed automatically into your plugins directory via composer/installers.
Connect the Plugin to your ONIK Account
The plugin runs in a full-featured free trial the moment it's activated — no account or credit card required. To keep it running on a production site, connect it to your ONIK subscription:
- Log in to app.onik.io. You will have to create an account and register your site if you have not done so already.
- Open your site's details.
- In the left-hand menu, open Lens Image Optimization.
- Copy the site token shown on that page.
- In WordPress, go to Settings → ONIK Lens and find the Connect to ONIK panel on the General tab, paste in the token, and click Connect to ONIK.
Your tenant, site, and CDN URL are filled in automatically once connected.
Configuration
Default settings will work great right out of the box. Tailor the settings in the WordPress admin under Settings → ONIK Lens.
No PHP configuration, no wp-config.php constants, and no manual file edits are required.
More Information
Full documentation, feature guides, and account setup are available at onik.io.
License
GPL-2.0-or-later — see LICENSE
onik/lens-wp 适用场景与选型建议
onik/lens-wp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 194 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「youtube」 「images」 「optimization」 「cdn」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 onik/lens-wp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 onik/lens-wp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 onik/lens-wp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova field for distribute your images as array of object.
Pexels API Client for www.pexels.com
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
♺ Laravel Nova Hashids card. Convert your ids.
Convert and serve jpeg/png to webp with PHP (if at all possible)
统计信息
- 总下载量: 194
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-03-13