wp-admin/includes/class-wp-site-health.php:2801Tests if opcode cache is enabled and available.
array<string, public function get_test_opcode_cache(): array { $opcode_cache_enabled = false; if ( function_exists( 'opcache_get_status' ) ) { $status = @opcache_get_status( false ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Warning emitted in failure case. if ( $status && true === $status['opcache_enabled'] ) { $opcode_cache_enabled = true; } } $result = array( 'label' => __( 'Opcode cache is enabled' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), 'color' => 'blue', ), 'description' => sprintf( '<p>%s</p>', __( 'Opcode cache improves PHP performance by storing precompiled script bytecode in memory, reducing the need for PHP to load and parse scripts on each request.' ) ), 'actions' => sprintf( '<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>', esc_url( 'https://www.php.net/manual/en/book.opcache.php' ), __( 'Learn more about OPcache.' ), /* translators: Hidden accessibility text. */ __( '(opens in a new tab)' ) ), 'test' => 'opcode_cache', ); if ( ! $opcode_cache_enabled ) { $result['status'] = 'recommended'; $result['label'] = __( 'Opcode cache is not enabled' ); $result['description'] .= '<p>' . __( 'Enabling this cache can significantly improve the performance of your site.' ) . '</p>'; } return $result; }Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-admin/includes/class-wp-site-health.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.