Safe Ship Pro Documentation

Welcome to Safe Ship Pro

This comprehensive documentation will guide you through every aspect of the Safe Ship Pro plugin, from basic setup to advanced customization.

What is Safe Ship Pro?

Safe Ship Pro is a comprehensive WooCommerce plugin that adds shipping protection options to your online store. It allows customers to purchase shipping insurance to protect their orders against loss, damage, or theft during transit, while providing store owners with a complete claims management system.

Shipping Protection
Add protection options at checkout with flexible fee calculation methods.
Claims Management
Complete system for handling shipping protection claims with file uploads.
Email Notifications
Automated notifications for customers and admins throughout the process.
Analytics Dashboard
Track protection rates, revenue, and claims with detailed reports.
HPOS Compatible
Full support for WooCommerce High-Performance Order Storage.
License Management
Built-in license system with automatic updates and support.

System Requirements

Component Minimum Version Recommended
WordPress 5.0 6.0+
WooCommerce 3.0 8.0+
PHP 7.4 8.1+
MySQL 5.6 8.0+
Ready to Get Started?

Continue to the Installation section to begin setting up Safe Ship Pro on your WooCommerce store.

Installation Guide

Standard Installation

  1. Download the plugin ZIP file from your account
  2. Navigate to WordPress Admin → Plugins → Add New
  3. Click "Upload Plugin" and select the ZIP file
  4. Click "Install Now" and then "Activate"
  5. Go to Safe Ship Pro → License to enter your license key
WooCommerce Required

Safe Ship Pro requires WooCommerce to be installed and active. The plugin will show an error notice if WooCommerce is not detected.

Manual Installation

If you prefer to install manually via FTP:

  1. Extract the ZIP file to /wp-content/plugins/safe-ship-pro/
  2. Activate the plugin through the WordPress Plugins menu
  3. Configure your settings in the admin panel

Post-Installation Setup

Quick Setup Checklist
  1. License Activation - Enter your license key in Safe Ship Pro → License
  2. Basic Configuration - Set up protection fees in Safe Ship Pro → Settings
  3. Test Checkout - Verify the protection option appears during checkout
  4. Email Setup - Test email notifications are working
  5. Claims Testing - Create a test claim to verify the system
Next Steps

Once installed, proceed to the Configuration section to set up your protection options and fees.

Configuration

General Settings

Navigate to Safe Ship Pro → Settings → General Settings to configure basic options:

Protection Settings
Setting Description Default
Enable Protection Toggle protection option on/off globally Enabled
Fee Type Percentage of cart value or flat fee Percentage
Fee Amount Percentage (1.5% = 1.5) or flat amount 1.5
Minimum Fee Minimum fee for percentage calculations $0.99
Maximum Fee Maximum fee for percentage calculations $9.99
Default Checked Pre-select protection at checkout Disabled

Display Customization

// Example: Custom protection label
Protection Label: "Package Insurance"
Description: "Protect your order against shipping issues"

// Logo and branding
Protection Logo: Upload company logo
Provider Name: "Your Insurance Provider"
Provider Link: "https://provider.com"

Claims Settings

Claims Configuration
  • Enable Claims System - Allow customers to file claims
  • Email Notifications - Send automated emails for claims
  • Claim Types - Define available claim categories
  • File Upload Support - Allow evidence attachments
Configuration Tips

Start with conservative settings and adjust based on your store's needs. Monitor protection adoption rates and claims frequency to optimize your configuration.

Plugin Features

Core Features Overview

Checkout Integration
Seamless integration with WooCommerce checkout process with modern toggle interface.
Dynamic Fee Calculation
Flexible percentage or flat fee calculation with min/max constraints.
Customer Portal
Dedicated claims section in customer account with full claim management.
Admin Dashboard
Complete admin interface for managing claims, orders, and analytics.

Advanced Features

Email Notification System
  • Protection Confirmation - Sent when customer adds protection
  • Claim Submitted - Confirmation for customer, notification for admin
  • Status Updates - Automated emails when claim status changes
  • Customizable Templates - Override email templates in your theme
Analytics & Reporting
  • Protection Metrics - Adoption rates, revenue tracking
  • Claims Analytics - Approval rates, type distribution
  • Visual Charts - Interactive charts with Chart.js
  • Export Capabilities - Data export for external analysis

Technical Features

HPOS Compatibility

Full support for WooCommerce High-Performance Order Storage (HPOS) ensuring future compatibility and optimal performance.

Feature Status Description
HPOS Support ✓ Full Complete WooCommerce HPOS compatibility
REST API ✓ Available RESTful endpoints for external integrations
Multisite Partial Network activation supported
Translations Ready Translation-ready with .pot file

Shipping Protection

How It Works

The shipping protection system integrates seamlessly into your WooCommerce checkout process:

  1. Customer adds products to cart
  2. Protection option appears at checkout
  3. Fee is calculated based on your settings
  4. Customer toggles protection on or off
  5. Fee is added to order if selected
  6. Order is marked as protected

Fee Calculation Methods

Percentage-Based Calculation
// Example calculation
cartTotal = $150.00
percentage = 1.5% (0.015)
calculatedFee = $150.00 * 0.015 = $2.25

// Apply min/max constraints
minFee = $0.99
maxFee = $9.99
finalFee = Math.max(minFee, Math.min(calculatedFee, maxFee))
// Result: $2.25 (within range)
Flat Fee Calculation
// Simple flat fee
cartTotal = $150.00
flatFee = $3.99
finalFee = $3.99
// Result: $3.99 (regardless of cart value)

Product Eligibility

Control which products are eligible for shipping protection:

  • Global Settings - Enable/disable protection site-wide
  • Category Exclusions - Exclude entire product categories
  • Individual Products - Override settings per product
  • Virtual Products - Automatically excluded
Best Practices
  • Start with conservative percentage rates (1-2%)
  • Set reasonable min/max fee limits
  • Exclude digital/virtual products
  • Test thoroughly before going live

Claims Management

Claims Workflow

The claims system provides a complete workflow from submission to resolution:

1. Submission
Customer files claim through My Account with supporting evidence.
2. Review
Admin reviews claim details and supporting documentation.
3. Processing
Claim moves to processing status while being investigated.
4. Resolution
Claim is approved/denied and marked as completed.

Claim Statuses

Status Description Customer Visible Actions Available
Pending Newly submitted claim awaiting review Yes Admin review, move to processing
Processing Claim under active investigation Yes Admin notes, approve/deny
Approved Claim approved for resolution Yes Mark as completed
Denied Claim rejected with reason Yes Close claim
Completed Claim fully resolved Yes Archive claim

File Upload Support

Customers can upload supporting evidence with their claims:

  • Supported Formats - JPG, PNG, PDF files
  • File Size Limits - 5MB per file maximum
  • Multiple Files - Upload multiple evidence files
  • Secure Storage - Files stored in protected directory
Claim Types

Configure available claim types in the admin settings:

  • Damaged Package - Items arrived damaged
  • Lost Package - Package never arrived
  • Stolen Package - Package stolen after delivery
  • Delayed Delivery - Significant shipping delays
  • Other Issue - Custom claim types

Analytics Dashboard

Key Metrics

The analytics dashboard provides comprehensive insights into your shipping protection performance:

Protection Rate
Percentage of orders that include shipping protection.
Protection Revenue
Total revenue generated from protection fees.
Claims Rate
Ratio of claims filed vs protected orders.
Approval Rate
Percentage of claims that are approved.

Visual Charts

Interactive charts powered by Chart.js provide visual insights:

  • Daily Protection Data - Line chart showing protection adoption over time
  • Claims by Type - Pie chart breakdown of claim categories
  • Claims by Status - Doughnut chart of claim status distribution
  • Revenue Trends - Bar chart showing protection revenue trends
Date Range Filtering

Filter analytics data by custom date ranges:

  • Default: Last 30 days
  • Custom: Any date range selection
  • Quick filters: 7 days, 30 days, 90 days, 1 year
  • Export: Download filtered data as CSV

Dashboard Widget

Key metrics are also available as a WordPress dashboard widget for quick access:

// Dashboard widget shows:
- Protected orders count
- Total protection fees collected
- Total claims filed
- Pending claims requiring attention

User Guide

For Customers

Adding Protection at Checkout
  1. Add products to cart and proceed to checkout
  2. Look for the "Shipping Protection" section
  3. Toggle the protection switch to enable
  4. Review the protection fee added to your total
  5. Complete your order as normal
Filing a Claim
  1. Log into your account on the store website
  2. Navigate to "Shipping Claims" in your account menu
  3. Click "File a New Claim" or select from protected orders
  4. Choose the appropriate claim type
  5. Provide detailed description of the issue
  6. Upload supporting photos or documents (optional)
  7. Submit the claim and wait for review

Tracking Your Claims

  • Status Updates - Receive email notifications when status changes
  • Claim History - View all claims in your account
  • Details View - See complete claim information and status
  • Response Times - Typical review time is 1-3 business days
Filing Tips
  • Provide clear, detailed descriptions
  • Upload photos showing damage or delivery issues
  • File claims promptly after discovering issues
  • Keep delivery confirmation and tracking information

Admin Guide

Managing Protected Orders

Protected orders are easily identifiable in your WooCommerce admin:

  • Order List - Protected orders show protection status
  • Order Details - Protection information in order meta box
  • Protection Amount - Fee amount clearly displayed
  • Quick Actions - Create claims directly from order page

Processing Claims

Claim Review Process
  1. New Claim Notification - Receive email when claim is filed
  2. Review Details - Examine claim information and attachments
  3. Update Status - Move from Pending → Processing → Approved/Denied
  4. Add Notes - Internal notes for team communication
  5. Customer Communication - Automated emails keep customer informed

Bulk Actions

Efficiently manage multiple claims:

  • Filter claims by status, date, or type
  • Bulk status updates for multiple claims
  • Export claim data for external analysis
  • Search claims by customer or order details

Analytics Review

Regular analytics review helps optimize your protection offering:

Metric Good Range Action if Outside Range
Protection Rate 15-30% Adjust fees or marketing
Claims Rate 1-5% Review shipping partners
Approval Rate 70-90% Review approval criteria

Developer Guide

Plugin Architecture

Safe Ship Pro follows WordPress coding standards with a modular architecture:

safe-ship-pro/
├── admin/                  # Admin-specific functionality
│   ├── css/               # Admin stylesheets
│   ├── js/                # Admin JavaScript
│   ├── partials/          # Admin template files
│   └── class-safe-ship-pro-admin.php
├── includes/              # Core plugin classes
│   ├── class-safe-ship-pro.php
│   ├── class-safe-ship-pro-protection.php
│   ├── class-safe-ship-pro-claims.php
│   ├── class-safe-ship-pro-analytics.php
│   └── class-safe-ship-pro-emails.php
├── public/                # Public-facing functionality
│   ├── css/               # Frontend stylesheets
│   ├── js/                # Frontend JavaScript
│   ├── partials/          # Frontend templates
│   └── class-safe-ship-pro-public.php
└── languages/             # Translation files

Core Classes

Main Classes Overview
  • Safe_Ship_Pro - Main plugin class and orchestrator
  • Safe_Ship_Pro_Protection - Protection functionality and fee calculation
  • Safe_Ship_Pro_Claims - Claims management and workflow
  • Safe_Ship_Pro_Analytics - Analytics and reporting features
  • Safe_Ship_Pro_Emails - Email notification system
  • Safe_Ship_Pro_License - License management and updates

Custom Development

Fee Calculation Customization

/**
 * Custom protection fee calculation
 */
function custom_protection_fee($fee, $cart_total) {
    // Custom logic for fee calculation
    if ($cart_total > 100) {
        return $cart_total * 0.02; // 2% for orders over $100
    } else if ($cart_total > 50) {
        return $cart_total * 0.025; // 2.5% for orders $50-$100
    }
    return $fee; // Use default calculation
}
add_filter('safe_ship_pro_protection_fee', 'custom_protection_fee', 10, 2);

Custom Email Templates

Override email templates by placing them in your theme:

// Template location in your theme:
your-theme/
└── safe-ship-pro/
    └── emails/
        ├── protection-confirmation.php
        ├── claim-notification.php
        └── claim-status-update.php

// Template hierarchy (checked in order):
1. your-theme/safe-ship-pro/emails/template-name.php
2. plugin/public/partials/emails/template-name.php

Database Schema

Claims Table Structure
CREATE TABLE wp_safe_ship_pro_claims (
    id mediumint(9) NOT NULL AUTO_INCREMENT,
    date_created datetime NOT NULL,
    date_updated datetime NOT NULL,
    user_id bigint(20) NOT NULL,
    order_id bigint(20) NOT NULL,
    claim_type varchar(50) NOT NULL,
    claim_reason text NOT NULL,
    claim_status varchar(20) DEFAULT 'pending',
    admin_notes text,
    attachments text,
    PRIMARY KEY (id),
    KEY user_id (user_id),
    KEY order_id (order_id),
    KEY claim_status (claim_status)
);

Order Meta Fields

// Protection-related order meta
_safe_ship_pro_protection_added  // 'yes' if protection added
_safe_ship_pro_protection_amount // Protection fee amount

// HPOS-compatible access
$order = wc_get_order($order_id);
$has_protection = $order->get_meta('_safe_ship_pro_protection_added', true) === 'yes';
$protection_amount = $order->get_meta('_safe_ship_pro_protection_amount', true);

API Reference

REST API Endpoints

Protection Statistics
GET /wp-json/safe-ship-pro/v1/stats

Response:
{
    "protection_rate": 65.5,
    "total_revenue": 1250.00,
    "total_claims": 15,
    "approval_rate": 85.7,
    "date_range": {
        "from": "2024-01-01",
        "to": "2024-01-31"
    }
}
Claims Data
GET /wp-json/safe-ship-pro/v1/claims

Parameters:
- status: pending|processing|approved|denied|completed
- limit: number of results (default: 20)
- offset: pagination offset

Response:
{
    "claims": [
        {
            "id": 123,
            "order_id": 456,
            "type": "damaged",
            "status": "processing",
            "date_created": "2024-01-15T10:30:00",
            "customer": {
                "name": "John Doe",
                "email": "john@example.com"
            }
        }
    ],
    "total": 45,
    "pages": 3
}

AJAX Endpoints

Submit Claim

// Submit new claim via AJAX
jQuery.ajax({
    url: ajaxurl,
    type: 'POST',
    data: {
        action: 'safe_ship_pro_submit_claim',
        order_id: 123,
        claim_type: 'damaged',
        claim_reason: 'Package arrived with damaged contents',
        security: nonce
    },
    success: function(response) {
        if (response.success) {
            alert('Claim submitted successfully!');
            location.reload();
        } else {
            alert('Error: ' + response.data.message);
        }
    }
});

Update Claim Status

// Admin: Update claim status
jQuery.ajax({
    url: ajaxurl,
    type: 'POST',
    data: {
        action: 'safe_ship_pro_update_claim',
        claim_id: 123,
        status: 'approved',
        admin_notes: 'Claim approved based on evidence provided',
        security: nonce
    },
    success: function(response) {
        // Handle response
    }
});

Helper Functions

Utility Functions
/**
 * Check if order has protection
 */
function order_has_protection($order_id) {
    $order = wc_get_order($order_id);
    return $order->get_meta('_safe_ship_pro_protection_added', true) === 'yes';
}

/**
 * Get protection amount for order
 */
function get_protection_amount($order_id) {
    $order = wc_get_order($order_id);
    return floatval($order->get_meta('_safe_ship_pro_protection_amount', true));
}

/**
 * Get claims for order
 */
function get_order_claims($order_id) {
    global $wpdb;
    $table_name = $wpdb->prefix . 'safe_ship_pro_claims';
    
    return $wpdb->get_results($wpdb->prepare(
        "SELECT * FROM $table_name WHERE order_id = %d ORDER BY date_created DESC",
        $order_id
    ));
}

Hooks & Filters

Action Hooks

Protection Actions
/**
 * Fired when protection is added to order
 */
do_action('safe_ship_pro_protection_added', $order_id, $protection_amount);

/**
 * Fired before protection fee calculation
 */
do_action('safe_ship_pro_before_fee_calculation', $cart_total);

/**
 * Fired after protection option is displayed
 */
do_action('safe_ship_pro_after_protection_display');
Claims Actions
/**
 * Fired when new claim is submitted
 */
do_action('safe_ship_pro_claim_submitted', $claim_id, $order_id);

/**
 * Fired when claim status is updated
 */
do_action('safe_ship_pro_claim_updated', $claim_id, $order_id, $new_status);

/**
 * Fired when claim is approved
 */
do_action('safe_ship_pro_claim_approved', $claim_id, $order_id);

/**
 * Fired when claim is denied
 */
do_action('safe_ship_pro_claim_denied', $claim_id, $order_id, $reason);

Filter Hooks

Protection Filters
/**
 * Modify protection fee calculation
 */
$fee = apply_filters('safe_ship_pro_protection_fee', $fee, $cart_total);

/**
 * Customize protection label
 */
$label = apply_filters('safe_ship_pro_protection_label', $label);

/**
 * Modify protection description
 */
$description = apply_filters('safe_ship_pro_protection_description', $description);

/**
 * Control product eligibility
 */
$eligible = apply_filters('safe_ship_pro_product_eligible', $eligible, $product_id);
Email Filters
/**
 * Customize email subjects
 */
$subject = apply_filters('safe_ship_pro_email_subject', $subject, $type, $order_id);

/**
 * Modify email templates
 */
$template = apply_filters('safe_ship_pro_email_template', $template, $type);

/**
 * Filter email recipients
 */
$recipients = apply_filters('safe_ship_pro_email_recipients', $recipients, $type);

Custom Hook Examples

Auto-approve Small Claims

/**
 * Auto-approve claims under $25
 */
function auto_approve_small_claims($claim_id, $order_id) {
    $order = wc_get_order($order_id);
    $order_total = $order->get_total();
    
    if ($order_total < 25) {
        // Auto-approve the claim
        global $wpdb;
        $table_name = $wpdb->prefix . 'safe_ship_pro_claims';
        
        $wpdb->update(
            $table_name,
            ['claim_status' => 'approved', 'admin_notes' => 'Auto-approved (order under $25)'],
            ['id' => $claim_id],
            ['%s', '%s'],
            ['%d']
        );
        
        // Trigger status update action
        do_action('safe_ship_pro_claim_updated', $claim_id, $order_id, 'approved');
    }
}
add_action('safe_ship_pro_claim_submitted', 'auto_approve_small_claims', 10, 2);

Custom Protection Fee Logic

/**
 * Tiered protection fee based on cart value
 */
function tiered_protection_fee($fee, $cart_total) {
    if ($cart_total < 50) {
        return 2.99; // Flat $2.99 for orders under $50
    } else if ($cart_total < 100) {
        return $cart_total * 0.02; // 2% for $50-$100
    } else {
        return min($cart_total * 0.015, 9.99); // 1.5% max $9.99 for $100+
    }
}
add_filter('safe_ship_pro_protection_fee', 'tiered_protection_fee', 10, 2);

Troubleshooting

Common Issues

Protection Option Not Showing

Symptoms: Protection option doesn't appear at checkout

Possible Causes & Solutions:

  1. Plugin not activated - Check Plugins page
  2. WooCommerce not active - Install and activate WooCommerce
  3. Protection disabled - Check Settings → General → Enable Protection
  4. Products not eligible - Check category exclusions and product settings
  5. Theme conflict - Switch to default theme to test
Claims Page Not Working

Symptoms: 404 error or blank page when accessing claims

Solutions:

  1. Flush permalinks - Go to Settings → Permalinks → Save Changes
  2. Check endpoint registration - Deactivate/reactivate plugin
  3. Verify claims enabled - Check Settings → Claims → Enable Claims
  4. Theme compatibility - Ensure theme supports WooCommerce account pages
Email Notifications Not Sending

Symptoms: Customers/admins not receiving emails

Troubleshooting Steps:

  1. Test WordPress mail - Use a mail testing plugin
  2. Check notification settings - Verify emails are enabled in settings
  3. Verify email addresses - Check admin email and customer addresses
  4. Check spam folders - Emails might be filtered as spam
  5. SMTP configuration - Consider using an SMTP plugin

Debug Mode

Enable WordPress debug mode to troubleshoot issues:

// Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

// Log file location
/wp-content/debug.log

Database Issues

Database Table Missing

If the claims table is missing, try these solutions:

  1. Deactivate and reactivate the plugin
  2. Check database user permissions (needs CREATE privilege)
  3. Verify file permissions on plugin directory
  4. Check error logs for SQL errors

Manual Table Creation

If automatic table creation fails, create manually:

CREATE TABLE wp_safe_ship_pro_claims (
    id mediumint(9) NOT NULL AUTO_INCREMENT,
    date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
    date_updated datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
    user_id bigint(20) NOT NULL,
    order_id bigint(20) NOT NULL,
    claim_type varchar(50) NOT NULL,
    claim_reason text NOT NULL,
    claim_status varchar(20) NOT NULL DEFAULT 'pending',
    admin_notes text,
    attachments text,
    PRIMARY KEY (id)
);

Performance Issues

Optimization Tips
  • Caching - Use object caching for analytics queries
  • Database Indexing - Add indexes on frequently queried columns
  • File Cleanup - Regularly clean up old claim attachments
  • Analytics Limits - Limit date ranges for large datasets

Plugin Conflicts

Common plugin conflicts and solutions:

Plugin Type Potential Issue Solution
Other Shipping Plugins Checkout field conflicts Adjust hook priorities
Checkout Customizers Protection option not showing Use different hook or filter
Email Customizers Notification conflicts Disable conflicting emails
Security Plugins AJAX requests blocked Whitelist AJAX actions

Frequently Asked Questions

Does this work with all WooCommerce themes?

Yes, Safe Ship Pro uses standard WooCommerce hooks and should work with any properly coded theme. The plugin integrates with the standard checkout process and My Account pages.

Can I customize the protection option appearance?

Yes, you can customize labels, descriptions, upload a logo, and set provider information. For advanced styling, you can override CSS classes or use custom templates in your theme.

Is this compatible with WooCommerce subscriptions?

The plugin works with subscription products, but protection applies per individual order, not per subscription renewal. Each renewal would need protection added separately.

How are protection fees calculated?

You can choose between percentage-based calculation (with min/max limits) or flat fee. Percentage fees are calculated as: cart total × percentage, then constrained by minimum and maximum fee limits.

Can I exclude certain products from protection?

Yes, you can exclude entire product categories in the settings, or set individual product protection settings in the product data tabs. Virtual and downloadable products are automatically excluded.

What file types can customers upload with claims?

Customers can upload JPG, PNG, and PDF files up to 5MB each. Multiple files can be uploaded per claim to provide supporting evidence.

Is the plugin GDPR compliant?

The plugin stores necessary order and claim data for business purposes. Ensure your privacy policy covers this data usage and consider implementing data retention policies for claim files.

Can I export claims data?

Yes, claims data can be exported through the analytics section or by directly accessing the database. The plugin also provides REST API endpoints for external integrations.

What happens if my license expires?

The plugin continues to work normally, but you won't receive updates or support until the license is renewed. It's important to keep your license active for security updates.

Can I use one license on multiple sites?

License terms depend on your purchase. Check your license agreement for multi-site usage rights. Most licenses are per-site, but multi-site licenses are available.

Still Need Help?

If you can't find the answer to your question here, please contact our support team with your license key for personalized assistance.