PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
← All changes | admin-core/ajax/debugger.php +22 -7 3.1.2 → 3.3.0 View file →
@@ -13,9 +13,8 @@
13 13 }
14 14
15 15 use CartflowsAdmin\AdminCore\Ajax\AjaxBase;
16 16 use CartflowsAdmin\AdminCore\Inc\LogStatus;
17 -use CartflowsAdmin\AdminCore\Inc\AdminHelper;
18 17
19 18 /**
20 19 * Class Steps.
21 20 */
@@ -84,10 +83,12 @@
84 83
85 84 check_ajax_referer( 'cartflows_sync_kb_docs', 'security' );
86 85
87 86 $docs_json = json_decode( wp_remote_retrieve_body( wp_remote_get( 'https://cartflows.com//wp-json/powerful-docs/v1/get-docs' ) ) );
88 - AdminHelper::update_admin_settings_option( 'cartflows_docs_data', $docs_json );
89 87
88 + // Never autoload — this payload runs to hundreds of KB and only the Knowledge Base screen reads it.
89 + update_option( 'cartflows_docs_data', $docs_json, false );
90 +
90 91 $response_data = array(
91 92 'message' => __( 'Sync Success.', 'cartflows' ),
92 93 'status' => true,
93 94 );
@@ -169,16 +170,30 @@
169 170 $real_log_dir = realpath( CARTFLOWS_LOG_DIR );
170 171
171 172 if ( $real_path && $real_log_dir && 0 === strpos( $real_path, $real_log_dir ) && file_exists( $real_path ) ) {
172 173 wp_delete_file( $real_path );
173 - self::$file_deleted = true;
174 +
175 + // Clear the stat cache so the re-check reflects the actual deletion.
176 + clearstatcache( true, $real_path );
177 +
178 + // Confirm the file is actually gone before reporting success.
179 + if ( ! file_exists( $real_path ) ) {
180 + self::$file_deleted = true;
181 +
182 + wp_send_json_success(
183 + array(
184 + 'message' => esc_html__( 'Log file deleted successfully.', 'cartflows' ),
185 + )
186 + );
187 + }
174 188 }
175 189
176 - // Return a success response to the client.
177 - $response_data = array(
178 - 'message' => esc_html__( 'Log file deleted successfully.', 'cartflows' ),
190 + // Reaching here means the file was not deleted.
191 + wp_send_json_error(
192 + array(
193 + 'message' => esc_html__( 'Log file could not be deleted. Please try again.', 'cartflows' ),
194 + )
179 195 );
180 - wp_send_json_success( $response_data );
181 196 }
182 197
183 198 /**
184 199 * Download the selected log file.