PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.2.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.2.0
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Core/Importer/LogHelper.php +15 -6 3.0.43.2.0 View file →
@@ -37,15 +37,24 @@
37 37 public function sse_message( $data ) {
38 38 // Log the data into debug log file
39 39 $this->debug_log( $data );
40 40
41 - echo "event: message\n";
42 - echo 'data: ' . wp_json_encode( $data ) . "\n\n";
41 + $log = get_option( 'templately_fsi_log' ) ?: [];
42 + $log[] = $data;
43 + update_option( 'templately_fsi_log', $log );
43 44
44 - // Extra padding.
45 - echo esc_html( ':' . str_repeat( ' ', 2048 ) . "\n\n" );
45 + // if(Helper::should_flush()){
46 + // echo "event: message\n";
47 + // echo 'data: ' . wp_json_encode( $data ) . "\n\n";
46 48
47 - flush();
49 + // // Extra padding.
50 + // echo esc_html( ':' . str_repeat( ' ', 2048 ) . "\n\n" );
51 +
52 + // flush();
53 + // }
54 + // else if($data['action'] === 'complete' || $data['action'] === 'downloadComplete' || $data['action'] === 'error'){
55 + // wp_send_json( $data );
56 + // }
48 57 }
49 58
50 59 /**
51 60 * Printing Error Logs in debug.log file.
@@ -56,10 +65,10 @@
56 65 public function debug_log( $log ){
57 66 if ( defined('TEMPLATELY_EVENT_LOG') && TEMPLATELY_EVENT_LOG === true ) {
58 67 if ( is_array( $log ) || is_object( $log ) ) {
59 68 error_log( print_r( $log, true ) );
60 - } else {
69 + } else if($log) {
61 70 error_log( $log );
62 71 }
63 72 }
64 73 }
65 74 }