PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.19
ووسلام – همگام سازی ووکامرس و باسلام v1.10.19
1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 All 53 releases
← All changes | AsyncBackgroundProcess.php +11 -2 1.9.01.10.19 View file →
@@ -26,10 +26,10 @@
26 26 $this->cronHook = $this->identifier . '_cron';
27 27
28 28 add_filter('cron_schedules', array($this, 'addCronInterval'));
29 29
30 - add_action('wp_ajax_' . $this->identifier, array($this, 'handleAsyncRequest'));
31 - add_action('wp_ajax_nopriv_' . $this->identifier, array($this, 'handleAsyncRequest'));
30 + add_action('wp_ajax_' . $this->identifier, array($this, 'maybeHandleAsyncRequest'));
31 + add_action('wp_ajax_nopriv_' . $this->identifier, array($this, 'maybeHandleAsyncRequest'));
32 32 add_action($this->cronHook, array($this, 'handleCronHealthcheck'));
33 33
34 34 $this->init();
35 35 }
@@ -125,8 +125,15 @@
125 125
126 126 return true;
127 127 }
128 128
129 + public function maybeHandleAsyncRequest()
130 + {
131 + check_ajax_referer($this->identifier, 'nonce');
132 +
133 + $this->handleAsyncRequest();
134 + }
135 +
129 136 public function handleAsyncRequest()
130 137 {
131 138 session_write_close();
132 139 if (!$this->isProcessing()) {
@@ -215,8 +222,9 @@
215 222 ORDER BY option_name ASC
216 223 LIMIT 1
217 224 ", $keyPattern);
218 225
226 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Custom plugin table; no object cache for these operational queries.
219 227 $batch = $wpdb->get_row($query);
220 228
221 229 if (empty($batch)) return array();
222 230
@@ -253,8 +261,9 @@
253 261
254 262 $table = $wpdb->options;
255 263 $keyPattern = $this->identifier . '_batch_%';
256 264
265 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Custom plugin table; no object cache for these operational queries.
257 266 return $wpdb->get_results(
258 267 $wpdb->prepare("
259 268 SELECT option_name
260 269 FROM {$table}