Linux 软件免费装
Banner图

Custom Code

开发者 bhagirath25
更新时间 2026年11月2日 00:58
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

custom code code snippets header footer code ai code generator php snippets

下载

2.0.0 2.0.1 2.0.2 2.0.3 2.0.4

详情介绍:

Custom Code by WALoops: Snippets & AI Code. Pick a ready-made snippet, write your own, or (with Custom Code Pro) describe what you want and the AI writes the code. It is the safe way to add code to WordPress without editing your theme. Paste a tracking script into the header, change how WooCommerce works with a PHP snippet, restyle a page with CSS, or let the Pro AI writer do it for you. Your snippets survive theme updates, can be switched off with one click, and a broken PHP snippet switches itself off instead of taking your site down. Crash protection that actually works The number one fear with code snippets is a white screen and a locked-out admin. Custom Code is built so that never sticks: AI snippet writer (Custom Code Pro) The AI writer, explainer and fixer are part of Custom Code Pro. The free plugin shows where they live, so you can see what you get. Describe what you want in plain words, in any language: "show a WhatsApp button under the price on product pages", "redirect customers to their account after login", "hide the coupon field on the cart". The AI picks the right type, location and conditions for your site, writes the code, explains it and tells you how to test it. Its snippet always arrives in test mode. 100+ ready-made snippets The library covers what people search for most, each one tested and filled in through a short form: 200+ places to put code Show it only where it belongs Combine rules with AND and OR: page type, post type, specific posts and pages, categories and tags, page template, author, URL, logged-in or not, user role, device, language (WPML and Polylang) and WooCommerce pages (shop, product, cart, checkout, order received, my account). Works inside every page builder Place a snippet with the Custom Code block, a native Elementor widget, Bricks element, Beaver Builder module, WPBakery and Avada elements, a classic widget, or the [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: Smart tags Use {{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

安装:

  1. Install Custom Code from Plugins → Add New, or upload the folder to /wp-content/plugins/.
  2. Activate it. A "Custom Code" menu appears in the admin.
  3. Add a snippet from the Library, or click Add new and paste your own.
Upgrading from Custom Code 1.x: your existing snippets are moved over automatically and keep running in the same place.

屏幕截图:

  • The editor: PHP, HTML, CSS, JavaScript or text, with test mode and the "Is it running?" check.
  • Snippet library with 100+ ready-made snippets you fill in through a short form.
  • Where it goes (200+ locations) and when it runs (conditions with AND / OR groups).
  • Import from WPCode, Code Snippets, Header Footer Code Manager and Simple Custom CSS and JS.
  • Settings: alerts, safe mode and cleanup.

升级注意事项:

2.0.0 A complete rewrite with PHP snippets, crash protection, an AI writer and a snippet library. Your existing snippets move over automatically. Fixes the 1.x bug that blanked page content.

常见问题:

Will a bad PHP snippet break my site?

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.

My site is broken and I cannot reach the admin. What now?

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.

Do snippets keep running if I deactivate the plugin?

No. Deactivating Custom Code stops every snippet immediately.

Does it slow my site down?

No database queries on page views: snippets are compiled into files that PHP caches in memory. Only snippets whose conditions match run.

Does it work with page caching?

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.

Is the AI writer free?

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.

Who can manage snippets?

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.

Does it work with the WooCommerce Cart and Checkout blocks?

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.

Can I move snippets to another site?

Yes: Import / Export → Export all snippets, then import the file on the other site. Pro's cloud library keeps them in sync across sites.

更新日志:

2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.1