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 +9 -2 1.9.21.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 }
@@ -123,8 +123,15 @@
123 123
124 124 spawn_cron();
125 125
126 126 return true;
127 + }
128 +
129 + public function maybeHandleAsyncRequest()
130 + {
131 + check_ajax_referer($this->identifier, 'nonce');
132 +
133 + $this->handleAsyncRequest();
127 134 }
128 135
129 136 public function handleAsyncRequest()
130 137 {