PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.17.6
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.17.6
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
← All changes | includes/Core/Capability/Request.php +40 -35 1.22.17.6 View file →
@@ -1,45 +1,50 @@
1 1 <?php
2 +
2 3 namespace BitCode\BitForm\Core\Capability;
3 4
5 +use BitCode\BitForm\Core\Util\FileDownloadProvider;
4 6
5 -use BitCode\BitForm\Core\Util\FileDownloadProvider;
6 7 final class Request
7 8 {
8 - public static function Check($type)
9 - {
10 - switch ($type) {
11 - case 'admin':
12 - return is_admin();
13 -
14 - case 'ajax':
15 - return defined('DOING_AJAX');
16 -
17 - case 'cron':
18 - return defined('DOING_CRON');
19 -
20 - case 'api':
21 - return defined('REST_REQUEST');
22 -
23 - case 'frontend':
24 - return (! is_admin() || defined('DOING_AJAX')) && ! defined('DOING_CRON');
25 - }
9 + public static function Check($type)
10 + {
11 + switch ($type) {
12 + case 'admin':
13 + return is_admin();
14 +
15 + case 'ajax':
16 + return defined('DOING_AJAX');
17 +
18 + case 'cron':
19 + return defined('DOING_CRON');
20 +
21 + case 'api':
22 + return defined('REST_REQUEST');
23 +
24 + case 'frontend':
25 + return (!is_admin() || defined('DOING_AJAX')) && !defined('DOING_CRON');
26 26 }
27 + }
27 28
28 - public static function isPluginPage()
29 - {
30 - global $wp;
31 - $queryToRemove = array('formID','entryID','fileID','download');
32 -
33 - $reqUrl = home_url(remove_query_arg($queryToRemove, $_SERVER['REQUEST_URI']));
34 - $downloadUrl = FileDownloadProvider::getBaseDownloadURL();
35 - $reqUrl = \substr($reqUrl, -1) !== '/' ? $reqUrl.'/' : $reqUrl;
36 - $downloadUrl = \substr($downloadUrl, -1) !== '/' ? $downloadUrl.'/' : $downloadUrl;
37 - switch ($reqUrl) {
38 - case $downloadUrl:{
39 - return true;
40 - }
41 - default:
42 - return false;
43 - }
29 + public static function isPluginPage()
30 + {
31 + $parsed_url = wp_parse_url(home_url());
32 + $site_url = $parsed_url['scheme'] . '://' . $parsed_url['host'];
33 + $parsedReqUri = wp_parse_url($_SERVER['REQUEST_URI']);
34 + if (!isset($parsedReqUri['path'])) {
35 + return false;
44 36 }
37 + $reqUrl = $site_url . $parsedReqUri['path'];
38 + $downloadUrl = FileDownloadProvider::getBaseDownloadURL();
39 + $reqUrl = '/' !== \substr($reqUrl, -1) ? $reqUrl . '/' : $reqUrl;
40 + $downloadUrl = '/' !== \substr($downloadUrl, -1) ? $downloadUrl . '/' : $downloadUrl;
41 +
42 + switch ($reqUrl) {
43 + case $downloadUrl:{
44 + return true;
45 + }
46 + default:
47 + return false;
48 + }
49 + }
45 50 }