| @@ -5,9 +5,8 @@ | ||
| 5 | 5 | use WPIDE\App\Kernel\Request; |
| 6 | 6 | use WPIDE\App\Kernel\Response; |
| 7 | 7 | use WPIDE\App\Services\Service; |
| 8 | 8 | use WPIDE\App\Services\Logger\LoggerInterface; |
| 9 | -use const WPIDE\Constants\SLUG; | |
| 10 | 9 | |
| 11 | 10 | /** |
| 12 | 11 | * @codeCoverageIgnore |
| 13 | 12 | */ |
| @@ -27,9 +26,9 @@ | ||
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | public function init(array $config = []) |
| 30 | 29 | { |
| 31 | - if(wp_doing_cron() || defined('WPIDE_DOING_TASK') || ! $this->isProtectedRequest()) { | |
| 30 | + if(!wp_doing_ajax() || wp_doing_cron() || defined('WPIDE_DOING_TASK')) { | |
| 32 | 31 | return; |
| 33 | 32 | } |
| 34 | 33 | |
| 35 | 34 | $nonce = wp_create_nonce(); |
| @@ -85,16 +84,6 @@ | ||
| 85 | 84 | die; |
| 86 | 85 | } |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | - } | |
| 90 | - | |
| 91 | - protected function isProtectedRequest(): bool | |
| 92 | - { | |
| 93 | - if(wp_doing_ajax()) { | |
| 94 | - return true; | |
| 95 | - } | |
| 96 | - | |
| 97 | - return $this->request->query->get('page') === SLUG | |
| 98 | - && $this->request->query->has('req'); | |
| 99 | 88 | } |
| 100 | 89 | } |