Wp plugin status (WP-CLI)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 21 jul 2022 om 15:50 (Nieuwe pagina aangemaakt met 'Bv.: <pre> > wp plugin status 15 installed plugins: UA advanced-custom-fields-pro 5.7.10 A classic-editor 1.4 A contact-f...')
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen

Bv.:

> wp plugin status

15 installed plugins:
 UA advanced-custom-fields-pro             5.7.10
  A classic-editor                         1.4
  A contact-form-7                         5.1.1
  A contact-form-7-honeypot                1.14
  A mollie-payments-for-woocommerce        5.1.0
  A tinymce-advanced                       5.0.1
  A woocommerce                            3.5.4
  A woocommerce-pdf-invoices-packing-slips 2.2.7
  A woocommerce-pdf-ips-templates          2.1.12
  A woocommerce-pip                        3.6.1
  A woocommerce-quantity-increment         1.1.0
  A wordfence                              7.2.2
  A wp-mail-smtp                           1.4.1
  A wp-sync-db-1.6                         1.6
  A wp-sync-db-media-files-master          1.1.4b1

Legend: A = Active, U = Update Available

of

> wp plugin status duplicate-post

wp plugin status duplicate-post

Plugin duplicate-post details:
    Name: Duplicate Post
    Status: Active
    Version: 3.2.2
    Author: Enrico Battocchi
    Description: Clone posts and pages.

Applications

  • De output van wp plugin status kan handig zijn als input voor een script om een nieuwe site te bouwen
  • Voor eigen routines om propriëtaire plugins bij te werken. Dan zou ik alleen het nummer aan het eind willen hebben

Versie-nummer uitfilteren

Je kunt het format van de output niet aanpassen middels parameters, maar wellicht dat bv. grep de output al een stuk hanteerbaarder maakt. Voorbeeld:

wp plugin status advanced-custom-fields-pro
Unable to open /var/www/example.com/wp-content/wflogs/config.php for reading and writing.
Plugin advanced-custom-fields-pro details:
    Name: Advanced Custom Fields PRO
    Status: Active
    Version: 5.7.10 (Update available)
    Author: Elliot Condon
    Description: Customize WordPress with powerful, professional and intuitive fields.

In dit geval geeft de string Update available precies de info die ik zoek.

Ander voorbeeld:

wp plugin status advanced-custom-fields-pro | grep Update
Unable to open /var/www/example.com/wp-content/wflogs/config.php for reading and writing.
    Version: 5.7.10 (Update available)

De waarschuwingstekst tav. wflogs krijg ik trouwens niet zomaar weggetoverd.

Sources