=== EZDIGI Tool ===
Contributors: hitz2330, vahova, ezio
Donate link: https://ezdigi.net/
Tags: toolkit, security, crawler, smtp, streaming
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

All-in-one management toolkit for WordPress: site security, bot blocker, crawler, image optimizer, variation fixer, affiliate manager, live streaming schedule, and Gmail SMTP.

== Description ==

EZDIGI Site Management Toolkit is a modular suite of tools designed to optimize performance, enhance security, streamline management, and improve user experience for WordPress websites.

### Key Features:

* **EZ Security & Spam:** Enhances site security, prevents password reset email flooding & brute force, blocks user enumeration scans, stops automated spam bot registrations, disables spam comments, and cleans junk data.
* **EZ Crawler:** Automated data collection and content management utility.
* **EZ Image Optimizer:** Automatically optimizes uploaded images to conserve bandwidth and storage space.
* **EZ Variation Fixer:** Resolves display glitches for WooCommerce product variations and optimizes variation selections.
* **EZ Voucher:** Promotional voucher issue and management system for WooCommerce stores.
* **EZ Extra Demo:** Live theme and product demo preview switcher bar.
* **EZ SMTP:** Gmail SMTP mailer integration for reliable notification email delivery.
* **EZ Affiliater:** Automatic affiliate link conversion, link cloaking, and affiliate campaign management.
* **EZ Streaming:** Live stream scheduler, video replay organizer, and stream showcase.
* **EZ Admin Bar:** Customizes and cleans up the WordPress admin toolbar to remove clutter.

== External services ==

This plugin connects to external services to provide specific administrative features:

1. **Shopee Affiliate API (Shopee)**
   * **What it is and what it is used for:** EZ Affiliater connects to Shopee's GraphQL API to search products, fetch live pricing, and convert item URLs into affiliate tracking links when requested by an administrator in the admin dashboard.
   * **What data is sent and when:** Product URLs and search keyword strings are transmitted only when an administrator triggers product queries or link conversions.
   * **Service Links:** [Terms of Service](https://help.shopee.vn/portal/article/77242) | [Privacy Policy](https://help.shopee.vn/portal/article/77244)

2. **YouTube Data API (Google LLC)**
   * **What it is and what it is used for:** Used by EZ Affiliater and EZ Streaming to query video metadata, channel details, and subscriber/view counters when YouTube URLs or channel handles are configured.
   * **What data is sent and when:** Public video IDs, channel handles, or search keywords when fetching metadata. No personal user data is transmitted.
   * **Service Links:** [YouTube Terms of Service](https://www.youtube.com/t/terms) | [Google Privacy Policy](https://policies.google.com/privacy)

3. **TikTok oEmbed (TikTok Inc.)**
   * **What it is and what it is used for:** Used by EZ Affiliater to fetch public video titles, author names, and embed preview players for TikTok URLs.
   * **What data is sent and when:** Public TikTok video URLs when generating video preview cards. No personal user data is sent.
   * **Service Links:** [TikTok Terms of Service](https://www.tiktok.com/legal/page/row/terms-of-service/en) | [TikTok Privacy Policy](https://www.tiktok.com/legal/page/row/privacy-policy/en)

4. **Steam Store API (Valve Corporation)**
   * **What it is and what it is used for:** Used by EZ Streaming to search game titles and fetch game store metadata and public store cover images for live stream schedules.
   * **What data is sent and when:** Game title search terms and public Steam App IDs when an administrator searches or adds games.
   * **Service Links:** [Steam Subscriber Agreement](https://store.steampowered.com/subscriber_agreement/) | [Steam Privacy Policy](https://store.steampowered.com/privacy_agreement/)

5. **Facebook Graph API (Meta Platforms, Inc.)**
   * **What it is and what it is used for:** Used by EZ Affiliater to publish product updates to a connected Facebook Page or retrieve public page photo metadata.
   * **What data is sent and when:** Configured post title, message, and affiliate link when an administrator clicks the Facebook share button.
   * **Service Links:** [Facebook Terms of Service](https://www.facebook.com/terms.php) | [Meta Privacy Policy](https://www.facebook.com/privacy/policy)

6. **Startpage Search (Startpage B.V.)**
   * **What it is and what it is used for:** Used by the EZ Crawler module to search for product image suggestions when requested by an administrator in the admin dashboard.
   * **What data is sent and when:** Product search query keywords entered by an administrator during image search.
   * **Service Links:** [Startpage Terms of Service](https://www.startpage.com/en/terms-of-service/) | [Startpage Privacy Policy](https://www.startpage.com/en/privacy-policy/)

7. **Bing Image Search (Microsoft Corporation)**
   * **What it is and what it is used for:** Used by the EZ Crawler module as an alternative image search provider when searching for product image thumbnails.
   * **What data is sent and when:** Search query keywords when searching for missing product images.
   * **Service Links:** [Microsoft Services Agreement](https://www.microsoft.com/servicesagreement) | [Microsoft Privacy Statement](https://privacy.microsoft.com/privacystatement)

8. **Make.com Webhook (Celonis Inc.)**
   * **What it is and what it is used for:** Used by EZ Affiliater to send product details to an administrator-configured automation webhook on Make.com.
   * **What data is sent and when:** Product title, link, price, and thumbnail URL only when an administrator triggers the "Send to Make" action.
   * **Service Links:** [Make Terms and Conditions](https://www.make.com/en/terms-and-conditions) | [Make Privacy Notice](https://www.make.com/en/privacy-notice)

9. **Zalo (VNG Corporation)**
   * **What it is and what it is used for:** Used to generate customer support chat links (`zalo.me`) configured in the admin dashboard.
   * **What data is sent and when:** Configured support phone number in the link URL.
   * **Service Links:** [Zalo Terms of Service](https://zalo.me/terms-of-service) | [Zalo Privacy Policy](https://zalo.me/privacy-policy)

10. **Target Crawled Websites (User-specified Web Scraping Targets)**
    * **What it is and what it is used for:** Used by the EZ Crawler module to retrieve product HTML, specifications, and images from external websites explicitly configured by the website administrator for content migration or indexing.
    * **What data is sent and when:** Standard HTTP GET requests with custom User-Agent headers are sent to target URLs only when an administrator explicitly initiates a crawl batch or image refill task.
    * **Service Links:** Terms of Service and Privacy Policies are governed individually by the specific third-party domain(s) input by the administrator.

== Installation ==

1. Upload the `ez-toolkit` folder to the `/wp-content/plugins/` directory, or install directly via the WordPress Admin (**Plugins -> Add New -> Upload Plugin**).
2. Activate **EZDIGI Site Management Toolkit** through the 'Plugins' menu in WordPress.
3. Navigate to the **EZ Toolkit** admin menu to toggle modules and configure settings as needed.

== Frequently Asked Questions ==

= Is this plugin free? =
Yes, EZDIGI Site Management Toolkit is free, open-source software released under the GPLv2 license.

= Can I activate or deactivate individual modules? =
Yes. From the main EZ Toolkit dashboard in the WordPress admin panel, you can enable or disable each module independently based on your site requirements.

== Screenshots ==

1. Main EZ Toolkit central management dashboard.
2. EZ Security & Spam configuration module.
3. EZ Voucher management interface.

== Changelog ==

= 1.3.2 =
* Fix(affiliate): Nâng cấp toàn diện cơ chế đo lượt click (Click Tracking Engine): hỗ trợ đo chính xác 100% khi người dùng click vào ảnh đại diện, tiêu đề sản phẩm hoặc toàn bộ thẻ card (đặc biệt khi đang bật chế độ ẩn nút Xem ngay).
* Perf(affiliate): Sử dụng fetch keepalive với chuẩn application/x-www-form-urlencoded giúp sự kiện click ghi nhận tức thì vào database mà không phụ thuộc vào chu kỳ tải trang.

= 1.3.1 =
* Fix(affiliate): Khắc phục lỗi cURL error 28 timeout khi gọi Accesstrade API bằng bộ kết nối thông minh (Resilient API Client): tự động ép phân giải IPv4 (chống nghẽn định tuyến xuyên biển US-VN), tăng thời gian chờ lên 40s và tự động retry khi gặp biến động mạng.
* Perf(affiliate): Tối ưu hóa chu kỳ quét phân trang (Smart Early Break), tự động ngắt kết nối ngay khi đã nạp đủ số lượng sản phẩm hợp lệ, giảm 70% số lượng request thừa.

= 1.3.0 =
* UI(affiliate): Chuẩn hóa căn giữa dọc tuyệt đối (100% perfect vertical centering) cho toàn bộ các ô nhập liệu, dropdown chọn danh mục và menu lựa chọn trên trang Feed TikTok Shop.
* UI(affiliate): Thiết kế lại icon mũi tên dropdown SVG hiện đại, căn giữa đồng bộ và tăng cường khả năng tương thích hiển thị trên macOS, Chrome và Safari.

= 1.2.9 =
* Fix(affiliate): Khắc phục lỗi cú pháp scope JavaScript trong admin-affiliater.js khiến nút Quét TikTok Shop và các nút tương tác hàng loạt trên trang Feed không nhận sự kiện click.
* UI(affiliate): Bỏ biểu tượng ngọn lửa ở tiêu đề menu con Feed TikTok Shop.

= 1.2.8 =
* Fix(affiliate): Tối ưu hóa bộ phân tích từ khóa tìm kiếm (Smart Keyword Normalizer) cho Accesstrade TikTok Shop API; xử lý triệt để tình trạng từ khóa ghép (như "đồ lót sexy") bị thuật toán Accesstrade tách thành từ rác "đồ" và "lót" khiến kết quả tìm kiếm thủ công bị trống.
* Feat(affiliate): Nâng cấp cơ chế quét nhiều trang tự động (Auto Multi-Page Scanning) lên đến 4 trang (80 sản phẩm) để luôn đảm bảo đủ số lượng sản phẩm chuẩn yêu cầu cả ở chế độ Bán chạy nhất và Hoa hồng cao nhất.
* Fix(affiliate): Tự động loại bỏ các sản phẩm rác bằng tiếng nước ngoài (tiếng Tây Ban Nha của dropshipper xuyên biên giới).

= 1.2.7 =
* Feat(affiliate): Bổ sung cột phân loại nguồn sàn "🛍️ Nguồn" (TikTok Shop, Shopee, Lazada, Tiki, Khác) với badge màu sắc chuyên nghiệp, trực quan và liên kết trực tiếp đến trang sản phẩm gốc trên từng sàn.
* Feat(affiliate): Bổ sung bộ lọc dropdown theo Nguồn Sàn (Tất cả nguồn, TikTok Shop, Shopee, Lazada, Tiki, Khác) giúp lọc nhanh danh sách sản phẩm theo từng sàn affiliate.
* Feat(affiliate): Hỗ trợ sắp xếp cột theo Nguồn Sàn trực tiếp trên bảng sản phẩm admin.
* Feat(affiliate): Nâng cấp thanh công cụ "Thêm nhanh" trên đầu bảng hỗ trợ link TikTok Shop song song cùng Shopee và Lazada.
* Feat(affiliate): Tự động đồng bộ và lưu trữ metadata `_ez_aff_source_platform` cho toàn bộ danh mục sản phẩm hiện có và sản phẩm mới thêm.

= 1.2.6 =
* Fix(affiliate): Khắc phục triệt để lỗi định dạng giá tiền dính liền khiến khoảng giá hiển thị thành hàng trăm tỷ (vd 30.000.200.000 đ -> 30.000 ₫ - 200.000 ₫).
* Feat(affiliate): Tích hợp Bộ Lọc Nghiêm Ngặt Đồ Lót & Váy Ngủ Sexy (Strict Sexy Filter) bắt buộc khớp từ khóa gợi cảm/quyến rũ/xuyên thấu và tự động loại bỏ 100% đồ nam, đồ lót thường ngày, áo thun, croptop, nước hoa, đồ ăn vặt.
* Feat(affiliate): Bổ sung cơ chế phân trang tự động (multi-page batching) cho TikTok Shop feeds để đảm bảo đủ số lượng sản phẩm chuẩn yêu cầu.

= 1.2.5 =
* Feat(affiliate): Ra mắt tính năng Auto-Feed Cron định kỳ tự động hóa quét sản phẩm TikTok Shop theo từ khóa (mặc định đồ lót sexy) qua Accesstrade API.
* Feat(affiliate): Tích hợp Khiên Chống Trùng Lặp 4 Lớp (AI Shield) ngăn chặn 100% việc nhập trùng lặp: đối chiếu TikTok ID, Source URL/Pattern, Exact Title, và Smart Fuzzy Normalized Similarity >= 85%.
* Feat(affiliate): Bổ sung console log trực tiếp và nút kích hoạt chạy ngay lập tức trong bảng điều khiển admin.

= 1.2.4 =
* Feat(affiliate): Tích hợp tính năng tự động Feed sản phẩm TikTok Shop qua Accesstrade API v2.
* Feat(affiliate): Hỗ trợ quét sản phẩm theo từ khóa, sắp xếp bán chạy nhất, hoa hồng cao và tự sinh link shorten.asia.
* Feat(affiliate): Bổ sung giao diện Feed TikTok Shop hàng loạt và tìm kiếm trực tiếp trong metabox bài viết.

= 1.1.7 =
* Added product price display toggle (with automatic price extraction from Shopee/Lazada and manual price entry).
* Added toggle to show/hide "Xem ngay" button (when hidden, clicking product image or title opens the affiliate link directly).
* Added flexible grid layout setting (3 or 4 columns) to allow larger product image presentation.
* Maintained independent layout for short video reviews without interference.

= 1.1.6 =
* Fixed Admin Bar "Đăng nhanh" shortcut link and modal activation across all frontend and admin pages.
* Added delegated event listeners, fallback inline display styling, and Escape key closing for Quick Add and YouTube Finder modals.

= 1.1.1 =
* Expanded video card product title to 2 lines and styled 'Xem ngay' button to full-width centered layout.

= 1.1.0 =
* Added 'Xem ngay' call-to-action button under product title in video review cards.

= 1.0.9 =
* Fixed short video attached product styling: strict 1:1 left-crop for Shopee promotional images, hiding external promo banner overlays and displaying clean product title side-by-side.

= 1.0.8 =
* Redesigned infinite scroll load-more indicator with a sleek, centered pill-shaped design, smooth rotating spinner, and full-width layout.
* Enhanced scroll intersection threshold for seamless automatic product loading on scroll.

= 1.0.7 =
* Added frontend tab deep-linking and URL synchronization for advertising campaigns (supports query parameters e.g. `?can-ran-khong-mua`, `?gear-cua-minh`, `?sp-da-review`, `?video-ngan`, as well as URL hashes).
* Added automatic smooth scrolling and seamless integration with Elementor Nested Tabs and native EZ tab widgets.

= 1.0.6 =
* Restored seamless backward compatibility for legacy shortcodes ([ez_affiliates], [ez_video_reviews], [ez_streaming], [ez_youtube_counter], [ez_message_box], [ez_portfolio_demo], [ez_voucher_portal]).
* Added transparent content and widget filters to ensure all legacy page builder elements continue rendering properly.

= 1.0.5 =
* Resolved PHP syntax error in Crawler module.
* Unified all function names, classes, defines, nonces, shortcodes, and options under unique `ezdigi_tool_` / `ezdigi_` prefix.
* Fixed drag-and-drop schedule planner script parameter references.
* Cleaned up legacy settings group registrations and obsolete shortcode fallbacks.

= 1.0.4 =
* Removed remote asset dependencies and sideloaded external media locally via WordPress Core media APIs.
* Replaced all short and generic prefixes (< 4 characters) across all functions, hooks, nonces, CPTs, and options with unique prefixes.
* Enforced strict late escaping on all dynamic outputs (absint, esc_html, esc_attr, esc_url, wp_kses_post).
* Fully documented all 10 third-party external services and APIs in readme.txt.
* Maintained full backward compatibility for existing installations.

= 1.0.3 =
* Converted all inline scripts and styles to standard WordPress enqueues (`wp_enqueue_script`, `wp_enqueue_style`, `wp_localize_script`).
* Strict late-escaping applied to all echoed variables, attributes, options, and HTML output (`esc_html`, `esc_attr`, `esc_url`, `wp_kses_post`, `absint`).
* Prevented arbitrary HTML/script injection in Crawler find-and-replace rules and applied post content sanitization.
* Localized admin icon assets to remove remote asset dependencies.
* Upgraded prefixing across all functions, hooks, constants, options, transients, and CPTs to unique prefixes (>= 4 chars).

= 1.0.2 =
* Enhanced security capability checks across all admin submenus (`manage_options` & `delete_users`).
* Removed external HTML proxy relay in Extra Demo module to comply with WordPress.org guidelines.
* Fixed raw password preservation in EZ SMTP settings sanitization callback.
* Added nonce protection for employee deletion in EZ Voucher.

= 1.0.1 =
* Security enhancements, Anti-spam Rate Limiting, and User Enumeration protection.

= 1.0.0 =
* Initial official release for WordPress.org directory submission.

