Skip to content

Instantly share code, notes, and snippets.

@mehdichaouch
Last active November 30, 2023 17:33
Show Gist options
  • Save mehdichaouch/a985f03ca7df030ceb64bbb17e1567c7 to your computer and use it in GitHub Desktop.
Save mehdichaouch/a985f03ca7df030ceb64bbb17e1567c7 to your computer and use it in GitHub Desktop.
🔧 WordPress Plugins Compatibility from command line with WP-CLI
#!/usr/bin/env bash
###
# @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
# @author Mehdi Chaouch <[email protected]> <@advocodo>
# @copyright Copyright (c) 2023 ADVOCODO (https://www.advocodo.com)
# @description This script check compatibility of all installed plugins.
# It's similar to Plugin Compatibility Checker or Better Plugin Compatibility Control
# but from the command line, usinq WP-CLI.
# NB. if you have a lot of plugins this can take few second to curl all data.
# @usage ./wordpress-plugins-compatibility.sh
###
#set -e
#set -x
PLUGINS_URL="";for SLUG in $(wp plugin list --field=name --status=active); do PLUGINS_URL+="https://wordpress.org/plugins/wp-json/plugins/v1/plugin/${SLUG} "; done; curl --silent $PLUGINS_URL | jq -rs '(["NAME","TESTED"] | (., map(length*"-"))),(.[] | [.slug, .tested]) | @tsv'| column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment