| 开发者 |
webberzone
ajay |
|---|---|
| 更新时间 | 2026年8月20日 04:30 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
WP_HTML_Tag_Processor class to efficiently parse and modify links at render time. For everything else — navigation menus, footers, sidebars, widgets, and theme output — a lightweight JavaScript scan runs after the page loads and applies the same rules. It adds appropriate ARIA attributes, visual indicators, and optional JavaScript-based warnings based on your configuration. Your stored content remains untouched — the plugin only alters rendered output and does not interfere with REST API responses or admin editing screens.
Why warn users about external links?
target="_blank" can disorient screen reader userstarget="_blank" linksnofollow, sponsored, ugc, noopener, noreferrer and target="_blank" to external links, affiliate links, or both — no post edits neededWP_HTML_Tag_Processor class to process links at display timeThis plugin assists with user awareness of external navigation. It does not automatically make your website fully accessible or legally compliant.How it works After activation, the setup wizard guides you through the initial configuration. You can also configure the plugin at Settings > WebberZone Link Warnings. Warning Methods:
target="_blank" linksnofollow, sponsored, ugc, open in a new tab, noopener, noreferrer)wzlw-affiliate, wzlw-affiliate-wrapper)wzlw-force-external)webberzone-link-warnings folder to /wp-content/plugins/Out of the box, no. WebberZone Link Warnings only modifies how links are displayed to users and never alters the href attribute or link structure.
If you enable the Link Attributes settings under Settings > WebberZone Link Warnings > Advanced, the plugin will add rel and target attributes to matching links, which is a deliberate SEO signal that you control. Attributes on links inside post content are written server-side and are present in the HTML that search engines download. Attributes on links elsewhere on the page — navigation menus, widgets, footers and other theme output — are applied by the JavaScript scan after the page loads, so they are only visible to crawlers that execute JavaScript.
Yes. The plugin adds screen reader text, ARIA attributes, and (for modal mode) keyboard navigation and focus management.
Yes. WebberZone Link Warnings is translation-ready. It uses standard WordPress translation functions and works with popular multilingual plugins such as WPML and Polylang.
Yes. Post content is processed via standard WordPress filters (the_content and the_excerpt). In addition, a JavaScript scan runs after the page loads and processes any links not already handled by PHP — including output generated by page builders, theme templates, navigation menus, and widgets.
Yes. Copy the template file to your-theme/webberzone-link-warnings/redirect-screen.php to override the default redirect screen with your own design.
Add the class wzlw-force-external directly to the <a> tag:
<a href="/go/partner/" class="wzlw-force-external">Partner link</a>
To force all links inside a container, add wzlw-force-external-wrapper to the wrapper element instead:
<div class="wzlw-force-external-wrapper"><a href="/go/product-a/">Product A</a><a href="/go/product-b/">Product B</a></div>
Both class names are configurable under Settings > WebberZone Link Warnings > Advanced.
Go to Settings > WebberZone Link Warnings > Advanced and use the Link Attributes section. Tick any combination of rel="nofollow", rel="sponsored", rel="ugc", "Open in a new tab", rel="noopener" and rel="noreferrer" under External Links, Affiliate Links, or both.
Attributes already on your links are kept. A link that carries rel="me author" becomes rel="me author nofollow" rather than losing its original values, and a link that already has rel="NoFollow" is not given a second copy — matching ignores case.
noopener and noreferrer are only added to links that actually open in a new tab, either because the link already has target="_blank" or because you enabled the new-tab option. Every option is off by default and nothing is added unless you tick it — the plugin has never rewritten rel on your links before this version.
They are deliberately separate options. Current browsers already imply noopener for target="_blank", so ticking it mainly satisfies security scanners and older browsers and costs you nothing. noreferrer is the one with a behavioural cost: it also stops the referrer being sent, so leave it unticked for affiliate links if your merchant relies on the referrer for attribution.
Add the class wzlw-affiliate directly to the <a> tag:
<a href="https://merchant.example.com/product" class="wzlw-affiliate">Buy now</a>
To mark every link inside a container, add wzlw-affiliate-wrapper to the wrapper element instead:
<div class="wzlw-affiliate-wrapper"><a href="https://merchant.example.com/a">Product A</a><a href="https://merchant.example.com/b">Product B</a></div>
Affiliate links receive both the External Links and Affiliate Links attribute sets. Both class names are configurable and accept comma-separated values under Settings > WebberZone Link Warnings > Advanced.
Note that marking a link as an affiliate link also treats it as external for warning purposes, exactly like the force-external class. An internal cloaked URL such as /go/product/ will show your configured modal, redirect screen or indicator, and a domain on your exclusion list will show a warning if you also give the link an affiliate class.
Add the class wzlw-no-icon to any link where you don't want an icon to appear. For example:
<a href="https://example.com" class="wzlw-no-icon">Link without icon</a>
This suppresses the visual indicator (icon and/or text). The modal or redirect warning still applies if your warning method includes one. Screen reader text and ARIA attributes are still added.
To exclude all links inside a wrapper element (e.g. a navigation block or card), add the class wzlw-no-icon-wrapper to the containing element:
<div class="wzlw-no-icon-wrapper"><a href="https://example.com">Link without icon</a></div>
All links inside that wrapper will have their visual indicators suppressed.
Yes. Go to Settings > WebberZone Link Warnings > Display tab and find the "Icon Style" dropdown. You can choose from several preset icons:
Yes. Go to Settings > WebberZone Link Warnings > Display and set "Modal Frequency" to either "Once per browser session" or "Once every N days". The modal then shows a "Don't show again" checkbox. When a visitor ticks it and clicks Continue, the dismissal is remembered and the link behaves like a normal link on later clicks.
"Dismissal Scope" controls how far that goes. "Per destination domain" suppresses the modal for the domain the visitor dismissed and leaves every other external link alone. "All external links" suppresses it everywhere on the site.
Dismissals live in the visitor's browser, in sessionStorage for the session option and localStorage for the N days option. No cookies are set and nothing is stored against a user account, so the setting is per browser rather than per person. Clearing site data resets it.
The default is "Always show the modal", which is the behaviour from earlier versions.
No. The plugin only alters rendered output. Your stored content remains unchanged.
Your links return to their original state. The plugin doesn't modify your content in the database — it only changes how links are displayed.
Please report security bugs found in the source code of the WebberZone Link Warnings plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.
switch_to_blog() call, such as during network activation or deactivation.rel and target attributes to your links automatically. Pick any combination of rel="nofollow", rel="sponsored", rel="ugc", "Open in a new tab" (target="_blank"), rel="noopener" and rel="noreferrer", configured separately for external links and for affiliate links.rel values are preserved rather than overwritten, and matching ignores case. A link with rel="me author" becomes rel="me author nofollow", and a link that already has rel="NoFollow" is not given a duplicate.noopener and noreferrer are separate options and are only added to links that actually open in a new tab — either because the link already carries target="_blank" or because you enabled the new-tab option. They are kept apart because noreferrer also stops the referrer being sent, which can break referrer-based affiliate attribution, while noopener is a pure security hint.wzlw-affiliate) and Affiliate Link Wrapper Class (default wzlw-affiliate-wrapper) settings mark a single link, or every link inside a container, as an affiliate link. Both accept comma-separated values, and affiliate links receive both the external and the affiliate attribute sets./go/product/ shows the same modal, redirect screen or indicator as a genuine outbound link. This mirrors how the force-external class already behaves and takes precedence over the excluded domains list.WP_HTML_Tag_Processor for post content, and the sitewide JavaScript scan for navigation menus, footers, sidebars, widgets and other theme output.sessionStorage or localStorage. No cookies are set and nothing is written to your database.target="_blank" links inside post content never triggered a warning. Under the "External links and internal links opening in a new tab" scope, PHP marked these links as processed but wrote no data attributes, so the JavaScript scan skipped them as well. The identical link in a navigation menu or widget did get a warning. PHP now mirrors the JavaScript logic and emits data-wzlw-blank for internal new-tab links.*.example.com matches any subdomain of example.com but not the base domain itself. Plain entries (e.g. example.com) match that exact domain only. Add both to exclude a domain and all its subdomains.target="_blank" in scope=both mode no longer incorrectly show a modal or redirect warning when processed by the JavaScript scanner. ARIA attributes are still applied for screen reader accessibility.wzlw-force-external, wzlw-force-external-wrapper, wzlw-no-icon, wzlw-no-icon-wrapper) work everywhere on the page.wzlw-no-icon-wrapper now correctly receive data-wzlw-* attributes so the redirect/modal warning still fires; only the visual icon is suppressed.wzlw-force-external / wzlw-force-external-wrapper class support to force links to be treated as external regardless of automatic detection. Both class names are configurable under Settings > Advanced.wzlw-no-icon and wzlw-no-icon-wrapper class names are now configurable under Settings > Advanced.& separator in HTML output.get_redirect_url() caused malformed redirect URLs.EXAMPLE.COM or example.com. are treated as internal.wzlw-no-icon-wrapper class support — add it to any wrapper element to exclude all links inside it from visual indicators.target="_blank" links.