Category: WordPress

  • How to convert a Network Active plugin to active on each site

    WordPress multisite allows plugins and themes to be Network Active. This prevents them from being deactivated on any site in the network.

    Instructions

    To change a plugin from Network Active on every site to individually active on each site:

    1. Manually Network Deactivate the plugin from the network plugins page. The wp network command does not yet support plugin deactivation.

    2. Connect to the server via SSH and run this WP CLI command. In this example, superlist-block/superlist-block.php is the plugin basename.

      wp site list --field=url | xargs -n1 -I % wp --url=% plugin activate superlist-block/superlist-block.php

    What does the command do?

    wp site list --field=url produces a list of URLs for all of the sites on the network.

    The | operator passes the results from wp site list to xargs. xargs can take the output from one command and send it to another command as parameters.

    The -n1 flag to xargs processes each line of output from the site list command one at a time. -n2 would send two site URLs to the next command.

    wp --url=% plugin activate hello.php is the command to which xargs is passing the site URLs. It activates the Hello Dolly plugin on each site specified by URL. The % sign is our replacement character where each URL will populate.

    A for loop might be easier to read

    If this code is easier to quickly read and comprehend, read Sal Ferrarello’s post, Loop Through WordPress Multisite Blogs with WP CLI.

    for URL in $(wp site list --field=url); do 
      wp plugin activate superlist-block/superlist-block.php --url=$URL;
    done
  • WordPress 6.7 supports HEIC & I’m the author of an HEIC conversion plugin

    WordPress 6.7 is going to support HEIC image conversion. I’m the author of an HEIC image conversion plugin.

    WordPress core will soon convert HEIC, or iOS format, photos during uploads.

    My free plugin, HEIC Support, just crossed 3,000 active installs.

    Does my copy-or-replace switch remain a useful feature? Do I get obsoleted out of the .org plugin repo on November 12th? Does it shrivel and die quietly? I have no idea. I can’t wait to find out.

    I’m not even an iOS user. I’ve never had any .heic images to convert! I wrote the plugin because @austinginder told me WordPress doesn’t accept iPhone photos at a meetup.

    When it launched, I wrote, “Someday, we will celebrate the death of this plugin.” Will we?