← All changes
|
pages/page-mainwp-server-information-handler.php
+651
-481
6.1.1
→
6.2.1
View file →
| @@ -1070,9 +1070,11 @@ | ||
| 1070 | 1070 | 'kb_url' => ( isset( $self_connect['code'] ) && 'unexpected_body' === $self_connect['code'] ) ? '' : 'https://docs.mainwp.com/troubleshooting/potential-issues/', |
| 1071 | 1071 | ); |
| 1072 | 1072 | } |
| 1073 | 1073 | |
| 1074 | - return $issues; | |
| 1074 | + $db_issues = MainWP_Database_Schema_Checker::get_detected_db_issues(); | |
| 1075 | + | |
| 1076 | + return array_merge( $issues, is_array( $db_issues ) ? $db_issues : array() ); | |
| 1075 | 1077 | } |
| 1076 | 1078 | |
| 1077 | 1079 | /** |
| 1078 | 1080 | * Add English export labels to localized report rows. |
| @@ -1165,29 +1167,29 @@ | ||
| 1165 | 1167 | $upload_directory = static::get_mainwp_upload_directory_data(); |
| 1166 | 1168 | |
| 1167 | 1169 | return self::add_export_labels_to_rows( |
| 1168 | 1170 | array( |
| 1169 | - array( | |
| 1170 | - 'label' => esc_html__( 'MainWP Dashboard Version', 'mainwp' ), | |
| 1171 | - 'value' => $version_value, | |
| 1172 | - 'status' => ( false !== $latest_version && $current_version === $latest_version ) ? 'pass' : 'warning', | |
| 1171 | + array( | |
| 1172 | + 'label' => esc_html__( 'MainWP Dashboard Version', 'mainwp' ), | |
| 1173 | + 'value' => $version_value, | |
| 1174 | + 'status' => ( false !== $latest_version && $current_version === $latest_version ) ? 'pass' : 'warning', | |
| 1175 | + ), | |
| 1176 | + array( | |
| 1177 | + 'label' => esc_html__( 'Number of connected sites', 'mainwp' ), | |
| 1178 | + 'value' => (string) MainWP_DB::instance()->get_websites_count(), | |
| 1179 | + ), | |
| 1180 | + array( | |
| 1181 | + 'label' => esc_html__( 'MainWP upload directory', 'mainwp' ), | |
| 1182 | + 'value' => $upload_directory['value'], | |
| 1183 | + 'status' => $upload_directory['status'], | |
| 1184 | + ), | |
| 1185 | + array( | |
| 1186 | + 'label' => esc_html__( 'MainWP REST API enabled', 'mainwp' ), | |
| 1187 | + 'value' => static::format_boolean_label( Rest_Api_V1::instance()->is_rest_api_enabled() ), | |
| 1188 | + 'status' => Rest_Api_V1::instance()->is_rest_api_enabled() ? 'pass' : 'warning', | |
| 1189 | + ), | |
| 1173 | 1190 | ), |
| 1174 | 1191 | array( |
| 1175 | - 'label' => esc_html__( 'Number of connected sites', 'mainwp' ), | |
| 1176 | - 'value' => (string) MainWP_DB::instance()->get_websites_count(), | |
| 1177 | - ), | |
| 1178 | - array( | |
| 1179 | - 'label' => esc_html__( 'MainWP upload directory', 'mainwp' ), | |
| 1180 | - 'value' => $upload_directory['value'], | |
| 1181 | - 'status' => $upload_directory['status'], | |
| 1182 | - ), | |
| 1183 | - array( | |
| 1184 | - 'label' => esc_html__( 'MainWP REST API enabled', 'mainwp' ), | |
| 1185 | - 'value' => static::format_boolean_label( Rest_Api_V1::instance()->is_rest_api_enabled() ), | |
| 1186 | - 'status' => Rest_Api_V1::instance()->is_rest_api_enabled() ? 'pass' : 'warning', | |
| 1187 | - ), | |
| 1188 | - ), | |
| 1189 | - array( | |
| 1190 | 1192 | 'MainWP Dashboard Version', |
| 1191 | 1193 | 'Number of connected sites', |
| 1192 | 1194 | 'MainWP upload directory', |
| 1193 | 1195 | 'MainWP REST API enabled', |
| @@ -1210,67 +1212,67 @@ | ||
| 1210 | 1212 | $signature = static::get_signature_algorithm_label(); |
| 1211 | 1213 | |
| 1212 | 1214 | return self::add_export_labels_to_rows( |
| 1213 | 1215 | array( |
| 1214 | - array( | |
| 1215 | - 'label' => esc_html__( 'Dashboard home URL', 'mainwp' ), | |
| 1216 | - 'value' => home_url( '/' ), | |
| 1217 | - 'visibility' => 'full_only', | |
| 1216 | + array( | |
| 1217 | + 'label' => esc_html__( 'Dashboard home URL', 'mainwp' ), | |
| 1218 | + 'value' => home_url( '/' ), | |
| 1219 | + 'visibility' => 'full_only', | |
| 1220 | + ), | |
| 1221 | + array( | |
| 1222 | + 'label' => esc_html__( 'Dashboard site URL', 'mainwp' ), | |
| 1223 | + 'value' => site_url( '/' ), | |
| 1224 | + 'visibility' => 'full_only', | |
| 1225 | + ), | |
| 1226 | + array( | |
| 1227 | + 'label' => esc_html__( 'Public Dashboard IP', 'mainwp' ), | |
| 1228 | + 'value' => $public_ip['value'], | |
| 1229 | + 'status' => $public_ip['status'], | |
| 1230 | + 'visibility' => 'community_masked', | |
| 1231 | + 'community_value' => $public_ip['community_value'], | |
| 1232 | + ), | |
| 1233 | + array( | |
| 1234 | + 'label' => esc_html__( 'HTTPS', 'mainwp' ), | |
| 1235 | + 'value' => is_ssl() ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1236 | + ), | |
| 1237 | + array( | |
| 1238 | + 'label' => esc_html__( 'Permalink structure', 'mainwp' ), | |
| 1239 | + 'value' => $permalink['value'], | |
| 1240 | + 'status' => $permalink['status'], | |
| 1241 | + ), | |
| 1242 | + array( | |
| 1243 | + 'label' => esc_html__( 'WordPress REST API endpoint', 'mainwp' ), | |
| 1244 | + 'value' => rest_url(), | |
| 1245 | + 'visibility' => 'full_only', | |
| 1246 | + ), | |
| 1247 | + array( | |
| 1248 | + 'label' => esc_html__( 'WordPress REST API reachability', 'mainwp' ), | |
| 1249 | + 'value' => $rest_api['value'], | |
| 1250 | + 'status' => $rest_api['status'], | |
| 1251 | + ), | |
| 1252 | + array( | |
| 1253 | + 'label' => esc_html__( 'Server self connect', 'mainwp' ), | |
| 1254 | + 'value' => $self_connect['value'], | |
| 1255 | + 'status' => $self_connect['status'], | |
| 1256 | + ), | |
| 1257 | + array( | |
| 1258 | + 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1259 | + 'value' => static::format_boolean_label( $ssl_verify ), | |
| 1260 | + ), | |
| 1261 | + array( | |
| 1262 | + 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1263 | + 'value' => 2 === $verify_con ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1264 | + ), | |
| 1265 | + array( | |
| 1266 | + 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1267 | + 'value' => $signature, | |
| 1268 | + ), | |
| 1269 | + array( | |
| 1270 | + 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1271 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1272 | + ), | |
| 1218 | 1273 | ), |
| 1219 | 1274 | array( |
| 1220 | - 'label' => esc_html__( 'Dashboard site URL', 'mainwp' ), | |
| 1221 | - 'value' => site_url( '/' ), | |
| 1222 | - 'visibility' => 'full_only', | |
| 1223 | - ), | |
| 1224 | - array( | |
| 1225 | - 'label' => esc_html__( 'Public Dashboard IP', 'mainwp' ), | |
| 1226 | - 'value' => $public_ip['value'], | |
| 1227 | - 'status' => $public_ip['status'], | |
| 1228 | - 'visibility' => 'community_masked', | |
| 1229 | - 'community_value' => $public_ip['community_value'], | |
| 1230 | - ), | |
| 1231 | - array( | |
| 1232 | - 'label' => esc_html__( 'HTTPS', 'mainwp' ), | |
| 1233 | - 'value' => is_ssl() ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1234 | - ), | |
| 1235 | - array( | |
| 1236 | - 'label' => esc_html__( 'Permalink structure', 'mainwp' ), | |
| 1237 | - 'value' => $permalink['value'], | |
| 1238 | - 'status' => $permalink['status'], | |
| 1239 | - ), | |
| 1240 | - array( | |
| 1241 | - 'label' => esc_html__( 'WordPress REST API endpoint', 'mainwp' ), | |
| 1242 | - 'value' => rest_url(), | |
| 1243 | - 'visibility' => 'full_only', | |
| 1244 | - ), | |
| 1245 | - array( | |
| 1246 | - 'label' => esc_html__( 'WordPress REST API reachability', 'mainwp' ), | |
| 1247 | - 'value' => $rest_api['value'], | |
| 1248 | - 'status' => $rest_api['status'], | |
| 1249 | - ), | |
| 1250 | - array( | |
| 1251 | - 'label' => esc_html__( 'Server self connect', 'mainwp' ), | |
| 1252 | - 'value' => $self_connect['value'], | |
| 1253 | - 'status' => $self_connect['status'], | |
| 1254 | - ), | |
| 1255 | - array( | |
| 1256 | - 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1257 | - 'value' => static::format_boolean_label( $ssl_verify ), | |
| 1258 | - ), | |
| 1259 | - array( | |
| 1260 | - 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1261 | - 'value' => 2 === $verify_con ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1262 | - ), | |
| 1263 | - array( | |
| 1264 | - 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1265 | - 'value' => $signature, | |
| 1266 | - ), | |
| 1267 | - array( | |
| 1268 | - 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1269 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1270 | - ), | |
| 1271 | - ), | |
| 1272 | - array( | |
| 1273 | 1275 | 'Dashboard home URL', |
| 1274 | 1276 | 'Dashboard site URL', |
| 1275 | 1277 | 'Public Dashboard IP', |
| 1276 | 1278 | 'HTTPS', |
| @@ -1298,10 +1300,10 @@ | ||
| 1298 | 1300 | } |
| 1299 | 1301 | |
| 1300 | 1302 | $rows = array( |
| 1301 | 1303 | array( |
| 1302 | - 'label' => esc_html__( 'Use WP Cron', 'mainwp' ), | |
| 1303 | - 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_wp_cron' ) ) || 1 === (int) get_option( 'mainwp_wp_cron', 1 ) ), | |
| 1304 | + 'label' => esc_html__( 'Use WP Cron', 'mainwp' ), | |
| 1305 | + 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_wp_cron' ) ) || 1 === (int) get_option( 'mainwp_wp_cron', 1 ) ), | |
| 1304 | 1306 | ), |
| 1305 | 1307 | array( |
| 1306 | 1308 | 'label' => esc_html__( 'Daily update frequency', 'mainwp' ), |
| 1307 | 1309 | 'value' => MainWP_Server_Information::get_schedule_auto_update_label( $daily_frequency ), |
| @@ -1377,9 +1379,9 @@ | ||
| 1377 | 1379 | if ( ! in_array( $frequency_auto_update, array( 'daily', 'weekly', 'monthly' ), true ) ) { |
| 1378 | 1380 | $frequency_auto_update = 'daily'; |
| 1379 | 1381 | } |
| 1380 | 1382 | |
| 1381 | - $show_widgets = get_user_option( 'mainwp_settings_show_widgets', array() ); | |
| 1383 | + $show_widgets = get_user_option( 'mainwp_settings_show_widgets' ); | |
| 1382 | 1384 | if ( ! is_array( $show_widgets ) ) { |
| 1383 | 1385 | $show_widgets = array(); |
| 1384 | 1386 | } |
| 1385 | 1387 | |
| @@ -1384,150 +1386,150 @@ | ||
| 1384 | 1386 | } |
| 1385 | 1387 | |
| 1386 | 1388 | return self::add_export_labels_to_rows( |
| 1387 | 1389 | array( |
| 1388 | - array( | |
| 1389 | - 'label' => esc_html__( 'Timezone', 'mainwp' ), | |
| 1390 | - 'value' => static::get_timezone_label(), | |
| 1391 | - ), | |
| 1392 | - array( | |
| 1393 | - 'label' => esc_html__( 'Date format', 'mainwp' ), | |
| 1394 | - 'value' => (string) get_option( 'date_format', $default_setting['date_format'] ), | |
| 1395 | - ), | |
| 1396 | - array( | |
| 1397 | - 'label' => esc_html__( 'Time format', 'mainwp' ), | |
| 1398 | - 'value' => (string) get_option( 'time_format', $default_setting['time_format'] ), | |
| 1399 | - ), | |
| 1400 | - array( | |
| 1401 | - 'label' => esc_html__( 'Sidebar position', 'mainwp' ), | |
| 1402 | - 'value' => 0 === (int) $sidebar ? esc_html__( 'Left', 'mainwp' ) : esc_html__( 'Right', 'mainwp' ), | |
| 1403 | - ), | |
| 1404 | - array( | |
| 1405 | - 'label' => esc_html__( 'Hide Update Everything', 'mainwp' ), | |
| 1406 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_hide_update_everything', $default_setting['mainwp_hide_update_everything'] ) ), | |
| 1407 | - ), | |
| 1408 | - array( | |
| 1409 | - 'label' => esc_html__( 'Dashboard widgets shown', 'mainwp' ), | |
| 1410 | - 'value' => sprintf( | |
| 1411 | - /* translators: %d: visible widget count */ | |
| 1412 | - esc_html__( '%d visible', 'mainwp' ), | |
| 1413 | - count( $show_widgets ) | |
| 1390 | + array( | |
| 1391 | + 'label' => esc_html__( 'Timezone', 'mainwp' ), | |
| 1392 | + 'value' => static::get_timezone_label(), | |
| 1414 | 1393 | ), |
| 1415 | - ), | |
| 1416 | - array( | |
| 1417 | - 'label' => esc_html__( 'WP Core advanced automatic updates', 'mainwp' ), | |
| 1418 | - 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_automaticDailyUpdate', $default_setting['mainwp_automaticDailyUpdate'] ) ), | |
| 1419 | - ), | |
| 1420 | - array( | |
| 1421 | - 'label' => esc_html__( 'Plugin advanced automatic updates', 'mainwp' ), | |
| 1422 | - 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_pluginAutomaticDailyUpdate', $default_setting['mainwp_pluginAutomaticDailyUpdate'] ) ), | |
| 1423 | - ), | |
| 1424 | - array( | |
| 1425 | - 'label' => esc_html__( 'Theme advanced automatic updates', 'mainwp' ), | |
| 1426 | - 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_themeAutomaticDailyUpdate', $default_setting['mainwp_themeAutomaticDailyUpdate'] ) ), | |
| 1427 | - ), | |
| 1428 | - array( | |
| 1429 | - 'label' => esc_html__( 'Translation advanced automatic updates', 'mainwp' ), | |
| 1430 | - 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_transAutomaticDailyUpdate', 0 ) ), | |
| 1431 | - ), | |
| 1432 | - array( | |
| 1433 | - 'label' => esc_html__( 'Automatic updates frequency', 'mainwp' ), | |
| 1434 | - 'value' => ucfirst( (string) $frequency_auto_update ), | |
| 1435 | - ), | |
| 1436 | - array( | |
| 1437 | - 'label' => esc_html__( 'Automatic updates time', 'mainwp' ), | |
| 1438 | - 'value' => (string) $time_auto_update, | |
| 1439 | - ), | |
| 1440 | - array( | |
| 1441 | - 'label' => esc_html__( 'Automatic updates day', 'mainwp' ), | |
| 1442 | - 'value' => static::get_automatic_updates_day_label( $frequency_auto_update ), | |
| 1443 | - ), | |
| 1444 | - array( | |
| 1445 | - 'label' => esc_html__( 'Advanced automatic updates delay', 'mainwp' ), | |
| 1446 | - 'value' => static::format_delay_label( (int) get_option( 'mainwp_delay_autoupdate', 1 ) ), | |
| 1447 | - ), | |
| 1448 | - array( | |
| 1449 | - 'label' => esc_html__( 'Show language updates', 'mainwp' ), | |
| 1450 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_show_language_updates', $default_setting['mainwp_show_language_updates'] ) ), | |
| 1451 | - ), | |
| 1452 | - array( | |
| 1453 | - 'label' => esc_html__( 'Disable update confirmations', 'mainwp' ), | |
| 1454 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_disable_update_confirmations', $default_setting['mainwp_disable_update_confirmations'] ) ), | |
| 1455 | - ), | |
| 1456 | - array( | |
| 1457 | - 'label' => esc_html__( 'After updates HTTP response check', 'mainwp' ), | |
| 1458 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_check_http_response', $default_setting['mainwp_check_http_response'] ) ), | |
| 1459 | - ), | |
| 1460 | - array( | |
| 1461 | - 'label' => esc_html__( 'After updates HTTP response method', 'mainwp' ), | |
| 1462 | - 'value' => strtoupper( (string) get_option( 'mainwp_check_http_response_method', $default_setting['mainwp_check_http_response_method'] ) ), | |
| 1463 | - ), | |
| 1464 | - array( | |
| 1465 | - 'label' => esc_html__( 'Backup before update', 'mainwp' ), | |
| 1466 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backup_before_upgrade', $default_setting['mainwp_backup_before_upgrade'] ) ), | |
| 1467 | - ), | |
| 1468 | - array( | |
| 1469 | - 'label' => esc_html__( 'Full backup tolerance before update', 'mainwp' ), | |
| 1470 | - 'value' => sprintf( | |
| 1471 | - /* translators: %d: days */ | |
| 1472 | - esc_html__( '%d days', 'mainwp' ), | |
| 1473 | - (int) get_option( 'mainwp_backup_before_upgrade_days', $default_setting['mainwp_backup_before_upgrade_days'] ) | |
| 1394 | + array( | |
| 1395 | + 'label' => esc_html__( 'Date format', 'mainwp' ), | |
| 1396 | + 'value' => (string) get_option( 'date_format', $default_setting['date_format'] ), | |
| 1474 | 1397 | ), |
| 1475 | - ), | |
| 1476 | - array( | |
| 1477 | - 'label' => esc_html__( 'Abandoned plugins/themes tolerance', 'mainwp' ), | |
| 1478 | - 'value' => sprintf( | |
| 1479 | - /* translators: %d: days */ | |
| 1480 | - esc_html__( '%d days', 'mainwp' ), | |
| 1481 | - (int) get_option( 'mainwp_numberdays_Outdate_Plugin_Theme', $default_setting['mainwp_numberdays_Outdate_Plugin_Theme'] ) | |
| 1398 | + array( | |
| 1399 | + 'label' => esc_html__( 'Time format', 'mainwp' ), | |
| 1400 | + 'value' => (string) get_option( 'time_format', $default_setting['time_format'] ), | |
| 1482 | 1401 | ), |
| 1402 | + array( | |
| 1403 | + 'label' => esc_html__( 'Sidebar position', 'mainwp' ), | |
| 1404 | + 'value' => 0 === (int) $sidebar ? esc_html__( 'Left', 'mainwp' ) : esc_html__( 'Right', 'mainwp' ), | |
| 1405 | + ), | |
| 1406 | + array( | |
| 1407 | + 'label' => esc_html__( 'Hide Update Everything', 'mainwp' ), | |
| 1408 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_hide_update_everything', $default_setting['mainwp_hide_update_everything'] ) ), | |
| 1409 | + ), | |
| 1410 | + array( | |
| 1411 | + 'label' => esc_html__( 'Dashboard widgets shown', 'mainwp' ), | |
| 1412 | + 'value' => sprintf( | |
| 1413 | + /* translators: %d: visible widget count */ | |
| 1414 | + esc_html__( '%d visible', 'mainwp' ), | |
| 1415 | + count( $show_widgets ) | |
| 1416 | + ), | |
| 1417 | + ), | |
| 1418 | + array( | |
| 1419 | + 'label' => esc_html__( 'WP Core advanced automatic updates', 'mainwp' ), | |
| 1420 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_automaticDailyUpdate', $default_setting['mainwp_automaticDailyUpdate'] ) ), | |
| 1421 | + ), | |
| 1422 | + array( | |
| 1423 | + 'label' => esc_html__( 'Plugin advanced automatic updates', 'mainwp' ), | |
| 1424 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_pluginAutomaticDailyUpdate', $default_setting['mainwp_pluginAutomaticDailyUpdate'] ) ), | |
| 1425 | + ), | |
| 1426 | + array( | |
| 1427 | + 'label' => esc_html__( 'Theme advanced automatic updates', 'mainwp' ), | |
| 1428 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_themeAutomaticDailyUpdate', $default_setting['mainwp_themeAutomaticDailyUpdate'] ) ), | |
| 1429 | + ), | |
| 1430 | + array( | |
| 1431 | + 'label' => esc_html__( 'Translation advanced automatic updates', 'mainwp' ), | |
| 1432 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_transAutomaticDailyUpdate', 0 ) ), | |
| 1433 | + ), | |
| 1434 | + array( | |
| 1435 | + 'label' => esc_html__( 'Automatic updates frequency', 'mainwp' ), | |
| 1436 | + 'value' => ucfirst( (string) $frequency_auto_update ), | |
| 1437 | + ), | |
| 1438 | + array( | |
| 1439 | + 'label' => esc_html__( 'Automatic updates time', 'mainwp' ), | |
| 1440 | + 'value' => (string) $time_auto_update, | |
| 1441 | + ), | |
| 1442 | + array( | |
| 1443 | + 'label' => esc_html__( 'Automatic updates day', 'mainwp' ), | |
| 1444 | + 'value' => static::get_automatic_updates_day_label( $frequency_auto_update ), | |
| 1445 | + ), | |
| 1446 | + array( | |
| 1447 | + 'label' => esc_html__( 'Advanced automatic updates delay', 'mainwp' ), | |
| 1448 | + 'value' => static::format_delay_label( (int) get_option( 'mainwp_delay_autoupdate', 1 ) ), | |
| 1449 | + ), | |
| 1450 | + array( | |
| 1451 | + 'label' => esc_html__( 'Show language updates', 'mainwp' ), | |
| 1452 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_show_language_updates', $default_setting['mainwp_show_language_updates'] ) ), | |
| 1453 | + ), | |
| 1454 | + array( | |
| 1455 | + 'label' => esc_html__( 'Disable update confirmations', 'mainwp' ), | |
| 1456 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_disable_update_confirmations', $default_setting['mainwp_disable_update_confirmations'] ) ), | |
| 1457 | + ), | |
| 1458 | + array( | |
| 1459 | + 'label' => esc_html__( 'After updates HTTP response check', 'mainwp' ), | |
| 1460 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_check_http_response', $default_setting['mainwp_check_http_response'] ) ), | |
| 1461 | + ), | |
| 1462 | + array( | |
| 1463 | + 'label' => esc_html__( 'After updates HTTP response method', 'mainwp' ), | |
| 1464 | + 'value' => strtoupper( (string) get_option( 'mainwp_check_http_response_method', $default_setting['mainwp_check_http_response_method'] ) ), | |
| 1465 | + ), | |
| 1466 | + array( | |
| 1467 | + 'label' => esc_html__( 'Backup before update', 'mainwp' ), | |
| 1468 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backup_before_upgrade', $default_setting['mainwp_backup_before_upgrade'] ) ), | |
| 1469 | + ), | |
| 1470 | + array( | |
| 1471 | + 'label' => esc_html__( 'Full backup tolerance before update', 'mainwp' ), | |
| 1472 | + 'value' => sprintf( | |
| 1473 | + /* translators: %d: days */ | |
| 1474 | + esc_html__( '%d days', 'mainwp' ), | |
| 1475 | + (int) get_option( 'mainwp_backup_before_upgrade_days', $default_setting['mainwp_backup_before_upgrade_days'] ) | |
| 1476 | + ), | |
| 1477 | + ), | |
| 1478 | + array( | |
| 1479 | + 'label' => esc_html__( 'Abandoned plugins/themes tolerance', 'mainwp' ), | |
| 1480 | + 'value' => sprintf( | |
| 1481 | + /* translators: %d: days */ | |
| 1482 | + esc_html__( '%d days', 'mainwp' ), | |
| 1483 | + (int) get_option( 'mainwp_numberdays_Outdate_Plugin_Theme', $default_setting['mainwp_numberdays_Outdate_Plugin_Theme'] ) | |
| 1484 | + ), | |
| 1485 | + ), | |
| 1486 | + array( | |
| 1487 | + 'label' => esc_html__( 'Primary backup system', 'mainwp' ), | |
| 1488 | + 'value' => static::get_primary_backup_method_label(), | |
| 1489 | + ), | |
| 1490 | + array( | |
| 1491 | + 'label' => esc_html__( 'MainWP legacy backups enabled', 'mainwp' ), | |
| 1492 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enableLegacyBackupFeature', 0 ) ), | |
| 1493 | + ), | |
| 1494 | + array( | |
| 1495 | + 'label' => esc_html__( 'Backups kept on server', 'mainwp' ), | |
| 1496 | + 'value' => (string) ( false === get_option( 'mainwp_backupsOnServer' ) ? 1 : intval( get_option( 'mainwp_backupsOnServer' ) ) ), | |
| 1497 | + ), | |
| 1498 | + array( | |
| 1499 | + 'label' => esc_html__( 'Backup to external sources', 'mainwp' ), | |
| 1500 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backupOnExternalSources', 0 ) ), | |
| 1501 | + ), | |
| 1502 | + array( | |
| 1503 | + 'label' => esc_html__( 'Archive format', 'mainwp' ), | |
| 1504 | + 'value' => static::format_archive_format_label( get_option( 'mainwp_archiveFormat', 'tar.gz' ) ), | |
| 1505 | + ), | |
| 1506 | + array( | |
| 1507 | + 'label' => esc_html__( 'Auto detect maximum file descriptors on child sites', 'mainwp' ), | |
| 1508 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_maximumFileDescriptorsAuto', 1 ) ), | |
| 1509 | + ), | |
| 1510 | + array( | |
| 1511 | + 'label' => esc_html__( 'Maximum file descriptors fallback value', 'mainwp' ), | |
| 1512 | + 'value' => (string) ( false === get_option( 'mainwp_maximumFileDescriptors' ) ? 150 : intval( get_option( 'mainwp_maximumFileDescriptors' ) ) ), | |
| 1513 | + ), | |
| 1514 | + array( | |
| 1515 | + 'label' => esc_html__( 'Load files in memory before zipping', 'mainwp' ), | |
| 1516 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_options_loadFilesBeforeZip', 1 ) ), | |
| 1517 | + ), | |
| 1518 | + array( | |
| 1519 | + 'label' => esc_html__( 'Send email when backup fails', 'mainwp' ), | |
| 1520 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupFail', 1 ) ), | |
| 1521 | + ), | |
| 1522 | + array( | |
| 1523 | + 'label' => esc_html__( 'Send email when backup starts', 'mainwp' ), | |
| 1524 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupStart', 1 ) ), | |
| 1525 | + ), | |
| 1526 | + array( | |
| 1527 | + 'label' => esc_html__( 'Execute backup tasks in chunks', 'mainwp' ), | |
| 1528 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_chunkedBackupTasks', 1 ) ), | |
| 1529 | + ), | |
| 1483 | 1530 | ), |
| 1484 | 1531 | array( |
| 1485 | - 'label' => esc_html__( 'Primary backup system', 'mainwp' ), | |
| 1486 | - 'value' => static::get_primary_backup_method_label(), | |
| 1487 | - ), | |
| 1488 | - array( | |
| 1489 | - 'label' => esc_html__( 'MainWP legacy backups enabled', 'mainwp' ), | |
| 1490 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enableLegacyBackupFeature', 0 ) ), | |
| 1491 | - ), | |
| 1492 | - array( | |
| 1493 | - 'label' => esc_html__( 'Backups kept on server', 'mainwp' ), | |
| 1494 | - 'value' => (string) ( false === get_option( 'mainwp_backupsOnServer' ) ? 1 : intval( get_option( 'mainwp_backupsOnServer' ) ) ), | |
| 1495 | - ), | |
| 1496 | - array( | |
| 1497 | - 'label' => esc_html__( 'Backup to external sources', 'mainwp' ), | |
| 1498 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backupOnExternalSources', 0 ) ), | |
| 1499 | - ), | |
| 1500 | - array( | |
| 1501 | - 'label' => esc_html__( 'Archive format', 'mainwp' ), | |
| 1502 | - 'value' => static::format_archive_format_label( get_option( 'mainwp_archiveFormat', 'tar.gz' ) ), | |
| 1503 | - ), | |
| 1504 | - array( | |
| 1505 | - 'label' => esc_html__( 'Auto detect maximum file descriptors on child sites', 'mainwp' ), | |
| 1506 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_maximumFileDescriptorsAuto', 1 ) ), | |
| 1507 | - ), | |
| 1508 | - array( | |
| 1509 | - 'label' => esc_html__( 'Maximum file descriptors fallback value', 'mainwp' ), | |
| 1510 | - 'value' => (string) ( false === get_option( 'mainwp_maximumFileDescriptors' ) ? 150 : intval( get_option( 'mainwp_maximumFileDescriptors' ) ) ), | |
| 1511 | - ), | |
| 1512 | - array( | |
| 1513 | - 'label' => esc_html__( 'Load files in memory before zipping', 'mainwp' ), | |
| 1514 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_options_loadFilesBeforeZip', 1 ) ), | |
| 1515 | - ), | |
| 1516 | - array( | |
| 1517 | - 'label' => esc_html__( 'Send email when backup fails', 'mainwp' ), | |
| 1518 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupFail', 1 ) ), | |
| 1519 | - ), | |
| 1520 | - array( | |
| 1521 | - 'label' => esc_html__( 'Send email when backup starts', 'mainwp' ), | |
| 1522 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupStart', 1 ) ), | |
| 1523 | - ), | |
| 1524 | - array( | |
| 1525 | - 'label' => esc_html__( 'Execute backup tasks in chunks', 'mainwp' ), | |
| 1526 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_chunkedBackupTasks', 1 ) ), | |
| 1527 | - ), | |
| 1528 | - ), | |
| 1529 | - array( | |
| 1530 | 1532 | 'Timezone', |
| 1531 | 1533 | 'Date format', |
| 1532 | 1534 | 'Time format', |
| 1533 | 1535 | 'Sidebar position', |
| @@ -1587,94 +1589,94 @@ | ||
| 1587 | 1589 | } |
| 1588 | 1590 | |
| 1589 | 1591 | return self::add_export_labels_to_rows( |
| 1590 | 1592 | array( |
| 1591 | - array( | |
| 1592 | - 'label' => esc_html__( 'Maximum simultaneous requests', 'mainwp' ), | |
| 1593 | - 'value' => (string) ( false === get_option( 'mainwp_maximumRequests' ) ? 4 : intval( get_option( 'mainwp_maximumRequests' ) ) ), | |
| 1594 | - ), | |
| 1595 | - array( | |
| 1596 | - 'label' => esc_html__( 'Minimum delay between requests', 'mainwp' ), | |
| 1597 | - 'value' => sprintf( | |
| 1598 | - /* translators: %d: milliseconds */ | |
| 1599 | - esc_html__( '%d ms', 'mainwp' ), | |
| 1600 | - (int) ( false === get_option( 'mainwp_minimumDelay' ) ? 200 : intval( get_option( 'mainwp_minimumDelay' ) ) ) | |
| 1593 | + array( | |
| 1594 | + 'label' => esc_html__( 'Maximum simultaneous requests', 'mainwp' ), | |
| 1595 | + 'value' => (string) ( false === get_option( 'mainwp_maximumRequests' ) ? 4 : intval( get_option( 'mainwp_maximumRequests' ) ) ), | |
| 1601 | 1596 | ), |
| 1602 | - ), | |
| 1603 | - array( | |
| 1604 | - 'label' => esc_html__( 'Maximum simultaneous requests per IP', 'mainwp' ), | |
| 1605 | - 'value' => (string) ( false === get_option( 'mainwp_maximumIPRequests' ) ? 1 : intval( get_option( 'mainwp_maximumIPRequests' ) ) ), | |
| 1606 | - ), | |
| 1607 | - array( | |
| 1608 | - 'label' => esc_html__( 'Minimum delay between requests to the same IP', 'mainwp' ), | |
| 1609 | - 'value' => sprintf( | |
| 1610 | - /* translators: %d: milliseconds */ | |
| 1611 | - esc_html__( '%d ms', 'mainwp' ), | |
| 1612 | - (int) ( false === get_option( 'mainwp_minimumIPDelay' ) ? 1000 : intval( get_option( 'mainwp_minimumIPDelay' ) ) ) | |
| 1597 | + array( | |
| 1598 | + 'label' => esc_html__( 'Minimum delay between requests', 'mainwp' ), | |
| 1599 | + 'value' => sprintf( | |
| 1600 | + /* translators: %d: milliseconds */ | |
| 1601 | + esc_html__( '%d ms', 'mainwp' ), | |
| 1602 | + (int) ( false === get_option( 'mainwp_minimumDelay' ) ? 200 : intval( get_option( 'mainwp_minimumDelay' ) ) ) | |
| 1603 | + ), | |
| 1613 | 1604 | ), |
| 1614 | - ), | |
| 1615 | - array( | |
| 1616 | - 'label' => esc_html__( 'Maximum simultaneous sync requests', 'mainwp' ), | |
| 1617 | - 'value' => (string) ( false === get_option( 'mainwp_maximumSyncRequests' ) ? 8 : intval( get_option( 'mainwp_maximumSyncRequests' ) ) ), | |
| 1618 | - ), | |
| 1619 | - array( | |
| 1620 | - 'label' => esc_html__( 'Maximum simultaneous install and update requests', 'mainwp' ), | |
| 1621 | - 'value' => (string) ( false === get_option( 'mainwp_maximumInstallUpdateRequests' ) ? 3 : intval( get_option( 'mainwp_maximumInstallUpdateRequests' ) ) ), | |
| 1622 | - ), | |
| 1623 | - array( | |
| 1624 | - 'label' => esc_html__( 'Maximum simultaneous uptime monitoring requests', 'mainwp' ), | |
| 1625 | - 'value' => (string) ( false === get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ? 10 : intval( get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ) ), | |
| 1626 | - ), | |
| 1627 | - array( | |
| 1628 | - 'label' => esc_html__( 'Sites processed per sync batch', 'mainwp' ), | |
| 1629 | - 'value' => (string) ( false === get_option( 'mainwp_chunksitesnumber' ) ? 10 : intval( get_option( 'mainwp_chunksitesnumber' ) ) ), | |
| 1630 | - ), | |
| 1631 | - array( | |
| 1632 | - 'label' => esc_html__( 'Sync batch sleep interval', 'mainwp' ), | |
| 1633 | - 'value' => sprintf( | |
| 1634 | - /* translators: %d: seconds */ | |
| 1635 | - esc_html__( '%d seconds', 'mainwp' ), | |
| 1636 | - (int) ( false === get_option( 'mainwp_chunksleepinterval' ) ? 5 : intval( get_option( 'mainwp_chunksleepinterval' ) ) ) | |
| 1605 | + array( | |
| 1606 | + 'label' => esc_html__( 'Maximum simultaneous requests per IP', 'mainwp' ), | |
| 1607 | + 'value' => (string) ( false === get_option( 'mainwp_maximumIPRequests' ) ? 1 : intval( get_option( 'mainwp_maximumIPRequests' ) ) ), | |
| 1637 | 1608 | ), |
| 1638 | - ), | |
| 1639 | - array( | |
| 1640 | - 'label' => esc_html__( 'Optimize data loading', 'mainwp' ), | |
| 1641 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_optimize', $default_setting['mainwp_optimize'] ) ), | |
| 1642 | - ), | |
| 1643 | - array( | |
| 1644 | - 'label' => esc_html__( 'Browser cache expiration time', 'mainwp' ), | |
| 1645 | - 'value' => sprintf( | |
| 1646 | - /* translators: %d: minutes */ | |
| 1647 | - esc_html__( '%d minutes', 'mainwp' ), | |
| 1648 | - (int) get_option( 'mainwp_warm_cache_pages_ttl', 10 ) | |
| 1609 | + array( | |
| 1610 | + 'label' => esc_html__( 'Minimum delay between requests to the same IP', 'mainwp' ), | |
| 1611 | + 'value' => sprintf( | |
| 1612 | + /* translators: %d: milliseconds */ | |
| 1613 | + esc_html__( '%d ms', 'mainwp' ), | |
| 1614 | + (int) ( false === get_option( 'mainwp_minimumIPDelay' ) ? 1000 : intval( get_option( 'mainwp_minimumIPDelay' ) ) ) | |
| 1615 | + ), | |
| 1649 | 1616 | ), |
| 1650 | - ), | |
| 1651 | - array( | |
| 1652 | - 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1653 | - 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_sslVerifyCertificate' ) ) || 1 === (int) get_option( 'mainwp_sslVerifyCertificate', 1 ) ), | |
| 1654 | - ), | |
| 1655 | - array( | |
| 1656 | - 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1657 | - 'value' => 2 === (int) get_option( 'mainwp_verify_connection_method', 1 ) ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1658 | - ), | |
| 1659 | - array( | |
| 1660 | - 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1661 | - 'value' => isset( $sign_algs[ $signature_algo ] ) ? $sign_algs[ $signature_algo ] : (string) $signature_algo, | |
| 1662 | - ), | |
| 1663 | - array( | |
| 1664 | - 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1665 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1666 | - ), | |
| 1667 | - array( | |
| 1668 | - 'label' => esc_html__( 'Selected data to sync', 'mainwp' ), | |
| 1669 | - 'value' => sprintf( | |
| 1670 | - /* translators: 1: enabled count, 2: total count */ | |
| 1671 | - esc_html__( '%1$d of %2$d enabled', 'mainwp' ), | |
| 1672 | - $enabled_sync, | |
| 1673 | - count( $sync_defaults ) | |
| 1617 | + array( | |
| 1618 | + 'label' => esc_html__( 'Maximum simultaneous sync requests', 'mainwp' ), | |
| 1619 | + 'value' => (string) ( false === get_option( 'mainwp_maximumSyncRequests' ) ? 8 : intval( get_option( 'mainwp_maximumSyncRequests' ) ) ), | |
| 1674 | 1620 | ), |
| 1621 | + array( | |
| 1622 | + 'label' => esc_html__( 'Maximum simultaneous install and update requests', 'mainwp' ), | |
| 1623 | + 'value' => (string) ( false === get_option( 'mainwp_maximumInstallUpdateRequests' ) ? 3 : intval( get_option( 'mainwp_maximumInstallUpdateRequests' ) ) ), | |
| 1624 | + ), | |
| 1625 | + array( | |
| 1626 | + 'label' => esc_html__( 'Maximum simultaneous uptime monitoring requests', 'mainwp' ), | |
| 1627 | + 'value' => (string) ( false === get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ? 10 : intval( get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ) ), | |
| 1628 | + ), | |
| 1629 | + array( | |
| 1630 | + 'label' => esc_html__( 'Sites processed per sync batch', 'mainwp' ), | |
| 1631 | + 'value' => (string) ( false === get_option( 'mainwp_chunksitesnumber' ) ? 10 : intval( get_option( 'mainwp_chunksitesnumber' ) ) ), | |
| 1632 | + ), | |
| 1633 | + array( | |
| 1634 | + 'label' => esc_html__( 'Sync batch sleep interval', 'mainwp' ), | |
| 1635 | + 'value' => sprintf( | |
| 1636 | + /* translators: %d: seconds */ | |
| 1637 | + esc_html__( '%d seconds', 'mainwp' ), | |
| 1638 | + (int) ( false === get_option( 'mainwp_chunksleepinterval' ) ? 5 : intval( get_option( 'mainwp_chunksleepinterval' ) ) ) | |
| 1639 | + ), | |
| 1640 | + ), | |
| 1641 | + array( | |
| 1642 | + 'label' => esc_html__( 'Optimize data loading', 'mainwp' ), | |
| 1643 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_optimize', $default_setting['mainwp_optimize'] ) ), | |
| 1644 | + ), | |
| 1645 | + array( | |
| 1646 | + 'label' => esc_html__( 'Browser cache expiration time', 'mainwp' ), | |
| 1647 | + 'value' => sprintf( | |
| 1648 | + /* translators: %d: minutes */ | |
| 1649 | + esc_html__( '%d minutes', 'mainwp' ), | |
| 1650 | + (int) get_option( 'mainwp_warm_cache_pages_ttl', 10 ) | |
| 1651 | + ), | |
| 1652 | + ), | |
| 1653 | + array( | |
| 1654 | + 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1655 | + 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_sslVerifyCertificate' ) ) || 1 === (int) get_option( 'mainwp_sslVerifyCertificate', 1 ) ), | |
| 1656 | + ), | |
| 1657 | + array( | |
| 1658 | + 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1659 | + 'value' => 2 === (int) get_option( 'mainwp_verify_connection_method', 1 ) ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1660 | + ), | |
| 1661 | + array( | |
| 1662 | + 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1663 | + 'value' => isset( $sign_algs[ $signature_algo ] ) ? $sign_algs[ $signature_algo ] : (string) $signature_algo, | |
| 1664 | + ), | |
| 1665 | + array( | |
| 1666 | + 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1667 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1668 | + ), | |
| 1669 | + array( | |
| 1670 | + 'label' => esc_html__( 'Selected data to sync', 'mainwp' ), | |
| 1671 | + 'value' => sprintf( | |
| 1672 | + /* translators: 1: enabled count, 2: total count */ | |
| 1673 | + esc_html__( '%1$d of %2$d enabled', 'mainwp' ), | |
| 1674 | + $enabled_sync, | |
| 1675 | + count( $sync_defaults ) | |
| 1676 | + ), | |
| 1677 | + ), | |
| 1675 | 1678 | ), |
| 1676 | - ), | |
| 1677 | 1679 | array( |
| 1678 | 1680 | 'Maximum simultaneous requests', |
| 1679 | 1681 | 'Minimum delay between requests', |
| 1680 | 1682 | 'Maximum simultaneous requests per IP', |
| @@ -1718,54 +1720,54 @@ | ||
| 1718 | 1720 | $threshold = (int) get_option( 'mainwp_sitehealthThreshold', 80 ); |
| 1719 | 1721 | |
| 1720 | 1722 | return self::add_export_labels_to_rows( |
| 1721 | 1723 | array( |
| 1722 | - array( | |
| 1723 | - 'label' => esc_html__( 'Enable uptime monitoring', 'mainwp' ), | |
| 1724 | - 'value' => static::format_boolean_label( ! empty( $monitoring_settings['active'] ) ), | |
| 1724 | + array( | |
| 1725 | + 'label' => esc_html__( 'Enable uptime monitoring', 'mainwp' ), | |
| 1726 | + 'value' => static::format_boolean_label( ! empty( $monitoring_settings['active'] ) ), | |
| 1727 | + ), | |
| 1728 | + array( | |
| 1729 | + 'label' => esc_html__( 'Monitor type', 'mainwp' ), | |
| 1730 | + 'value' => static::format_monitor_type_label( $monitoring_settings['type'] ?? 'http' ), | |
| 1731 | + ), | |
| 1732 | + array( | |
| 1733 | + 'label' => esc_html__( 'Method', 'mainwp' ), | |
| 1734 | + 'value' => strtoupper( (string) ( $monitoring_settings['method'] ?? 'get' ) ), | |
| 1735 | + ), | |
| 1736 | + array( | |
| 1737 | + 'label' => esc_html__( 'Interval', 'mainwp' ), | |
| 1738 | + 'value' => (string) $interval_value, | |
| 1739 | + ), | |
| 1740 | + array( | |
| 1741 | + 'label' => esc_html__( 'Timeout', 'mainwp' ), | |
| 1742 | + 'value' => (string) $timeout_value, | |
| 1743 | + ), | |
| 1744 | + array( | |
| 1745 | + 'label' => esc_html__( 'Up HTTP codes', 'mainwp' ), | |
| 1746 | + 'value' => ! empty( $monitoring_settings['up_status_codes'] ) ? (string) $monitoring_settings['up_status_codes'] : esc_html__( 'Default', 'mainwp' ), | |
| 1747 | + ), | |
| 1748 | + array( | |
| 1749 | + 'label' => esc_html__( 'Down confirmation check', 'mainwp' ), | |
| 1750 | + 'value' => ! empty( $monitoring_settings['maxretries'] ) ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1751 | + ), | |
| 1752 | + array( | |
| 1753 | + 'label' => esc_html__( 'Keyword monitoring value', 'mainwp' ), | |
| 1754 | + 'value' => ! empty( $monitoring_settings['keyword'] ) ? (string) $monitoring_settings['keyword'] : esc_html__( 'Not configured', 'mainwp' ), | |
| 1755 | + ), | |
| 1756 | + array( | |
| 1757 | + 'label' => esc_html__( 'Monitoring data retention', 'mainwp' ), | |
| 1758 | + 'value' => static::format_retention_days_label( $retention_days ), | |
| 1759 | + ), | |
| 1760 | + array( | |
| 1761 | + 'label' => esc_html__( 'Enable site health monitoring', 'mainwp' ), | |
| 1762 | + 'value' => static::format_boolean_label( $site_health ), | |
| 1763 | + ), | |
| 1764 | + array( | |
| 1765 | + 'label' => esc_html__( 'Site Health threshold', 'mainwp' ), | |
| 1766 | + 'value' => 100 === $threshold ? esc_html__( 'Good', 'mainwp' ) : esc_html__( 'Should be improved', 'mainwp' ), | |
| 1767 | + ), | |
| 1725 | 1768 | ), |
| 1726 | 1769 | array( |
| 1727 | - 'label' => esc_html__( 'Monitor type', 'mainwp' ), | |
| 1728 | - 'value' => static::format_monitor_type_label( $monitoring_settings['type'] ?? 'http' ), | |
| 1729 | - ), | |
| 1730 | - array( | |
| 1731 | - 'label' => esc_html__( 'Method', 'mainwp' ), | |
| 1732 | - 'value' => strtoupper( (string) ( $monitoring_settings['method'] ?? 'get' ) ), | |
| 1733 | - ), | |
| 1734 | - array( | |
| 1735 | - 'label' => esc_html__( 'Interval', 'mainwp' ), | |
| 1736 | - 'value' => (string) $interval_value, | |
| 1737 | - ), | |
| 1738 | - array( | |
| 1739 | - 'label' => esc_html__( 'Timeout', 'mainwp' ), | |
| 1740 | - 'value' => (string) $timeout_value, | |
| 1741 | - ), | |
| 1742 | - array( | |
| 1743 | - 'label' => esc_html__( 'Up HTTP codes', 'mainwp' ), | |
| 1744 | - 'value' => ! empty( $monitoring_settings['up_status_codes'] ) ? (string) $monitoring_settings['up_status_codes'] : esc_html__( 'Default', 'mainwp' ), | |
| 1745 | - ), | |
| 1746 | - array( | |
| 1747 | - 'label' => esc_html__( 'Down confirmation check', 'mainwp' ), | |
| 1748 | - 'value' => ! empty( $monitoring_settings['maxretries'] ) ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1749 | - ), | |
| 1750 | - array( | |
| 1751 | - 'label' => esc_html__( 'Keyword monitoring value', 'mainwp' ), | |
| 1752 | - 'value' => ! empty( $monitoring_settings['keyword'] ) ? (string) $monitoring_settings['keyword'] : esc_html__( 'Not configured', 'mainwp' ), | |
| 1753 | - ), | |
| 1754 | - array( | |
| 1755 | - 'label' => esc_html__( 'Monitoring data retention', 'mainwp' ), | |
| 1756 | - 'value' => static::format_retention_days_label( $retention_days ), | |
| 1757 | - ), | |
| 1758 | - array( | |
| 1759 | - 'label' => esc_html__( 'Enable site health monitoring', 'mainwp' ), | |
| 1760 | - 'value' => static::format_boolean_label( $site_health ), | |
| 1761 | - ), | |
| 1762 | - array( | |
| 1763 | - 'label' => esc_html__( 'Site Health threshold', 'mainwp' ), | |
| 1764 | - 'value' => 100 === $threshold ? esc_html__( 'Good', 'mainwp' ) : esc_html__( 'Should be improved', 'mainwp' ), | |
| 1765 | - ), | |
| 1766 | - ), | |
| 1767 | - array( | |
| 1768 | 1770 | 'Enable uptime monitoring', |
| 1769 | 1771 | 'Monitor type', |
| 1770 | 1772 | 'Method', |
| 1771 | 1773 | 'Interval', |
| @@ -1840,45 +1842,45 @@ | ||
| 1840 | 1842 | } |
| 1841 | 1843 | |
| 1842 | 1844 | return self::add_export_labels_to_rows( |
| 1843 | 1845 | array( |
| 1844 | - array( | |
| 1845 | - 'label' => esc_html__( 'Currency', 'mainwp' ), | |
| 1846 | - 'value' => (string) $selected_currency, | |
| 1847 | - ), | |
| 1848 | - array( | |
| 1849 | - 'label' => esc_html__( 'Currency position', 'mainwp' ), | |
| 1850 | - 'value' => (string) $currency_format['currency_position'], | |
| 1851 | - ), | |
| 1852 | - array( | |
| 1853 | - 'label' => esc_html__( 'Thousand separator', 'mainwp' ), | |
| 1854 | - 'value' => '' === (string) $currency_format['thousand_separator'] ? esc_html__( 'None', 'mainwp' ) : (string) $currency_format['thousand_separator'], | |
| 1855 | - ), | |
| 1856 | - array( | |
| 1857 | - 'label' => esc_html__( 'Decimal separator', 'mainwp' ), | |
| 1858 | - 'value' => (string) $currency_format['decimal_separator'], | |
| 1859 | - ), | |
| 1860 | - array( | |
| 1861 | - 'label' => esc_html__( 'Decimals', 'mainwp' ), | |
| 1862 | - 'value' => (string) intval( $currency_format['decimals'] ), | |
| 1863 | - ), | |
| 1864 | - array( | |
| 1865 | - 'label' => esc_html__( 'Product categories', 'mainwp' ), | |
| 1866 | - 'value' => sprintf( | |
| 1867 | - /* translators: %d: count */ | |
| 1868 | - esc_html__( '%d configured', 'mainwp' ), | |
| 1869 | - count( $product_types ) | |
| 1846 | + array( | |
| 1847 | + 'label' => esc_html__( 'Currency', 'mainwp' ), | |
| 1848 | + 'value' => (string) $selected_currency, | |
| 1870 | 1849 | ), |
| 1871 | - ), | |
| 1872 | - array( | |
| 1873 | - 'label' => esc_html__( 'Payment methods', 'mainwp' ), | |
| 1874 | - 'value' => sprintf( | |
| 1875 | - /* translators: %d: count */ | |
| 1876 | - esc_html__( '%d configured', 'mainwp' ), | |
| 1877 | - count( $custom_payment_methods ) | |
| 1850 | + array( | |
| 1851 | + 'label' => esc_html__( 'Currency position', 'mainwp' ), | |
| 1852 | + 'value' => (string) $currency_format['currency_position'], | |
| 1878 | 1853 | ), |
| 1854 | + array( | |
| 1855 | + 'label' => esc_html__( 'Thousand separator', 'mainwp' ), | |
| 1856 | + 'value' => '' === (string) $currency_format['thousand_separator'] ? esc_html__( 'None', 'mainwp' ) : (string) $currency_format['thousand_separator'], | |
| 1857 | + ), | |
| 1858 | + array( | |
| 1859 | + 'label' => esc_html__( 'Decimal separator', 'mainwp' ), | |
| 1860 | + 'value' => (string) $currency_format['decimal_separator'], | |
| 1861 | + ), | |
| 1862 | + array( | |
| 1863 | + 'label' => esc_html__( 'Decimals', 'mainwp' ), | |
| 1864 | + 'value' => (string) intval( $currency_format['decimals'] ), | |
| 1865 | + ), | |
| 1866 | + array( | |
| 1867 | + 'label' => esc_html__( 'Product categories', 'mainwp' ), | |
| 1868 | + 'value' => sprintf( | |
| 1869 | + /* translators: %d: count */ | |
| 1870 | + esc_html__( '%d configured', 'mainwp' ), | |
| 1871 | + count( $product_types ) | |
| 1872 | + ), | |
| 1873 | + ), | |
| 1874 | + array( | |
| 1875 | + 'label' => esc_html__( 'Payment methods', 'mainwp' ), | |
| 1876 | + 'value' => sprintf( | |
| 1877 | + /* translators: %d: count */ | |
| 1878 | + esc_html__( '%d configured', 'mainwp' ), | |
| 1879 | + count( $custom_payment_methods ) | |
| 1880 | + ), | |
| 1881 | + ), | |
| 1879 | 1882 | ), |
| 1880 | - ), | |
| 1881 | 1883 | array( |
| 1882 | 1884 | 'Currency', |
| 1883 | 1885 | 'Currency position', |
| 1884 | 1886 | 'Thousand separator', |
| @@ -1912,38 +1914,38 @@ | ||
| 1912 | 1914 | } |
| 1913 | 1915 | |
| 1914 | 1916 | return self::add_export_labels_to_rows( |
| 1915 | 1917 | array( |
| 1916 | - array( | |
| 1917 | - 'label' => esc_html__( 'Enable Network Activity logging', 'mainwp' ), | |
| 1918 | - 'value' => static::format_boolean_label( ! empty( $options['enabled'] ) ), | |
| 1918 | + array( | |
| 1919 | + 'label' => esc_html__( 'Enable Network Activity logging', 'mainwp' ), | |
| 1920 | + 'value' => static::format_boolean_label( ! empty( $options['enabled'] ) ), | |
| 1921 | + ), | |
| 1922 | + array( | |
| 1923 | + 'label' => esc_html__( 'Automatically archive logs', 'mainwp' ), | |
| 1924 | + 'value' => static::format_boolean_label( ! empty( $options['auto_archive'] ) ), | |
| 1925 | + ), | |
| 1926 | + array( | |
| 1927 | + 'label' => esc_html__( 'Data retention period', 'mainwp' ), | |
| 1928 | + 'value' => static::format_log_retention_label( isset( $options['records_logs_ttl'] ) ? intval( $options['records_logs_ttl'] ) : 3 * YEAR_IN_SECONDS ), | |
| 1929 | + ), | |
| 1930 | + array( | |
| 1931 | + 'label' => esc_html__( 'Child-site Network Activity retention', 'mainwp' ), | |
| 1932 | + 'value' => static::format_retention_days_label( isset( $options['child_logs_ttl'] ) ? intval( $options['child_logs_ttl'] ) : 7 ), | |
| 1933 | + ), | |
| 1934 | + array( | |
| 1935 | + 'label' => esc_html__( 'Disabled dashboard event types', 'mainwp' ), | |
| 1936 | + 'value' => (string) $dashboard_disabled, | |
| 1937 | + ), | |
| 1938 | + array( | |
| 1939 | + 'label' => esc_html__( 'Disabled child-site event types', 'mainwp' ), | |
| 1940 | + 'value' => (string) $child_disabled, | |
| 1941 | + ), | |
| 1942 | + array( | |
| 1943 | + 'label' => esc_html__( 'Disabled change-log event types', 'mainwp' ), | |
| 1944 | + 'value' => (string) $changes_disabled, | |
| 1945 | + ), | |
| 1919 | 1946 | ), |
| 1920 | 1947 | array( |
| 1921 | - 'label' => esc_html__( 'Automatically archive logs', 'mainwp' ), | |
| 1922 | - 'value' => static::format_boolean_label( ! empty( $options['auto_archive'] ) ), | |
| 1923 | - ), | |
| 1924 | - array( | |
| 1925 | - 'label' => esc_html__( 'Data retention period', 'mainwp' ), | |
| 1926 | - 'value' => static::format_log_retention_label( isset( $options['records_logs_ttl'] ) ? intval( $options['records_logs_ttl'] ) : 3 * YEAR_IN_SECONDS ), | |
| 1927 | - ), | |
| 1928 | - array( | |
| 1929 | - 'label' => esc_html__( 'Child-site Network Activity retention', 'mainwp' ), | |
| 1930 | - 'value' => static::format_retention_days_label( isset( $options['child_logs_ttl'] ) ? intval( $options['child_logs_ttl'] ) : 7 ), | |
| 1931 | - ), | |
| 1932 | - array( | |
| 1933 | - 'label' => esc_html__( 'Disabled dashboard event types', 'mainwp' ), | |
| 1934 | - 'value' => (string) $dashboard_disabled, | |
| 1935 | - ), | |
| 1936 | - array( | |
| 1937 | - 'label' => esc_html__( 'Disabled child-site event types', 'mainwp' ), | |
| 1938 | - 'value' => (string) $child_disabled, | |
| 1939 | - ), | |
| 1940 | - array( | |
| 1941 | - 'label' => esc_html__( 'Disabled change-log event types', 'mainwp' ), | |
| 1942 | - 'value' => (string) $changes_disabled, | |
| 1943 | - ), | |
| 1944 | - ), | |
| 1945 | - array( | |
| 1946 | 1948 | 'Enable Network Activity logging', |
| 1947 | 1949 | 'Automatically archive logs', |
| 1948 | 1950 | 'Data retention period', |
| 1949 | 1951 | 'Child-site Network Activity retention', |
| @@ -2057,26 +2059,26 @@ | ||
| 2057 | 2059 | */ |
| 2058 | 2060 | public static function get_tools_report_rows() { |
| 2059 | 2061 | return self::add_export_labels_to_rows( |
| 2060 | 2062 | array( |
| 2061 | - array( | |
| 2062 | - 'label' => esc_html__( 'Current MainWP theme', 'mainwp' ), | |
| 2063 | - 'value' => MainWP_Settings::get_instance()->get_current_user_theme(), | |
| 2063 | + array( | |
| 2064 | + 'label' => esc_html__( 'Current MainWP theme', 'mainwp' ), | |
| 2065 | + 'value' => MainWP_Settings::get_instance()->get_current_user_theme(), | |
| 2066 | + ), | |
| 2067 | + array( | |
| 2068 | + 'label' => esc_html__( 'Guided tours', 'mainwp' ), | |
| 2069 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_tours', 0 ) ), | |
| 2070 | + ), | |
| 2071 | + array( | |
| 2072 | + 'label' => esc_html__( 'Chatbase', 'mainwp' ), | |
| 2073 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_chatbase', 0 ) ), | |
| 2074 | + ), | |
| 2075 | + array( | |
| 2076 | + 'label' => esc_html__( 'Guided video', 'mainwp' ), | |
| 2077 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_video', 0 ) ), | |
| 2078 | + ), | |
| 2064 | 2079 | ), |
| 2065 | 2080 | array( |
| 2066 | - 'label' => esc_html__( 'Guided tours', 'mainwp' ), | |
| 2067 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_tours', 0 ) ), | |
| 2068 | - ), | |
| 2069 | - array( | |
| 2070 | - 'label' => esc_html__( 'Chatbase', 'mainwp' ), | |
| 2071 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_chatbase', 0 ) ), | |
| 2072 | - ), | |
| 2073 | - array( | |
| 2074 | - 'label' => esc_html__( 'Guided video', 'mainwp' ), | |
| 2075 | - 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_video', 0 ) ), | |
| 2076 | - ), | |
| 2077 | - ), | |
| 2078 | - array( | |
| 2079 | 2081 | 'Current MainWP theme', |
| 2080 | 2082 | 'Guided tours', |
| 2081 | 2083 | 'Chatbase', |
| 2082 | 2084 | 'Guided video', |
| @@ -2094,36 +2096,36 @@ | ||
| 2094 | 2096 | $log_readable = ! empty( $error_log_path ) && file_exists( $error_log_path ) ? is_readable( $error_log_path ) : false; |
| 2095 | 2097 | |
| 2096 | 2098 | return self::add_export_labels_to_rows( |
| 2097 | 2099 | array( |
| 2098 | - array( | |
| 2099 | - 'label' => esc_html__( 'WP_DEBUG', 'mainwp' ), | |
| 2100 | - 'value' => static::format_boolean_label( defined( 'WP_DEBUG' ) && WP_DEBUG ), | |
| 2100 | + array( | |
| 2101 | + 'label' => esc_html__( 'WP_DEBUG', 'mainwp' ), | |
| 2102 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG' ) && WP_DEBUG ), | |
| 2103 | + ), | |
| 2104 | + array( | |
| 2105 | + 'label' => esc_html__( 'WP_DEBUG_LOG', 'mainwp' ), | |
| 2106 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ), | |
| 2107 | + ), | |
| 2108 | + array( | |
| 2109 | + 'label' => esc_html__( 'WP_DEBUG_DISPLAY', 'mainwp' ), | |
| 2110 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ), | |
| 2111 | + ), | |
| 2112 | + array( | |
| 2113 | + 'label' => esc_html__( 'PHP log_errors', 'mainwp' ), | |
| 2114 | + 'value' => static::format_boolean_label( filter_var( ini_get( 'log_errors' ), FILTER_VALIDATE_BOOLEAN ) ), | |
| 2115 | + ), | |
| 2116 | + array( | |
| 2117 | + 'label' => esc_html__( 'PHP error_log path', 'mainwp' ), | |
| 2118 | + 'value' => ! empty( $error_log_path ) ? $error_log_path : esc_html__( 'Not set', 'mainwp' ), | |
| 2119 | + 'visibility' => 'community_masked', | |
| 2120 | + 'community_value' => ! empty( $error_log_path ) ? esc_html__( 'Configured', 'mainwp' ) : esc_html__( 'Not set', 'mainwp' ), | |
| 2121 | + ), | |
| 2122 | + array( | |
| 2123 | + 'label' => esc_html__( 'PHP error_log readable', 'mainwp' ), | |
| 2124 | + 'value' => static::format_boolean_label( $log_readable ), | |
| 2125 | + ), | |
| 2101 | 2126 | ), |
| 2102 | 2127 | array( |
| 2103 | - 'label' => esc_html__( 'WP_DEBUG_LOG', 'mainwp' ), | |
| 2104 | - 'value' => static::format_boolean_label( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ), | |
| 2105 | - ), | |
| 2106 | - array( | |
| 2107 | - 'label' => esc_html__( 'WP_DEBUG_DISPLAY', 'mainwp' ), | |
| 2108 | - 'value' => static::format_boolean_label( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ), | |
| 2109 | - ), | |
| 2110 | - array( | |
| 2111 | - 'label' => esc_html__( 'PHP log_errors', 'mainwp' ), | |
| 2112 | - 'value' => static::format_boolean_label( filter_var( ini_get( 'log_errors' ), FILTER_VALIDATE_BOOLEAN ) ), | |
| 2113 | - ), | |
| 2114 | - array( | |
| 2115 | - 'label' => esc_html__( 'PHP error_log path', 'mainwp' ), | |
| 2116 | - 'value' => ! empty( $error_log_path ) ? $error_log_path : esc_html__( 'Not set', 'mainwp' ), | |
| 2117 | - 'visibility' => 'community_masked', | |
| 2118 | - 'community_value' => ! empty( $error_log_path ) ? esc_html__( 'Configured', 'mainwp' ) : esc_html__( 'Not set', 'mainwp' ), | |
| 2119 | - ), | |
| 2120 | - array( | |
| 2121 | - 'label' => esc_html__( 'PHP error_log readable', 'mainwp' ), | |
| 2122 | - 'value' => static::format_boolean_label( $log_readable ), | |
| 2123 | - ), | |
| 2124 | - ), | |
| 2125 | - array( | |
| 2126 | 2128 | 'WP_DEBUG', |
| 2127 | 2129 | 'WP_DEBUG_LOG', |
| 2128 | 2130 | 'WP_DEBUG_DISPLAY', |
| 2129 | 2131 | 'PHP log_errors', |
| @@ -2138,9 +2140,9 @@ | ||
| 2138 | 2140 | * |
| 2139 | 2141 | * @return array<int,array<string,mixed>> |
| 2140 | 2142 | */ |
| 2141 | 2143 | public static function get_conflict_signal_report_rows() { |
| 2142 | - $caching_plugins = static::get_active_plugins_by_keyword_group( | |
| 2144 | + $caching_plugins = static::get_active_plugins_by_keyword_group( | |
| 2143 | 2145 | array( |
| 2144 | 2146 | 'cache', |
| 2145 | 2147 | 'rocket', |
| 2146 | 2148 | 'litespeed', |
| @@ -2153,9 +2155,9 @@ | ||
| 2153 | 2155 | 'nitropack', |
| 2154 | 2156 | 'hummingbird', |
| 2155 | 2157 | ) |
| 2156 | 2158 | ); |
| 2157 | - $security_plugins = static::get_active_plugins_by_keyword_group( | |
| 2159 | + $security_plugins = static::get_active_plugins_by_keyword_group( | |
| 2158 | 2160 | array( |
| 2159 | 2161 | 'wordfence', |
| 2160 | 2162 | 'sucuri', |
| 2161 | 2163 | 'solid security', |
| @@ -2168,48 +2170,224 @@ | ||
| 2168 | 2170 | 'cloudflare', |
| 2169 | 2171 | 'limit login', |
| 2170 | 2172 | ) |
| 2171 | 2173 | ); |
| 2172 | - $maintenance_plugins = static::get_active_plugins_by_keyword_group( | |
| 2174 | + | |
| 2175 | + $maintenance_mode = static::get_maintenance_mode_indicators(); | |
| 2176 | + $dropins = static::get_dropin_conflict_indicators(); | |
| 2177 | + | |
| 2178 | + return self::add_export_labels_to_rows( | |
| 2173 | 2179 | array( |
| 2174 | - 'maintenance', | |
| 2175 | - 'coming soon', | |
| 2176 | - 'seedprod', | |
| 2177 | - 'lightstart', | |
| 2180 | + array( | |
| 2181 | + 'label' => esc_html__( 'Caching / performance plugins', 'mainwp' ), | |
| 2182 | + 'value' => static::format_conflict_items_label( $caching_plugins ), | |
| 2183 | + ), | |
| 2184 | + array( | |
| 2185 | + 'label' => esc_html__( 'Security / access-control plugins', 'mainwp' ), | |
| 2186 | + 'value' => static::format_conflict_items_label( $security_plugins ), | |
| 2187 | + ), | |
| 2188 | + array( | |
| 2189 | + 'label' => esc_html__( 'Maintenance mode indicators', 'mainwp' ), | |
| 2190 | + 'value' => static::format_conflict_items_label( $maintenance_mode ), | |
| 2191 | + 'status' => empty( $maintenance_mode ) ? '' : 'warning', | |
| 2192 | + ), | |
| 2193 | + array( | |
| 2194 | + 'label' => esc_html__( 'Drop-ins / object cache', 'mainwp' ), | |
| 2195 | + 'value' => static::format_conflict_items_label( $dropins ), | |
| 2196 | + ), | |
| 2197 | + ), | |
| 2198 | + array( | |
| 2199 | + 'Caching / performance plugins', | |
| 2200 | + 'Security / access-control plugins', | |
| 2201 | + 'Maintenance mode indicators', | |
| 2202 | + 'Drop-ins / object cache', | |
| 2178 | 2203 | ) |
| 2179 | 2204 | ); |
| 2180 | - $maintenance_mode = static::get_maintenance_mode_indicators(); | |
| 2181 | - $dropins = static::get_dropin_conflict_indicators(); | |
| 2205 | + } | |
| 2182 | 2206 | |
| 2183 | - return self::add_export_labels_to_rows( | |
| 2207 | + | |
| 2208 | + /** | |
| 2209 | + * Get database rows. | |
| 2210 | + * | |
| 2211 | + * @return array<int,array<string,mixed>> | |
| 2212 | + */ | |
| 2213 | + public static function get_database_report_rows() { // phpcs:ignore -- NOSONAR - complex function. | |
| 2214 | + | |
| 2215 | + $db_info = MainWP_Database_Schema_Checker::get_database_info(); | |
| 2216 | + | |
| 2217 | + $database_size = isset( $db_info['database_size'] ) ? $db_info['database_size'] : array(); | |
| 2218 | + | |
| 2219 | + $data_size = isset( $database_size['data'] ) ? $database_size['data'] : 0; | |
| 2220 | + $index_size = isset( $database_size['index'] ) ? $database_size['index'] : 0; | |
| 2221 | + | |
| 2222 | + $db_privileges_info = MainWP_Database_Schema_Checker::get_database_privileges(); | |
| 2223 | + | |
| 2224 | + $db_privileges = ! empty( $db_privileges_info['database_grants'] ) && is_array( $db_privileges_info['database_grants'] ) ? implode( ', ', $db_privileges_info['database_grants'] ) . '.' : ''; | |
| 2225 | + | |
| 2226 | + $db_privileges_status = 'pass'; | |
| 2227 | + if ( ! empty( $db_privileges_info['database_missing_privileges'] ) && is_array( $db_privileges_info['database_missing_privileges'] ) ) { | |
| 2228 | + $db_privileges .= ' ' . esc_html__( 'Missing database privileges:', 'mainwp' ) . ' ' . implode( ', ', $db_privileges_info['database_missing_privileges'] ); | |
| 2229 | + $db_privileges_status = 'error'; | |
| 2230 | + } | |
| 2231 | + | |
| 2232 | + $db_rows_info = array( | |
| 2184 | 2233 | array( |
| 2234 | + 'label' => esc_html__( 'MainWP database version', 'mainwp' ), | |
| 2235 | + 'value' => $db_info['mainwp_database_version'], | |
| 2236 | + ), | |
| 2185 | 2237 | array( |
| 2186 | - 'label' => esc_html__( 'Caching / performance plugins', 'mainwp' ), | |
| 2187 | - 'value' => static::format_conflict_items_label( $caching_plugins ), | |
| 2238 | + 'label' => esc_html__( 'Database prefix', 'mainwp' ), | |
| 2239 | + 'value' => $db_info['database_prefix'], | |
| 2188 | 2240 | ), |
| 2189 | 2241 | array( |
| 2190 | - 'label' => esc_html__( 'Security / access-control plugins', 'mainwp' ), | |
| 2191 | - 'value' => static::format_conflict_items_label( $security_plugins ), | |
| 2242 | + 'label' => esc_html__( 'Total Database Size', 'mainwp' ), | |
| 2243 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $data_size + $index_size ) ), | |
| 2192 | 2244 | ), |
| 2193 | 2245 | array( |
| 2194 | - 'label' => esc_html__( 'Maintenance mode indicators', 'mainwp' ), | |
| 2195 | - 'value' => static::format_conflict_items_label( $maintenance_mode ), | |
| 2196 | - 'status' => empty( $maintenance_mode ) ? '' : 'warning', | |
| 2246 | + 'label' => esc_html__( 'Database Data Size', 'mainwp' ), | |
| 2247 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $data_size ) ), | |
| 2197 | 2248 | ), |
| 2198 | 2249 | array( |
| 2199 | - 'label' => esc_html__( 'Drop-ins / object cache', 'mainwp' ), | |
| 2200 | - 'value' => static::format_conflict_items_label( $dropins ), | |
| 2250 | + 'label' => esc_html__( 'Database Index Size', 'mainwp' ), | |
| 2251 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $index_size ) ), | |
| 2201 | 2252 | ), |
| 2253 | + array( | |
| 2254 | + 'status' => $db_privileges_status, | |
| 2255 | + 'label' => esc_html__( 'Database privileges', 'mainwp' ), | |
| 2256 | + 'value' => $db_privileges, | |
| 2202 | 2257 | ), |
| 2258 | + ); | |
| 2259 | + | |
| 2260 | + $db_rows = array(); | |
| 2261 | + $db_rows_missing = array(); | |
| 2262 | + | |
| 2263 | + if ( isset( $db_info['database_tables'] ) && is_array( $db_info['database_tables'] ) ) { | |
| 2264 | + | |
| 2265 | + $missing_db_tables = MainWP_Database_Schema_Checker::detect_missing_tables( $db_info['database_tables'] ); | |
| 2266 | + | |
| 2267 | + if ( is_array( $missing_db_tables ) ) { | |
| 2268 | + foreach ( array( 'core', 'extensions' ) as $type ) { | |
| 2269 | + $miss_tables = isset( $missing_db_tables[ $type ] ) ? $missing_db_tables[ $type ] : array(); | |
| 2270 | + if ( ! empty( $miss_tables ) && is_array( $miss_tables ) ) { | |
| 2271 | + if ( 'core' === $type ) { | |
| 2272 | + foreach ( $miss_tables as $tb_name ) { | |
| 2273 | + $db_rows_missing[] = array( | |
| 2274 | + 'label' => $tb_name, | |
| 2275 | + 'value' => esc_html__( 'Missing core table', 'mainwp' ), | |
| 2276 | + 'status' => 'error', | |
| 2277 | + ); | |
| 2278 | + } | |
| 2279 | + } else { | |
| 2280 | + foreach ( $miss_tables as $ext_slug => $miss_ext_tables ) { | |
| 2281 | + $title = MainWP_Database_Schema_Checker::get_loaded_extension_title( $ext_slug ); | |
| 2282 | + foreach ( $miss_ext_tables as $tb_name ) { | |
| 2283 | + $db_rows_missing[] = array( | |
| 2284 | + 'label' => $tb_name, | |
| 2285 | + 'value' => sprintf( esc_html__( 'Missing extension table: %1s', 'mainwp' ), $title ), | |
| 2286 | + 'status' => 'error', | |
| 2287 | + ); | |
| 2288 | + } | |
| 2289 | + } | |
| 2290 | + } | |
| 2291 | + } | |
| 2292 | + } | |
| 2293 | + } | |
| 2294 | + | |
| 2295 | + foreach ( array( 'core', 'other' ) as $type ) { | |
| 2296 | + $type_tables = isset( $db_info['database_tables'][ $type ] ) ? $db_info['database_tables'][ $type ] : array(); | |
| 2297 | + if ( is_array( $type_tables ) ) { | |
| 2298 | + foreach ( $type_tables as $tb_name => $info ) { | |
| 2299 | + | |
| 2300 | + if ( empty( $info ) ) { | |
| 2301 | + continue; // Missing table, so skip column detection. | |
| 2302 | + } | |
| 2303 | + | |
| 2304 | + $status = 'pass'; | |
| 2305 | + | |
| 2306 | + $detect_cols_issues = array(); | |
| 2307 | + | |
| 2308 | + /** | |
| 2309 | + * Filter to disable detection of missing table columns. Useful for slow hosts. | |
| 2310 | + * | |
| 2311 | + * @since 6.1.3. | |
| 2312 | + */ | |
| 2313 | + if ( apply_filters( 'mainwp_detect_table_column_issues', true ) ) { | |
| 2314 | + $detect_cols_issues = MainWP_Database_Schema_Checker::detect_table_columns_issues( $tb_name, $type ); | |
| 2315 | + } | |
| 2316 | + | |
| 2317 | + $missing_cols = is_array( $detect_cols_issues ) && isset( $detect_cols_issues['missing_columns'] ) ? $detect_cols_issues['missing_columns'] : array(); | |
| 2318 | + $invalid_cols = is_array( $detect_cols_issues ) && isset( $detect_cols_issues['invalid_columns'] ) ? $detect_cols_issues['invalid_columns'] : array(); | |
| 2319 | + | |
| 2320 | + $issues_cols_info = array(); | |
| 2321 | + | |
| 2322 | + if ( ! empty( $missing_cols ) && is_array( $missing_cols ) ) { | |
| 2323 | + $issues_cols_info[] = sprintf( esc_html__( 'Missing columns: %1s;', 'mainwp' ), implode( ', ', $missing_cols ) ); | |
| 2324 | + $status = 'error'; | |
| 2325 | + } | |
| 2326 | + | |
| 2327 | + if ( ! empty( $invalid_cols ) && is_array( $invalid_cols ) && isset( $invalid_cols[0]['column'] ) ) { | |
| 2328 | + | |
| 2329 | + $issues_string = implode( | |
| 2330 | + '; ', | |
| 2331 | + array_map( | |
| 2332 | + static function ( $issue ) { | |
| 2333 | + return sprintf( | |
| 2334 | + 'column: "%s" - expected: "%s" - actual: "%s"', | |
| 2335 | + $issue['column'], | |
| 2336 | + $issue['expected'], | |
| 2337 | + $issue['actual'] | |
| 2338 | + ); | |
| 2339 | + }, | |
| 2340 | + $invalid_cols | |
| 2341 | + ) | |
| 2342 | + ); | |
| 2343 | + | |
| 2344 | + $issues_cols_info[] = sprintf( | |
| 2345 | + esc_html__( 'Incorrect column definitions found: %s;', 'mainwp' ), | |
| 2346 | + $issues_string | |
| 2347 | + ); | |
| 2348 | + | |
| 2349 | + if ( 'pass' === $status ) { | |
| 2350 | + $status = 'error'; // warning - incorrect column definition. | |
| 2351 | + } | |
| 2352 | + } | |
| 2353 | + | |
| 2354 | + $tbl_info = ''; | |
| 2355 | + if ( is_array( $info ) && isset( $info['data'] ) ) { | |
| 2356 | + $tbl_info = sprintf( __( 'Data: %sMB + Index: %sMB + Engine %s', 'mainwp' ), $info['data'], $info['index'], $info['engine'] ); | |
| 2357 | + } | |
| 2358 | + | |
| 2359 | + $db_rows[] = array( | |
| 2360 | + 'label' => esc_html( $tb_name ), | |
| 2361 | + 'value' => esc_html( | |
| 2362 | + $tbl_info . ( ! empty( $issues_cols_info ) ? ' (' . implode( '; ', $issues_cols_info ) . ') ' : '' ), | |
| 2363 | + ), | |
| 2364 | + 'status' => $status, | |
| 2365 | + ); | |
| 2366 | + | |
| 2367 | + } | |
| 2368 | + } | |
| 2369 | + } | |
| 2370 | + | |
| 2371 | + MainWP_Database_Schema_Checker::prepare_db_and_tables_issues( $missing_db_tables ); | |
| 2372 | + } | |
| 2373 | + | |
| 2374 | + return self::add_export_labels_to_rows( | |
| 2375 | + array_merge( $db_rows_info, $db_rows_missing, $db_rows ), | |
| 2203 | 2376 | array( |
| 2204 | - 'Caching / performance plugins', | |
| 2205 | - 'Security / access-control plugins', | |
| 2206 | - 'Maintenance mode indicators', | |
| 2207 | - 'Drop-ins / object cache', | |
| 2377 | + 'Database', | |
| 2378 | + 'Database privileges', | |
| 2379 | + 'MainWP database version', | |
| 2380 | + 'Database prefix', | |
| 2381 | + 'Total Database Size', | |
| 2382 | + 'Database Data Size', | |
| 2383 | + 'Database Index Size', | |
| 2384 | + 'Missing core table', | |
| 2208 | 2385 | ) |
| 2209 | 2386 | ); |
| 2210 | 2387 | } |
| 2211 | 2388 | |
| 2389 | + | |
| 2212 | 2390 | /** |
| 2213 | 2391 | * Format boolean label. |
| 2214 | 2392 | * |
| 2215 | 2393 | * @param mixed $value True-ish value. |
| @@ -2665,20 +2843,12 @@ | ||
| 2665 | 2843 | if ( null !== $cached_data ) { |
| 2666 | 2844 | return $cached_data; |
| 2667 | 2845 | } |
| 2668 | 2846 | |
| 2669 | - $url = site_url( 'wp-cron.php' ); | |
| 2670 | - $query_args = array( 'mainwp_run' => 'test' ); | |
| 2671 | - $url = esc_url_raw( add_query_arg( $query_args, $url ) ); | |
| 2672 | - $response = wp_remote_post( | |
| 2673 | - $url, | |
| 2674 | - array( | |
| 2675 | - 'blocking' => true, | |
| 2676 | - 'sslverify' => apply_filters( 'https_local_ssl_verify', true ), | |
| 2677 | - 'timeout' => 15, | |
| 2678 | - ) | |
| 2679 | - ); | |
| 2847 | + $url = admin_url( 'admin-ajax.php' ); | |
| 2680 | 2848 | |
| 2849 | + $response = MainWP_System_Utility::test_self_connect( $url ); | |
| 2850 | + | |
| 2681 | 2851 | if ( is_wp_error( $response ) ) { |
| 2682 | 2852 | $cached_data = array( |
| 2683 | 2853 | 'value' => sprintf( |
| 2684 | 2854 | /* translators: %s: error message */ |
| @@ -2720,9 +2890,9 @@ | ||
| 2720 | 2890 | return $cached_data; |
| 2721 | 2891 | } |
| 2722 | 2892 | |
| 2723 | 2893 | $response_body = wp_remote_retrieve_body( $response ); |
| 2724 | - if ( false === strstr( $response_body, 'MainWP Test' ) ) { | |
| 2894 | + if ( 'MainWP Self Connect OK' !== trim( $response_body ) ) { | |
| 2725 | 2895 | $cached_data = array( |
| 2726 | 2896 | 'value' => esc_html__( 'Unexpected response body. Note: This is common and usually not a problem unless WP-Cron or loopback requests are failing.', 'mainwp' ), |
| 2727 | 2897 | 'status' => 'warning', |
| 2728 | 2898 | 'code' => 'unexpected_body', |
| @@ -2777,9 +2947,9 @@ | ||
| 2777 | 2947 | * |
| 2778 | 2948 | * @return string |
| 2779 | 2949 | */ |
| 2780 | 2950 | private static function get_primary_backup_method_label() { |
| 2781 | - $primary_backup = get_option( 'mainwp_primaryBackup' ); | |
| 2951 | + $primary_backup = get_option( 'mainwp_primaryBackup' ); | |
| 2782 | 2952 | $primary_methods = apply_filters_deprecated( 'mainwp-getprimarybackup-methods', array( array() ), '4.0.7.2', 'mainwp_getprimarybackup_methods' ); // NOSONAR - not IP. |
| 2783 | 2953 | $primary_methods = apply_filters( 'mainwp_getprimarybackup_methods', $primary_methods ); |
| 2784 | 2954 | |
| 2785 | 2955 | if ( is_array( $primary_methods ) ) { |