How to clean up after debugging.
- posts, pages
- products
- orders
- users
Debugging theory: https://github.com/szepeviktor/debug-wordpress
memory_limitmax_execution_timeopcache.memory_consumptionopcache.interned_strings_buffer| while :; do ps -u $USER -o pcpu= | awk '{sum+=$1} END {printf("%4.0f\n", sum)}'; sleep 1; done |
| #!/usr/bin/env php | |
| <?php | |
| #$ composer require matomo/device-detector | |
| require __DIR__.'/vendor/autoload.php'; | |
| use DeviceDetector\DeviceDetector; | |
| use DeviceDetector\Parser\Device\AbstractDeviceParser; | |
| AbstractDeviceParser::setVersionTruncation(AbstractDeviceParser::VERSION_TRUNCATION_NONE); |
| #!/bin/bash | |
| wget -O wordfence-vulnerabilities.json "https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production" | |
| wp plugin list --skip-update-check --status=active --fields=name,version \ | |
| | tail -n +2 \ | |
| | while read -r PLUGIN VERSION; do | |
| UPDATE="$(jq -r --arg slug "${PLUGIN}" \ | |
| '[.. | objects | select(."type"=="plugin" and ."slug"==$slug) | ."patched_versions"[]?] | if length>0 then map(split(".") | map(tonumber)) | max | join(".") else empty end' \ | |
| wordfence-vulnerabilities.json |
| #!/bin/bash | |
| # | |
| # Send SMS with Twilio API. | |
| # | |
| export LC_ALL="C.UTF-8" | |
| declare -a iso1_to_gsm=( | |
| 'À' 'Ä' 'Â' 'Ä' 'Ã' 'Ä' | |
| 'È' 'É' 'Ê' 'É' 'Ë' 'É' | |
| 'Ì' 'I' 'Î' 'I' 'Ï' 'I' |
| <?php | |
| /** | |
| * Plugin Name: WC Admin Search by Global Unique ID | |
| * Description: Make the admin Products search match the _global_unique_id (GTIN/EAN/UPC/ISBN). | |
| * Version: 1.0.0 | |
| * WC requires at least: 9.2 | |
| * Requires PHP: 7.4 | |
| * Author: Viktor Szépe | |
| * Author URI: https://www.szepe.net/ | |
| */ |
| #!/bin/bash | |
| mkdir -p /usr/local/bin/php8.3 | |
| ln -s /usr/bin/php8.3 /usr/local/bin/php8.3/php | |
| # Add this to your script: export PATH="/usr/local/bin/php8.3:$PATH" |
| wp option get auto_update_plugins --format=json \ | |
| | jq -c 'to_entries | map(select(.value != "wordpress-seo/wp-seo.php")) | from_entries' \ | |
| | wp option update auto_update_plugins --format=json |