A smart WordPress plugin that automatically replaces jsDelivr, unpkg, and cdnjs CDN links with the Iranian ArvanCloud CDN.
Given the current internet situation in Iran and unstable connectivity or complete outages that both users and hosting providers face, WordPress sites often fail to load essential JS and CSS files from foreign CDNs like jsDelivr, unpkg, and cdnjs. Fortunately, ArvanCloud has mirrored a large collection of open‑source libraries at lib.arvancloud.ir. This plugin automatically redirects your old CDN links to the correct path on ArvanCloud, fixing broken styles, slow loading, and JavaScript errors.
If you encounter a library that is not in our list or does not work correctly after adding it, please report it on Git. We will do our best to fix it.
Free internet is the right of every human.
- 🔄 Supports multiple CDNs: Detects and rewrites URLs from
cdn.jsdelivr.net,unpkg.com, andcdnjs.cloudflare.com. - 🧠 Smart URL parsing: Extracts package name, version, and file path to build correct ArvanCloud URLs.
- 📚 Pre-configured library map: Over 50 popular libraries (Bootstrap, jQuery, Font Awesome, Swiper, Chart.js, etc.) are mapped by default.
- 🔍 Automatic library search: Uses ArvanCloud's own search engine (
lib.arvancloud.ir/search) to find folder names for new libraries and save them automatically. - 🔧 Automatic file path correction (NEW in 2.1.0): Uses lightweight HTTP HEAD requests to automatically fix common path issues (e.g.,
lib/prefix,.min.jsvs.js). - ⚙️ Easy manual management: Add, edit, or delete custom mappings through a clean settings page.
- 📦 ES Module support: Works with WordPress 6.5+ script modules.
- ⚡ Performance caching: Search results and HEAD request results are cached for 24 hours to keep things fast.
- Upload the
arvancloud-smart-cdnfolder to your/wp-content/plugins/directory. - Activate the plugin from the WordPress admin panel.
- Go to Settings → ArvanCloud CDN to manage mappings and use the search feature.
The plugin starts working immediately. To get the most out of it:
- Auto-Search a Library: Enter a package name (e.g.,
swiper) in the settings page and click Search & Save. The plugin will locate its folder on ArvanCloud. - Add a Manual Mapping: If a library is missing, enter the npm package name and its ArvanCloud folder name.
- No further configuration needed: All enqueued CSS/JS from supported CDNs will be replaced on the fly. The plugin will automatically fix file paths when needed (e.g., removing
lib/or.min).
Does this plugin modify my files?
No, it uses WordPress filters only – nothing is changed in your theme or plugins.
What if a library isn't in the default list?
Use the automatic search, or add it manually from the settings page.
How does automatic file path correction work?
When a CDN URL is replaced, the plugin checks if the resulting file exists on ArvanCloud by sending a lightweight HEAD request. If it returns 404, it tries alternative paths (removing lib/, removing .min, using just the filename, etc.) and caches the correct one for 24 hours.
Is it compatible with all themes?
Yes, as long as they use standard wp_enqueue_script/style methods.
Is ArvanCloud CDN free?
Yes, lib.arvancloud.ir is a free public CDN. Check their terms for details.
Contributions are welcome! Feel free to open an Issue or submit a Pull Request on GitHub.
This plugin is licensed under the GPL v3 (or later).
See LICENSE for more details.
- Thanks to ArvanCloud for their excellent Iranian CDN.
- Developed by Hossein Mohmmadian