Title: AffLoc — Affiliate Link Localization
Author: AffLoc
Published: <strong>2026 年 3 月 30 日</strong>
Last modified: 2026 年 3 月 30 日

---

搜索插件

![](https://ps.w.org/affloc/assets/banner-772x250.png?rev=3494521)

![](https://ps.w.org/affloc/assets/icon-256x256.png?rev=3494521)

# AffLoc — Affiliate Link Localization

 作者：[AffLoc](https://profiles.wordpress.org/affloc/)

[下载](https://downloads.wordpress.org/plugin/affloc.0.2.0.zip)

 * [详情](https://cn.wordpress.org/plugins/affloc/#description)
 * [评价](https://cn.wordpress.org/plugins/affloc/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/affloc/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/affloc/#developers)

 [支持](https://wordpress.org/support/plugin/affloc/)

## 描述

AffLoc is a lightweight, cache-friendly WordPress plugin designed to help you maximize
your affiliate revenue globally. It automatically detects your visitor’s country
via IP and swaps out your affiliate links to match their regional store (e.g., Amazon
US vs Amazon UK), ensuring you never lose a commission due to a “Not Available in
Your Country” error.

#### Features

 * **Automatic Geolocation:** Detects visitor country securely and accurately.
 * **Country-Specific Links:** Assign different URLs for the same offer based on
   the user’s country code.
 * **Cache-Friendly:** Uses a hybrid JavaScript approach so it works perfectly with
   caching plugins (WP Rocket, W3 Total Cache, etc.).
 * **Global Fallback:** Define a default link for countries without a specific mapping.
 * **Easy Shortcodes:** Simply use `[affloc_link slug="your-offer"]` and let the
   plugin handle the rest.

### External Services

This plugin relies on the following external services to function:
 1. **ipapi.co**–
Used to detect the visitor’s country securely over HTTPS by resolving their IP address.
Their privacy policy is available at [https://ipapi.co/privacy/](https://ipapi.co/privacy/).
No personal data other than the user’s IP address and proxy headers is transmitted.
2. **flagcdn.com** – Used to deliver fast and reliable SVG/PNG country flag icons
inside the WordPress Admin Dashboard.

## 屏幕截图

 * [[
 * The **AffLoc admin page** featuring the **Add New Mapping** form (Offer Slug,
   Country search, Affiliate text and URL fields) alongside the sidebar with **White-
   label Shortcode (Pro)**, **Shortcode Helper**, and **Import / Export Mappings**
   tools.
 * [[
 * The **Existing Mappings** table — all mappings grouped by slug/project, showing
   country flags, destination URLs, ready-to-copy shortcodes with a “Copy Shortcode”
   button, creation date, and Edit/Delete row actions.
 * [[
 * Inserting the shortcode into a page using the WordPress block editor (Gutenberg)—
   add a standard **Shortcode** block and paste `[affloc_link slug="your-slug" text
   ="Buy Now"]`.
 * [[
 * The rendered result on the front end — a geo-localised **“Buy Now”** affiliate
   link automatically swapped to the correct regional URL based on the visitor’s
   country.

## 安装

 1. Upload the plugin files to the `/wp-content/plugins/affloc` directory, or install
    the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Navigate to **AffLoc** in your WordPress admin menu.
 4. Add your first mapping (e.g., `slug: amazon`, `country: US`, `url: https://amazon.
    com/...`).
 5. Use the shortcode `[affloc_link slug="amazon" text="Buy Now"]` in your posts or
    pages.

## 常见问题

### Does it work with caching plugins?

Yes! The substitution happens on the client side (in the browser), meaning your 
pages remain fully cacheable.

### Which IP geolocation service is used?

We use the free ipapi.co service with a secure HTTPS connection. The plugin also
caches the location in the user’s browser to minimize API calls and speed up link
swapping.

## 评价

此插件暂无评价。

## 贡献者及开发者

「AffLoc — Affiliate Link Localization」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ AffLoc ](https://profiles.wordpress.org/affloc/)

[帮助将「AffLoc — Affiliate Link Localization」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/affloc)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/affloc/)，查看[SVN仓库](https://plugins.svn.wordpress.org/affloc/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/affloc/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/affloc/)。

## 更新日志

#### 0.2.0

 * Features: Added maximum mapping limit and Affiliate Text shortcode support.
 * Refactoring: Conformed strictly to WordPress Database APIs for SQL queries.

#### 0.1.5

 * Enhancements: Added copy-to-clipboard functionality for shortcodes.
 * Enhancements: Admin UI improvements including country flags, grouping, searching,
   date sorting, and row actions.
 * Security: Switched to secure HTTPS endpoints for IP geolocation.
 * Security: Added comprehensive IP validation including support for Cloudflare/
   Proxies.
 * Performance: Frontend scripts now only load on pages containing the shortcode.

#### 0.1.0

 * Initial Beta release.

## 额外信息

 *  版本 **0.2.0**
 *  最后更新：**2 月前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  语言
 * [English (US)](https://wordpress.org/plugins/affloc/)
 * 标签
 * [affiliate](https://cn.wordpress.org/plugins/tags/affiliate/)[geotargeting](https://cn.wordpress.org/plugins/tags/geotargeting/)
   [links](https://cn.wordpress.org/plugins/tags/links/)[localization](https://cn.wordpress.org/plugins/tags/localization/)
   [redirects](https://cn.wordpress.org/plugins/tags/redirects/)
 *  [高级视图](https://cn.wordpress.org/plugins/affloc/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/affloc/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/affloc/reviews/)

## 贡献者

 *   [ AffLoc ](https://profiles.wordpress.org/affloc/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/affloc/)