| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository is the working manual, template, validator, and AI instruction pack for building third-party add-ons for BotBlocker Security.
BotBlocker Security is a WordPress anti-bot firewall and proactive protection plugin. It protects login flows, XML-RPC, REST, comments, file requests, payment callbacks, and high-risk traffic with request checks, rules, CAPTCHA, logs, early-init protection, and add-on based extensions.
1.7.5 is the minimum BotBlocker version required for the Add-on API v2 system. New third-party add-ons should target 1.7.5+.
BotBlocker does not load third-party add-ons from this repository or from your source folder. They run only from the WordPress uploads runtime directory after they are uploaded and installed.
The real runtime flow is:
Read docs/botblocker-runtime-contract.md before writing code.
Important timing note: normal active v2 add-ons are still included after the main BotBlocker request check has run. A traffic add-on can participate inside the request cycle only when it explicitly opts into the pre-run contract described in docs/core-hook-integration.md: manifest features must include traffic_decision_provider, manifest runtime.pre_run must name a safe pre-run file, and that file must expose the declared readiness marker plus registration callback.
Weekly-report add-ons (Pusher/Telegram style) need no in-cycle contract at all: they run on their own cron schedule and read statistics from the BotBlocker database. See docs/addon-api-v2.md (Weekly-report add-ons); the built-in bbcs-pusher and bbcs-telegram add-ons are working references.
Traffic-management add-ons are high-risk security and operations code. A bad rule can redirect real visitors, break checkout/payment callbacks, block support/admin workflows, hide BotBlocker challenge or denied pages, create redirect loops, or weaken BotBlocker protection.
Use traffic_decision_provider only when a normal post-check WordPress hook cannot solve the problem. Ship traffic add-ons disabled by default, keep dry_run enabled first, test on staging, document rollback steps, and require explicit administrator review before production redirects, blocks, bypasses, or CAPTCHA decisions are enabled.
From this kit root:
php .\tools\validate-addon.php .\examples\acme-botblocker-sample
php .\tools\validate-addon.php .\examples\acme-traffic-guardValidate a ZIP:
php .\tools\validate-addon.php .\dist\acme-botblocker-sample.zipPowerShell:
.\tools\package-addon.ps1 -AddonPath .\examples\acme-botblocker-sample -DestinationPath .\dist\acme-botblocker-sample.zip
.\tools\package-addon.ps1 -AddonPath .\examples\acme-traffic-guard -DestinationPath .\dist\acme-traffic-guard.zipManual equivalent (Linux/macOS, or WSL on Windows):
zip -r acme-botblocker-sample.zip acme-botblocker-sampleRun manual packaging from the directory that contains the add-on folder. Archive the folder itself, not the files inside it. Do NOT use Compress-Archive on Windows: it writes backslash separators that WordPress unzip_file does not normalize, so the package extracts to literal \-named files on Linux hosting and fails to install. Use tools/package-addon.ps1 (forward-slash entries) or zip -r.
Correct ZIP:
acme-botblocker-sample.zip
acme-botblocker-sample/
bbcs-addon.json
acme-botblocker-sample.php
inc/core.php
inc/settings.php
assets/icon.svg
readme.txt
Wrong ZIP:
acme-botblocker-sample.zip
bbcs-addon.json
inc/core.php
{
"schema": "2.0",
"slug": "vendor-addon",
"name": "Vendor Add-on",
"version": "1.0.0",
"requires_core": "1.7.5",
"requires_php": "7.4",
"author": "Vendor",
"description": "Adds a focused BotBlocker extension with configurable runtime behavior.",
"main": "vendor-addon.php",
"core": "inc/core.php",
"settings": {
"view": "inc/settings.php",
"option": "vendor_addon_settings",
"sanitize": "vendor_addon_sanitize_settings"
},
"lifecycle": {
"activate": "vendor_addon_activate",
"delete": "vendor_addon_delete"
},
"features": [
"vendor_feature_provider"
],
"ui": {
"palette": {
"icon": "puzzle",
"title": "Vendor Add-on",
"priority": 50
}
},
"gateway": {},
"storage": {},
"assets": {
"icon": "assets/icon.svg",
"readme": "readme.txt"
}
}Required fields:
Quality-required fields for normal add-ons:
Third-party v2 settings must use the manifest option array:
<input type="hidden" name="vendor_addon_settings[enabled]" value="0">
<input type="checkbox" name="vendor_addon_settings[enabled]" value="1">Do not copy BotBlocker's built-in plain-field settings such as:
<input type="checkbox" name="disable_emojis" value="1">Those fields work only because BotBlocker core has hardcoded internal save logic for its own built-in options. Third-party add-ons are saved by BotBlockerAddons::saveSettingsFromPost() through settings.option.
settings.view is rendered inside the add-on settings tab on BotBlocker -> Add-ons for active add-ons. It should start with a BotBlocker-style help block and then render grouped controls.
Use this layout:
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$settings = function_exists( 'vendor_addon_settings' ) ? vendor_addon_settings() : array();
$option = 'vendor_addon_settings';
$icon_url = function_exists( 'vendor_addon_asset_url' ) ? vendor_addon_asset_url( 'assets/icon.svg' ) : '';
?>
<div class="row">
<div class="col-xxl-3 col-xl-6 col-lg-6 col-sm-12 col-md-12 bbcs-info-column">
<div class="bbcs-info-inner">
<?php if ( '' !== $icon_url ) : ?>
<img src="<?php echo esc_url( $icon_url ); ?>" alt="" class="img-fluid bbcs-info-image mb-3">
<?php else : ?>
<i class="fa-solid fa-puzzle-piece fa-3x bbcs_color_green mb-3" aria-hidden="true"></i>
<?php endif; ?>
<p class="bbcs-info-text"><?php esc_html_e( 'Explain what the add-on does and where it acts.', 'vendor-addon' ); ?></p>
<p class="bbcs-info-text"><?php esc_html_e( 'Explain what the admin can configure and what data is stored.', 'vendor-addon' ); ?></p>
<hr class="bbcs-info-hr">
<div class="bbcs-info-footer">
<i class="fa-regular fa-circle-question"></i>
<a href="https://botblocker.top/docs/" target="_blank" rel="noopener noreferrer" class="bbcs-info-footer-a"><?php esc_html_e( 'BotBlocker docs', 'vendor-addon' ); ?></a>
<a href="https://botblocker.top/contacts/" target="_blank" rel="noopener noreferrer" class="bbcs-info-footer-a"><?php esc_html_e( 'Support', 'vendor-addon' ); ?></a>
</div>
</div>
</div>
<div class="col-xxl-3 col-xl-6 col-lg-6 col-sm-12 col-md-12">
<h3 class="bbcs_settings_h3"><?php esc_html_e( 'Main', 'vendor-addon' ); ?></h3>
<!-- Controls go here. -->
</div>
</div>Common BotBlocker field wrappers:
Checkbox example:
<div class="bbcs_checkbox_input mb-2">
<div class="bbcs_label_checkbox_box">
<input type="hidden" name="<?php echo esc_attr( $option ); ?>[enabled]" value="0">
<input type="checkbox" name="<?php echo esc_attr( $option ); ?>[enabled]" value="1" <?php checked( 1, $settings['enabled'] ?? 0 ); ?>>
<span class="bbcs_label_input_checkbox"><?php esc_html_e( 'Enable add-on', 'vendor-addon' ); ?></span>
</div>
</div>Text field example:
<div class="bbcs_text_input mb-2">
<div class="bbcs_label_input_box">
<span class="bbcs-label-input"><?php esc_html_e( 'Label', 'vendor-addon' ); ?></span>
</div>
<div class="bbcs_text_input_inner">
<input type="text" name="<?php echo esc_attr( $option ); ?>[label]" class="bbcs_text_input_input" value="<?php echo esc_attr( $settings['label'] ?? '' ); ?>">
</div>
</div>Textarea and select examples are in docs/settings-ui-patterns.md.
Uploaded add-ons live outside the BotBlocker plugin source directory. Do not use plugin_dir_url() for package assets.
Use:
function vendor_addon_asset_url( string $relative ): string {
return class_exists( 'BotBlockerAddons' )
? BotBlockerAddons::fileUrl( 'vendor-addon', $relative )
: '';
}Server caveat: BotBlocker installs runtime packages into a protected uploads directory. Test every icon/JS/CSS URL in a real WordPress install and confirm HTTP 200. See docs/known-core-contract-gaps.md.
An add-on is not done until it passes:
Read docs/code-quality-standard.md and docs/testing.md for the full checklist.
Use examples/acme-botblocker-sample as the canonical normal add-on template.
Use examples/acme-traffic-guard only for advanced traffic-management add-ons that must participate inside the BotBlocker request cycle. It demonstrates:
Both kit examples are the canonical third-party references. Copy and adapt them rather than any other add-on source.
See docs/links-and-assets.md for screenshots, banners, icons, and public links.
A developer or AI can use this kit to create a v2 add-on, validate it, package it, upload it through BotBlocker admin, activate it, see its Add-ons card and settings tab, save settings, observe runtime behavior, deactivate it, delete it, and reinstall it without fatal errors, PHP warnings, manual BotBlocker core edits, or undocumented assumptions.
| Back | FazBrowse Home | New Git URL |