diff --git a/admin/environment.xml b/admin/environment.xml
index e031c7fc270..2fd7533f84a 100644
--- a/admin/environment.xml
+++ b/admin/environment.xml
@@ -4504,6 +4504,203 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/admin/renderer.php b/admin/renderer.php
index 6141dfec8a6..990efa48719 100644
--- a/admin/renderer.php
+++ b/admin/renderer.php
@@ -2051,8 +2051,10 @@ class core_admin_renderer extends plugin_renderer_base {
// We are checking installed & enabled things
if ($environment_result->getLevel() == 'required') {
$stringtouse = 'environmentrequirecustomcheck';
- } else {
+ } else if ($environment_result->getLevel() == 'optional') {
$stringtouse = 'environmentrecommendcustomcheck';
+ } else {
+ $stringtouse = 'environmentshouldfixcustomcheck';
}
} else if ($environment_result->getPart() == 'php_setting') {
@@ -2083,7 +2085,8 @@ class core_admin_renderer extends plugin_renderer_base {
if ($status) { //Handle ok result (ok)
$status = get_string('statusok');
} else {
- if ($environment_result->getLevel() == 'optional') {//Handle check result (warning)
+ // Handle check result (warning).
+ if (in_array($environment_result->getLevel(), ['optional', 'recommended'])) {
$status = get_string('check');
$warningline = true;
} else { //Handle error result (error)
diff --git a/lang/en/admin.php b/lang/en/admin.php
index f7eb015f451..9cf4b9d91b3 100644
--- a/lang/en/admin.php
+++ b/lang/en/admin.php
@@ -73,6 +73,9 @@ $string['alternativefullnameformat_desc'] = 'This defines how names are shown to
$string['always'] = 'Always';
$string['appearance'] = 'Appearance';
$string['aspellpath'] = 'Path to aspell';
+$string['asyncbackupdisabled'] = 'Your site is currently configured to use synchronous backups. Asynchronous backups provide a better user experience.
+Asynchronous backups will be enabled for all sites from Moodle LMS 4.5 LTS.
+Synchronous backups will be removed from Moodle LMS the version after 4.5 LTS';
$string['authentication'] = 'Authentication';
$string['authpreventaccountcreation'] = 'Prevent account creation when authenticating';
$string['authpreventaccountcreation_help'] = 'When a user authenticates, an account on the site is automatically created if it doesn\'t yet exist. If an external database, such as LDAP, is used for authentication, but you wish to restrict access to the site to users with an existing account only, then this option should be enabled. New accounts will need to be created manually or via the upload users feature. Note that this setting doesn\'t apply to MNet authentication.';
@@ -636,6 +639,7 @@ $string['environmentrequirecustomcheck'] = 'this test must pass';
$string['environmentrequireinstall'] = 'must be installed and enabled';
$string['environmentrequireversion'] = 'version {$a->needed} is required and you are running {$a->current}';
$string['environmentsettingok'] = 'recommended setting detected';
+$string['environmentshouldfixcustomcheck'] = 'should be enabled for best results';
$string['environmentshouldfixsetting'] = 'PHP setting should be changed.';
$string['environmentxmlerror'] = 'Error reading environment data ({$a->error_code})';
$string['environmentmariadbwrongdbtype'] = 'Wrong $CFG->dbtype. You need to change it in your config.php file from \'mysqli\' to \'mariadb\'.';
diff --git a/lib/environmentlib.php b/lib/environmentlib.php
index 4d82c2ca49a..05e9d0be157 100644
--- a/lib/environmentlib.php
+++ b/lib/environmentlib.php
@@ -1251,7 +1251,7 @@ class environment_results {
*/
var $error_code;
/**
- * @var string required/optional
+ * @var string required/optional/recommended.
*/
var $level;
/**
@@ -1548,8 +1548,9 @@ function get_level($element) {
$level = 'required';
if (isset($element['@']['level'])) {
$level = $element['@']['level'];
- if (!in_array($level, array('required', 'optional'))) {
- debugging('The level of a check in the environment.xml file must be "required" or "optional".', DEBUG_DEVELOPER);
+ if (!in_array($level, ['required', 'optional', 'recommended'])) {
+ debugging('The level of a check in the environment.xml file must be "required", "optional" or "recommended".',
+ DEBUG_DEVELOPER);
$level = 'required';
}
} else {
diff --git a/lib/upgradelib.php b/lib/upgradelib.php
index ca122bd8b3f..f6d286e41ee 100644
--- a/lib/upgradelib.php
+++ b/lib/upgradelib.php
@@ -2887,3 +2887,21 @@ function check_oracle_usage(environment_results $result): ?environment_results {
return null;
}
+
+/**
+ * Check if asynchronous backups are enabled.
+ *
+ * @param environment_results $result
+ * @return environment_results|null
+ */
+function check_async_backup(environment_results $result): ?environment_results {
+ global $CFG;
+
+ if (!during_initial_install() && empty($CFG->enableasyncbackup)) { // Have to use $CFG as config table may not be available.
+ $result->setInfo('Asynchronous backups disabled');
+ $result->setFeedbackStr('asyncbackupdisabled');
+ return $result;
+ }
+
+ return null;
+}