| @@ -327,8 +327,19 @@ | ||
| 327 | 327 | return ini_get( 'default_socket_timeout' ); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /** |
| 331 | + * Effective MainWP child request timeout, in seconds. | |
| 332 | + * | |
| 333 | + * This is the plugin CURLOPT_TIMEOUT, not PHP default_socket_timeout. | |
| 334 | + * | |
| 335 | + * @return string | |
| 336 | + */ | |
| 337 | + public static function get_child_request_timeout() { | |
| 338 | + return (string) MainWP_Connect::resolve_child_request_timeout( '' ); | |
| 339 | + } | |
| 340 | + | |
| 341 | + /** | |
| 331 | 342 | * Method get_php_version() |
| 332 | 343 | * |
| 333 | 344 | * Get PHP Version. |
| 334 | 345 | * |
| @@ -859,8 +870,9 @@ | ||
| 859 | 870 | 'mainwp_automaticDailyUpdate' => esc_html__( 'WP Core advanced automatic updates enabled', 'mainwp' ), |
| 860 | 871 | 'mainwp_pluginAutomaticDailyUpdate' => esc_html__( 'Plugin advanced automatic updates enabled', 'mainwp' ), |
| 861 | 872 | 'mainwp_themeAutomaticDailyUpdate' => esc_html__( 'Theme advanced automatic updates enabled', 'mainwp' ), |
| 862 | 873 | 'mainwp_numberdays_Outdate_Plugin_Theme' => esc_html__( 'Abandoned plugins/themes tolerance', 'mainwp' ), |
| 874 | + 'mainwp_abandoned_check_by_local_date' => esc_html__( 'Abandoned check by local file date', 'mainwp' ), | |
| 863 | 875 | 'mainwp_maximumPosts' => esc_html__( 'Maximum number of posts to return', 'mainwp' ), |
| 864 | 876 | 'mainwp_maximumPages' => esc_html__( 'Maximum number of pages to return', 'mainwp' ), |
| 865 | 877 | 'mainwp_maximumComments' => esc_html__( 'Maximum number of comments', 'mainwp' ), |
| 866 | 878 | 'mainwp_enableLegacyBackupFeature' => esc_html__( 'MainWP legacy backups enabled', 'mainwp' ), |
| @@ -873,8 +885,9 @@ | ||
| 873 | 885 | 'mainwp_minimumIPDelay' => esc_html__( 'Minimum delay between requests to the same ip', 'mainwp' ), |
| 874 | 886 | 'mainwp_maximumSyncRequests' => esc_html__( 'Maximum simultaneous sync requests', 'mainwp' ), |
| 875 | 887 | 'mainwp_maximumInstallUpdateRequests' => esc_html__( 'Maximum simultaneous install and update requests', 'mainwp' ), |
| 876 | 888 | 'mainwp_maximum_uptime_monitoring_requests' => esc_html__( 'Maximum simultaneous uptime monitoring requests (Default: 10)', 'mainwp' ), |
| 889 | + 'mainwp_child_request_timeout' => esc_html__( 'Child request timeout', 'mainwp' ), | |
| 877 | 890 | 'mainwp_auto_purge_cache' => esc_html__( 'Cache control enabled', 'mainwp' ), |
| 878 | 891 | ); |
| 879 | 892 | |
| 880 | 893 | if ( ! is_plugin_active( 'mainwp-comments-extension/mainwp-comments-extension.php' ) ) { |
| @@ -922,8 +935,11 @@ | ||
| 922 | 935 | break; |
| 923 | 936 | case 'mainwp_maximum_uptime_monitoring_requests': |
| 924 | 937 | $value = ( false === $value ) ? 10 : $value; |
| 925 | 938 | break; |
| 939 | + case 'mainwp_child_request_timeout': | |
| 940 | + $value = static::get_child_request_timeout() . ' ' . esc_html__( 'seconds', 'mainwp' ); | |
| 941 | + break; | |
| 926 | 942 | case 'is_enable_automatic_check_uptime_monitoring': |
| 927 | 943 | $value = ! empty( $value ) ? esc_html__( 'Yes', 'mainwp' ) : esc_html__( 'No', 'mainwp' ); |
| 928 | 944 | break; |
| 929 | 945 | case 'mainwp_disableSitesHealthMonitoring': |
| @@ -1013,9 +1029,9 @@ | ||
| 1013 | 1029 | 'severity' => 'warning', |
| 1014 | 1030 | 'title' => esc_html__( 'Low cURL timeout', 'mainwp' ), |
| 1015 | 1031 | 'detail' => sprintf( |
| 1016 | 1032 | /* translators: 1: detected timeout, 2: recommended timeout */ |
| 1017 | - esc_html__( 'Detected %1$s seconds. MainWP recommends at least %2$s seconds.', 'mainwp' ), | |
| 1033 | + esc_html__( 'Detected %1$s seconds for PHP default_socket_timeout. MainWP recommends at least %2$s seconds. This is the PHP setting, not the MainWP child request timeout.', 'mainwp' ), | |
| 1018 | 1034 | (string) static::get_curl_timeout(), |
| 1019 | 1035 | '300' |
| 1020 | 1036 | ), |
| 1021 | 1037 | 'anchor' => 'mainwp-system-report-php-table', |
| @@ -1070,9 +1086,11 @@ | ||
| 1070 | 1086 | 'kb_url' => ( isset( $self_connect['code'] ) && 'unexpected_body' === $self_connect['code'] ) ? '' : 'https://docs.mainwp.com/troubleshooting/potential-issues/', |
| 1071 | 1087 | ); |
| 1072 | 1088 | } |
| 1073 | 1089 | |
| 1074 | - return $issues; | |
| 1090 | + $db_issues = MainWP_Database_Schema_Checker::get_detected_db_issues(); | |
| 1091 | + | |
| 1092 | + return array_merge( $issues, is_array( $db_issues ) ? $db_issues : array() ); | |
| 1075 | 1093 | } |
| 1076 | 1094 | |
| 1077 | 1095 | /** |
| 1078 | 1096 | * Add English export labels to localized report rows. |
| @@ -1165,29 +1183,29 @@ | ||
| 1165 | 1183 | $upload_directory = static::get_mainwp_upload_directory_data(); |
| 1166 | 1184 | |
| 1167 | 1185 | return self::add_export_labels_to_rows( |
| 1168 | 1186 | 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', | |
| 1187 | + array( | |
| 1188 | + 'label' => esc_html__( 'MainWP Dashboard Version', 'mainwp' ), | |
| 1189 | + 'value' => $version_value, | |
| 1190 | + 'status' => ( false !== $latest_version && $current_version === $latest_version ) ? 'pass' : 'warning', | |
| 1191 | + ), | |
| 1192 | + array( | |
| 1193 | + 'label' => esc_html__( 'Number of connected sites', 'mainwp' ), | |
| 1194 | + 'value' => (string) MainWP_DB::instance()->get_websites_count(), | |
| 1195 | + ), | |
| 1196 | + array( | |
| 1197 | + 'label' => esc_html__( 'MainWP upload directory', 'mainwp' ), | |
| 1198 | + 'value' => $upload_directory['value'], | |
| 1199 | + 'status' => $upload_directory['status'], | |
| 1200 | + ), | |
| 1201 | + array( | |
| 1202 | + 'label' => esc_html__( 'MainWP REST API enabled', 'mainwp' ), | |
| 1203 | + 'value' => static::format_boolean_label( Rest_Api_V1::instance()->is_rest_api_enabled() ), | |
| 1204 | + 'status' => Rest_Api_V1::instance()->is_rest_api_enabled() ? 'pass' : 'warning', | |
| 1205 | + ), | |
| 1173 | 1206 | ), |
| 1174 | 1207 | 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 | 1208 | 'MainWP Dashboard Version', |
| 1191 | 1209 | 'Number of connected sites', |
| 1192 | 1210 | 'MainWP upload directory', |
| 1193 | 1211 | 'MainWP REST API enabled', |
| @@ -1210,67 +1228,67 @@ | ||
| 1210 | 1228 | $signature = static::get_signature_algorithm_label(); |
| 1211 | 1229 | |
| 1212 | 1230 | return self::add_export_labels_to_rows( |
| 1213 | 1231 | array( |
| 1214 | - array( | |
| 1215 | - 'label' => esc_html__( 'Dashboard home URL', 'mainwp' ), | |
| 1216 | - 'value' => home_url( '/' ), | |
| 1217 | - 'visibility' => 'full_only', | |
| 1232 | + array( | |
| 1233 | + 'label' => esc_html__( 'Dashboard home URL', 'mainwp' ), | |
| 1234 | + 'value' => home_url( '/' ), | |
| 1235 | + 'visibility' => 'full_only', | |
| 1236 | + ), | |
| 1237 | + array( | |
| 1238 | + 'label' => esc_html__( 'Dashboard site URL', 'mainwp' ), | |
| 1239 | + 'value' => site_url( '/' ), | |
| 1240 | + 'visibility' => 'full_only', | |
| 1241 | + ), | |
| 1242 | + array( | |
| 1243 | + 'label' => esc_html__( 'Public Dashboard IP', 'mainwp' ), | |
| 1244 | + 'value' => $public_ip['value'], | |
| 1245 | + 'status' => $public_ip['status'], | |
| 1246 | + 'visibility' => 'community_masked', | |
| 1247 | + 'community_value' => $public_ip['community_value'], | |
| 1248 | + ), | |
| 1249 | + array( | |
| 1250 | + 'label' => esc_html__( 'HTTPS', 'mainwp' ), | |
| 1251 | + 'value' => is_ssl() ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1252 | + ), | |
| 1253 | + array( | |
| 1254 | + 'label' => esc_html__( 'Permalink structure', 'mainwp' ), | |
| 1255 | + 'value' => $permalink['value'], | |
| 1256 | + 'status' => $permalink['status'], | |
| 1257 | + ), | |
| 1258 | + array( | |
| 1259 | + 'label' => esc_html__( 'WordPress REST API endpoint', 'mainwp' ), | |
| 1260 | + 'value' => rest_url(), | |
| 1261 | + 'visibility' => 'full_only', | |
| 1262 | + ), | |
| 1263 | + array( | |
| 1264 | + 'label' => esc_html__( 'WordPress REST API reachability', 'mainwp' ), | |
| 1265 | + 'value' => $rest_api['value'], | |
| 1266 | + 'status' => $rest_api['status'], | |
| 1267 | + ), | |
| 1268 | + array( | |
| 1269 | + 'label' => esc_html__( 'Server self connect', 'mainwp' ), | |
| 1270 | + 'value' => $self_connect['value'], | |
| 1271 | + 'status' => $self_connect['status'], | |
| 1272 | + ), | |
| 1273 | + array( | |
| 1274 | + 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1275 | + 'value' => static::format_boolean_label( $ssl_verify ), | |
| 1276 | + ), | |
| 1277 | + array( | |
| 1278 | + 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1279 | + 'value' => 2 === $verify_con ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1280 | + ), | |
| 1281 | + array( | |
| 1282 | + 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1283 | + 'value' => $signature, | |
| 1284 | + ), | |
| 1285 | + array( | |
| 1286 | + 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1287 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1288 | + ), | |
| 1218 | 1289 | ), |
| 1219 | 1290 | 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 | 1291 | 'Dashboard home URL', |
| 1274 | 1292 | 'Dashboard site URL', |
| 1275 | 1293 | 'Public Dashboard IP', |
| 1276 | 1294 | 'HTTPS', |
| @@ -1298,10 +1316,10 @@ | ||
| 1298 | 1316 | } |
| 1299 | 1317 | |
| 1300 | 1318 | $rows = array( |
| 1301 | 1319 | 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 ) ), | |
| 1320 | + 'label' => esc_html__( 'Use WP Cron', 'mainwp' ), | |
| 1321 | + 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_wp_cron' ) ) || 1 === (int) get_option( 'mainwp_wp_cron', 1 ) ), | |
| 1304 | 1322 | ), |
| 1305 | 1323 | array( |
| 1306 | 1324 | 'label' => esc_html__( 'Daily update frequency', 'mainwp' ), |
| 1307 | 1325 | 'value' => MainWP_Server_Information::get_schedule_auto_update_label( $daily_frequency ), |
| @@ -1377,9 +1395,9 @@ | ||
| 1377 | 1395 | if ( ! in_array( $frequency_auto_update, array( 'daily', 'weekly', 'monthly' ), true ) ) { |
| 1378 | 1396 | $frequency_auto_update = 'daily'; |
| 1379 | 1397 | } |
| 1380 | 1398 | |
| 1381 | - $show_widgets = get_user_option( 'mainwp_settings_show_widgets', array() ); | |
| 1399 | + $show_widgets = get_user_option( 'mainwp_settings_show_widgets' ); | |
| 1382 | 1400 | if ( ! is_array( $show_widgets ) ) { |
| 1383 | 1401 | $show_widgets = array(); |
| 1384 | 1402 | } |
| 1385 | 1403 | |
| @@ -1384,150 +1402,154 @@ | ||
| 1384 | 1402 | } |
| 1385 | 1403 | |
| 1386 | 1404 | return self::add_export_labels_to_rows( |
| 1387 | 1405 | 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 ) | |
| 1406 | + array( | |
| 1407 | + 'label' => esc_html__( 'Timezone', 'mainwp' ), | |
| 1408 | + 'value' => static::get_timezone_label(), | |
| 1414 | 1409 | ), |
| 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'] ) | |
| 1410 | + array( | |
| 1411 | + 'label' => esc_html__( 'Date format', 'mainwp' ), | |
| 1412 | + 'value' => (string) get_option( 'date_format', $default_setting['date_format'] ), | |
| 1474 | 1413 | ), |
| 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'] ) | |
| 1414 | + array( | |
| 1415 | + 'label' => esc_html__( 'Time format', 'mainwp' ), | |
| 1416 | + 'value' => (string) get_option( 'time_format', $default_setting['time_format'] ), | |
| 1482 | 1417 | ), |
| 1418 | + array( | |
| 1419 | + 'label' => esc_html__( 'Sidebar position', 'mainwp' ), | |
| 1420 | + 'value' => 0 === (int) $sidebar ? esc_html__( 'Left', 'mainwp' ) : esc_html__( 'Right', 'mainwp' ), | |
| 1421 | + ), | |
| 1422 | + array( | |
| 1423 | + 'label' => esc_html__( 'Hide Update Everything', 'mainwp' ), | |
| 1424 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_hide_update_everything', $default_setting['mainwp_hide_update_everything'] ) ), | |
| 1425 | + ), | |
| 1426 | + array( | |
| 1427 | + 'label' => esc_html__( 'Dashboard widgets shown', 'mainwp' ), | |
| 1428 | + 'value' => sprintf( | |
| 1429 | + /* translators: %d: visible widget count */ | |
| 1430 | + esc_html__( '%d visible', 'mainwp' ), | |
| 1431 | + count( $show_widgets ) | |
| 1432 | + ), | |
| 1433 | + ), | |
| 1434 | + array( | |
| 1435 | + 'label' => esc_html__( 'WP Core advanced automatic updates', 'mainwp' ), | |
| 1436 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_automaticDailyUpdate', $default_setting['mainwp_automaticDailyUpdate'] ) ), | |
| 1437 | + ), | |
| 1438 | + array( | |
| 1439 | + 'label' => esc_html__( 'Plugin advanced automatic updates', 'mainwp' ), | |
| 1440 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_pluginAutomaticDailyUpdate', $default_setting['mainwp_pluginAutomaticDailyUpdate'] ) ), | |
| 1441 | + ), | |
| 1442 | + array( | |
| 1443 | + 'label' => esc_html__( 'Theme advanced automatic updates', 'mainwp' ), | |
| 1444 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_themeAutomaticDailyUpdate', $default_setting['mainwp_themeAutomaticDailyUpdate'] ) ), | |
| 1445 | + ), | |
| 1446 | + array( | |
| 1447 | + 'label' => esc_html__( 'Translation advanced automatic updates', 'mainwp' ), | |
| 1448 | + 'value' => static::get_trusted_update_mode_label( get_option( 'mainwp_transAutomaticDailyUpdate', 0 ) ), | |
| 1449 | + ), | |
| 1450 | + array( | |
| 1451 | + 'label' => esc_html__( 'Automatic updates frequency', 'mainwp' ), | |
| 1452 | + 'value' => ucfirst( (string) $frequency_auto_update ), | |
| 1453 | + ), | |
| 1454 | + array( | |
| 1455 | + 'label' => esc_html__( 'Automatic updates time', 'mainwp' ), | |
| 1456 | + 'value' => (string) $time_auto_update, | |
| 1457 | + ), | |
| 1458 | + array( | |
| 1459 | + 'label' => esc_html__( 'Automatic updates day', 'mainwp' ), | |
| 1460 | + 'value' => static::get_automatic_updates_day_label( $frequency_auto_update ), | |
| 1461 | + ), | |
| 1462 | + array( | |
| 1463 | + 'label' => esc_html__( 'Advanced automatic updates delay', 'mainwp' ), | |
| 1464 | + 'value' => static::format_delay_label( (int) get_option( 'mainwp_delay_autoupdate', 1 ) ), | |
| 1465 | + ), | |
| 1466 | + array( | |
| 1467 | + 'label' => esc_html__( 'Show language updates', 'mainwp' ), | |
| 1468 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_show_language_updates', $default_setting['mainwp_show_language_updates'] ) ), | |
| 1469 | + ), | |
| 1470 | + array( | |
| 1471 | + 'label' => esc_html__( 'Disable update confirmations', 'mainwp' ), | |
| 1472 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_disable_update_confirmations', $default_setting['mainwp_disable_update_confirmations'] ) ), | |
| 1473 | + ), | |
| 1474 | + array( | |
| 1475 | + 'label' => esc_html__( 'After updates HTTP response check', 'mainwp' ), | |
| 1476 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_check_http_response', $default_setting['mainwp_check_http_response'] ) ), | |
| 1477 | + ), | |
| 1478 | + array( | |
| 1479 | + 'label' => esc_html__( 'After updates HTTP response method', 'mainwp' ), | |
| 1480 | + 'value' => strtoupper( (string) get_option( 'mainwp_check_http_response_method', $default_setting['mainwp_check_http_response_method'] ) ), | |
| 1481 | + ), | |
| 1482 | + array( | |
| 1483 | + 'label' => esc_html__( 'Backup before update', 'mainwp' ), | |
| 1484 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backup_before_upgrade', $default_setting['mainwp_backup_before_upgrade'] ) ), | |
| 1485 | + ), | |
| 1486 | + array( | |
| 1487 | + 'label' => esc_html__( 'Full backup tolerance before update', 'mainwp' ), | |
| 1488 | + 'value' => sprintf( | |
| 1489 | + /* translators: %d: days */ | |
| 1490 | + esc_html__( '%d days', 'mainwp' ), | |
| 1491 | + (int) get_option( 'mainwp_backup_before_upgrade_days', $default_setting['mainwp_backup_before_upgrade_days'] ) | |
| 1492 | + ), | |
| 1493 | + ), | |
| 1494 | + array( | |
| 1495 | + 'label' => esc_html__( 'Abandoned plugins/themes tolerance', 'mainwp' ), | |
| 1496 | + 'value' => sprintf( | |
| 1497 | + /* translators: %d: days */ | |
| 1498 | + esc_html__( '%d days', 'mainwp' ), | |
| 1499 | + (int) get_option( 'mainwp_numberdays_Outdate_Plugin_Theme', $default_setting['mainwp_numberdays_Outdate_Plugin_Theme'] ) | |
| 1500 | + ), | |
| 1501 | + ), | |
| 1502 | + array( | |
| 1503 | + 'label' => esc_html__( 'Abandoned check by local file date', 'mainwp' ), | |
| 1504 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_abandoned_check_by_local_date', $default_setting['mainwp_abandoned_check_by_local_date'] ) ), | |
| 1505 | + ), | |
| 1506 | + array( | |
| 1507 | + 'label' => esc_html__( 'Primary backup system', 'mainwp' ), | |
| 1508 | + 'value' => static::get_primary_backup_method_label(), | |
| 1509 | + ), | |
| 1510 | + array( | |
| 1511 | + 'label' => esc_html__( 'MainWP legacy backups enabled', 'mainwp' ), | |
| 1512 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enableLegacyBackupFeature', 0 ) ), | |
| 1513 | + ), | |
| 1514 | + array( | |
| 1515 | + 'label' => esc_html__( 'Backups kept on server', 'mainwp' ), | |
| 1516 | + 'value' => (string) ( false === get_option( 'mainwp_backupsOnServer' ) ? 1 : intval( get_option( 'mainwp_backupsOnServer' ) ) ), | |
| 1517 | + ), | |
| 1518 | + array( | |
| 1519 | + 'label' => esc_html__( 'Backup to external sources', 'mainwp' ), | |
| 1520 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_backupOnExternalSources', 0 ) ), | |
| 1521 | + ), | |
| 1522 | + array( | |
| 1523 | + 'label' => esc_html__( 'Archive format', 'mainwp' ), | |
| 1524 | + 'value' => static::format_archive_format_label( get_option( 'mainwp_archiveFormat', 'tar.gz' ) ), | |
| 1525 | + ), | |
| 1526 | + array( | |
| 1527 | + 'label' => esc_html__( 'Auto detect maximum file descriptors on child sites', 'mainwp' ), | |
| 1528 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_maximumFileDescriptorsAuto', 1 ) ), | |
| 1529 | + ), | |
| 1530 | + array( | |
| 1531 | + 'label' => esc_html__( 'Maximum file descriptors fallback value', 'mainwp' ), | |
| 1532 | + 'value' => (string) ( false === get_option( 'mainwp_maximumFileDescriptors' ) ? 150 : intval( get_option( 'mainwp_maximumFileDescriptors' ) ) ), | |
| 1533 | + ), | |
| 1534 | + array( | |
| 1535 | + 'label' => esc_html__( 'Load files in memory before zipping', 'mainwp' ), | |
| 1536 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_options_loadFilesBeforeZip', 1 ) ), | |
| 1537 | + ), | |
| 1538 | + array( | |
| 1539 | + 'label' => esc_html__( 'Send email when backup fails', 'mainwp' ), | |
| 1540 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupFail', 1 ) ), | |
| 1541 | + ), | |
| 1542 | + array( | |
| 1543 | + 'label' => esc_html__( 'Send email when backup starts', 'mainwp' ), | |
| 1544 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_notificationOnBackupStart', 1 ) ), | |
| 1545 | + ), | |
| 1546 | + array( | |
| 1547 | + 'label' => esc_html__( 'Execute backup tasks in chunks', 'mainwp' ), | |
| 1548 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_chunkedBackupTasks', 1 ) ), | |
| 1549 | + ), | |
| 1483 | 1550 | ), |
| 1484 | 1551 | 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 | 1552 | 'Timezone', |
| 1531 | 1553 | 'Date format', |
| 1532 | 1554 | 'Time format', |
| 1533 | 1555 | 'Sidebar position', |
| @@ -1587,94 +1609,94 @@ | ||
| 1587 | 1609 | } |
| 1588 | 1610 | |
| 1589 | 1611 | return self::add_export_labels_to_rows( |
| 1590 | 1612 | 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' ) ) ) | |
| 1613 | + array( | |
| 1614 | + 'label' => esc_html__( 'Maximum simultaneous requests', 'mainwp' ), | |
| 1615 | + 'value' => (string) ( false === get_option( 'mainwp_maximumRequests' ) ? 4 : intval( get_option( 'mainwp_maximumRequests' ) ) ), | |
| 1601 | 1616 | ), |
| 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' ) ) ) | |
| 1617 | + array( | |
| 1618 | + 'label' => esc_html__( 'Minimum delay between requests', 'mainwp' ), | |
| 1619 | + 'value' => sprintf( | |
| 1620 | + /* translators: %d: milliseconds */ | |
| 1621 | + esc_html__( '%d ms', 'mainwp' ), | |
| 1622 | + (int) ( false === get_option( 'mainwp_minimumDelay' ) ? 200 : intval( get_option( 'mainwp_minimumDelay' ) ) ) | |
| 1623 | + ), | |
| 1613 | 1624 | ), |
| 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' ) ) ) | |
| 1625 | + array( | |
| 1626 | + 'label' => esc_html__( 'Maximum simultaneous requests per IP', 'mainwp' ), | |
| 1627 | + 'value' => (string) ( false === get_option( 'mainwp_maximumIPRequests' ) ? 1 : intval( get_option( 'mainwp_maximumIPRequests' ) ) ), | |
| 1637 | 1628 | ), |
| 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 ) | |
| 1629 | + array( | |
| 1630 | + 'label' => esc_html__( 'Minimum delay between requests to the same IP', 'mainwp' ), | |
| 1631 | + 'value' => sprintf( | |
| 1632 | + /* translators: %d: milliseconds */ | |
| 1633 | + esc_html__( '%d ms', 'mainwp' ), | |
| 1634 | + (int) ( false === get_option( 'mainwp_minimumIPDelay' ) ? 1000 : intval( get_option( 'mainwp_minimumIPDelay' ) ) ) | |
| 1635 | + ), | |
| 1649 | 1636 | ), |
| 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 ) | |
| 1637 | + array( | |
| 1638 | + 'label' => esc_html__( 'Maximum simultaneous sync requests', 'mainwp' ), | |
| 1639 | + 'value' => (string) ( false === get_option( 'mainwp_maximumSyncRequests' ) ? 8 : intval( get_option( 'mainwp_maximumSyncRequests' ) ) ), | |
| 1674 | 1640 | ), |
| 1641 | + array( | |
| 1642 | + 'label' => esc_html__( 'Maximum simultaneous install and update requests', 'mainwp' ), | |
| 1643 | + 'value' => (string) ( false === get_option( 'mainwp_maximumInstallUpdateRequests' ) ? 3 : intval( get_option( 'mainwp_maximumInstallUpdateRequests' ) ) ), | |
| 1644 | + ), | |
| 1645 | + array( | |
| 1646 | + 'label' => esc_html__( 'Maximum simultaneous uptime monitoring requests', 'mainwp' ), | |
| 1647 | + 'value' => (string) ( false === get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ? 10 : intval( get_option( 'mainwp_maximum_uptime_monitoring_requests' ) ) ), | |
| 1648 | + ), | |
| 1649 | + array( | |
| 1650 | + 'label' => esc_html__( 'Sites processed per sync batch', 'mainwp' ), | |
| 1651 | + 'value' => (string) ( false === get_option( 'mainwp_chunksitesnumber' ) ? 10 : intval( get_option( 'mainwp_chunksitesnumber' ) ) ), | |
| 1652 | + ), | |
| 1653 | + array( | |
| 1654 | + 'label' => esc_html__( 'Sync batch sleep interval', 'mainwp' ), | |
| 1655 | + 'value' => sprintf( | |
| 1656 | + /* translators: %d: seconds */ | |
| 1657 | + esc_html__( '%d seconds', 'mainwp' ), | |
| 1658 | + (int) ( false === get_option( 'mainwp_chunksleepinterval' ) ? 5 : intval( get_option( 'mainwp_chunksleepinterval' ) ) ) | |
| 1659 | + ), | |
| 1660 | + ), | |
| 1661 | + array( | |
| 1662 | + 'label' => esc_html__( 'Optimize data loading', 'mainwp' ), | |
| 1663 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_optimize', $default_setting['mainwp_optimize'] ) ), | |
| 1664 | + ), | |
| 1665 | + array( | |
| 1666 | + 'label' => esc_html__( 'Browser cache expiration time', 'mainwp' ), | |
| 1667 | + 'value' => sprintf( | |
| 1668 | + /* translators: %d: minutes */ | |
| 1669 | + esc_html__( '%d minutes', 'mainwp' ), | |
| 1670 | + (int) get_option( 'mainwp_warm_cache_pages_ttl', 10 ) | |
| 1671 | + ), | |
| 1672 | + ), | |
| 1673 | + array( | |
| 1674 | + 'label' => esc_html__( 'Verify SSL certificate', 'mainwp' ), | |
| 1675 | + 'value' => static::format_boolean_label( ( false === get_option( 'mainwp_sslVerifyCertificate' ) ) || 1 === (int) get_option( 'mainwp_sslVerifyCertificate', 1 ) ), | |
| 1676 | + ), | |
| 1677 | + array( | |
| 1678 | + 'label' => esc_html__( 'Verify connection method', 'mainwp' ), | |
| 1679 | + 'value' => 2 === (int) get_option( 'mainwp_verify_connection_method', 1 ) ? esc_html__( 'PHPSECLIB (fallback)', 'mainwp' ) : esc_html__( 'OpenSSL (default)', 'mainwp' ), | |
| 1680 | + ), | |
| 1681 | + array( | |
| 1682 | + 'label' => esc_html__( 'OpenSSL signature algorithm', 'mainwp' ), | |
| 1683 | + 'value' => isset( $sign_algs[ $signature_algo ] ) ? $sign_algs[ $signature_algo ] : (string) $signature_algo, | |
| 1684 | + ), | |
| 1685 | + array( | |
| 1686 | + 'label' => esc_html__( 'Force IPv4', 'mainwp' ), | |
| 1687 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_forceUseIPv4', 0 ) ), | |
| 1688 | + ), | |
| 1689 | + array( | |
| 1690 | + 'label' => esc_html__( 'Selected data to sync', 'mainwp' ), | |
| 1691 | + 'value' => sprintf( | |
| 1692 | + /* translators: 1: enabled count, 2: total count */ | |
| 1693 | + esc_html__( '%1$d of %2$d enabled', 'mainwp' ), | |
| 1694 | + $enabled_sync, | |
| 1695 | + count( $sync_defaults ) | |
| 1696 | + ), | |
| 1697 | + ), | |
| 1675 | 1698 | ), |
| 1676 | - ), | |
| 1677 | 1699 | array( |
| 1678 | 1700 | 'Maximum simultaneous requests', |
| 1679 | 1701 | 'Minimum delay between requests', |
| 1680 | 1702 | 'Maximum simultaneous requests per IP', |
| @@ -1718,54 +1740,54 @@ | ||
| 1718 | 1740 | $threshold = (int) get_option( 'mainwp_sitehealthThreshold', 80 ); |
| 1719 | 1741 | |
| 1720 | 1742 | return self::add_export_labels_to_rows( |
| 1721 | 1743 | array( |
| 1722 | - array( | |
| 1723 | - 'label' => esc_html__( 'Enable uptime monitoring', 'mainwp' ), | |
| 1724 | - 'value' => static::format_boolean_label( ! empty( $monitoring_settings['active'] ) ), | |
| 1744 | + array( | |
| 1745 | + 'label' => esc_html__( 'Enable uptime monitoring', 'mainwp' ), | |
| 1746 | + 'value' => static::format_boolean_label( ! empty( $monitoring_settings['active'] ) ), | |
| 1747 | + ), | |
| 1748 | + array( | |
| 1749 | + 'label' => esc_html__( 'Monitor type', 'mainwp' ), | |
| 1750 | + 'value' => static::format_monitor_type_label( $monitoring_settings['type'] ?? 'http' ), | |
| 1751 | + ), | |
| 1752 | + array( | |
| 1753 | + 'label' => esc_html__( 'Method', 'mainwp' ), | |
| 1754 | + 'value' => strtoupper( (string) ( $monitoring_settings['method'] ?? 'get' ) ), | |
| 1755 | + ), | |
| 1756 | + array( | |
| 1757 | + 'label' => esc_html__( 'Interval', 'mainwp' ), | |
| 1758 | + 'value' => (string) $interval_value, | |
| 1759 | + ), | |
| 1760 | + array( | |
| 1761 | + 'label' => esc_html__( 'Timeout', 'mainwp' ), | |
| 1762 | + 'value' => (string) $timeout_value, | |
| 1763 | + ), | |
| 1764 | + array( | |
| 1765 | + 'label' => esc_html__( 'Up HTTP codes', 'mainwp' ), | |
| 1766 | + 'value' => ! empty( $monitoring_settings['up_status_codes'] ) ? (string) $monitoring_settings['up_status_codes'] : esc_html__( 'Default', 'mainwp' ), | |
| 1767 | + ), | |
| 1768 | + array( | |
| 1769 | + 'label' => esc_html__( 'Down confirmation check', 'mainwp' ), | |
| 1770 | + 'value' => ! empty( $monitoring_settings['maxretries'] ) ? esc_html__( 'Enabled', 'mainwp' ) : esc_html__( 'Disabled', 'mainwp' ), | |
| 1771 | + ), | |
| 1772 | + array( | |
| 1773 | + 'label' => esc_html__( 'Keyword monitoring value', 'mainwp' ), | |
| 1774 | + 'value' => ! empty( $monitoring_settings['keyword'] ) ? (string) $monitoring_settings['keyword'] : esc_html__( 'Not configured', 'mainwp' ), | |
| 1775 | + ), | |
| 1776 | + array( | |
| 1777 | + 'label' => esc_html__( 'Monitoring data retention', 'mainwp' ), | |
| 1778 | + 'value' => static::format_retention_days_label( $retention_days ), | |
| 1779 | + ), | |
| 1780 | + array( | |
| 1781 | + 'label' => esc_html__( 'Enable site health monitoring', 'mainwp' ), | |
| 1782 | + 'value' => static::format_boolean_label( $site_health ), | |
| 1783 | + ), | |
| 1784 | + array( | |
| 1785 | + 'label' => esc_html__( 'Site Health threshold', 'mainwp' ), | |
| 1786 | + 'value' => 100 === $threshold ? esc_html__( 'Good', 'mainwp' ) : esc_html__( 'Should be improved', 'mainwp' ), | |
| 1787 | + ), | |
| 1725 | 1788 | ), |
| 1726 | 1789 | 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 | 1790 | 'Enable uptime monitoring', |
| 1769 | 1791 | 'Monitor type', |
| 1770 | 1792 | 'Method', |
| 1771 | 1793 | 'Interval', |
| @@ -1840,45 +1862,45 @@ | ||
| 1840 | 1862 | } |
| 1841 | 1863 | |
| 1842 | 1864 | return self::add_export_labels_to_rows( |
| 1843 | 1865 | 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 ) | |
| 1866 | + array( | |
| 1867 | + 'label' => esc_html__( 'Currency', 'mainwp' ), | |
| 1868 | + 'value' => (string) $selected_currency, | |
| 1870 | 1869 | ), |
| 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 ) | |
| 1870 | + array( | |
| 1871 | + 'label' => esc_html__( 'Currency position', 'mainwp' ), | |
| 1872 | + 'value' => (string) $currency_format['currency_position'], | |
| 1878 | 1873 | ), |
| 1874 | + array( | |
| 1875 | + 'label' => esc_html__( 'Thousand separator', 'mainwp' ), | |
| 1876 | + 'value' => '' === (string) $currency_format['thousand_separator'] ? esc_html__( 'None', 'mainwp' ) : (string) $currency_format['thousand_separator'], | |
| 1877 | + ), | |
| 1878 | + array( | |
| 1879 | + 'label' => esc_html__( 'Decimal separator', 'mainwp' ), | |
| 1880 | + 'value' => (string) $currency_format['decimal_separator'], | |
| 1881 | + ), | |
| 1882 | + array( | |
| 1883 | + 'label' => esc_html__( 'Decimals', 'mainwp' ), | |
| 1884 | + 'value' => (string) intval( $currency_format['decimals'] ), | |
| 1885 | + ), | |
| 1886 | + array( | |
| 1887 | + 'label' => esc_html__( 'Product categories', 'mainwp' ), | |
| 1888 | + 'value' => sprintf( | |
| 1889 | + /* translators: %d: count */ | |
| 1890 | + esc_html__( '%d configured', 'mainwp' ), | |
| 1891 | + count( $product_types ) | |
| 1892 | + ), | |
| 1893 | + ), | |
| 1894 | + array( | |
| 1895 | + 'label' => esc_html__( 'Payment methods', 'mainwp' ), | |
| 1896 | + 'value' => sprintf( | |
| 1897 | + /* translators: %d: count */ | |
| 1898 | + esc_html__( '%d configured', 'mainwp' ), | |
| 1899 | + count( $custom_payment_methods ) | |
| 1900 | + ), | |
| 1901 | + ), | |
| 1879 | 1902 | ), |
| 1880 | - ), | |
| 1881 | 1903 | array( |
| 1882 | 1904 | 'Currency', |
| 1883 | 1905 | 'Currency position', |
| 1884 | 1906 | 'Thousand separator', |
| @@ -1912,38 +1934,38 @@ | ||
| 1912 | 1934 | } |
| 1913 | 1935 | |
| 1914 | 1936 | return self::add_export_labels_to_rows( |
| 1915 | 1937 | array( |
| 1916 | - array( | |
| 1917 | - 'label' => esc_html__( 'Enable Network Activity logging', 'mainwp' ), | |
| 1918 | - 'value' => static::format_boolean_label( ! empty( $options['enabled'] ) ), | |
| 1938 | + array( | |
| 1939 | + 'label' => esc_html__( 'Enable Network Activity logging', 'mainwp' ), | |
| 1940 | + 'value' => static::format_boolean_label( ! empty( $options['enabled'] ) ), | |
| 1941 | + ), | |
| 1942 | + array( | |
| 1943 | + 'label' => esc_html__( 'Automatically archive logs', 'mainwp' ), | |
| 1944 | + 'value' => static::format_boolean_label( ! empty( $options['auto_archive'] ) ), | |
| 1945 | + ), | |
| 1946 | + array( | |
| 1947 | + 'label' => esc_html__( 'Data retention period', 'mainwp' ), | |
| 1948 | + 'value' => static::format_log_retention_label( isset( $options['records_logs_ttl'] ) ? intval( $options['records_logs_ttl'] ) : 3 * YEAR_IN_SECONDS ), | |
| 1949 | + ), | |
| 1950 | + array( | |
| 1951 | + 'label' => esc_html__( 'Child-site Network Activity retention', 'mainwp' ), | |
| 1952 | + 'value' => static::format_retention_days_label( isset( $options['child_logs_ttl'] ) ? intval( $options['child_logs_ttl'] ) : 7 ), | |
| 1953 | + ), | |
| 1954 | + array( | |
| 1955 | + 'label' => esc_html__( 'Disabled dashboard event types', 'mainwp' ), | |
| 1956 | + 'value' => (string) $dashboard_disabled, | |
| 1957 | + ), | |
| 1958 | + array( | |
| 1959 | + 'label' => esc_html__( 'Disabled child-site event types', 'mainwp' ), | |
| 1960 | + 'value' => (string) $child_disabled, | |
| 1961 | + ), | |
| 1962 | + array( | |
| 1963 | + 'label' => esc_html__( 'Disabled change-log event types', 'mainwp' ), | |
| 1964 | + 'value' => (string) $changes_disabled, | |
| 1965 | + ), | |
| 1919 | 1966 | ), |
| 1920 | 1967 | 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 | 1968 | 'Enable Network Activity logging', |
| 1947 | 1969 | 'Automatically archive logs', |
| 1948 | 1970 | 'Data retention period', |
| 1949 | 1971 | 'Child-site Network Activity retention', |
| @@ -2057,26 +2079,26 @@ | ||
| 2057 | 2079 | */ |
| 2058 | 2080 | public static function get_tools_report_rows() { |
| 2059 | 2081 | return self::add_export_labels_to_rows( |
| 2060 | 2082 | array( |
| 2061 | - array( | |
| 2062 | - 'label' => esc_html__( 'Current MainWP theme', 'mainwp' ), | |
| 2063 | - 'value' => MainWP_Settings::get_instance()->get_current_user_theme(), | |
| 2083 | + array( | |
| 2084 | + 'label' => esc_html__( 'Current MainWP theme', 'mainwp' ), | |
| 2085 | + 'value' => MainWP_Settings::get_instance()->get_current_user_theme(), | |
| 2086 | + ), | |
| 2087 | + array( | |
| 2088 | + 'label' => esc_html__( 'Guided tours', 'mainwp' ), | |
| 2089 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_tours', 0 ) ), | |
| 2090 | + ), | |
| 2091 | + array( | |
| 2092 | + 'label' => esc_html__( 'Chatbase', 'mainwp' ), | |
| 2093 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_chatbase', 0 ) ), | |
| 2094 | + ), | |
| 2095 | + array( | |
| 2096 | + 'label' => esc_html__( 'Guided video', 'mainwp' ), | |
| 2097 | + 'value' => static::format_boolean_label( (int) get_option( 'mainwp_enable_guided_video', 0 ) ), | |
| 2098 | + ), | |
| 2064 | 2099 | ), |
| 2065 | 2100 | 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 | 2101 | 'Current MainWP theme', |
| 2080 | 2102 | 'Guided tours', |
| 2081 | 2103 | 'Chatbase', |
| 2082 | 2104 | 'Guided video', |
| @@ -2094,36 +2116,36 @@ | ||
| 2094 | 2116 | $log_readable = ! empty( $error_log_path ) && file_exists( $error_log_path ) ? is_readable( $error_log_path ) : false; |
| 2095 | 2117 | |
| 2096 | 2118 | return self::add_export_labels_to_rows( |
| 2097 | 2119 | array( |
| 2098 | - array( | |
| 2099 | - 'label' => esc_html__( 'WP_DEBUG', 'mainwp' ), | |
| 2100 | - 'value' => static::format_boolean_label( defined( 'WP_DEBUG' ) && WP_DEBUG ), | |
| 2120 | + array( | |
| 2121 | + 'label' => esc_html__( 'WP_DEBUG', 'mainwp' ), | |
| 2122 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG' ) && WP_DEBUG ), | |
| 2123 | + ), | |
| 2124 | + array( | |
| 2125 | + 'label' => esc_html__( 'WP_DEBUG_LOG', 'mainwp' ), | |
| 2126 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ), | |
| 2127 | + ), | |
| 2128 | + array( | |
| 2129 | + 'label' => esc_html__( 'WP_DEBUG_DISPLAY', 'mainwp' ), | |
| 2130 | + 'value' => static::format_boolean_label( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ), | |
| 2131 | + ), | |
| 2132 | + array( | |
| 2133 | + 'label' => esc_html__( 'PHP log_errors', 'mainwp' ), | |
| 2134 | + 'value' => static::format_boolean_label( filter_var( ini_get( 'log_errors' ), FILTER_VALIDATE_BOOLEAN ) ), | |
| 2135 | + ), | |
| 2136 | + array( | |
| 2137 | + 'label' => esc_html__( 'PHP error_log path', 'mainwp' ), | |
| 2138 | + 'value' => ! empty( $error_log_path ) ? $error_log_path : esc_html__( 'Not set', 'mainwp' ), | |
| 2139 | + 'visibility' => 'community_masked', | |
| 2140 | + 'community_value' => ! empty( $error_log_path ) ? esc_html__( 'Configured', 'mainwp' ) : esc_html__( 'Not set', 'mainwp' ), | |
| 2141 | + ), | |
| 2142 | + array( | |
| 2143 | + 'label' => esc_html__( 'PHP error_log readable', 'mainwp' ), | |
| 2144 | + 'value' => static::format_boolean_label( $log_readable ), | |
| 2145 | + ), | |
| 2101 | 2146 | ), |
| 2102 | 2147 | 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 | 2148 | 'WP_DEBUG', |
| 2127 | 2149 | 'WP_DEBUG_LOG', |
| 2128 | 2150 | 'WP_DEBUG_DISPLAY', |
| 2129 | 2151 | 'PHP log_errors', |
| @@ -2138,9 +2160,9 @@ | ||
| 2138 | 2160 | * |
| 2139 | 2161 | * @return array<int,array<string,mixed>> |
| 2140 | 2162 | */ |
| 2141 | 2163 | public static function get_conflict_signal_report_rows() { |
| 2142 | - $caching_plugins = static::get_active_plugins_by_keyword_group( | |
| 2164 | + $caching_plugins = static::get_active_plugins_by_keyword_group( | |
| 2143 | 2165 | array( |
| 2144 | 2166 | 'cache', |
| 2145 | 2167 | 'rocket', |
| 2146 | 2168 | 'litespeed', |
| @@ -2153,9 +2175,9 @@ | ||
| 2153 | 2175 | 'nitropack', |
| 2154 | 2176 | 'hummingbird', |
| 2155 | 2177 | ) |
| 2156 | 2178 | ); |
| 2157 | - $security_plugins = static::get_active_plugins_by_keyword_group( | |
| 2179 | + $security_plugins = static::get_active_plugins_by_keyword_group( | |
| 2158 | 2180 | array( |
| 2159 | 2181 | 'wordfence', |
| 2160 | 2182 | 'sucuri', |
| 2161 | 2183 | 'solid security', |
| @@ -2168,48 +2190,224 @@ | ||
| 2168 | 2190 | 'cloudflare', |
| 2169 | 2191 | 'limit login', |
| 2170 | 2192 | ) |
| 2171 | 2193 | ); |
| 2172 | - $maintenance_plugins = static::get_active_plugins_by_keyword_group( | |
| 2194 | + | |
| 2195 | + $maintenance_mode = static::get_maintenance_mode_indicators(); | |
| 2196 | + $dropins = static::get_dropin_conflict_indicators(); | |
| 2197 | + | |
| 2198 | + return self::add_export_labels_to_rows( | |
| 2173 | 2199 | array( |
| 2174 | - 'maintenance', | |
| 2175 | - 'coming soon', | |
| 2176 | - 'seedprod', | |
| 2177 | - 'lightstart', | |
| 2200 | + array( | |
| 2201 | + 'label' => esc_html__( 'Caching / performance plugins', 'mainwp' ), | |
| 2202 | + 'value' => static::format_conflict_items_label( $caching_plugins ), | |
| 2203 | + ), | |
| 2204 | + array( | |
| 2205 | + 'label' => esc_html__( 'Security / access-control plugins', 'mainwp' ), | |
| 2206 | + 'value' => static::format_conflict_items_label( $security_plugins ), | |
| 2207 | + ), | |
| 2208 | + array( | |
| 2209 | + 'label' => esc_html__( 'Maintenance mode indicators', 'mainwp' ), | |
| 2210 | + 'value' => static::format_conflict_items_label( $maintenance_mode ), | |
| 2211 | + 'status' => empty( $maintenance_mode ) ? '' : 'warning', | |
| 2212 | + ), | |
| 2213 | + array( | |
| 2214 | + 'label' => esc_html__( 'Drop-ins / object cache', 'mainwp' ), | |
| 2215 | + 'value' => static::format_conflict_items_label( $dropins ), | |
| 2216 | + ), | |
| 2217 | + ), | |
| 2218 | + array( | |
| 2219 | + 'Caching / performance plugins', | |
| 2220 | + 'Security / access-control plugins', | |
| 2221 | + 'Maintenance mode indicators', | |
| 2222 | + 'Drop-ins / object cache', | |
| 2178 | 2223 | ) |
| 2179 | 2224 | ); |
| 2180 | - $maintenance_mode = static::get_maintenance_mode_indicators(); | |
| 2181 | - $dropins = static::get_dropin_conflict_indicators(); | |
| 2225 | + } | |
| 2182 | 2226 | |
| 2183 | - return self::add_export_labels_to_rows( | |
| 2227 | + | |
| 2228 | + /** | |
| 2229 | + * Get database rows. | |
| 2230 | + * | |
| 2231 | + * @return array<int,array<string,mixed>> | |
| 2232 | + */ | |
| 2233 | + public static function get_database_report_rows() { // phpcs:ignore -- NOSONAR - complex function. | |
| 2234 | + | |
| 2235 | + $db_info = MainWP_Database_Schema_Checker::get_database_info(); | |
| 2236 | + | |
| 2237 | + $database_size = isset( $db_info['database_size'] ) ? $db_info['database_size'] : array(); | |
| 2238 | + | |
| 2239 | + $data_size = isset( $database_size['data'] ) ? $database_size['data'] : 0; | |
| 2240 | + $index_size = isset( $database_size['index'] ) ? $database_size['index'] : 0; | |
| 2241 | + | |
| 2242 | + $db_privileges_info = MainWP_Database_Schema_Checker::get_database_privileges(); | |
| 2243 | + | |
| 2244 | + $db_privileges = ! empty( $db_privileges_info['database_grants'] ) && is_array( $db_privileges_info['database_grants'] ) ? implode( ', ', $db_privileges_info['database_grants'] ) . '.' : ''; | |
| 2245 | + | |
| 2246 | + $db_privileges_status = 'pass'; | |
| 2247 | + if ( ! empty( $db_privileges_info['database_missing_privileges'] ) && is_array( $db_privileges_info['database_missing_privileges'] ) ) { | |
| 2248 | + $db_privileges .= ' ' . esc_html__( 'Missing database privileges:', 'mainwp' ) . ' ' . implode( ', ', $db_privileges_info['database_missing_privileges'] ); | |
| 2249 | + $db_privileges_status = 'error'; | |
| 2250 | + } | |
| 2251 | + | |
| 2252 | + $db_rows_info = array( | |
| 2184 | 2253 | array( |
| 2254 | + 'label' => esc_html__( 'MainWP database version', 'mainwp' ), | |
| 2255 | + 'value' => $db_info['mainwp_database_version'], | |
| 2256 | + ), | |
| 2185 | 2257 | array( |
| 2186 | - 'label' => esc_html__( 'Caching / performance plugins', 'mainwp' ), | |
| 2187 | - 'value' => static::format_conflict_items_label( $caching_plugins ), | |
| 2258 | + 'label' => esc_html__( 'Database prefix', 'mainwp' ), | |
| 2259 | + 'value' => $db_info['database_prefix'], | |
| 2188 | 2260 | ), |
| 2189 | 2261 | array( |
| 2190 | - 'label' => esc_html__( 'Security / access-control plugins', 'mainwp' ), | |
| 2191 | - 'value' => static::format_conflict_items_label( $security_plugins ), | |
| 2262 | + 'label' => esc_html__( 'Total Database Size', 'mainwp' ), | |
| 2263 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $data_size + $index_size ) ), | |
| 2192 | 2264 | ), |
| 2193 | 2265 | array( |
| 2194 | - 'label' => esc_html__( 'Maintenance mode indicators', 'mainwp' ), | |
| 2195 | - 'value' => static::format_conflict_items_label( $maintenance_mode ), | |
| 2196 | - 'status' => empty( $maintenance_mode ) ? '' : 'warning', | |
| 2266 | + 'label' => esc_html__( 'Database Data Size', 'mainwp' ), | |
| 2267 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $data_size ) ), | |
| 2197 | 2268 | ), |
| 2198 | 2269 | array( |
| 2199 | - 'label' => esc_html__( 'Drop-ins / object cache', 'mainwp' ), | |
| 2200 | - 'value' => static::format_conflict_items_label( $dropins ), | |
| 2270 | + 'label' => esc_html__( 'Database Index Size', 'mainwp' ), | |
| 2271 | + 'value' => esc_html( sprintf( __( '%sMB', 'mainwp' ), $index_size ) ), | |
| 2201 | 2272 | ), |
| 2273 | + array( | |
| 2274 | + 'status' => $db_privileges_status, | |
| 2275 | + 'label' => esc_html__( 'Database privileges', 'mainwp' ), | |
| 2276 | + 'value' => $db_privileges, | |
| 2202 | 2277 | ), |
| 2278 | + ); | |
| 2279 | + | |
| 2280 | + $db_rows = array(); | |
| 2281 | + $db_rows_missing = array(); | |
| 2282 | + | |
| 2283 | + if ( isset( $db_info['database_tables'] ) && is_array( $db_info['database_tables'] ) ) { | |
| 2284 | + | |
| 2285 | + $missing_db_tables = MainWP_Database_Schema_Checker::detect_missing_tables( $db_info['database_tables'] ); | |
| 2286 | + | |
| 2287 | + if ( is_array( $missing_db_tables ) ) { | |
| 2288 | + foreach ( array( 'core', 'extensions' ) as $type ) { | |
| 2289 | + $miss_tables = isset( $missing_db_tables[ $type ] ) ? $missing_db_tables[ $type ] : array(); | |
| 2290 | + if ( ! empty( $miss_tables ) && is_array( $miss_tables ) ) { | |
| 2291 | + if ( 'core' === $type ) { | |
| 2292 | + foreach ( $miss_tables as $tb_name ) { | |
| 2293 | + $db_rows_missing[] = array( | |
| 2294 | + 'label' => $tb_name, | |
| 2295 | + 'value' => esc_html__( 'Missing core table', 'mainwp' ), | |
| 2296 | + 'status' => 'error', | |
| 2297 | + ); | |
| 2298 | + } | |
| 2299 | + } else { | |
| 2300 | + foreach ( $miss_tables as $ext_slug => $miss_ext_tables ) { | |
| 2301 | + $title = MainWP_Database_Schema_Checker::get_loaded_extension_title( $ext_slug ); | |
| 2302 | + foreach ( $miss_ext_tables as $tb_name ) { | |
| 2303 | + $db_rows_missing[] = array( | |
| 2304 | + 'label' => $tb_name, | |
| 2305 | + 'value' => sprintf( esc_html__( 'Missing extension table: %1s', 'mainwp' ), $title ), | |
| 2306 | + 'status' => 'error', | |
| 2307 | + ); | |
| 2308 | + } | |
| 2309 | + } | |
| 2310 | + } | |
| 2311 | + } | |
| 2312 | + } | |
| 2313 | + } | |
| 2314 | + | |
| 2315 | + foreach ( array( 'core', 'other' ) as $type ) { | |
| 2316 | + $type_tables = isset( $db_info['database_tables'][ $type ] ) ? $db_info['database_tables'][ $type ] : array(); | |
| 2317 | + if ( is_array( $type_tables ) ) { | |
| 2318 | + foreach ( $type_tables as $tb_name => $info ) { | |
| 2319 | + | |
| 2320 | + if ( empty( $info ) ) { | |
| 2321 | + continue; // Missing table, so skip column detection. | |
| 2322 | + } | |
| 2323 | + | |
| 2324 | + $status = 'pass'; | |
| 2325 | + | |
| 2326 | + $detect_cols_issues = array(); | |
| 2327 | + | |
| 2328 | + /** | |
| 2329 | + * Filter to disable detection of missing table columns. Useful for slow hosts. | |
| 2330 | + * | |
| 2331 | + * @since 6.1.3. | |
| 2332 | + */ | |
| 2333 | + if ( apply_filters( 'mainwp_detect_table_column_issues', true ) ) { | |
| 2334 | + $detect_cols_issues = MainWP_Database_Schema_Checker::detect_table_columns_issues( $tb_name, $type ); | |
| 2335 | + } | |
| 2336 | + | |
| 2337 | + $missing_cols = is_array( $detect_cols_issues ) && isset( $detect_cols_issues['missing_columns'] ) ? $detect_cols_issues['missing_columns'] : array(); | |
| 2338 | + $invalid_cols = is_array( $detect_cols_issues ) && isset( $detect_cols_issues['invalid_columns'] ) ? $detect_cols_issues['invalid_columns'] : array(); | |
| 2339 | + | |
| 2340 | + $issues_cols_info = array(); | |
| 2341 | + | |
| 2342 | + if ( ! empty( $missing_cols ) && is_array( $missing_cols ) ) { | |
| 2343 | + $issues_cols_info[] = sprintf( esc_html__( 'Missing columns: %1s;', 'mainwp' ), implode( ', ', $missing_cols ) ); | |
| 2344 | + $status = 'error'; | |
| 2345 | + } | |
| 2346 | + | |
| 2347 | + if ( ! empty( $invalid_cols ) && is_array( $invalid_cols ) && isset( $invalid_cols[0]['column'] ) ) { | |
| 2348 | + | |
| 2349 | + $issues_string = implode( | |
| 2350 | + '; ', | |
| 2351 | + array_map( | |
| 2352 | + static function ( $issue ) { | |
| 2353 | + return sprintf( | |
| 2354 | + 'column: "%s" - expected: "%s" - actual: "%s"', | |
| 2355 | + $issue['column'], | |
| 2356 | + $issue['expected'], | |
| 2357 | + $issue['actual'] | |
| 2358 | + ); | |
| 2359 | + }, | |
| 2360 | + $invalid_cols | |
| 2361 | + ) | |
| 2362 | + ); | |
| 2363 | + | |
| 2364 | + $issues_cols_info[] = sprintf( | |
| 2365 | + esc_html__( 'Incorrect column definitions found: %s;', 'mainwp' ), | |
| 2366 | + $issues_string | |
| 2367 | + ); | |
| 2368 | + | |
| 2369 | + if ( 'pass' === $status ) { | |
| 2370 | + $status = 'error'; // warning - incorrect column definition. | |
| 2371 | + } | |
| 2372 | + } | |
| 2373 | + | |
| 2374 | + $tbl_info = ''; | |
| 2375 | + if ( is_array( $info ) && isset( $info['data'] ) ) { | |
| 2376 | + $tbl_info = sprintf( __( 'Data: %sMB + Index: %sMB + Engine %s', 'mainwp' ), $info['data'], $info['index'], $info['engine'] ); | |
| 2377 | + } | |
| 2378 | + | |
| 2379 | + $db_rows[] = array( | |
| 2380 | + 'label' => esc_html( $tb_name ), | |
| 2381 | + 'value' => esc_html( | |
| 2382 | + $tbl_info . ( ! empty( $issues_cols_info ) ? ' (' . implode( '; ', $issues_cols_info ) . ') ' : '' ), | |
| 2383 | + ), | |
| 2384 | + 'status' => $status, | |
| 2385 | + ); | |
| 2386 | + | |
| 2387 | + } | |
| 2388 | + } | |
| 2389 | + } | |
| 2390 | + | |
| 2391 | + MainWP_Database_Schema_Checker::prepare_db_and_tables_issues( $missing_db_tables ); | |
| 2392 | + } | |
| 2393 | + | |
| 2394 | + return self::add_export_labels_to_rows( | |
| 2395 | + array_merge( $db_rows_info, $db_rows_missing, $db_rows ), | |
| 2203 | 2396 | array( |
| 2204 | - 'Caching / performance plugins', | |
| 2205 | - 'Security / access-control plugins', | |
| 2206 | - 'Maintenance mode indicators', | |
| 2207 | - 'Drop-ins / object cache', | |
| 2397 | + 'Database', | |
| 2398 | + 'Database privileges', | |
| 2399 | + 'MainWP database version', | |
| 2400 | + 'Database prefix', | |
| 2401 | + 'Total Database Size', | |
| 2402 | + 'Database Data Size', | |
| 2403 | + 'Database Index Size', | |
| 2404 | + 'Missing core table', | |
| 2208 | 2405 | ) |
| 2209 | 2406 | ); |
| 2210 | 2407 | } |
| 2211 | 2408 | |
| 2409 | + | |
| 2212 | 2410 | /** |
| 2213 | 2411 | * Format boolean label. |
| 2214 | 2412 | * |
| 2215 | 2413 | * @param mixed $value True-ish value. |
| @@ -2367,8 +2565,22 @@ | ||
| 2367 | 2565 | return count( $emails ); |
| 2368 | 2566 | } |
| 2369 | 2567 | |
| 2370 | 2568 | /** |
| 2569 | + * Dashboard outbound IP to allowlist (Public Dashboard IP from Status). | |
| 2570 | + * | |
| 2571 | + * @return string | |
| 2572 | + */ | |
| 2573 | + public static function get_dashboard_outbound_ip() { | |
| 2574 | + $data = static::get_public_dashboard_ip_data(); | |
| 2575 | + if ( isset( $data['status'], $data['value'] ) && 'pass' === $data['status'] && static::is_public_ip_address( (string) $data['value'] ) ) { | |
| 2576 | + return (string) $data['value']; | |
| 2577 | + } | |
| 2578 | + | |
| 2579 | + return ''; | |
| 2580 | + } | |
| 2581 | + | |
| 2582 | + /** | |
| 2371 | 2583 | * Get public dashboard IP data. |
| 2372 | 2584 | * |
| 2373 | 2585 | * @return array<string,string> |
| 2374 | 2586 | */ |
| @@ -2665,20 +2877,12 @@ | ||
| 2665 | 2877 | if ( null !== $cached_data ) { |
| 2666 | 2878 | return $cached_data; |
| 2667 | 2879 | } |
| 2668 | 2880 | |
| 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 | - ); | |
| 2881 | + $url = admin_url( 'admin-ajax.php' ); | |
| 2680 | 2882 | |
| 2883 | + $response = MainWP_System_Utility::test_self_connect( $url ); | |
| 2884 | + | |
| 2681 | 2885 | if ( is_wp_error( $response ) ) { |
| 2682 | 2886 | $cached_data = array( |
| 2683 | 2887 | 'value' => sprintf( |
| 2684 | 2888 | /* translators: %s: error message */ |
| @@ -2720,9 +2924,9 @@ | ||
| 2720 | 2924 | return $cached_data; |
| 2721 | 2925 | } |
| 2722 | 2926 | |
| 2723 | 2927 | $response_body = wp_remote_retrieve_body( $response ); |
| 2724 | - if ( false === strstr( $response_body, 'MainWP Test' ) ) { | |
| 2928 | + if ( 'MainWP Self Connect OK' !== trim( $response_body ) ) { | |
| 2725 | 2929 | $cached_data = array( |
| 2726 | 2930 | '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 | 2931 | 'status' => 'warning', |
| 2728 | 2932 | 'code' => 'unexpected_body', |
| @@ -2777,9 +2981,9 @@ | ||
| 2777 | 2981 | * |
| 2778 | 2982 | * @return string |
| 2779 | 2983 | */ |
| 2780 | 2984 | private static function get_primary_backup_method_label() { |
| 2781 | - $primary_backup = get_option( 'mainwp_primaryBackup' ); | |
| 2985 | + $primary_backup = get_option( 'mainwp_primaryBackup' ); | |
| 2782 | 2986 | $primary_methods = apply_filters_deprecated( 'mainwp-getprimarybackup-methods', array( array() ), '4.0.7.2', 'mainwp_getprimarybackup_methods' ); // NOSONAR - not IP. |
| 2783 | 2987 | $primary_methods = apply_filters( 'mainwp_getprimarybackup_methods', $primary_methods ); |
| 2784 | 2988 | |
| 2785 | 2989 | if ( is_array( $primary_methods ) ) { |