IN PROGRESS
Technical summary
NEXUS plugin for centralized affiliate link and promo code management: full CRUD organized by project and category, click tracking (302 redirect + counter + detailed log), Dead Link Detector with periodic HTTP health checks via cron every 12 hours, coupon suggestions in the Intelligence Hub, QR Code generation and share snippets — 100% internal, no external API (first in the series).
Executed scope
backend.phpbackend (519 lines): internal MySQL CRUD — no external API dependency (only one in the series so far).- Tables (created by
affiliates_install()):nexus_affiliates(project, name, url, promo_code, status, category, commission_rate, clicks_count, notes, expires_at, http_code, last_checked_at; indexesidx_project,idx_status,idx_category,idx_expires_at) with silent migrations (ADD COLUMNfor expires_at/http_code/last_checked_at) andnexus_affiliate_clicks(affiliate_id, ip, user_agent, referer, clicked_at;idx_affiliate_id,idx_clicked_at). - Initial seeds: 3 sample records (Cloudflare Enterprise 15%, Hetzner Cloud VPS €10 credit, Shodan Pro Engine 20%) created when the table is empty.
affiliates_list— filters by project/status/category/search (LIKE on name/promo_code/url/notes), limit ≤ 100; autoexpiredmarking whenexpires_atpasses;short_urlbuilt fromsite_url(/api.php?action=affiliate_redirect&id=X);is_expiring_soonflag (< 3 days); distinct categories and embedded stats.affiliates_save— validates required name, URL viaFILTER_VALIDATE_URL, status whitelist (active/pending/cancelled/expired) and auto-expires when the date is in the past; insert or update.affiliates_delete— removes the record and linked clicks (manual cascade).affiliates_check_health(Dead Link Detector) — HEAD request (CURLOPT_NOBODY), follows up to 5 redirects, 8s timeout / 4s connect,NEXUS-Affiliate-HealthCheck/1.0UA; with ID checks 1 link; without ID checks up to 10 oldest active links (last_checked_at ASC); storeshttp_code+last_checked_at.affiliate_redirect— incrementsclicks_count, logs detailed click (IP, User-Agent, Referer) innexus_affiliate_clicksand redirects with HTTP 302 (or returns JSON on AJAX calls).affiliates_stats— total, active, pending, cancelled, expired, total clicks, with coupon and dead_links (http_code ≥ 400or0).- Settings (
affiliates_settings/affiliates_settings_save) —base_url(validated),enable_tracking,default_category,auto_shortenviaDB::setConfig('plugin.affiliates.*'). - Intelligence Hub:
nexus-affiliatesenricher (priority 20, typesaffiliate,promo,cupom,cloud,hosting,vpn,vps) — suggestion format (not a severity signal): when the user mentions services (Hetzner, Cloudflare, Shodan...), it suggests up to 3 active coupons with shortened link, promo code and commission. - Cron (
cronjob.json):Affiliate Link Health Checkjob with a **real cron schedule0 */12 * * *** (every 12 hours) →affiliates_check_health— first in the series with a cron expression (previous ones used soft-cron ticks). - API: 9 actions via
PluginManager::registerApiAction(affiliates_list, affiliates_get, affiliates_save, affiliates_delete, affiliates_check_health, affiliate_redirect, affiliates_stats, affiliates_settings, affiliates_settings_save). - Alpine.js UI (
tab.php, 712 lines — largest in the series): indigo theme; 2 sub-tabs (Dashboard / Settings); 5 KPI cards (Total Links, Active, Accumulated Clicks, Coupons, Unreachable Links); toolbar with search (300ms debounce) and project/status/category filters; Test Link Health button; cards with status badge (Active/Pending/Cancelled/Expired), HTTP badge (green 2xx / blue 3xx / red 4xx or 0) and "⏰ Expires soon" alert (< 3 days); QR Code actions (api.qrserver.com), copy shortened link, test redirect, generate Markdown snippet and edit/delete; create/edit modal; settings with usage guide. - Fastr: 2 commands —
/afiliados(PT) and/affiliates(EN) →affiliates_list. - No external API — 100% internal: MySQL + cURL (only for health check and redirect).
Stack and tools
- PHP 8 (no framework)
- MySQL 8 (nexus_affiliates + nexus_affiliate_clicks)
- Alpine.js + Tailwind CSS (premium light, indigo ring)
- NEXUS plugin system (PluginManager + cronjob.json)
- cURL (HEAD health check + 302 redirect)
Operational tags
- Affiliates
- Coupons
- Marketing
- Link Building
- Click Tracking
- QR Code
- Plugin NEXUS
Operational outcome
- Centralized affiliate link and coupon registry organized by project and category (Geral, NEXUS, Security, etc.).
- Conversion tracking: NEXUS shortened link with click counter and detailed log (IP, User-Agent, Referer).
- Dead Link Detector: automatic check every 12 hours plus manual, flagging broken links with an HTTP badge.
- Coupon suggestions in chat/tasks via Intel Hub (service mentions → coupon with link and commission).
- QR Codes and Markdown snippets ready for sharing in one click.
- 100% internal: no external API cost, own data in MySQL.
GitHub progress (issues)
Real-time panel with latest repository issues.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
Real results
NEXUS plugin for centralized affiliate link and promo code management: full CRUD organized by project and category, click tracking with 302 redirect and counter, Dead Link Detector with periodic HTTP health checks via cron every 12 hours, coupon suggestions in the Intelligence Hub, QR Code generation and share snippets — 100% internal, no external API.
Architecture and organization
- PHP 8
- MySQL 8
- Alpine.js
- Tailwind CSS
- Plugin NEXUS
Execution and operations
The project follows reproducible execution flow with technical validation in production-like environments.
Screenshots
Talk about this project
Apply this implementation pattern in your environment and accelerate delivery with technical consistency.