WP_Site_Health::get_test_php_extensions() – Tests if required PHP modules are installed on the host.

You appear to be a bot. Output may be restricted

Description

Tests if required PHP modules are installed on the host.

This test builds on the recommendations made by the WordPress Hosting Team as seen at https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions

Usage

$array = WP_Site_Health::get_test_php_extensions();

Parameters

Returns

array

Source

File name: wordpress/wp-admin/includes/class-wp-site-health.php
Lines:

1 to 100 of 230
  public function get_test_php_extensions() {
    $result = array(
      'label'       => __( 'Required and recommended modules are installed' ),
      'status'      => 'good',
      'badge'       => array(
        'label' => __( 'Performance' ),
        'color' => 'blue',
      ),
      'description' => sprintf(
        '<p>%s</p><p>%s</p>',
        __( 'PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.' ),
        sprintf(
          /* translators: 1: Link to the hosting group page about recommended PHP modules. 2: Additional link attributes. 3: Accessibility text. */
          __( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in <a href="%1$s" %2$s>the team handbook%3$s</a>.' ),
          /* translators: Localized team handbook, if one exists. */
          esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),
          'target="_blank" rel="noopener"',
          sprintf(
            ' <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
            /* translators: Hidden accessibility text. */
            __( '(opens in a new tab)' )
          )
        )
      ),
      'actions'     => '',
      'test'        => 'php_extensions',
    );

    $modules = array(
      'curl'      => array(
        'function' => 'curl_version',
        'required' => false,
      ),
      'dom'       => array(
        'class'    => 'DOMNode',
        'required' => false,
      ),
      'exif'      => array(
        'function' => 'exif_read_data',
        'required' => false,
      ),
      'fileinfo'  => array(
        'function' => 'finfo_file',
        'required' => false,
      ),
      'hash'      => array(
        'function' => 'hash',
        'required' => false,
      ),
      'imagick'   => array(
        'extension' => 'imagick',
        'required'  => false,
      ),
      'json'      => array(
        'function' => 'json_last_error',
        'required' => true,
      ),
      'mbstring'  => array(
        'function' => 'mb_check_encoding',
        'required' => false,
      ),
      'mysqli'    => array(
        'function' => 'mysqli_connect',
        'required' => false,
      ),
      'libsodium' => array(
        'constant'            => 'SODIUM_LIBRARY_VERSION',
        'required'            => false,
        'php_bundled_version' => '7.2.0',
      ),
      'openssl'   => array(
        'function' => 'openssl_encrypt',
        'required' => false,
      ),
      'pcre'      => array(
        'function' => 'preg_match',
        'required' => false,
      ),
      'mod_xml'   => array(
        'extension' => 'libxml',
        'required'  => false,
      ),
      'zip'       => array(
        'class'    => 'ZipArchive',
        'required' => false,
      ),
      'filter'    => array(
        'function' => 'filter_list',
        'required' => false,
      ),
      'gd'        => array(
        'extension'    => 'gd',
        'required'     => false,
        'fallback_for' => 'imagick',
      ),
      'iconv'     => array(
        'function' => 'iconv',
        'required' => false,
      ),
      'intl'      => array(
 

 View on GitHub View on Trac