Lesson 126 Implementation — Building the Escrow Settings Administration Page
In the previous lesson, we introduced the Flipnzee_Escrow_API_Client to separate Escrow.com communication from the rest of the plugin. Before making live API requests, however, the plugin needs a secure and configurable way to store connection settings.
In this lesson, we implement a dedicated Escrow Settings administration page. This page becomes the central location for configuring the Escrow integration and provides the foundation for future Sandbox and Production connectivity.
Why This Lesson Matters
Rather than hard-coding credentials inside PHP files, professional WordPress plugins allow administrators to manage configuration through the WordPress dashboard.
This approach offers several advantages:
- Secure credential storage
- Easy environment switching
- No source code modifications
- Future extensibility
- Better user experience
This lesson transforms our Escrow integration from a developer-only feature into one that can be configured by site administrators.
Objectives
By the end of this lesson the plugin can:
- Display a dedicated Escrow Settings page
- Store settings using the WordPress Options API
- Support multiple environments
- Store Sandbox credentials
- Enable or disable debug logging
- Protect submissions using WordPress nonces
Creating a Dedicated Admin Page
A new administration class was introduced:
admin/
└── class-admin-escrow-settings.php
Keeping Escrow settings isolated from the rest of the administration area improves maintainability and keeps responsibilities clearly separated.
Registering the Menu
A new submenu was added beneath the Flipnzee Auctions menu.
The page now appears as:
Flipnzee Auctions
Escrow Settings
This provides administrators with a single location for all Escrow configuration.
Building the User Interface
The settings page currently includes:
- Environment selector
- Sandbox Email
- Sandbox API Key
- Debug Logging option
- Save Settings button
The interface follows the standard WordPress administration style using native form controls and the familiar form-table layout.
Supported Environments
The plugin now supports multiple operating modes.
| Environment | Purpose |
|---|---|
| Simulation | Internal testing without API requests |
| Sandbox | Escrow.com’s testing environment |
| Production | Live Escrow transactions |
Development will continue using Simulation Mode until live API communication is introduced in later lessons.
Saving Configuration
Instead of storing credentials in PHP constants or configuration files, settings are saved using the WordPress Options API.
This provides several benefits:
- Persistent storage
- Automatic serialization
- Easy retrieval
- WordPress compatibility
The page automatically loads the stored configuration whenever it is opened.
Security
Administrative forms should never trust submitted data.
This lesson includes several security measures:
- WordPress nonce verification
- Capability checks through the admin menu
- Data sanitization
- Escaping output before rendering
These practices help protect against common attack vectors while following WordPress coding standards.
Object-Oriented Design
The implementation continues the plugin’s object-oriented architecture.
Responsibilities remain clearly separated.
Flipnzee_Admin_Escrow_Settings
│
├── render_page()
├── save_settings()
└── get_settings()
Each method performs a single responsibility, making future maintenance significantly easier.
Integration with Previous Lessons
This lesson connects naturally with the previous architecture.
Lesson 125
Escrow API Client
│
▼
Lesson 126
Escrow Settings
│
▼
Future Lessons
Sandbox API Requests
Production API Requests
Transaction Synchronization
The API Client introduced previously will soon begin reading these settings instead of relying on hard-coded values.
Testing
The following functionality was successfully verified:
- Escrow Settings page loads correctly
- Environment selection works
- Sandbox credentials display properly
- Debug Logging option is available
- Settings persist using the WordPress Options API
- WordPress nonce protection is functioning
- Object-oriented structure loads correctly
Challenges Encountered
While implementing the page, several issues were identified and resolved:
- Missing class loading in the plugin bootstrap
- Callback registration issues
- Runtime debugging for admin page rendering
- Validation of class loading order
- Refactoring the settings page into a dedicated administration class
Resolving these issues strengthened the plugin’s initialization process and improved its overall architecture.
What’s Next?
With configuration now handled through the WordPress dashboard, the next step is to make practical use of these settings.
In Lesson 127, we will connect the Escrow API Client to the stored configuration and implement the first Test Escrow Connection feature, allowing administrators to verify communication with the selected Simulation, Sandbox, or Production environment before creating live transactions.
Files Introduced / Updated
admin/class-admin-escrow-settings.php
admin/class-admin.php
flipnzee-auctions.php
These changes establish the administrative foundation required for the upcoming Escrow integration while keeping the plugin modular, secure, and aligned with WordPress development best practices.
https://github.com/SplendidDigital/flipnzee-auctions/releases/tag/lesson-126-stable
