PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.18
ووسلام – همگام سازی ووکامرس و باسلام v1.10.18
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 1.8.7 1.8.4 All 51 releases
sync-basalam / includes / Services / CheckHttpBlockService.php

CheckHttpBlockService.php in ووسلام – همگام سازی ووکامرس و باسلام 1.10.18, at includes/Services/CheckHttpBlockService.php

32 lines 747 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SyncBasalam\Services;
4
5 defined('ABSPATH') || exit;
6
7 class CheckHttpBlockService
8 {
9 public function SyncBasalamHttpBlock()
10 {
11 if (!defined('WP_HTTP_BLOCK_EXTERNAL') || WP_HTTP_BLOCK_EXTERNAL !== true) return false;
12
13 $required_hosts = [
14 'basalam.com',
15 '*.basalam.com',
16 '*.hamsalam.ir',
17 ];
18
19 $current_hosts = [];
20
21 if (defined('WP_ACCESSIBLE_HOSTS')) {
22 $current_hosts = array_filter(array_map('trim', explode(',', WP_ACCESSIBLE_HOSTS)));
23 }
24
25 $missing_hosts = array_diff($required_hosts, $current_hosts);
26
27 if (empty($missing_hosts)) return false;
28
29 return $required_hosts;
30 }
31 }
32