WP Wallex Tether Price Copier
WordPress admin floating button for copying cached Wallex Tether price.
by Amirreza Shayesteh Far · github.com/amirrezashf/wp-wallex-tether-price-copier · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/amirrezashf/wp-wallex-tether-price-copier/archive/refs/heads/main.zipReadme
WP Wallex Tether Price Copier
A lightweight WordPress admin plugin that adds a floating button for copying the latest cached Wallex Tether price.
Description
WP Wallex Tether Price Copier fetches the Tether price from the Wallex markets API and shows a floating copy button inside the WordPress admin panel.
The price is cached for 30 minutes to reduce API requests. The plugin also keeps the last successful price as a fallback when the API is unavailable.
Features
- Floating admin copy button
- Fetches Tether price from Wallex
- 30-minute cache
- Fallback to last successful price
- Clipboard copy support
- No custom database tables
- No external JavaScript
- Capability-based access
- Filterable endpoint, symbol, cache time, and copy text
- Single-file plugin
Requirements
- PHP 7.4+
- WordPress 6.0+
By default, the button is visible to users with the manage_woocommerce capability.
Installation
- Create a folder named
wp-wallex-tether-price-copier. - Place
wp-wallex-tether-price-copier.phpinside it. - Upload the folder to:
wp-content/plugins/
- Activate the plugin from WordPress admin.
Usage / How it Works
After activation, a floating green button appears in the WordPress admin panel.
Clicking the button copies text like this:
Tether Price / Wallex: 99,000 Toman
The default market symbol is:
USDTTMN
Data Storage
The plugin stores:
- A temporary transient for the fresh cached price
- One option for the last successful price fallback
It does not store user data or sensitive information.
Development
Built with:
- WordPress Coding Standards
- Native WordPress APIs
- WordPress HTTP API
- WordPress transients
- Sanitized remote response handling
- Escaped admin output
- Translation-ready strings
- Lightweight single-file architecture
Hooks
plugins_loadedadmin_enqueue_scriptsadmin_footer
Filters
wp_wtpc_required_capability
Change the required capability.
add_filter(
'wp_wtpc_required_capability',
static function () {
return 'manage_options';
}
);
wp_wtpc_cache_ttl
Change cache duration.
add_filter(
'wp_wtpc_cache_ttl',
static function () {
return 15 * MINUTE_IN_SECONDS;
}
);
wp_wtpc_copy_text
Change copied text.
add_filter(
'wp_wtpc_copy_text',
static function ( $copy_text, $price ) {
return 'USDT: ' . number_format( $price ) . ' Toman';
},
10,
2
);
wp_wtpc_api_endpoint
Change API endpoint.
wp_wtpc_market_symbol
Change market symbol.
Future Improvements
- Admin settings page
- Optional price display on the button
- Manual refresh button
License
GPL-2.0-or-later
Author
Amirreza Shayesteh Far
GitHub: https://github.com/amirrezashf
کپی نرخ تتر والکس در پنل وردپرس
یک افزونه سبک برای وردپرس که یک دکمه شناور در پنل مدیریت اضافه میکند تا نرخ تتر والکس سریع کپی شود.
توضیحات
افزونه WP Wallex Tether Price Copier نرخ تتر را از API بازارهای والکس دریافت میکند و در پنل مدیریت وردپرس یک دکمه شناور برای کپی کردن آن نمایش میدهد.
نرخ برای ۳۰ دقیقه cache میشود تا درخواستهای API کاهش پیدا کند. اگر API در دسترس نباشد، آخرین نرخ موفق بهعنوان fallback استفاده میشود.
ویژگیها
- دکمه شناور در پنل مدیریت
- دریافت نرخ تتر از والکس
- کش ۳۰ دقیقهای
- fallback به آخرین نرخ موفق
- کپی در clipboard
- بدون جدول اختصاصی دیتابیس
- بدون JavaScript خارجی
- کنترل دسترسی بر اساس capability
- امکان تغییر endpoint، symbol، زمان cache و متن کپی با filter
- معماری تکفایلی
نیازمندیها
- PHP 7.4+
- WordPress 6.0+
بهصورت پیشفرض، دکمه فقط برای کاربران دارای capability زیر نمایش داده میشود:
manage_woocommerce
نصب
- یک پوشه با نام
wp-wallex-tether-price-copierبسازید. - فایل
wp-wallex-tether-price-copier.phpرا داخل آن قرار دهید. - پوشه را در مسیر زیر آپلود کنید:
wp-content/plugins/
- افزونه را از پنل مدیریت وردپرس فعال کنید.
نحوه استفاده / عملکرد افزونه
بعد از فعالسازی، یک دکمه سبز شناور در پنل مدیریت وردپرس نمایش داده میشود.
با کلیک روی دکمه، متنی شبیه نمونه زیر کپی میشود:
Tether Price / Wallex: 99,000 Toman
symbol پیشفرض بازار:
USDTTMN
ذخیرهسازی داده
افزونه فقط موارد زیر را ذخیره میکند:
- transient موقت برای نرخ cache شده
- یک option برای آخرین نرخ موفق
اطلاعات کاربر یا داده حساس ذخیره نمیشود.
توسعه
توسعه دادهشده بر اساس:
- WordPress Coding Standards
- Native WordPress APIs
- WordPress HTTP API
- WordPress transients
- مدیریت امن پاسخ API
- خروجیهای escape شده در admin
- متنهای آماده ترجمه
- معماری سبک تکفایلی
هوکها
plugins_loadedadmin_enqueue_scriptsadmin_footer
فیلترها
wp_wtpc_required_capability
تغییر capability لازم برای نمایش دکمه.
add_filter(
'wp_wtpc_required_capability',
static function () {
return 'manage_options';
}
);
wp_wtpc_cache_ttl
تغییر مدت cache.
add_filter(
'wp_wtpc_cache_ttl',
static function () {
return 15 * MINUTE_IN_SECONDS;
}
);
wp_wtpc_copy_text
تغییر متن کپیشده.
add_filter(
'wp_wtpc_copy_text',
static function ( $copy_text, $price ) {
return 'USDT: ' . number_format( $price ) . ' Toman';
},
10,
2
);
wp_wtpc_api_endpoint
تغییر endpoint API.
wp_wtpc_market_symbol
تغییر symbol بازار.
بهبودهای آینده
- صفحه تنظیمات
- نمایش اختیاری قیمت روی دکمه
- دکمه refresh دستی
مجوز
GPL-2.0-or-later
نویسنده
Amirreza Shayesteh Far
GitHub: https://github.com/amirrezashf