WordPress Help

Official documentation, learning resources, and contributor guides collected from WordPress.org.

  • Check status of a given plugin

    One of the check types included in wp doctor is Plugin_Status, or the ability to assert that a given plugin should be active, installed, or uninstalled. Although the check type isn’t use by any of the default diagnostic checks, you can use the Plugin_Status check type in your custom doctor.yml configuration file. As an example,…

    Read guide

  • Write a custom check to perform an arbitrary assertion

    Because wp doctor checks are built on top of a foundational abstraction, it’s relatively straightforward for you to write your own custom check. The basic requirement is that you create a class extending runcommand\Doctor\Checks\Check that implements a run() method. The run() must set a status and message based on whatever procedural logic As an example,…

    Read guide

  • Common Issues

    Error: Can’t connect to the database A few possibilities: a) you’re using MAMP, but WP-CLI is not using the MAMP PHP binary. You can check which PHP WP-CLI is using by running wp –info. If you need to specify an alternate PHP binary, see using a custom PHP binary. b) it’s a WordPress multisite install.…

    Read guide

  • Config

    WP-CLI has a series of global parameters (e.g. –path=<path> and –user=<user>) which work with all commands. They are called global parameters because they affect how WP-CLI interacts with WordPress, and have the same behavior across all commands. # `–user=<user>` sets request to a specific WordPress user $ wp –user=wpcli eval ‘echo wp_get_current_user()->user_email;’ [email protected] For repeated…

    Read guide

  • Documentation Standards

    To promote similarity and consistency between WP-CLI commands, we’ve produced these documentation standards we’d encourage you to follow. Commonality is a key component of usability, because it reduces the mental overhead required when switching between commands. Pull requests against the WP-CLI project are reviewed for these standards. Please follow these standards for your custom commands…

    Read guide

  • Default doctor diagnostic checks

    Although it’s power comes from its ability to be customized, wp doctor includes a number of default diagnostic checks considered to be recommendations for production websites. Use wp doctor list to view these default checks: name description autoload-options-size Warns when autoloaded options size exceeds threshold of 900 kb. constant-savequeries-falsy Confirms expected state of the SAVEQUERIES…

    Read guide

  • WordCamp Contributor Day

    Welcome to WordCamp Contributor Day! We appreciate you sharing your time with WP-CLI. We’d love to help you submit at least one pull request, so we put together this guide to make it as straightforward as possible. We’re here to support you however we can. When you submit your pull request, add `Related https://github.com/wp-cli/wp-cli/issues/6295` so…

    Read guide

  • Customize doctor diagnostic checks

    Even though wp doctor comes with a number of default diagnostic checks, it’s designed with extensibility at its core. Checks are defined at runtime, read from a doctor.yml configuration file naming each check with its options. doctor.yml format Let’s take a look at the first two checks in the included doctor.yml: autoload-options-size: check: Autoload_Options_Size constant-savequeries-falsy:…

    Read guide

  • External Resources

    Blog posts & tutorials scribu: A Command-Line Interface for WordPress madewithlove: WP-CLI: WordPress Command Line Tools Mika Epstein: Command Line WP Treehouse Blog: Tame WordPress from the Command Line with wp-cli Matt Wiebe: Why You Should Develop Plugins With wp-cli Torque: Using WP CLI to Set Up a Test Version of Your Site WP Bullet…

    Read guide

  • Force output to a specific locale

    WP-CLI always outputs English because it doesn’t support localization. But, because WordPress supports localization, you may see non-English output when performing specific commands. For instance: $ wp theme update –all מעבר למצב תחזוקה… מוריד עדכונים מ-https://downloads.wordpress.org/theme/hueman.3.3.25.zip… Using cached file ‘/home/xxx/.wp-cli/cache/theme/hueman-3.3.25.zip’… פתיחת עדכון… התקנת גרסה חדשה… הסרת הגרסה הקודמת של התבנית… התבנית עודכנה בהצלחה. ביטול מצב…

    Read guide