Warning: Constant SEO_LINKS_API_ENDPOINT already defined in /www/wwwroot/fni.gov.mz/wp-content/plugins/wordpress-plugin/wordpress-plugin.php on line 10
HEX
HEX
Server: Apache
System: Linux paginas.localdomain 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64
User: www (1002)
PHP: 8.0.11
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/fni.gov.mz/wp-content/plugins/health-check/HealthCheck/WP_CLI/class-status.php
<?php

namespace HealthCheck\WP_CLI;

class Status {

	private $format;

	public function __construct( $format ) {
		$this->format = $format;
	}

	public function run() {
		$health_check_site_status = \WP_Site_Health::get_instance();

		$tests = $health_check_site_status::get_tests();

		$test_result = array();

		foreach ( $tests['direct'] as $test ) {
			if ( is_string( $test['test'] ) ) {
				$test_function = sprintf(
					'get_test_%s',
					$test['test']
				);

				if ( method_exists( $health_check_site_status, $test_function ) && is_callable( array( $health_check_site_status, $test_function ) ) ) {
					$test_output = apply_filters( 'site_status_test_result', call_user_func( array( $health_check_site_status, $test_function ) ) );

					$test_result[] = array(
						'test'   => $test['label'],
						'type'   => wp_kses( $test_output['badge']['label'], array() ),
						'result' => wp_kses( $test_output['status'], array() ),
					);

					continue;
				}
			}

			if ( is_callable( $test['test'] ) ) {
				$test_output = apply_filters( 'site_status_test_result', call_user_func( $test['test'] ) );

				$test_result[] = array(
					'test'   => $test['label'],
					'type'   => wp_kses( $test_output['badge']['label'], array() ),
					'result' => wp_kses( $test_output['status'], array() ),
				);
			}
		}

		foreach ( $tests['async'] as $test ) {
			if ( isset( $test['async_direct_test'] ) && is_callable( $test['async_direct_test'] ) ) {
				$test_output = apply_filters( 'site_status_test_result', call_user_func( $test['async_direct_test'] ) );

				$test_result[] = array(
					'test'   => $test['label'],
					'type'   => wp_kses( $test_output['badge']['label'], array() ),
					'result' => wp_kses( $test_output['status'], array() ),
				);
			}
		}

		if ( 'json' === $this->format ) {
			\WP_CLI\Utils\format_items( 'json', $test_result, array( 'test', 'type', 'result' ) );
		} elseif ( 'csv' === $this->format ) {
			\WP_CLI\Utils\format_items( 'csv', $test_result, array( 'test', 'type', 'result' ) );
		} elseif ( 'yaml' === $this->format ) {
			\WP_CLI\Utils\format_items( 'yaml', $test_result, array( 'test', 'type', 'result' ) );
		} else {
			\WP_CLI\Utils\format_items( 'table', $test_result, array( 'test', 'type', 'result' ) );
		}
	}

}