Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dackzui/machship-tracking/archive/refs/heads/main.zipThis WordPress plugin provides comprehensive MachShip tracking integration.
Contributors: marieapellanes
Tags: tracking, shipping, machship, logistics, delivery
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Features
- MachShip Tracking: Full API integration with MachShip for detailed consignment information and POD downloads
- Secure POD Downloads: Download proof of delivery documents from MachShip
- REST API: Full REST API endpoints for custom integrations
- Multiple Search Methods: Search by MS number, carrier consignment ID, Reference1, or Reference2
- Admin Interface: Easy API token configuration in WordPress admin
Shortcodes
MachShip Tracking Form
[machship_tracking_form]
Displays a form that searches the MachShip system for consignment information.
API Endpoints
MachShip Tracking
POST /wp-json/machship/v1/track- Searches MachShip system for consignment information
- Returns detailed consignment data and POD download links
API Connection Test
POST /wp-json/machship/v1/test- Tests the MachShip API connection
- Useful for troubleshooting API token issues
POD Download
GET /wp-json/machship/v1/pods/{consignmentId}- Downloads proof of delivery documents from MachShip
- Requires valid consignment ID
Setup
- Install and activate the plugin
- Go to Settings → MachShip Tracking in WordPress admin
- Enter your MachShip API token
- Use the shortcode on any page or post
Supported Tracking Codes
The plugin supports multiple search methods for maximum flexibility:
- MS Numbers: MS00123456 (automatically converted to numeric ID)
- Numeric IDs: Direct MachShip consignment IDs
- Carrier Consignment IDs: External carrier tracking numbers
- Reference1: Custom reference field 1
- Reference2: Custom reference field 2
Usage Examples
Basic Tracking Form
Add this to any page or post:
[machship_tracking_form]
API Usage
// Track consignment
fetch('/wp-json/machship/v1/track', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({code: 'MS00123456'})
})
.then(response => response.json())
.then(data => {
console.log('Consignment:', data.data);
if (data.podUrl) {
console.log('POD available:', data.podUrl);
}
});
Test API Connection
// Test MachShip API connection
fetch('/wp-json/machship/v1/test', {
method: 'POST',
headers: {'Content-Type': 'application/json'}
})
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('API connection successful');
} else {
console.error('API error:', data.message);
}
});
Response Format
Successful Tracking Response
{
"ok": true,
"data": {
"id": 12345,
"consignmentNumber": "MS00123456",
"carrierConsignmentId": "ABC123456",
"status": "Delivered",
"carrierName": "Australia Post",
"completedDate": "2024-01-15T10:30:00Z",
"attachmentCount": 1,
"trackingPageAccessToken": "abc123"
},
"podUrl": "https://yoursite.com/wp-json/machship/v1/pods/12345"
}
Error Response
{
"code": "machship_not_found",
"message": "No matching consignment found for: MS00123456"
}
Styling
The plugin includes inline CSS for basic styling. You can customize the appearance by adding CSS to your theme or using the WordPress Customizer.
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Valid MachShip API token
- cURL extension enabled
Version History
- 0.3.0: Removed EPM/EFM logistics integration, focused on MachShip-only functionality
- 0.2.0: Original dual tracking system version