[WordPress] 外掛分享: All Users Filter

首頁外掛目錄 › All Users Filter
全新外掛
安裝啟用
★★★★★
5/5 分(1 則評價)
24 天前
最後更新
問題解決
WordPress 6.9+ PHP 7.4+ v1.4 上架:2025-09-03

內容簡介

總結:
這個外掛可以幫助您篩選、排序和導出使用者。您可以按照日期、角色、元鍵值和註冊日期等多個參數來篩選使用者。由 Hardik Patel(也被稱為 Hardik Lakkad)開發。

問題與答案:
問題1:這個外掛的主要功能是什麼?
答:這個外掛主要功能是篩選、排序和導出使用者。

問題2:如何在這個外掛中建立複雜的查詢而不需要編碼?
答:您可以在使用者 → 所有使用者篩選畫面中組成條件。選擇元鍵、運算子、類型、值,並(可選)組關係來建立複雜的查詢。

問題3:這個外掛中提供的測試案例主要驗證什麼?
答:這些測試案例主要驗證常見情境和防護措施。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「All Users Filter」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Plugin for filtering, sorting, and exporting users.
This plugin allows you to filter, sort, and export users in CSV format. You can filter users by multiple parameters, such as date, role, meta key-value, and registration date.
Usage
Use the Users → All Users Filter screen to compose conditions. Choose a meta key, operator, type, value, and (optionally) group relation to build complex queries without code. Export matched users to CSV.
Admin UI → WP_Meta_Query Mapping

meta_key → key
operator → compare
Type → type
meta_value → value
Group relation (if available) → relation: AND | OR

Meta keys used in tests (wp_usermeta.meta_key)

job_description (string)
job_designation (string; single value OR a pipe/comma-separated list)
age_in_years (integer-like string)
joining_date (stored as YYYY-MM-DD or full YYYY-MM-DD HH:MM:SS)
monthly_salary (numeric, e.g., 9000)

If your dataset stores dates in a different format (e.g., DD/MM/YYYY) or salaries with commas (e.g., 9,000), see Edge Cases below.
Test Cases
The following UI test cases validate common scenarios and guardrails.
1) Single-condition functional tests
1A. Exact match on text
Intent: Users with job_description exactly “Lorem ipsum test”.
UI:
– meta_key: job_description
– operator: =
– Type: CHAR
– meta_value: Lorem ipsum test
Expected: Exact match; typically case-insensitive under default collations; respects spaces.
1B. Case-sensitive regex match
Intent: job_description starts with Lorem (case-sensitive).
UI:
– meta_key: job_description
– operator: REGEXP
– Type: BINARY
– meta_value: ^Lorem
Expected: Matches only values beginning with uppercase Lorem.
1C. Negative regex
Intent: job_description does NOT mention ipsum as a whole word.
UI:
– meta_key: job_description
– operator: NOT REGEXP
– Type: CHAR
– meta_value: (^|[^A-Za-z])ipsum([^A-Za-z]|$)
Expected: Excludes any row containing ipsum as a separate word.
2) Multi-value (roles) tests for `job_designation`
Assume values include: UI/UX Designer | QA Engineer | DevOps Engineer | Project Manager | Business Analyst | HR Manager | Data Analyst | Software Engineer | System Admin | Marketing Specialist
2A. Membership via IN
Intent: QA Engineer OR DevOps Engineer.
UI:
– meta_key: job_designation
– operator: IN
– Type: CHAR
– meta_value: QA Engineer, DevOps Engineer (comma-separated → parsed to array) Must Include at least one array
Expected: Exact membership match.
2B. Pipe-separated field using REGEXP
Intent: Field stores multiple roles separated by |; match Software Engineer or Data Analyst.
UI:
– meta_key: job_designation
– operator: REGEXP
– Type: CHAR
– meta_value: (^|\s*\|\s*)(Software Engineer|Data Analyst)(\s*\|\s*|$)
Expected: Token-aware match; avoids partials like “Engineer” inside longer tokens.
2C. Excluding a role with NOT REGEXP
Intent: Exclude HR Manager.
UI:
– meta_key: job_designation
– operator: NOT REGEXP
– Type: CHAR
– meta_value: (^|\s*\|\s*)HR Manager(\s*\|\s*|$)
Expected: Excludes any token equal to HR Manager.
3) Numeric range tests for `age_in_years`
3A. Inclusive range (happy path)
Intent: 18–45 inclusive.
UI:
– meta_key: age_in_years
– operator: BETWEEN
– Type: NUMERIC (or UNSIGNED)
– meta_value: 18,45
Expected: Ages 18 through 45 inclusive.
4) Date tests for `joining_date` on Meta Filters
Reference cut-off date: 2023-08-25 (two years ago from baseline).
4A. On or before cut-off (joined ≥ 2 years ago)
UI:
– meta_key: joining_date
– operator: <= – Type: DATE – meta_value: 2023-08-25 Expected: On or before 2023-08-25. If stored as DATETIME, see 4A’. 4B’. DATETIME variant UI: – meta_key: joining_date – operator: <= – Type: DATETIME – meta_value: 2023-08-25 23:59:59 5) Salary tests for `monthly_salary` (business rule: exactly 9000) 5A. Exact numeric UI: – meta_key: monthly_salary – operator: = – Type: NUMERIC – meta_value: 9000 5B. Degenerate range ⇒ equality UI: – operator: BETWEEN – Type: NUMERIC – meta_value: 9000,9000 10) Extending scope for multiple users Allow non-admins (specific user ID) to use the plugin by adding this to your theme’s functions.php:

延伸相關外掛

文章
Filter
Apply Filters
Mastodon