# Bounmee Wallet Leaderboard for WordPress

Embed a **live Polymarket top-wallet leaderboard** on any page with a single shortcode — always-fresh API data, 30D/7D period toggle, White & Navy Blue themes, category filters, optional Wallet of the Day, wallet compare tool, and CopyTrade button.

[![License: GPL v2](https://img.shields.io/badge/License-GPLv2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0)
![Version](https://img.shields.io/badge/version-3.7.0-green)
![WordPress](https://img.shields.io/badge/WordPress-5.5%2B-blue)
![PHP](https://img.shields.io/badge/PHP-7.4%2B-purple)

[→ WordPress.org Plugin Page](https://wordpress.org/plugins/bounmee-wallet-leaderboard/)

---

## Features

**Leaderboard**
- Live top-10 wallets ranked by PNL, 30D / 7D toggle, category filters
- Wallet address copy, X profile links, verified badges
- Full table on desktop, card layout on mobile
- Zero first-paint spinner — data seeded server-side on page load

**Themes**
- White (default) — clean light design readable on any background
- Navy Blue — dark gradient background, full WCAG AA contrast adaptation
- Set in Settings, applies globally to all shortcode instances

**Wallet of the Day** *(optional — enable in Settings)*
- Spotlights the #1 ranked wallet with a full performance breakdown card
- Auto-generated analysis adapts to selected time period (30D or 7D)
- Share to X button pre-filled with wallet stats, one-click address copy

**Wallet Compare Tool** *(optional — enable in Settings)*
- Side-by-side comparison of any two wallets from the leaderboard
- Bar charts for PNL, volume, and PNL/volume efficiency ratio
- Verdict summary with winner and key insight

**CopyTrade Button** *(optional — enable in Settings, off by default)*
- Styled button on each row linking to an external copy-trading service
- Fully configurable URL — set your own destination in Settings
- Disabled by default per WP.org guideline 10

**Technical**
- Server-side AJAX proxy — zero CORS issues on any host
- No caching — every request fetches live data from the Polymarket API
- Pure vanilla JS — no jQuery, no external dependencies
- Compatible with all page caching plugins (WP Rocket, W3 Total Cache, etc.)
- Falls back to anonymised demo data if Polymarket API is unreachable
- Fully theme-isolated CSS — scoped under `#ttg-lb-root-wp`
- WCAG AA contrast on all text in both themes

---

## Quick Start

```
[polymarket_leaderboard]
```

Pre-select a category on load:

```
[polymarket_leaderboard category="CRYPTO"]
```

Valid categories: `OVERALL` · `POLITICS` · `SPORTS` · `CRYPTO` · `CULTURE` · `ECONOMICS` · `TECH` · `FINANCE`

---

## Installation

1. Download from [WordPress.org](https://wordpress.org/plugins/bounmee-wallet-leaderboard/) or upload the zip via **Plugins → Add New → Upload Plugin**
2. Activate and add `[polymarket_leaderboard]` to any page or post
3. Visit **Settings → Polymarket LB** to choose your theme and enable optional features

---

## External Services

- **Polymarket Data API** (`https://data-api.polymarket.com/v1/leaderboard`) — fetches public wallet rankings. No user data is sent. [Terms of Service](https://polymarket.com/tos) · [Privacy Policy](https://polymarket.com/privacy-policy)
- **Google Fonts** (`https://fonts.googleapis.com`) — DM Sans and DM Mono fonts, loaded only on pages using the shortcode. [Privacy Policy](https://policies.google.com/privacy)

---

## Changelog

**3.7.0**
- New: 24H period toggle now shows period-aware Wallet of the Day badge and subtitle
- Fix: Tested up to WordPress 7.0
- Fix: Minor CSS scoping improvements for theme compatibility


**3.6.4**
- New: 24H period toggle (🔥 24H button) — fetches `timePeriod=DAY` to show wallets hot right now, not just long-term PNL leaders
- New: Period-aware badge and subtitle copy update automatically in 24H mode
- Fix: PHP AJAX proxy whitelist extended to accept `DAY` as a valid period

**3.6.3**
- Fix: `shortcode_atts` filter tag corrected (`bounwale_leaderboard` → `polymarket_leaderboard`)
- Fix: `wp_register_script/style` called with invalid `false` src — changed to `''`
- Fix: Table loading state used wrong `colspan` — corrected in both PHP and JS
- Fix: `admin_init` redirect now guards with `is_admin()`
- Fix: Admin enqueue hook tightened to exact page match
- Fix: `uninstall.php` was deleting wrong option keys — options never cleaned on deletion

**3.6.2**
- Fix: Layout never scrolls horizontally — `overflow-x:hidden`, `table-layout:fixed`
- Fix: Responsive breakpoints extended — new 900px and 360px breakpoints
- Fix: Mobile card actions and small screen padding tightened

**3.6.1**
- Fix: Wallet of the Day mobile Share on X button now correctly populated
- Fix: PHP category whitelist trimmed to match UI

**3.6.0**
- Fix: All inline `<script>`/`<style>` tags replaced with WP enqueue API

**3.5.0 – 3.5.1**
- Fix: Controls row and compare heading centred on both themes

**3.4.1 – 3.4.9**
- Fix: Table row colour bleed, text sizes, 7D volume fallback
- Fix: Share on X desktop/mobile, Navy Blue card style, compare alignment

**3.3.0**
- New: White / Navy Blue theme selector
- New: 30D / 7D period toggle, always-live data
- Fix: WCAG AA contrast for PNL, rank badges, wallet addresses

**3.0.0 – 3.2.3**
- Initial release: proxy, filters, WOTD, compare, mobile cards
- Full CSS isolation under `#ttg-lb-root-wp`

---

## License

GPL-2.0+
