PHPackages                             szepeviktor/site-health-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. szepeviktor/site-health-command

ActiveWp-cli-package[Utility &amp; Helpers](/categories/utility)

szepeviktor/site-health-command
===============================

Check critical values in your WordPress installation

v1.1.0(1y ago)30[3 issues](https://github.com/szepeviktor/critical-site-health/issues)MITPHPPHP &gt;=7.4

Since May 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/szepeviktor/critical-site-health)[ Packagist](https://packagist.org/packages/szepeviktor/site-health-command)[ RSS](/packages/szepeviktor-site-health-command/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Critical site health
====================

[](#critical-site-health)

Check critical values in your WordPress installation with this WP-CLI command.

```
wp site-health check critical-site-health.yml
```

Installation
------------

[](#installation)

```
wp package install https://github.com/szepeviktor/critical-site-health.git
```

Configuration
-------------

[](#configuration)

There are four kinds of checks.

- options
- constants
- static class methods
- PHP expressions

```
---
# I should be self-sufficient.
option:
    "home": "https://example.com"
    "blog_public": "1"
    "blog_charset": "UTF-8"
    "WPLANG": "en_US"
    "users_can_register": "0"
    "admin_email": "admin@szepe.net"
    "wp_mailfrom_ii_email": "webmaster@szepe.net"
    "elementor_safe_mode": ""
    "woocommerce_shop_page_id": "101"
    "woocommerce_cart_page_id": "102"
    "woocommerce_checkout_page_id": "103"
    "woocommerce_myaccount_page_id": "104"
    "woocommerce_refund_returns_page_id": "105"
    "woocommerce_terms_page_id": "106"
    "woocommerce_coming_soon": "no"
    "woocommerce_logs_logging_enabled": "yes"
    "woocommerce_logs_level_threshold": "info"
constant:
    "WP_DEBUG": false
    "SCRIPT_DEBUG": false
    "DISALLOW_FILE_EDIT": true
    "DISABLE_WP_CRON": true
    "WP_CACHE_KEY_SALT": "prefix:"
    # Namespaced constant
    "Company\Theme\VERSION": "1.0.0"
    # Class constant
    "Company\Theme::VERSION": "1.0.0"
class_method:
    "Company::version": "1.0.0"
# Should return true
eval:
    # Check file owner
    - |
        exec('find /home/PROJECT/website/code/ -not -user $USER', $output, $exit_status) === '' && $exit_status === 0
    # Check git working tree status
    - |
        exec('git -C /home/PROJECT/website/code status -s -uno', $output, $exit) === '' && $exit === 0
    # IP address of WordPress home URL equals server's primary IP address
    - |
        gethostbyname(parse_url(get_bloginfo('url'), PHP_URL_HOST)) === trim(shell_exec('hostname -i'))
    # This is a production environment
    - |
        wp_get_environment_type() === 'production'
    # Core files are unchanged
    - |
        WP_CLI::runcommand('core verify-checksums --quiet', ['return' => 'return_code', 'exit_error' => false]) === 0
    # Plugin files are unchanged
    - |
        WP_CLI::runcommand('plugin verify-checksums --quiet --all', ['return' => 'return_code', 'exit_error' => false]) === 0
    # Database is up-to-date
    - |
        WP_CLI::runcommand('core update-db --quiet --dry-run', ['return' => 'return_code', 'exit_error' => false]) === 0
    # All active plugins are compatible with core
    - |
        array_reduce(get_option('active_plugins'), function ($c,$p) {return $c && version_compare(get_plugin_data(WP_PLUGIN_DIR.'/'.$p)['RequiresWP'],get_bloginfo('version'),'
