# Enterprise Request Management System (WordPress Plugin)
A full-featured enterprise WordPress plugin for managing client requests with pricing calculation, workflow states, admin dashboard, client portals, and secure token-based access control.
Purpose
Enterprise businesses need systematic request handling:
- Client submission — Web form for new requests
- Pricing calculation — Auto-calculate based on request type/priority
- Workflow management — Track status through lifecycle
- Admin dashboard — Full management interface
- Client portal — Secure access for clients to view their requests
- Kanban view — Visual workflow management
Architecture
Core Shortcodes
| Shortcode | Purpose |
|---|---|
[erms_request_form] | Public request submission form |
[erms_admin_dashboard] | Admin management interface |
[erms_client_portal] | Client access via token |
Request Form Features
php
function erms_render_request_form() {
ob_start();
?>
<form id="erms-request-form" class="erms-form">
<div class="form-group">
<label>Name *</label>
<input type="text" name="client_name" required>
</div>
<div class="form-group">
<label>Email *</label>
<input type="email" name="client_email" required>
</div>
<div class="form-group">
<label>Organization</label>
<input type="text" name="organization">
</div>
<div class="form-group">
<label>Website URL</label>
<input type="url" name="website_url">
</div>
<div class="form-group">
<label>Request Type *</label>
<select name="request_type" id="erms-request-type" required>
<option value="">Select Type</option>
<option value="development">Development</option>
<option value="design">Design</option>
<option value="content">Content</option>
<option value="maintenance">Maintenance</option>
</select>
</div>
<div class="form-group">
<label>Priority *</label>
<select name="priority" required>
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
<option value="urgent">Urgent</option>
</select>
</div>
<div class="form-group">
<label>Project Details *</label>
<textarea name="details" rows="5" required></textarea>
</div>
<div class="erms-price-estimate">
<h4>Estimated Cost: <span id="erms-estimated-price">₹0</span></h4>
</div>
<button type="submit" class="btn btn-primary">Submit Request</button>
</form>
<?php
return ob_get_clean();
}Admin Dashboard Features
php
function erms_render_admin_dashboard() {
if (!current_user_can('manage_options')) {
return '<p>Access denied.</p>';
}
ob_start();
?>
<div id="erms-admin-app" class="erms-admin-container">
<!-- Navigation -->
<div class="erms-nav">
<button data-view="requests" class="active">Requests</button>
<button data-view="clients">Clients</button>
<button data-view="pricing">Pricing</button>
<button data-view="settings">Settings</button>
<button data-view="export">Export/Import</button>
</div>
<!-- Requests View -->
<div id="erms-requests-view" class="erms-view">
<div class="erms-stats-row">
<div class="erms-stat-card">
<span class="stat-value" id="erms-count-pending">0</span>
<span class="stat-label">Pending</span>
</div>
<div class="erms-stat-card">
<span class="stat-value" id="erms-count-progress">0</span>
<span class="stat-label">In Progress</span>
</div>
<div class="erms-stat-card">
<span class="stat-value" id="erms-count-completed">0</span>
<span class="stat-label">Completed</span>
</div>
</div>
<!-- List/Kanban Toggle -->
<div class="erms-view-toggle">
<button class="toggle-btn" data-view-type="list">List</button>
<button class="toggle-btn" data-view-type="kanban">Kanban</button>
</div>
<!-- Kanban Board -->
<div id="erms-kanban" class="erms-kanban">
<div class="kanban-column" data-status="pending">
<h3>Pending Review</h3>
<div class="kanban-cards"></div>
</div>
<div class="kanban-column" data-status="in_progress">
<h3>In Progress</h3>
<div class="kanban-cards"></div>
</div>
<div class="kanban-column" data-status="completed">
<h3>Completed</h3>
<div class="kanban-cards"></div>
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
}Client Portal Features
php
function erms_render_client_portal() {
$token = $_GET['token'] ?? '';
if (!$token) {
return '<p>Access token required. Please use your unique access link.</p>';
}
// Validate token
$client = erms_validate_client_token($token);
if (!$client) {
return '<p>Invalid or expired access token.</p>';
}
// Get client requests
$requests = erms_get_client_requests($client->ID);
ob_start();
?>
<div class="erms-client-portal">
<h2>Welcome, <?php echo esc_html($client->client_name); ?></h2>
<table class="erms-requests-table">
<thead>
<tr>
<th>Request ID</th>
<th>Type</th>
<th>Priority</th>
<th>Status</th>
<th>Submitted</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($requests as $request): ?>
<tr>
<td>#<?php echo $request->ID; ?></td>
<td><?php echo ucfirst($request->request_type); ?></td>
<td><span class="priority-<?php echo $request->priority; ?>"><?php echo ucfirst($request->priority); ?></span></td>
<td><span class="status-<?php echo $request->status; ?>"><?php echo ucfirst($request->status); ?></span></td>
<td><?php echo date('M j, Y', strtotime($request->post_date)); ?></td>
<td><button class="view-details" data-id="<?php echo $request->ID; ?>">View</button></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
return ob_get_clean();
}Pricing Configuration
php
// Pricing stored in options
function erms_get_pricing() {
return get_option('erms_pricing', [
'development' => [
'low' => 5000,
'medium' => 10000,
'high' => 20000,
'urgent' => 35000
],
'design' => [
'low' => 3000,
'medium' => 7500,
'high' => 15000,
'urgent' => 25000
],
'content' => [
'low' => 2000,
'medium' => 5000,
'high' => 10000,
'urgent' => 18000
],
'maintenance' => [
'low' => 1500,
'medium' => 3500,
'high' => 7000,
'urgent' => 12000
]
]);
}
function erms_calculate_price($request_type, $priority) {
$pricing = erms_get_pricing();
return $pricing[$request_type][$priority] ?? 0;
}Request Lifecycle
code
New → Pending Review → In Progress → Completed
↓ ↑
Rejected On HoldDatabase Schema
| Table | Purpose |
|---|---|
| wp_posts (CPT: erms_request) | Main request storage |
| wp_postmeta | Request metadata |
| wp_erms_clients | Client records with tokens |
| wp_options (erms_pricing) | Pricing configuration |
Features Summary
- Public request form with price estimation
- Admin SPA dashboard with Vue.js
- Kanban board for workflow visualization
- Client management with access tokens
- Pricing configuration per request type/priority
- Export/Import functionality
- Activity logging
Architecture Feedback
Spotted a potential optimization or antipattern? Let me know.