| @@ -40,9 +40,11 @@ | ||
| 40 | 40 | const WARM_CACHE_LOG_PRIORITY = 20250915; |
| 41 | 41 | const EXTENSION_UPDATES_CHECK_LOG_PRIORITY = 20260306; |
| 42 | 42 | const EXECUTION_SYNC_LOG_PRIORITY = 20260316; |
| 43 | 43 | const EXECUTION_SYNC_DETAILS_LOG_PRIORITY = 20260323; |
| 44 | + const AUTO_UPDATES_LOG_PRIORITY = 20260707; | |
| 44 | 45 | |
| 46 | + | |
| 45 | 47 | const DISABLED = - 1; |
| 46 | 48 | const LOG = 0; |
| 47 | 49 | const WARNING = 1; |
| 48 | 50 | const INFO = 2; |
| @@ -385,8 +387,11 @@ | ||
| 385 | 387 | break; |
| 386 | 388 | case 'extension-updates-check': |
| 387 | 389 | $this->log_action( '[Extension Updates Check] :: ' . $text, static::EXTENSION_UPDATES_CHECK_LOG_PRIORITY, $color ); |
| 388 | 390 | break; |
| 391 | + case 'auto-updates': | |
| 392 | + $this->log_action( '[Auto Updates] :: ' . $text, static::AUTO_UPDATES_LOG_PRIORITY ); | |
| 393 | + break; | |
| 389 | 394 | default: |
| 390 | 395 | break; |
| 391 | 396 | } |
| 392 | 397 | } |
| @@ -728,15 +733,29 @@ | ||
| 728 | 733 | * |
| 729 | 734 | * @return mixed $data filtered data. |
| 730 | 735 | */ |
| 731 | 736 | public function prepare_log_info( $data ) { |
| 732 | - $patterns[0] = '/user=([^\&]+)\&/'; | |
| 733 | - $replacement[0] = 'user=xxxxxx&'; | |
| 734 | - $patterns[1] = '/alt_user=([^\&]+)\&/'; | |
| 735 | - $replacement[1] = 'alt_user=xxxxxx&'; | |
| 736 | - $patterns[2] = '/\&server=([^\&]+)\&/'; | |
| 737 | - $replacement[2] = '&server=xxxxxx&'; | |
| 738 | - $data = preg_replace( $patterns, $replacement, $data ); | |
| 737 | + $patterns[] = '/user=([^\&]+)\&/'; | |
| 738 | + $replacement[] = 'user=xxxxxx&'; | |
| 739 | + $patterns[] = '/alt_user=([^\&]+)\&/'; | |
| 740 | + $replacement[] = 'alt_user=xxxxxx&'; | |
| 741 | + $patterns[] = '/\&server=([^\&]+)\&/'; | |
| 742 | + $replacement[] = '&server=xxxxxx&'; | |
| 743 | + $patterns[] = '/(^|[?&])data_signature=[^&]*/'; | |
| 744 | + $replacement[] = '$1data_signature=xxxxxx'; | |
| 745 | + $patterns[] = '/(^|[?&])mainwpsignature=[^&]*/'; | |
| 746 | + $replacement[] = '$mainwpsignature=xxxxxx'; | |
| 747 | + $patterns[] = '/(^|[?&])nonce=[^&]*/'; | |
| 748 | + $replacement[] = '$nonce=xxxxxx'; | |
| 749 | + $patterns[] = '/(^|[?&])req_id=[^&]*/'; | |
| 750 | + $replacement[] = '$req_id=xxxxxx'; | |
| 751 | + $patterns[] = '/(^|[?&])mainwpsignature_adv=[^&]*/'; | |
| 752 | + $replacement[] = '$mainwpsignature_adv=xxxxxx'; | |
| 753 | + $patterns[] = '/(^|[?&])wp_http_user=[^&]*/'; | |
| 754 | + $replacement[] = '$wp_http_user=xxxxxx'; | |
| 755 | + $patterns[] = '/(^|[?&])wp_http_pass=[^&]*/'; | |
| 756 | + $replacement[] = '$wp_http_pass=xxxxxx'; | |
| 757 | + $data = preg_replace( $patterns, $replacement, $data ); | |
| 739 | 758 | return $data; |
| 740 | 759 | } |
| 741 | 760 | |
| 742 | 761 | /** |
| @@ -1079,10 +1098,11 @@ | ||
| 1079 | 1098 | $end_wrapper = '</div>'; |
| 1080 | 1099 | |
| 1081 | 1100 | while ( $rows && ( $row = MainWP_DB::fetch_object( $rows ) ) ) { |
| 1082 | 1101 | $line = $row->log_content; |
| 1083 | - if ( 120 * 1024 < strlen( $line ) ) { | |
| 1084 | - $line = '[Data row too long]'; | |
| 1102 | + if ( strlen( $line ) > 120 * KB_IN_BYTES ) { | |
| 1103 | + $size_kb = round( strlen( $line ) / KB_IN_BYTES, 1 ); | |
| 1104 | + $line = sprintf( '[Data row too long] :: [size=%s KB]', $size_kb ); | |
| 1085 | 1105 | } |
| 1086 | 1106 | |
| 1087 | 1107 | $time = gmdate( $this->logDateFormat, MainWP_Utility::get_timestamp( $row->log_timestamp ) ); |
| 1088 | 1108 | |