WPRuby Logo WPRuby
Log in Get started
  • Plugins
  • Themes
  • Docs
  • Blog
    • eCommerce
    • Plugins
    • How to
    • Coding
  • Affiliate Area
  • Contact Us
  • About Us
  • Plugins
  • Themes
  • Docs
  • Blog
    • eCommerce
    • Plugins
    • How to
    • Coding
  • Affiliate Area
  • Contact Us
  • About Us

WPRuby Account

4
  • How to upgrade your license
  • How to renew your license
  • How to change your plugin’s license domain
  • How to cancel your subscription.

WooCommerce Australia Post Shipping Method Pro

14
  • Installation
  • How to activate your Australia Post Pro license
  • How to Upgrade from Free to Pro
  • Australia Post Zone Settings
  • Australia Post Global Settings
  • Australia Post Tracking
  • Pre-Paid Satchels
  • How to Mark a Product to be Shipped Individually?
  • Troubleshooting and common issues
  • Available WordPress Actions and Filters
  • [Labels Pro] How to connect the plugin with your MyPost Business account
  • [Labels Pro] How to connect Labels Pro with your eParcel account
  • [Labels Pro] How to print labels and create shipping orders.
  • [Labels Pro] How to Mark a Product as Containing Hazardous Materials?

WooCommerce Custom Payment Gateway Pro

11
  • Getting Started
  • Custom Payment Gateway Settings
  • Custom Checkout Field Builder
  • Conditional Display Rules
  • Sending Payment Data to an External API
  • How to Create a Pay by Invoice Payment Method
  • How to Create a Manual Payment Link or Review-Based Payment Method
  • Troubleshooting
  • Frequently Asked Questions
  • Security and Sensitive Payment Data
  • How to Upgrade from Free to Pro

WooCommerce Royal Mail Shipping Calculator Pro

4
  • Installation
  • Settings
  • Troubleshooting and common issues
  • How to activate your plugin license

Controlled Admin Access Pro

3
  • Available Actions for a Restricted Admin
  • Installation
  • Settings

WooCommerce Address Guard Pro

7
  • Get Started
  • Configuring Address Providers
  • Configuring Checkout Validation
  • Creating Address Rules
  • Customizing Customer Messages
  • Using the Address Tester
  • Reviewing Address Quality Inside WooCommerce Orders

WooCommerce Simple Table Rates Pro

8
  • Installation
  • Settings
  • Rules and Actions
  • How to Setup Weight Based Shipping
  • How To Setup Shipping By Shipping Class
  • How to Setup Shipping by Cart Total
  • How to Setup Shipping by Product
  • How to Setup Shipping by Product Category

WooCommerce Pack IQ

5
  • Installation
  • How to activate your plugin license
  • How to add a new box
  • How to change the boxes weight and dimensions units
  • How to view the packing results

WooCommerce Restricted Shipping and Payment Pro

4
  • Installation
  • Setting Up Shipping Methods Conditions
  • Available Shipping & Payment Rules
  • Setting Up Payment Gateways Conditions

Affiliate Butler PRO

11
  • Installation and Upgrade
  • Quick Start Guide
  • Managing Auto Links
  • Link Types
  • Short Links
  • Auto Link in the Block Editor
  • Statistics
  • Import and Export
  • Settings
  • Frequently Asked Questions
  • Developers

WooCommerce Adyen Payment Gateway

2
  • Setup the Adyen payment gateway
  • How to configure Adyen Webhook notifications? 

WooCommerce Free Shipping Per Product

2
  • Installation
  • How to setup free shipping for a certain product

WooCommerce UPS Shipping Method Pro

10
  • Installation
  • How to get your UPS Client ID and Client Secret
  • UPS Center Settings
  • UPS Zone Settings
  • How to ship an order and print UPS labels
  • Managing UPS shipments
  • UPS tracking numbers and order completion
  • Shipping Health checks
  • How to activate your UPS license
  • Troubleshooting common issues

Delivery Promise for WooCommerce

9
  • Getting Started
  • Understanding Processing Time vs Transit Time
  • Setting the Cutoff Countdown
  • Configuring Default Delivery Estimates
  • Creating Delivery Rules
  • Setting Working Days and Holidays
  • Using Rule Presets
  • Product-Level Lead Times
  • Why the “Order Within” Countdown Is Not Showing

Cartavera

16
  • Cartavera documentation
  • Install Cartavera
  • Activate your licence
  • Import a starter site
  • Styles, colours and fonts
  • Headers and footers
  • The homepage
  • Catalog and filters
  • The product page
  • Cart and checkout
  • Translation and right-to-left languages
  • Child themes
  • Hooks and filters reference
  • Troubleshooting
  • FAQ
  • Changelog

Candy Shop

14
  • Candy Shop documentation
  • Install Candy Shop
  • Activate your licence
  • Import a starter site
  • Set up your products
  • Food information and allergens
  • Shop pages and filters
  • Styles, colors and fonts
  • Headers, footers and menus
  • The homepage
  • Child theme
  • Hooks and filters
  • FAQ
  • Changelog

Foliowick

16
  • Foliowick documentation
  • Install Foliowick
  • Activate your licence
  • Import a demo store
  • Authors and author pages
  • Book details and editions
  • Genres, reading lists and the Editor’s Pick
  • Secondhand copies and forthcoming books
  • Shop pages, search and book pages
  • Styles, colors and fonts
  • Headers, footers and menus
  • The homepage
  • The journal and editorial pages
  • Hooks and filters
  • FAQ
  • Changelog

Gemelune

14
  • Gemelune documentation
  • Install Gemelune
  • Activate your licence
  • Import a starter site
  • Metals, sizes and swatches
  • Size guide, delivery and care pages
  • Shop pages, product cards and product pages
  • Styles, colors and fonts
  • Headers, footers and menus
  • The homepage
  • Child theme
  • Hooks and filters
  • FAQ
  • Changelog

Formafern

15
  • Formafern documentation
  • Install Formafern
  • Activate your licence
  • Import the demo store
  • Finishes and swatches
  • Dimensions, materials and care
  • Rooms and Shop the Room
  • Shop pages, product cards and product pages
  • Styles, colors and fonts
  • Headers, footers and menus
  • The homepage and editorial pages
  • Child theme
  • Hooks and filters
  • FAQ
  • Changelog

Pawtani

15
  • Pawtani documentation
  • Install Pawtani
  • Activate your licence
  • Install a starter site
  • Pets, sizes, flavours and product facts
  • Size & fit guides
  • Shop pages, filters and product pages
  • Repeat purchases, subscriptions and wishlists
  • Styles, colors and fonts
  • Headers, footers and menus
  • The homepage
  • Child theme
  • Hooks and filters
  • FAQ
  • Changelog

Deep Insights for WooCommerce

19
  • Getting Started with Deep Insights for WooCommerce
  • Upgrading from Woo Insights
  • Importing Your Order History
  • Dates, Comparisons and Filters
  • Revenue Report
  • Products Reports
  • Customer Reports
  • RFM Customer Segments
  • Retention and Cohorts
  • Profitability and Cost of Goods
  • Subscriptions Analytics
  • Inventory Intelligence
  • Shipping, Discounts and Refunds
  • Automated Insights
  • Settings Reference
  • Why Numbers Can Differ from WooCommerce Analytics
  • Troubleshooting
  • Privacy, Security and Updates
  • Developer Hooks
WooCommerce GLS Canada Shipping Pro

WooCommerce GLS Canada Shipping Pro

11
  • Installation
  • How to get your GLS Canada API access
  • GLS Canada Centre settings
  • Adding GLS Canada to a shipping zone
  • How to create a GLS shipment and print the label
  • Creating GLS labels in bulk
  • Requesting GLS pickups
  • GLS tracking for you and your customers
  • Shipping Health checks
  • How to activate your GLS Canada license
  • Troubleshooting common issues
WooCommerce Canada Post Extension PRO

WooCommerce Canada Post Extension PRO

17
  • Installation
  • Demo mode, Test API mode and going live
  • How to connect your Canada Post account
  • Canada Post settings
  • Adding Canada Post to a shipping zone
  • Boxes, packing and product shipping options
  • Canada Post at checkout: rates, Deliver to Post Office and address lookup
  • How to create a Canada Post shipment and print the label
  • International shipments and customs
  • Creating Canada Post labels in bulk
  • Manifests: closing out the day
  • Canada Post tracking for you and your customers
  • Canada Post returns
  • Requesting Canada Post pickups
  • Dashboard, Shipments, Rate Calculator and Post Offices
  • How to activate your Canada Post licence
  • Troubleshooting common issues
View Categories
  • Home
  • Knowledge Base
  • Affiliate Butler PRO
  • Developers

Developers

Waseem
Updated on November 15, 2026

4 min read

0:00 / 4:11
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

This page is for developers who want to extend Affiliate Butler Pro or connect it to other tools. You don’t need any of it to use the plugin.

Table of Contents

Toggle
  • Files
  • REST API
  • Filters
  • Actions
  • JavaScript event
  • Translations

Files

  • affiliate-butler-pro.php: the main plugin file.
  • src/: the plugin code, in the AffiliateButlerPro namespace: the links and the replacement of the keywords (Links/), the click stats (Stats/), the REST API (Rest/), the admin screens (Admin/) and the licence (Licence/).
  • public/: the short links redirect and the content filters.
  • build/: the compiled scripts and styles of the admin screens, the block editor and the site.
  • languages/: the translations, and the affiliate-butler-pro.pot template to make your own.
  • includes/: the updater, which installs updates from WPRuby when your licence is active.
  • uninstall.php: deletes the plugin’s data when the plugin is deleted and the “Delete all data” setting is on.

Auto links are posts of the lar_link post type, and their categories are terms of the links_category taxonomy. The clicks are in the {prefix}abutler_clicks table. Please edit links through the admin or the REST API, which check and sanitize them.

REST API

Every route is under /wp-json/affiliate-butler/v1 and uses the usual WordPress authentication (cookie and nonce, or application passwords).

Method Route What it does Capability
GET /links Lists the links. Query: page, per_page, search, status. edit_posts
POST /links Creates a link. edit_posts
GET /links/{id} Reads a link, with all its fields. edit_post
PUT /links/{id} Updates a link. Fields you leave out keep their value. edit_post
DELETE /links/{id} Moves a link to the Trash, or deletes it with force=true. delete_post
GET /links/{id}/occurrences The posts that contain the link’s keywords. edit_post
GET /links/{id}/stats The clicks of a link. Query: days. manage_options
POST /import Imports a JSON or CSV file sent in content. dry_run=true only checks it. edit_posts
GET /settings Reads the settings. manage_options
POST /settings Changes the settings. manage_options

A link is a JSON object with the fields of the link editor. GET /links/{id} shows all of them. For example, to create an external link with a short link:

POST /wp-json/affiliate-butler/v1/links
{
  "keywords": [ "web hosting" ],
  "type": "external",
  "target_url": "https://example.com/?ref=me",
  "short_link_enabled": true
}

Invalid fields return a 400 error with a message per field in data.errors.

Filters

Filter and arguments Use
abutler_track_clicks
$track, $link_id
Return false to not record a click, e.g. until the visitor accepts your cookie banner.
abutler_is_bot
$is_bot, $user_agent
Decide which visitors are bots; their clicks aren’t counted.
abutler_visitor_country
$country
The visitor’s two-letter country code, when your host passes it in another header.
abutler_stats_capability
$capability
Who can see the stats, manage_options by default.
abutler_redirect_status
$status, $link_id
The HTTP status of a short link redirect.
abutler_forward_params
$params, $url
The query parameters a short link passes on to its URL.
abutler_rotation_target
$url, $rotation, $link_id
The URL a rotating short link sends the visitor to, e.g. to keep returning visitors on the same one.
abutler_share_networks
$networks, $link_id
The buttons of the share boxes: name => array( label, share URL ).
abutler_disable_box_screens
$post_types
The post types that have the “Disable auto links in this post” option.
abutler_replace_content
$html
The content after the keywords were linked.

For example, to let editors see the stats:

add_filter( 'abutler_stats_capability', function () {
  return 'edit_others_posts';
} );

Actions

  • abutler_click_recorded( $link_id, $post_id ): after a click is saved.
  • lar_link_redirected( $link_id, $target ): before a short link redirects; $target is the URL a rotating link picked, empty for the others.

JavaScript event

Every click on an auto link fires an abutler:click event on document, so your own scripts can react to it, for example to send the click to another analytics tool:

document.addEventListener( 'abutler:click', ( event ) => {
  const { linkId, postId, url, text } = event.detail;
  // e.g. plausible( 'Affiliate click', { props: { url } } );
} );

Translations

The text domain is affiliate-butler-pro. The translations are in the plugin’s languages/ folder: a .po and .mo file per language, and .json files for the admin screens. To translate the plugin into a new language, start from affiliate-butler-pro.pot and send us your file, we’ll ship it in the next update.

This guide is for

Affiliate Butler Pro

Link your keywords to affiliate, internal or external links automatically, with short links, URL rotation and click stats.

From US$59.00

See features and pricing
Frequently Asked Questions
WPRuby Logo WPRuby

In 2015, WPRuby was established as an independent agency where we focus on producing and supporting many WordPress plugins. Each product we develop is simple to use and easy to customize and backed by awesome support and regular updates.

Resources

  • Knowledge Base
  • Affiliate Area
  • About Us
  • Nomad Jar
  • GarnerDocs
  • UnavailableToday

Legal

  • Privacy Policy
  • Terms of Use

Follow us

  • Github
  • X.com
  • LinkedIn
  • Facebook

© 2026 - WPRuby