Load any CDN library in WordPress without writing code
Set up a library importer WordPress sites can manage visually: pick GSAP, Alpine.js, Font Awesome or 236 other templates, choose the exact version from the CDN's own release list, and decide whether it loads from the CDN, as a local copy on your own server, or inline in the page — no functions.php required.
- 240 catalog templates across 14 categories, 33 with starter code.
- Live version picker for jsDelivr and cdnjs-hosted libraries.
- Optional local hosting — static file or inline — instead of the CDN.
- Toggle, duplicate or reorder any library without touching code.
Library importer WordPress: what does the module actually manage?
This is what a library importer WordPress sites get with TheOneWP: TOWP_Library_Importer stores a list of external script and stylesheet URLs — either typed in manually or picked from a 240-template built-in catalog — and loads each one exactly where it was configured: frontend, backend, both, or the login page, in the head or the footer. For jsDelivr and cdnjs addresses, a live version picker reads the CDN's own release list and rewrites the URL to match. Each library can also be delivered as a locally hosted static file, printed inline into the page, duplicated, reordered by drag and drop, or toggled on and off — all through one admin screen with no theme or plugin file editing involved.
Adding one CDN script usually means editing code
Loading a single library from a CDN normally means writing a wp_enqueue_scripts callback, picking a hook priority, and deciding head versus footer by hand — for every library, on every site.
A hardcoded script tag is easy to forget about
A library added directly into a theme file has no on/off switch and no record of why it is there, so it tends to outlive the feature it was added for.
Site builders and marketers cannot add a library themselves
Wanting to try Alpine.js or a new icon set for a landing page usually means asking a developer, even for something as simple as one script tag.
A visual catalog, not a code edit
The module turns "add this CDN library" into a form: pick from the catalog or paste a URL, choose where it loads, and it is live.
240 templates, ready to use
Popular frameworks, icon sets and utilities are already configured with the right URL, type and default placement.
Precise placement control
Frontend, backend, both, or the login page, each with independent head or footer placement.
Reversible, not permanent
Every library has its own switch — testing a new library never means committing to a code change.
The complete library importer WordPress feature set
Every capability below is present in the class, its catalog data or the admin view.
240 templates, 14 categories
CSS frameworks, icons, animation, the full GSAP plugin suite, JS utilities, UI components, 3D/WebGL, fonts and more — each pre-filled with its correct URL and type.
Starter code for 33 templates
Libraries like AOS, GSAP ScrollTrigger, Chart.js and Swiper include a ready init snippet shown right in the catalog.
Four locations, two positions
Frontend, backend, both, or the login page; head or footer — set independently for every library.
Live version picker
For jsDelivr and cdnjs addresses, a dropdown lists every published version straight from the CDN's own API, and picking one rewrites just the version segment of the URL.
Local hosting: static file or inline
Instead of linking the CDN, a library can be downloaded once and served from this site as a linked file, or printed directly into the page as inline code.
Drag-and-drop load order
Reordering updates the stored list directly, so libraries that depend on another loading first — like every GSAP plugin needing GSAP Core — can be sequenced correctly.
Per-library enable toggle, and duplicate
Switch a library off without losing its configuration, or duplicate it — the copy is created switched off, so nothing double-loads by accident.
Automatic type detection
Leave the type as "auto" and the module infers script or style from the URL's file extension.
Add a library importer WordPress template in four steps
Browse the catalog, place it correctly, and confirm it loaded before building on top of it.
Browse or search the catalog
Filter by category or search by name across all 240 templates to find the library you need.
Choose location and position
Pick frontend, backend, both, or login page, and head or footer — the catalog pre-fills sensible defaults.
Add it and check the starter snippet
If the template includes example code, copy it into your theme or a code snippet to initialize the library.
Reorder if load sequence matters
Drag a dependency, like GSAP Core, above the plugins that require it.
Where a visual library manager saves real time
The module fits any workflow that currently means editing a theme file to add one script tag.
Landing pages with scroll animations
Add GSAP Core plus ScrollTrigger from the catalog and copy the included starter snippet to get moving elements without a build step.
Agencies standardizing a stack across clients
Reuse the same catalog picks — Alpine.js, Swiper, Font Awesome — consistently across every client site without repeating manual enqueue code.
Admin dashboards needing a chart library
Load Chart.js on the backend only, so it never ships to frontend visitors who will never see it.
A CDN library manager anyone on the team can use
Every design choice in the verified code favors a visual, reversible workflow over a code change.
Nothing loads where it wasn't asked to
The verified implementation only prints what each library's own location setting allows.
Location-gated enqueueing
A library set to "Backend" never enqueues on the frontend, and vice versa — each of the four hooks checks the item's own location first.
Disabled means never loaded
An item with its toggle off is skipped entirely in every enqueue method — no dead script tag left in the markup.
No forced cache-busting parameter
Omitting the version string lets the CDN's own caching and versioning behave exactly as that library's provider intended.
Version lists cached for 12 hours
A CDN's published-versions list is fetched once and held in a transient for 12 hours — a failed lookup is remembered for only 5 minutes, so a slow CDN is not retried on every keystroke.
Local copies re-download only when needed
A static or inline library is fetched again when it is newly switched on, when its URL changes, or when the file has gone missing — not on every save.
Every URL validated, every action capability-gated
Loading external code is inherently an admin-trust feature — the code enforces that boundary consistently.
manage_options on every action
Adding, editing, deleting, toggling and reordering libraries all require the same administrator-level capability.
Real URL validation, not just formatting
wp_http_validate_url() checks that a submitted URL is a genuinely well-formed http:// or https:// address before it is ever saved.
Escaped on save and on output
URLs pass through esc_url_raw() when stored and esc_url() again at the point they are printed, on every surface including the login page.
Non-guessable library IDs
Each new library gets an ID built from random_bytes(6), not a predictable counter.
Local copies stored in a hardened, execution-blocked folder
Downloaded files live in their own uploads/theonewp-libraries folder, which gets a blank index.php and an .htaccess denying any .php request — even though only .css and .js are ever written there.
Works with core enqueueing everywhere WordPress allows it
The supplied code integrates through native WordPress hooks, falling back to direct output only where core's own system does not reach. No compatibility claim beyond the verified implementation is assumed.
wp_enqueue_scripts / admin_enqueue_scripts
Standard core enqueue hooks handle every library targeting the frontend, the backend, or both.
login_head / login_footer
Libraries targeting the login page print directly through these hooks, since the standard enqueue system does not apply there the same way.
Shared toast notifications
Save, delete and toggle actions use the same towp-toast.js feedback pattern other TheOneWP admin screens rely on.
jsDelivr Data API & cdnjs API
The version picker calls these two CDN APIs directly with wp_remote_get(), and treats a failed or slow response as simply "no versions available" rather than an error.
TheOneWP versus common alternatives
Compare a real library importer WordPress implementation with typical hardcoded enqueue snippets or a dedicated CDN-loading plugin.
| Capability | TheOneWP Library Importer | Other common solutions |
|---|---|---|
| Adding a library | Pick from 240 templates or paste any URL, no code | Usually a functions.php snippet per library |
| Placement control | Frontend, backend, both or login page; head or footer | Depends entirely on how the snippet was written |
| Starter code | 33 templates ship with a ready init snippet | Usually requires finding the library's own docs |
| Version control | Live picker for jsDelivr/cdnjs, reading real published versions | Usually means editing the version number in a URL by hand |
| Local hosting | Optional static file or inline, with automatic CDN fallback | Typically requires a separate asset-optimization plugin |
| Load order | Drag-and-drop reordering built in | Reordering means editing hook priorities in code |
| Turning a library off | One toggle, instantly reversible | Usually means commenting out or deleting code |
| Administration | One TheOneWP screen, submenu or standalone | May require a separate plugin and its own settings |
Add libraries without slowing the site down
A CDN library manager still benefits from a few deliberate choices.
Scope location as narrowly as possible
A library only needed in wp-admin should be set to "Backend," not "Both," so frontend visitors never load it.
Respect dependency order
Load GSAP Core above any GSAP plugin, and any framework core above plugins that extend it.
Turn off what you are not using
A library added to test something and forgotten still loads on every matching page until it is toggled off.
Use the starter snippet as a starting point
The included code is meant to be adapted to your actual markup and IDs, not pasted in unchanged.
Avoid assumptions the code does not support
The module has a defined, verified scope — a few assumptions outside it cause confusion.
Assuming there is a CDN domain whitelist
There is not. Any well-formed http(s) URL is accepted — the actual protection is that only manage_options users can add one at all.
Adding a plugin without its dependency
A GSAP plugin without GSAP Core loaded first, and ordered first, will not work — the module does not add missing dependencies automatically.
Expecting the starter snippet to run itself
Snippets are reference code shown in the catalog; they still need to be copied into your theme or a code-snippet manager to actually execute.
Expecting a version picker on every URL
It only appears for addresses matching jsDelivr's or cdnjs's own URL pattern. A library from another CDN, like the Tailwind Play CDN, has no version to pick — the field simply stays hidden.
Turning static file off and expecting the copy to stay
Switching a library back to loading straight from the CDN deletes its local copy on save — re-enabling it later downloads it again rather than restoring the old file.
Library Importer FAQ
These answers come directly from the verified class, its catalog data and the admin view.
What does Library Importer actually load?
Any external script or stylesheet URL an administrator adds, either picked from a built-in catalog of 240 templates or entered manually. Each one gets a location (frontend, backend, both, or the login page) and a position (head or footer).
How big is the built-in catalog?
240 templates across 14 categories: CSS frameworks, icon sets, animation libraries, the full GSAP plugin suite, JS utilities, UI components, 3D/WebGL, fonts, code editors, file upload, form validation, JS frameworks, layout tools and charting libraries.
Do catalog templates come with example code?
Many do. 33 of the 240 templates include a ready-to-use starter snippet — enough to initialize the library correctly, shown as a reference in the catalog and never injected automatically.
Why do catalog scripts default to loading in the head instead of the footer?
Because a starter snippet often needs the library's global object to exist immediately. get_templates() explicitly forces every script template to the head position so any accompanying inline init code has something to call.
Can Library Importer load a library on the login page?
Yes. Setting a library's location to "Login page" prints its <link> or <script> tag directly in login_head or login_footer, since the login screen does not go through the normal wp_enqueue_scripts flow the same way the rest of the site does.
Is there a whitelist of allowed CDN domains?
No. Any URL that passes wp_http_validate_url() — meaning a well-formed http:// or https:// address — is accepted. The feature itself is gated behind the manage_options capability, so only trusted administrators can add a URL at all.
What happens to the version query parameter WordPress normally adds?
It is intentionally left out. do_enqueue() passes null as the version for every library, so WordPress does not append its own ?ver= string — respecting whatever versioning the CDN URL already has instead.
Can I turn a library off without deleting it?
Yes. Every library has its own enabled toggle, switched through the same AJAX action used for adding and editing — no need to delete and re-add it later.
Which libraries get a version picker?
Only ones hosted on jsDelivr or cdnjs, since those are the two CDNs whose URLs the module knows how to read a package name and version out of. For anything else — a CDN like Tailwind Play, or a custom URL — there is no version to choose, so the field stays hidden.
How does the version picker know what versions exist?
It asks the CDN directly: jsDelivr's own data API for jsDelivr addresses, cdnjs's API for cdnjs ones. The result is cached for 12 hours so switching between libraries in the form does not repeatedly hit the CDN.
What does "static file" actually do?
It downloads the library once and saves it in a dedicated uploads folder on your own site, then links to that local copy instead of the CDN. If the download fails, the library still loads from the original CDN address rather than breaking the page.
What does loading a library "inline" mean?
Instead of a linked file, the library's downloaded code is printed directly into the page through wp_add_inline_style() or wp_add_inline_script() — no separate request for that file at all.
Stop hardcoding script tags.Pick, place and toggle libraries visually.
Use a library importer WordPress teams can share: a 240-template catalog, precise placement, and a switch for every library instead of a code edit.

