Test Orders for WooCommerce® WP Registry grade C-. High-severity findings · 1 findingWP RegistryHigh-severity findings · 1 findingOpen the reportC-
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/robertdevore/test-orders-for-woocommerce/releases/download/1.1.0/test-orders-for-woocommerce.zipTest Orders for WooCommerce® is a lightweight plugin that adds a "Test Order" option to your WooCommerce store, allowing you to place test orders without requiring payment.
Perfect for staging environments or testing new WooCommerce setups.
Features
- Test Order Payment Gateway: Adds a "Test Order" option to your checkout.
- Customizable Settings: Configure the order status and whether to reduce stock levels for test orders.
- Seamless WooCommerce Integration: Built using WooCommerce hooks and standards.
- Developer-Friendly: Easily extensible for advanced use cases.
- Localization Ready: Fully translatable with
.mo/.pofiles.
Installation
From the WordPress Admin Dashboard:
- Download the latest release from GitHub.
- Go to Plugins > Add New > Upload Plugin.
- Upload the downloaded ZIP file and activate the plugin.
- Ensure WooCommerce® is active.
Manual Installation:
- Upload the
test-orders-for-woocommercefolder to the/wp-content/plugins/directory. - Activate the plugin through the Plugins menu in WordPress.
- Ensure WooCommerce® is active.
Usage
Enabling Test Orders
- Go to WooCommerce > Settings > Payments.
- Enable the "Test Order" payment gateway.
Customizing Test Order Behavior
- Navigate to WooCommerce > Test Orders.
- Configure the following options:
- Order Status: Choose the default status for test orders (
Completed,Processing,On Hold, orPending). - Reduce Stock: Determine whether stock levels should decrease when processing test orders.
- Order Status: Choose the default status for test orders (
Example Use Case
Use the "Test Order" gateway in staging environments to verify order workflows, email notifications, and other post-purchase functionalities without actual payments.
Development
Prerequisites
- WordPress® Version: 5.0 or higher
- WooCommerce® Version: 4.0 or higher
Code Structure
- Custom Payment Gateway: Implements WooCommerce's
WC_Payment_Gatewayclass. - Admin Settings Page: Accessible via WooCommerce > Test Orders.
Extending the Plugin
Developers can customize plugin behavior by using filters and actions. For example, modify the default test order status:
add_filter( 'wc_test_order_status', function( $status ) {
return 'on-hold';
});
Updating the Plugin
This plugin uses YahnisElsts/Plugin Update Checker for automatic updates via GitHub.
Security
- Input Sanitization: All user inputs are sanitized using WordPress functions.
- Nonce Protection: Nonces are used for all settings forms to prevent CSRF attacks.
- Escaping Outputs: Proper escaping is applied to all outputs in the admin panel.
Releases
2 releases. Each count is every asset in that release; expand a row for the breakdown.
Active-site estimate ≈10 comes from the median of recent superseded releases. Method.