#!/bin/bash # Define plugin details PLUGIN_URL="https://git.nixc.us/colin/SimpleTracking/raw/branch/main/simple-tracking.php" PLUGIN_DIR="./wp-content/plugins/simple-tracking" # Create plugin directory if it doesn't exist mkdir -p "$PLUGIN_DIR" # Download the plugin file curl -o "$PLUGIN_DIR/simple-tracking.php" "$PLUGIN_URL" # Create a blank tracking-code.php file if it doesn't exist if [ ! -f "$PLUGIN_DIR/tracking-code.php" ]; then touch "$PLUGIN_DIR/tracking-code.php" echo "Please add your tracking code to wp-content/plugins/simple-tracking/tracking-code.php." else echo "tracking-code.php already exists." fi # Set correct permissions chmod 644 "$PLUGIN_DIR/simple-tracking.php" chmod 644 "$PLUGIN_DIR/tracking-code.php" # Inform user echo "Simple Tracking plugin installed/updated successfully."