0 ? $setting : ( self::is_local_site() ? 20 : 15 ); if ( defined( 'WP_CLI' ) && WP_CLI ) { $slice = max( $slice, 120 ); } $max = self::max_execution_time(); if ( $max > 0 ) { $slice = min( $slice, max( 5, $max - 8 ) ); } return $slice; } /** * Site, PHP and database facts (used by preflight and the hello operation). * * @return array */ public static function facts() { global $wpdb, $wp_version; $db_version = (string) $wpdb->get_var( 'SELECT VERSION()' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Server version, read once for the preflight report. return array( 'site' => array( 'home' => home_url(), 'siteurl' => site_url(), 'abspath' => wp_normalize_path( ABSPATH ), 'content_dir' => Paths::content_dir(), 'content_url' => content_url(), 'uploads_dir' => Paths::uploads_dir(), 'uploads_url' => wp_upload_dir( null, false )['baseurl'], 'plugins_dir' => Paths::plugins_dir(), 'mu_dir' => Paths::mu_plugins_dir(), 'themes_dir' => Paths::themes_dir(), 'prefix' => $wpdb->prefix, 'base_prefix' => $wpdb->base_prefix, 'multisite' => is_multisite(), 'wp_version' => $wp_version, 'db_version' => (int) get_option( 'db_version' ), 'template' => get_option( 'template' ), 'stylesheet' => get_option( 'stylesheet' ), 'locale' => get_locale(), 'name' => get_bloginfo( 'name' ), 'active_plugins' => array_values( (array) get_option( 'active_plugins', array() ) ), ), 'php' => array( 'version' => PHP_VERSION, 'sapi' => PHP_SAPI, 'os' => PHP_OS, 'memory_limit' => self::memory_limit(), 'max_execution_time' => self::max_execution_time(), 'set_time_limit' => self::can_call( 'set_time_limit' ), 'disk_free_space' => self::can_call( 'disk_free_space' ), 'open_basedir' => (string) ini_get( 'open_basedir' ), 'zlib' => function_exists( 'gzencode' ), 'gcm' => Secrets::has_gcm(), 'curl' => function_exists( 'curl_init' ), 'server_software' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '', ), 'db' => array( 'version' => $db_version, 'mariadb' => false !== stripos( $db_version, 'mariadb' ), 'charset' => $wpdb->charset, 'collate' => $wpdb->collate, 'max_allowed_packet' => (int) $wpdb->get_var( 'SELECT @@max_allowed_packet' ), // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- A server setting, read once for the preflight report. 'lower_case_table_names' => (int) $wpdb->get_var( 'SELECT @@lower_case_table_names' ), 'mysqli' => $wpdb->dbh instanceof \mysqli, ), 'plugin' => array( 'version' => ACCESSNOW_REPLICA_VERSION, 'protocol' => ACCESSNOW_REPLICA_PROTOCOL, ), 'time' => time(), ); } }