#!/bin/bash
# WordPress Plugin Reload Helper
# This script helps reload the BioLogin plugin in WordPress

echo "=== BioLogin Plugin Reload Helper ==="
echo ""
echo "The license activation routes have been added to biologin.php"
echo "WordPress needs to reload the plugin to recognize the new routes."
echo ""
echo "To fix the routing error, please do ONE of the following:"
echo ""
echo "Option 1: Deactivate and Reactivate the Plugin"
echo "  1. Go to WordPress Admin → Plugins"
echo "  2. Find 'MSNDev BioLogin'"
echo "  3. Click 'Deactivate'"
echo "  4. Click 'Activate'"
echo ""
echo "Option 2: Use WP-CLI (if available)"
echo "  wp plugin deactivate biologin"
echo "  wp plugin activate biologin"
echo ""
echo "Option 3: Clear WordPress Object Cache"
echo "  - If using Redis/Memcached, flush the cache"
echo "  - Or use a cache plugin to clear all caches"
echo ""
echo "After reloading, the license activation should work correctly."
echo "The routes are now registered at:"
echo "  - GET  /wp-json/biologin/v1/license/status"
echo "  - POST /wp-json/biologin/v1/license/activate"
echo ""
