| 开发者 | bhagirath25 |
|---|---|
| 更新时间 | 2026年11月2日 00:58 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<body>, footer, as early or as late as possible.[custom_code id="…"] shortcode in Divi, Oxygen, Breakdance and any other builder.
Fast
Active snippets are compiled into files that PHP keeps in memory, so pages run snippets without a single database query. Options per snippet: minify CSS, load CSS or JS as a cached file, defer or async, wait for page ready, and delay scripts until the visitor's first interaction, which takes heavy chat widgets and pixels off your PageSpeed score.
Built against snippet malware
Attackers who steal an admin login like to hide scripts in snippet plugins. Custom Code makes that hard to miss:
{{page_title}}, {{user_first_name}}, {{product_price}} or, on the order received page, {{order_total}}, {{order_currency}}, {{order_items_json}} and {{order_email_hash}} in HTML and JavaScript snippets. Values are escaped for where they land.
Move from another plugin in one click
Custom Code finds snippets of Code Snippets, WPCode / Insert Headers and Footers, Header Footer Code Manager and Simple Custom CSS and JS on your site and copies them over, switched off until you check them. It also imports Code Snippets export files, and exports your own snippets as JSON.
Custom Code Pro
Pro adds the 16 locked snippets you see in the library (Meta Conversions API, full GA4 e-commerce events, TikTok, Pinterest and Snapchat pixels, Google Ads enhanced conversions, custom checkout fields, payment rules by country and cart, free gifts, quantity discounts, delay all third-party scripts, white-label admin, an exit-intent popup and more), AI that writes about 80–100 snippets a month (no API key needed, or use your own), conditions for schedules, country, UTM source, cookies, cart total and contents and past purchases, unlimited versions with a diff, and a cloud library to reuse snippets on all your sites. See Custom Code Pro.
The free plugin is complete on its own and stays that way: nothing in it is time-limited, and features never move from free to Pro.
Made by WALoops
Custom Code is made by WALoops, the WhatsApp automation platform for online stores. If you run a WooCommerce store, WALoops sends order updates, Cash on Delivery confirmations and abandoned cart reminders on WhatsApp, with an AI agent and a shared team inbox. The free "Order on WhatsApp" and WhatsApp chat button snippets are a good start.
External services
Custom Code does not connect to any outside service for its features. Optional usage sharing is described below. The AI writer is part of the separate Custom Code Pro add-on, which explains what it sends on its own settings screen and on the privacy page.
Library snippets for analytics and ad platforms (Google, Meta, Microsoft) load those platforms' scripts on your site once you add and activate them; they are subject to those platforms' terms.
Usage sharing (optional, off until you allow it) and deactivation feedback: after activation, an admin notice asks whether you want to share usage data with WALoops. Only if you click Allow, the plugin sends to https://app.waloops.com/api/plugin_events.php when you allow it and when the plugin is activated or deactivated: your site's address, the plugin version, your WordPress, PHP and WooCommerce versions, site language, whether it is a multisite, and an anonymous site ID. When you deactivate the plugin, a short form asks why; if you click Submit & Deactivate, the reason you picked and any text you typed are sent to the same address (with your site's address only if you allowed usage sharing). Click Skip & Deactivate to send nothing. No customer or personal data is sent. WALoops privacy policy, terms.
Guides
/wp-content/plugins/.Custom Code checks PHP syntax before it lets a snippet run, catches errors while it runs and switches the faulty snippet off, and even after a fatal error the next page load works again. Test mode lets you try code on your own before visitors see it, and the safe mode link runs no snippets at all if you ever need it.
Open the safe mode link from Settings (it is also in every alert email). If you do not have it, add define( 'WLCC_SAFE_MODE', true ); to wp-config.php, or rename the plugin folder over FTP.
No. Deactivating Custom Code stops every snippet immediately.
No database queries on page views: snippets are compiled into files that PHP caches in memory. Only snippets whose conditions match run.
Yes. After you save a snippet, clear your page cache so visitors get the new version. Device conditions are decided on the server, so with a page cache that does not separate mobile pages, use CSS media queries instead.
No. The AI writer, explainer and fixer are part of Custom Code Pro, with WALoops AI credits for about 80–100 snippets a month and no key needed. Pro sites can also use their own Anthropic API key for no limit from us; Anthropic bills you directly, usually less than a cent per snippet. Everything else in this plugin is free.
Administrators who are allowed to post unfiltered HTML. On multisite, that means super admins. Developers can change this with the wlcc_user_can_manage filter.
The block cart and checkout do not run WooCommerce's classic hooks. Use the "Before a block…" and "After a block…" locations with woocommerce/cart or woocommerce/checkout, or the WooCommerce shopper action events.
Yes: Import / Export → Export all snippets, then import the file on the other site. Pro's cloud library keeps them in sync across sites.