WP Manifestindependent plugin directory
manifest / ecommerce / webcave-zero-order-customer-cleaner

Webcave Zero Order Customer Cleaner

Safely clean WooCommerce user accounts with no matching orders by role and date — تنظيف آمن لحسابات WooCommerce بدون طلبات مطابقة

by Webcave · github.com/fathyweb/webcave-zero-order-customer-cleaner

0stars
0forks

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/fathyweb/webcave-zero-order-customer-cleaner/archive/refs/heads/main.zip

العربية | English

التوثيق العربي

Webcave Zero Order Customer Cleaner إضافة إدارية لـWordPress وWooCommerce تساعدك على حذف حسابات المستخدمين التي لا يوجد لها طلب مطابق لمعايير الفحص، بدلًا من مراجعة آلاف الحسابات وحذفها يدويًا.

تتيح لك الإضافة تحديد من تريد فحصه حسب دور المستخدم وتاريخ تسجيله، ثم تحدد ما الطلب الذي يحمي الحساب من الحذف حسب تاريخ الطلب. تفحص الإضافة كل حساب على دفعات صغيرة، وتحتفظ بالحساب إذا وجدت له طلبًا مطابقًا، وتحذفه إذا لم تجد، مع حماية المديرين ومديري المتجر دائمًا.

الخلاصة: الإضافة تحذف حساب المستخدم من WordPress، ولا تحذف طلبات WooCommerce. حذف WordPress القياسي قد يحذف أيضًا بيانات المستخدم وبعض المحتوى المؤلف له كما هو موضح في قسم «قواعد الحماية والحذف». الحذف نهائي، لذلك يجب إنشاء نسخة احتياطية واختبار الإعدادات بعناية.

اسم “Zero Order” يعني صفر طلبات مطابقة لنطاق الطلبات الذي اخترته. إذا تركت نطاق الطلبات فارغًا، يصبح المعنى صفر طلبات في كل السجل التاريخي.

⬇️ تحميل أحدث إصدار · 📦 جميع الإصدارات · 🐞 الإبلاغ عن مشكلة

ما المشكلة التي تحلها الإضافة؟

قد يمتلئ متجر WooCommerce بحسابات أنشأها زوار أو حملات تسويقية أو عمليات تسجيل تلقائية، من دون أن تتحول هذه الحسابات إلى عملاء فعليين. مراجعة هذه الحسابات يدويًا بطيئة، والحذف الجماعي من دون فحص الطلبات قد يؤدي إلى حذف عميل حقيقي.

تحل الإضافة هذه المشكلة من خلال:

  • حصر الفحص في أدوار مستخدمين محددة بدلًا من التعامل مع جميع مستخدمي الموقع.
  • حصر الحسابات حسب فترة التسجيل المطلوبة.
  • البحث عن الطلبات بواسطة معرف الحساب وبريد الفوترة.
  • تنفيذ الفحص والحذف تدريجيًا لتقليل الضغط على الخادم.
  • عرض أرقام واضحة للحسابات المفحوصة والمحذوفة والمحتفظ بها والمتعذر حذفها.
  • السماح بإيقاف المهمة واستكمالها من آخر حساب تم فحصه.

لمن صُممت؟

الإضافة مناسبة لـ:

  • أصحاب متاجر WooCommerce الذين تراكم لديهم عدد كبير من الحسابات التي لم تطلب مطلقًا.
  • مديري المتاجر الذين يريدون تنظيف حسابات فترة أو حملة محددة.
  • وكالات WordPress وفرق الصيانة التي تدير متاجر كبيرة وتحتاج إلى عملية تنظيف قابلة للتحكم.
  • مسؤولي قواعد البيانات والأداء الذين يريدون تقليل الحسابات غير الضرورية من دون كتابة استعلامات SQL مباشرة.
  • المتاجر التي تستخدم أدوارًا مخصصة مثل العملاء بالجملة أو أعضاء حملة تسويقية، وتريد فحص كل دور على حدة.

لا تحتاج إلى معرفة برمجية لاستخدام الإضافة، لكن يجب أن تكون لديك صلاحية إدارة WooCommerce وأن تفهم أن حذف المستخدم نهائي.

متى لا تكون الإضافة مناسبة؟

لا تستخدمها إذا كنت تريد:

  • حذف طلبات WooCommerce؛ الإضافة لا تحذف الطلبات.
  • حذف المديرين أو مديري المتجر؛ هذه الحسابات محمية عمدًا.
  • تشغيل التنظيف تلقائيًا في الخلفية أو وفق جدول زمني؛ يجب إبقاء صفحة المهمة مفتوحة أثناء المعالجة.
  • حذف العملاء غير النشطين لمجرد أن آخر طلب لهم قديم؛ الإعداد الآمن الافتراضي يحمي كل حساب له أي طلب تاريخي.
  • تنفيذ الحذف من دون نسخة احتياطية أو تجربة مسبقة على بيئة staging.

كيف تعمل الإضافة؟

  1. تكوين قائمة المرشحين: تجمع المستخدمين الذين يطابقون الأدوار المختارة ونطاق تاريخ التسجيل.
  2. الفحص على دفعات: تجلب عددًا صغيرًا من الحسابات في كل طلب AJAX لتجنب استهلاك موارد الخادم دفعة واحدة.
  3. تطبيق الحماية الإدارية: تستبعد المستخدم الحالي وكل من يملك صلاحية إدارة WordPress أو WooCommerce.
  4. البحث عن الطلبات: تبحث أولًا بمعرف المستخدم، ثم ببريد الفوترة، داخل نطاق الطلبات المختار.
  5. اتخاذ القرار: تحتفظ بالحساب عند العثور على طلب مطابق، وتحذف الحساب عند عدم العثور على طلب.
  6. حفظ التقدم: تسجل المؤشر والإحصاءات والإعدادات حتى يمكن إيقاف المهمة ومتابعتها.

تأثير كل إعداد

الإعداد ما الذي يتحكم فيه؟ إذا تُرك فارغًا
أدوار المستخدمين أنواع الحسابات المرشحة للفحص يجب اختيار دور واحد على الأقل
التسجيل — من أقدم تاريخ تسجيل مقبول لا يوجد حد بداية
التسجيل — إلى أحدث تاريخ تسجيل مقبول لا يوجد حد نهاية
الطلبات — من أول تاريخ للطلبات التي تحمي الحساب تُفحص الطلبات منذ البداية إذا كان تاريخ النهاية محددًا فقط
الطلبات — إلى آخر تاريخ للطلبات التي تحمي الحساب تُفحص الطلبات حتى الوقت الحالي إذا كان تاريخ البداية محددًا فقط
نطاق الطلبات بالكامل يحدد الطلبات التي تمنع حذف الحساب فحص كل الطلبات تاريخيًا، وهو الإعداد الأكثر أمانًا
حجم الدفعة عدد الحسابات التي تعالج في كل اتصال القيمة الافتراضية 10
الانتظار المدة بين كل دفعة وأخرى القيمة الافتراضية 3 ثوانٍ

مثال سريع

لديك 20,000 حساب بدور Customer، وتريد حذف الحسابات المسجلة خلال عام 2024 التي لم تنفذ أي طلب مطلقًا:

  1. اختر دور Customer.
  2. اجعل تاريخ التسجيل من 2024-01-01 إلى 2024-12-31.
  3. اترك تاريخي الطلبات فارغين حتى تفحص الإضافة كل الطلبات التاريخية.
  4. ابدأ بحجم دفعة 10 وانتظار 3 ثوانٍ.
  5. ستحتفظ الإضافة بأي حساب له طلب في أي وقت، وتحذف فقط الحسابات المطابقة التي لم تجد لها أي طلب.

المزايا

  • اختيار دور مستخدم واحد أو عدة أدوار من الأدوار المسجلة في WordPress.
  • واجهة إدارة كاملة باللغتين العربية والإنجليزية، وتتبع لغة مستخدم WordPress تلقائيًا.
  • تصفية الحسابات حسب تاريخ التسجيل: من تاريخ، إلى تاريخ، أو نطاق مفتوح.
  • فحص الطلبات ضمن نطاق زمني مستقل.
  • مطابقة الطلبات بمعرف المستخدم، ثم بالبريد الإلكتروني للفوترة لحماية طلبات الضيوف المرتبطة بالبريد نفسه.
  • دعم جميع حالات طلب WooCommerce المسجلة، بما فيها المعلقة والملغاة والفاشلة والمستردة والحالات المخصصة.
  • معالجة تدريجية مع حجم دفعة ووقت انتظار قابلين للتعديل.
  • إيقاف المهمة واستئنافها من آخر مستخدم تم فحصه.
  • توافق معلن مع WooCommerce High-Performance Order Storage (HPOS).
  • حماية المستخدم الحالي وأصحاب صلاحيات manage_options أو manage_woocommerce من الحذف دائمًا.
  • استخدام Nonce وصلاحية manage_woocommerce لكل طلب AJAX.

المتطلبات

  • WordPress 6.2 أو أحدث.
  • PHP 7.4 أو أحدث.
  • WooCommerce 7.0 أو أحدث ومفعّل.

التثبيت

  1. نزّل ملف webcave-zero-order-customer-cleaner.zip من صفحة Releases.
  2. خذ نسخة احتياطية حديثة من قاعدة البيانات.
  3. من لوحة WordPress انتقل إلى إضافات ← أضف إضافة جديدة ← رفع إضافة.
  4. ارفع ملف ZIP، ثم ثبّت الإضافة وفعّلها.
  5. افتح WooCommerce ← تنظيف المستخدمين.

الاستخدام

  1. اختر دور مستخدم واحدًا على الأقل. دور customer محدد افتراضيًا إذا كان موجودًا.
  2. حدد نطاق تسجيل الحسابات المطلوب فحصها، أو اترك الحقلين فارغين لفحص كل تواريخ التسجيل.
  3. حدد نطاق الطلبات المطلوب اعتباره، أو اتركه فارغًا للبحث في كل الطلبات تاريخيًا.
  4. اختر حجم الدفعة ومدة الانتظار. القيمتان 10 و3 ثوانٍ مناسبتان كبداية.
  5. أكد وجود نسخة احتياطية، ثم ابدأ المهمة.
  6. يمكن إيقاف المهمة مؤقتًا ومتابعتها لاحقًا من الصفحة نفسها.

لغة الواجهة

تستخدم الإضافة نظام ترجمة WordPress القياسي. تظهر الواجهة بالعربية عندما تكون لغة مستخدم لوحة التحكم عربية، وبالإنجليزية عندما تكون لغة المستخدم إنجليزية. يمكن تغيير لغة المستخدم من المستخدمون ← الملف الشخصي ← اللغة، أو تغيير لغة الموقع من الإعدادات ← عام إذا لم يكن للمستخدم اختيار مستقل.

فهم نطاقات التاريخ

نطاق التسجيل ونطاق الطلبات يؤديان وظيفتين مختلفتين:

  • نطاق التسجيل: يحدد قائمة المستخدمين المرشحين للفحص.
  • نطاق الطلبات: يحدد أي الطلبات تمنع حذف مستخدم مرشح.

عند ترك نطاق الطلبات فارغًا، تحتفظ الإضافة بأي مستخدم لديه طلب في أي وقت. هذا هو الاستخدام الأكثر أمانًا لتنظيف الحسابات التي لم تطلب مطلقًا.

تحذير: عند تحديد نطاق للطلبات، لا تُحتسب الطلبات الموجودة خارج هذا النطاق. لذلك قد يُحذف حساب لديه طلب قديم أو أحدث من النطاق، مع بقاء الطلب نفسه في WooCommerce. استخدم نطاق الطلبات فقط عندما يكون هذا السلوك مقصودًا وبعد أخذ نسخة احتياطية.

يمكن ترك تاريخ البداية أو النهاية فارغًا. تاريخ النهاية شامل حتى الساعة 23:59:59 وفق المنطقة الزمنية للموقع عند فحص الطلبات.

ملاحظة المنطقة الزمنية: نطاق تسجيل المستخدم يُطبق على حقل user_registered المخزن في WordPress بتوقيت UTC، بينما نطاق الطلبات يُحسب وفق المنطقة الزمنية المضبوطة للموقع. إذا كان توقيت موقعك بعيدًا عن UTC، راجع الحسابات المسجلة قرب منتصف الليل بعناية.

قواعد الحماية والحذف

لا تحذف الإضافة:

  • المستخدم الذي يشغّل المهمة.
  • أي مستخدم يملك صلاحية إدارة WordPress أو WooCommerce، حتى لو كان دوره مخصصًا.
  • أي مستخدم لديه طلب مطابق لنطاق الطلبات بواسطة معرف الحساب.
  • أي مستخدم يوجد طلب مطابق يحمل بريده كبريد فوترة.

تستدعي الإضافة دالة WordPress القياسية wp_delete_user() من دون تمرير مستخدم لإعادة إسناد المحتوى إليه. ووفق توثيق WordPress الرسمي، يعني ذلك على الموقع العادي:

  • حذف سجل المستخدم وبياناته الوصفية user meta وجلساته المرتبطة بها.
  • احتمال حذف المقالات أو الصفحات أو أنواع المحتوى التي ألّفها المستخدم إذا كان نوع المحتوى معدًا للحذف مع صاحبه.
  • تشغيل خطافات الحذف القياسية، لذلك قد تنفذ الإضافات الأخرى إجراءات إضافية مرتبطة بحذف المستخدم.
  • عدم حذف طلبات WooCommerce؛ تبقى الطلبات محفوظة حتى إذا حُذف الحساب المرتبط بها.

في WordPress Multisite، تستدعي الإضافة الدالة نفسها، والتي تزيل المستخدم من الموقع الحالي بدل حذفه من قاعدة بيانات الشبكة بالكامل. لم يُختبر هذا الإصدار اختبار توافق شاملًا مع Multisite، لذا يجب اختباره على staging أولًا.

مهم جدًا: الإضافة لا تعيد إسناد محتوى المستخدم إلى حساب آخر، ولا تفحص تلقائيًا الاشتراكات أو العضويات أو الحجوزات أو التنزيلات أو العلاقات التي تنشئها إضافات خارجية. استخدمها افتراضيًا مع أدوار العملاء التي لا تنشئ محتوى، واحتفظ بنسخة احتياطية كاملة للموقع وقاعدة البيانات يمكن استعادتها فعليًا.

حدود معروفة قبل التشغيل

  • لا توجد حاليًا خاصية Preview أو Dry Run أو تصدير لقائمة الحسابات قبل الحذف.
  • جميع حالات الطلبات المسجلة في WooCommerce تحمي الحساب، بما فيها الطلبات المعلقة والملغاة والفاشلة والمستردة، وأي حالات مخصصة مسجلة.
  • مطابقة البريد تستخدم بريد حساب WordPress مقابل billing_email المخزن في الطلب وفق استعلام WooCommerce؛ لا تقوم الإضافة بتوحيد البريد أو تنظيفه قبل المقارنة.
  • استخدام بريد فوترة مشترك قد يحمي حسابًا آخر يحمل البريد نفسه، وهذا سلوك حماية مقصود لتقليل الحذف الخاطئ.
  • إجمالي الحسابات يُحسب عند بدء المهمة، لكن الدفعات تُستعلم مباشرة أثناء التشغيل؛ لذلك لا تغيّر الأدوار أو المستخدمين أو إعدادات المتجر أثناء المهمة.
  • تحفظ كل مهمة حسب المستخدم الإداري الذي بدأها. يمكن لمديرين تشغيل مهمتين منفصلتين، لكن تشغيل مهام متداخلة على الأدوار والفترات نفسها غير موصى به وقد يجعل العدادات غير متوقعة.
  • تبقى حالة المهمة محفوظة حتى اكتمالها أو الضغط على «بدء مهمة جديدة». تسجيل الخروج أو إغلاق الصفحة يوقف إرسال الدفعات، ويمكن فتح الصفحة لاحقًا والمتابعة.
  • فلاتر المهمة لا يمكن تعديلها أثناء التشغيل أو الإيقاف المؤقت؛ لبدء معايير جديدة، أوقف المهمة ثم ابدأ مهمة جديدة.

حالات الاستخدام

حذف العملاء الذين لم يطلبوا مطلقًا

  • الدور: Customer.
  • نطاق التسجيل: حسب الحاجة.
  • نطاق الطلبات: اترك الحقلين فارغين.

فحص المسجلين خلال حملة محددة

  • الدور: الدور المرتبط بالحملة أو Customer.
  • نطاق التسجيل: تاريخ بداية الحملة ونهايتها.
  • نطاق الطلبات: فترة القياس المطلوبة.

الأداء والاستئناف

تجلب الإضافة المستخدمين تصاعديًا حسب المعرف وتعالج عددًا صغيرًا في كل طلب AJAX. تحفظ حالة مستقلة لكل مشغّل في جدول الخيارات، وتشمل المؤشر والعدادات والفلاتر. إغلاق الصفحة يوقف إرسال الدفعات الجديدة، ولا يشغّل مهمة خلفية. عند العودة يمكن متابعة المهمة المحفوظة.

استكشاف الأخطاء

  • WooCommerce غير مفعّل: فعّل WooCommerce ثم أعد تحميل الصفحة.
  • انقطاع أو خطأ خادم: خفّض حجم الدفعة وزد وقت الانتظار، ثم اضغط متابعة.
  • لا تظهر أدوار إدارية: هذا مقصود؛ الأدوار الإدارية محمية.
  • تم الاحتفاظ بالمستخدم: يوجد له طلب مطابق، أو يملك صلاحية إدارية، أو هو المستخدم الحالي.
  • إجمالي الفحص صفر: راجع الأدوار المختارة ونطاق تسجيل الحسابات.

بنية المشروع

webcave-zero-order-customer-cleaner/
├── assets/
│   ├── admin.css
│   └── admin.js
├── languages/
│   ├── webcave-zero-order-customer-cleaner.pot
│   ├── webcave-zero-order-customer-cleaner-ar.po
│   └── webcave-zero-order-customer-cleaner-ar.mo
├── webcave-zero-order-customer-cleaner.php
├── readme.txt
├── README.md
├── CHANGELOG.md
└── LICENSE

التطوير والمساهمة

لا تحتاج الإضافة إلى خطوة بناء أو مدير حزم. عدّل الملفات مباشرة، ثم شغّل فحص صياغة PHP وJavaScript قبل إنشاء الإصدار:

php -l webcave-zero-order-customer-cleaner.php
node --check assets/admin.js

للمساهمة، افتح Issue يشرح الحالة وطريقة إعادة إنتاجها، أو أرسل Pull Request صغيرًا ومحددًا مع وصف الاختبار.

الأمان

إذا اكتشفت مشكلة أمنية، لا تنشر تفاصيل الاستغلال في Issue عام. تواصل مع Webcave عبر قناة الدعم الرسمية للموقع.

الترخيص

مرخصة وفق GNU General Public License v2.0 أو أحدث. راجع ملف LICENSE.

سجل الإصدارات

راجع CHANGELOG.md.


English documentation

Webcave Zero Order Customer Cleaner is a WordPress and WooCommerce administration plugin that removes user accounts with no orders matching the chosen scan criteria, avoiding the need to review and delete thousands of accounts manually.

You choose who should be scanned by user role and registration date, then define which orders protect an account from deletion with an independent order date range. The plugin scans accounts in small batches, keeps an account when it finds a matching order, and deletes it when none is found. Administrators and store managers remain protected.

In short: the plugin deletes the WordPress user account, not WooCommerce orders. Standard WordPress deletion can also remove user metadata and some authored content, as detailed under “Protection and deletion rules.” User deletion is permanent, so create a backup and review the filters carefully.

“Zero Order” means zero orders matching the selected order range. When the order range is empty, it means zero orders across all available order history.

⬇️ Download the latest release · 📦 All releases · 🐞 Report an issue

What problem does it solve?

WooCommerce stores can accumulate accounts created by visitors, campaigns, imports, or automated registrations that never become real customers. Reviewing these accounts manually is slow, while bulk deletion without checking orders risks removing genuine customers.

The plugin addresses this by:

  • Restricting the scan to selected user roles instead of every WordPress user.
  • Restricting candidate accounts to a registration period.
  • Checking orders by both customer ID and billing email.
  • Processing scans and deletions incrementally to reduce server load.
  • Reporting scanned, deleted, kept, and failed account totals.
  • Allowing a job to be paused and resumed from its last scanned account.

Who is it for?

The plugin is intended for:

  • WooCommerce store owners with many accounts that have never placed an order.
  • Store managers cleaning accounts created during a particular period or campaign.
  • WordPress agencies and maintenance teams that manage large stores and need a controlled cleanup process.
  • Database and performance administrators who want to reduce unnecessary accounts without writing direct SQL queries.
  • Stores with custom roles, such as wholesale customers or campaign members, that need to scan each role independently.

No programming knowledge is required, but the operator must have WooCommerce management permission and understand that deleting a user is permanent.

When should it not be used?

Do not use this plugin when you need to:

  • Delete WooCommerce orders; the plugin never deletes orders.
  • Delete administrators or store managers; those accounts are deliberately protected.
  • Run scheduled or unattended background cleanup; the job page must remain open while batches are processed.
  • Delete customers only because their latest order is old; the safest default protects every account with any historical order.
  • Run destructive cleanup without a backup or a prior test on a staging environment.

How does it work?

  1. Build candidate list: find users matching the selected roles and registration date range.
  2. Process batches: fetch a small number of accounts per AJAX request to avoid a single long-running server process.
  3. Apply administrative protection: exclude the current operator and anyone with WordPress or WooCommerce management capabilities.
  4. Check orders: search by customer ID and then billing email within the selected order range.
  5. Make the decision: keep the account when a matching order exists; delete it when no matching order exists.
  6. Save progress: store the cursor, counters, and filters so the job can be paused and resumed.

What each setting controls

Setting What does it control? When left empty
User roles Account types eligible for scanning At least one role is required
Registration — from Earliest accepted registration date No start limit
Registration — to Latest accepted registration date No end limit
Orders — from First order date that can protect an account Orders are checked from the beginning when only an end date is set
Orders — to Last order date that can protect an account Orders are checked through the present when only a start date is set
Entire order range Which orders prevent account deletion All historical orders are checked; this is the safest setting
Batch size Accounts processed per request Default is 10
Delay Time between consecutive batches Default is 3 seconds

Quick example

Suppose a store has 20,000 users with the Customer role and needs to delete accounts registered during 2024 that have never placed an order:

  1. Select the Customer role.
  2. Set registration dates from 2024-01-01 to 2024-12-31.
  3. Leave both order dates empty so every historical order is checked.
  4. Start with a batch size of 10 and a delay of 3 seconds.
  5. The plugin keeps any account with an order at any time and deletes only matching accounts for which no order is found.

Features

  • Select one or multiple registered WordPress user roles.
  • Complete Arabic and English admin interfaces that automatically follow the WordPress user's language.
  • Filter candidate accounts by registration date, with optional open start or end dates.
  • Check WooCommerce orders within an independent date range.
  • Match orders by customer ID and billing email.
  • Include every registered WooCommerce order status, including pending, cancelled, failed, refunded, and custom statuses.
  • Process users in configurable batches with a delay between requests.
  • Pause and resume a saved cleanup job from the last scanned user.
  • Compatible with WooCommerce High-Performance Order Storage (HPOS).
  • Permanently protect the current user and anyone with manage_options or manage_woocommerce capabilities.
  • Protect every AJAX request with a nonce and the manage_woocommerce capability check.

Requirements

  • WordPress 6.2 or newer.
  • PHP 7.4 or newer.
  • WooCommerce 7.0 or newer, installed and active.

Installation

  1. Download webcave-zero-order-customer-cleaner.zip from the Releases page.
  2. Create a current database backup.
  3. In WordPress, go to Plugins → Add New Plugin → Upload Plugin.
  4. Upload the ZIP file, install it, and activate it.
  5. Open WooCommerce → User Cleaner.

Usage

  1. Select at least one user role. The customer role is selected by default when available.
  2. Set the candidate account registration range, or leave both fields empty to include all registration dates.
  3. Set the order date range to check, or leave both fields empty to search all historical orders.
  4. Choose a batch size and request delay. A batch size of 10 with a 3-second delay is a sensible starting point.
  5. Confirm that a backup exists and start the job.
  6. Pause or resume the job when needed.

Interface language

The plugin uses the standard WordPress localization system. Its interface appears in Arabic when the current admin user's WordPress language is Arabic and in English when it is English. Change the user language under Users → Profile → Language, or change the site language under Settings → General when the user has no separate language preference.

Understanding the date ranges

The two ranges serve different purposes:

  • Registration range: determines which users are candidates for scanning.
  • Order range: determines which orders protect a candidate from deletion.

Leaving the order range empty protects any user who has an order at any time. This is the safest configuration when removing accounts that have never ordered.

Warning: When an order range is specified, orders outside that range are ignored. A user who has an older or newer order outside the range may therefore be deleted, while the WooCommerce order itself remains stored. Use an order range only when this behavior is intentional and after creating a backup.

Either end of a range may be left empty. The end date includes the complete day through 23:59:59 in the site's timezone when checking orders.

Timezone note: the registration range is applied to WordPress's user_registered field, which is stored in UTC. The order range is calculated in the site's configured timezone. On stores far from UTC, review registrations near midnight carefully.

Protection and deletion rules

The plugin never deletes:

  • The user currently running the job.
  • A user with WordPress or WooCommerce management capabilities, including users assigned to custom administrative roles.
  • A user with an order matching the selected order range and customer ID.
  • A user whose billing email appears on an order matching the selected range.

The plugin calls the standard WordPress wp_delete_user() function without supplying another user for content reassignment. According to the official WordPress documentation, on a standard single-site installation this means:

  • The user record, user metadata, and associated sessions are removed.
  • Posts, pages, or other authored post types may be deleted when that content type is configured to be deleted with its author.
  • Standard deletion hooks run, so other plugins may perform additional cleanup connected to user deletion.
  • WooCommerce orders are not deleted; they remain stored even when the linked account is removed.

On WordPress Multisite, the same function removes the user from the current site rather than deleting the user from the entire network database. This release has not received comprehensive Multisite compatibility testing, so test it on staging first.

Critical: the plugin does not reassign authored content and does not independently inspect subscriptions, memberships, bookings, downloads, or relationships created by third-party plugins. Prefer customer roles that do not create content, and keep a verified full-site and database backup that can actually be restored.

Known limitations before running

  • There is currently no preview, dry-run mode, or export of candidate account IDs before deletion.
  • Every WooCommerce order status protects an account, including pending, cancelled, failed, refunded, and registered custom statuses.
  • Email matching compares the WordPress account email with the order's stored billing_email through WooCommerce's query API; the plugin performs no additional normalization.
  • A shared billing email can protect another account using that email. This conservative behavior reduces accidental deletion.
  • The total is counted when the job starts, while batches query live user data during execution. Do not modify users, roles, or store settings during a job.
  • Job state is stored per administrative operator. Two operators can start separate jobs, but overlapping jobs for the same roles and periods are not recommended and can produce unexpected counters.
  • A job remains saved until it completes or the operator starts a new job. Logging out or closing the page stops new batches; reopen the page to resume.
  • Job filters cannot be edited while a job is running or paused. Pause it and start a new job to use different criteria.

Common use cases

Remove customers who have never ordered

  • Role: Customer.
  • Registration range: as required.
  • Order range: leave both fields empty.

Review accounts registered during a campaign

  • Role: the campaign role or Customer.
  • Registration range: campaign start and end dates.
  • Order range: the required measurement period.

Performance and job recovery

Users are fetched in ascending ID order and processed through small AJAX batches. A separate state is stored for each operator in the WordPress options table, including the cursor, counters, and selected filters. Closing the page stops new batches; this is not a background process. Reopening the page allows the saved job to continue.

Troubleshooting

  • WooCommerce is unavailable: activate WooCommerce and reload the page.
  • Server or connection error: reduce the batch size, increase the delay, and resume the job.
  • Administrative roles are missing: this is intentional; administrative accounts are protected.
  • A user was kept: the user has a matching order, administrative capabilities, or is the current operator.
  • The scan total is zero: review the selected roles and registration range.

Development

The plugin has no build step or package-manager dependency. Before packaging a release, validate the source files:

php -l webcave-zero-order-customer-cleaner.php
node --check assets/admin.js

For contributions, open an issue with reproducible steps or submit a focused pull request that describes how the change was tested.

Security

Please do not publish exploit details in a public issue. Contact Webcave through its official support channel for responsible disclosure.

License

Licensed under the GNU General Public License v2.0 or later. See LICENSE.

Changelog

See CHANGELOG.md.