PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 2.11.9
Independent Analytics – WordPress Analytics Plugin v2.11.9
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / IAWP / Plugin_Conflict_Detector.php
independent-analytics / IAWP Last commit date
AJAX 1 year ago Admin_Page 1 year ago Click_Tracking 1 year ago Custom_WordPress_Columns 1 year ago Data_Pruning 1 year ago Date_Picker 1 year ago Date_Range 1 year ago Ecommerce 1 year ago Email_Reports 1 year ago Filter_Lists 1 year ago Form_Submissions 1 year ago Integrations 1 year ago Interval 1 year ago Menu_Bar_Stats 1 year ago Migrations 1 year ago Models 1 year ago Overview 1 year ago Public_API 1 year ago Rows 1 year ago Statistics 1 year ago Tables 1 year ago Utils 1 year ago Appearance.php 1 year ago Campaign_Builder.php 1 year ago Capability_Manager.php 1 year ago Chart.php 1 year ago Chart_Data.php 1 year ago Click_Tracking.php 1 year ago Cron_Job.php 1 year ago Cron_Manager.php 1 year ago Current_Traffic_Finder.php 1 year ago Dashboard_Options.php 1 year ago Dashboard_Widget.php 2 years ago Database.php 1 year ago Database_Manager.php 1 year ago Empty_Report_Option.php 2 years ago Env.php 1 year ago Filters.php 1 year ago Geo_Database_Background_Job.php 1 year ago Geo_Database_Manager.php 1 year ago Geoposition.php 1 year ago Icon_Directory.php 2 years ago Icon_Directory_Factory.php 2 years ago Illuminate_Builder.php 1 year ago Independent_Analytics.php 1 year ago Interrupt.php 1 year ago Known_Referrers.php 1 year ago MainWP.php 1 year ago Map.php 1 year ago Map_Data.php 1 year ago Migration_Fixer_Job.php 1 year ago Patch.php 1 year ago Payload_Validator.php 1 year ago Plugin_Conflict_Detector.php 1 year ago Plugin_Group.php 1 year ago Plugin_Group_Option.php 2 years ago Query.php 1 year ago Query_Taps.php 1 year ago Quick_Stats.php 1 year ago REST_API.php 1 year ago Real_Time.php 1 year ago Report.php 1 year ago Report_Finder.php 1 year ago Report_Options_Parser.php 2 years ago Resource_Identifier.php 1 year ago Settings.php 1 year ago Sort_Configuration.php 1 year ago Tables.php 1 year ago Track_Resource_Changes.php 1 year ago View.php 1 year ago View_Counter.php 1 year ago Views_Over_Time_Finder.php 1 year ago WP_Option_Cache_Bust.php 2 years ago
Plugin_Conflict_Detector.php
205 lines
1 <?php
2
3 namespace IAWP;
4
5 use IAWP\Utils\String_Util;
6 /** @internal */
7 class Plugin_Conflict_Detector
8 {
9 private $plugin;
10 private $error;
11 public function __construct()
12 {
13 $check = $this->run_conflict_check();
14 if (!\is_null($check)) {
15 $this->plugin = $check['plugin'];
16 $this->error = $check['error'];
17 }
18 }
19 /**
20 * Did the health check pass?
21 *
22 * @return bool
23 */
24 public function has_conflict() : bool
25 {
26 return !empty($this->error);
27 }
28 /**
29 * Returns the plugin name, if any
30 *
31 * @return string|null
32 */
33 public function get_plugin() : ?string
34 {
35 return $this->plugin;
36 }
37 /**
38 * Returns the health check error, if any
39 *
40 * @return string|null
41 */
42 public function get_error() : ?string
43 {
44 return $this->error;
45 }
46 public function plugin_requiring_logged_in_tracking()
47 {
48 if (\is_plugin_active('woocommerce/woocommerce.php')) {
49 return 'WooCommerce';
50 } elseif (\is_plugin_active('surecart/surecart.php')) {
51 return 'SureCart';
52 } elseif (\is_plugin_active('paid-memberships-pro/paid-memberships-pro.php')) {
53 return 'Paid Memberships Pro';
54 } elseif (\is_plugin_active('ultimate-member/ultimate-member.php')) {
55 return 'Ultimate Member';
56 } elseif (\is_plugin_active('simple-membership/simple-wp-membership.php')) {
57 return 'Simple WordPress Membership';
58 } elseif (\is_plugin_active('members/members.php')) {
59 return 'Members plugin';
60 }
61 return \false;
62 }
63 /**
64 * @return string|null Returns a string error message if the health check fails
65 */
66 private function run_conflict_check() : ?array
67 {
68 if (\is_plugin_active('disable-wp-rest-api/disable-wp-rest-api.php')) {
69 return ['plugin' => 'disable-wp-rest-api', 'error' => \__('The "Disable WP REST API" plugin needs to be deactivated because Independent Analytics uses the REST API to record visits.', 'independent-analytics')];
70 }
71 if (\is_plugin_active('all-in-one-wp-security-and-firewall/wp-security.php')) {
72 $settings = \get_option('aio_wp_security_configs', []);
73 if (\array_key_exists('aiowps_disallow_unauthorized_rest_requests', $settings)) {
74 if ($settings['aiowps_disallow_unauthorized_rest_requests'] == 1) {
75 return ['plugin' => 'wp-security', 'error' => \__('The "All In One WP Security" plugin is blocking REST API requests, which Independent Analytics needs to record views. Please disable this setting via the WP Security > Miscellaneous menu.', 'independent-analytics')];
76 }
77 }
78 }
79 if (\is_plugin_active('disable-json-api/disable-json-api.php')) {
80 $settings = \get_option('disable_rest_api_options', []);
81 if (\array_key_exists('roles', $settings)) {
82 if ($settings['roles']['none']['default_allow'] == \false) {
83 if ($settings['roles']['none']['allow_list']['/iawp/search'] == \false) {
84 return ['plugin' => 'disable-json-api', 'error' => \__('The "Disable REST API" plugin is blocking REST API requests for unauthenticated users, which Independent Analytics needs to record views. Please enable the /iawp/search route, so Independent Analytics can track your visitors.', 'independent-analytics')];
85 }
86 }
87 }
88 }
89 if (\is_plugin_active('disable-xml-rpc-api/disable-xml-rpc-api.php')) {
90 $settings = \get_option('dsxmlrpc-settings');
91 if (\array_key_exists('json-rest-api', $settings)) {
92 if ($settings['json-rest-api'] == 1) {
93 return ['plugin' => 'disable-xml-rpc-api', 'error' => \__('The "Disable XML-RPC-API" plugin is blocking REST API requests, which Independent Analytics needs to record views. Please visit the Security Settings menu and turn off the "Disable JSON REST API" option, so Independent Analytics can track your visitors.', 'independent-analytics')];
94 }
95 }
96 }
97 if (\is_plugin_active('wpo-tweaks/wordpress-wpo-tweaks.php')) {
98 return ['plugin' => 'wordpress-wpo-tweaks', 'error' => \__('The "WPO Tweaks & Optimizations" plugin needs to be deactivated because it is disabling the REST API, which Independent Analytics uses to record visits.', 'independent-analytics')];
99 }
100 if (\is_plugin_active('all-in-one-intranet/basic_all_in_one_intranet.php')) {
101 return ['plugin' => 'basic_all_in_one_intranet', 'error' => \__('The "All-In-One Intranet" plugin needs to be deactivated because it is disabling the REST API, which Independent Analytics uses to record visits. You may want to try the "My Private Site" plugin instead.', 'independent-analytics')];
102 }
103 if (\is_plugin_active('wp-security-hardening/wp-hardening.php')) {
104 $settings = \get_option('whp_fixer_option');
105 if (\array_key_exists('disable_json_api', $settings)) {
106 if ($settings['disable_json_api'] != 'off') {
107 return ['plugin' => 'wp-hardening', 'error' => \__('The "WP Hardening" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the WP Hardening > Security Fixers menu and turn off the "Disable WP API JSON" option, so Independent Analytics can track your visitors.', 'independent-analytics')];
108 }
109 }
110 }
111 if (\is_plugin_active('wp-rest-api-authentication/miniorange-api-authentication.php')) {
112 $settings = \get_option('mo_api_authentication_protectedrestapi_route_whitelist');
113 if (\in_array('/iawp/search', $settings)) {
114 return ['plugin' => 'miniorange-api-authentication', 'error' => \__('The "WordPress REST API Authentication" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the miniOrange API Authentication > Protected REST APIs menu and uncheck the "/iawp/search" box to allow Independent Analytics to track your visitors.', 'independent-analytics')];
115 }
116 }
117 if (\is_plugin_active('ninjafirewall/ninjafirewall.php')) {
118 $settings = \get_option('nfw_options');
119 if (\array_key_exists('no_restapi', $settings)) {
120 if ($settings['no_restapi'] == 1) {
121 return ['plugin' => 'ninjafirewall', 'error' => \__('The "NinjaFirewall" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the NinjaFirewall > Firewall Policies menu and uncheck the "Block any access to the API" checkbox to allow Independent Analytics to track your visitors.', 'independent-analytics')];
122 }
123 }
124 }
125 if (\is_plugin_active('wp-cerber/wp-cerber.php')) {
126 // This option has been renamed before. If there's an issue in here, check that it wasn't renamed again.
127 $settings = \get_option('cerber_configuration');
128 if ($settings === \false) {
129 $settings = \get_option('cerber-hardening');
130 }
131 if ($settings !== \false) {
132 if (\array_key_exists('norest', $settings)) {
133 if ($settings['norest'] === '1') {
134 if (\is_array($settings['restwhite']) && !\in_array('iawp', $settings['restwhite']) || \is_string($settings['restwhite']) && !String_Util::str_contains($settings['restwhite'], 'iawp')) {
135 return ['plugin' => 'wp-cerber', 'error' => \__('The "WP Cerber" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the WP Cerber > Dashboard > Hardening menu and add "iawp" to your allowed namespaces. This will keep the REST API locked down while allowing requests for Independent Analytics.', 'independent-analytics')];
136 }
137 }
138 }
139 }
140 }
141 if (\is_plugin_active('wp-simple-firewall/icwp-wpsf.php')) {
142 // This option has been renamed before. If there's an issue in here, check that it wasn't renamed again.
143 $settings = \get_option('icwp_wpsf_opts_all');
144 if ($settings === \false) {
145 $settings = \get_option('icwp_wpsf_opts_free');
146 }
147 if (\array_key_exists('lockdown', $settings)) {
148 if (\array_key_exists('disable_anonymous_restapi', $settings['lockdown'])) {
149 if ($settings['lockdown']['disable_anonymous_restapi'] == 'Y') {
150 if (\array_key_exists('api_namespace_exclusions', $settings['lockdown'])) {
151 if (!\in_array('iawp', $settings['lockdown']['api_namespace_exclusions'])) {
152 return ['plugin' => 'icwp-wpsf', 'error' => \__('The "Shield Security" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the Shield Security > Config > Lockdown menu and add "iawp" to your allowed namespaces. This will keep the REST API locked down while allowing requests for Independent Analytics.', 'independent-analytics')];
153 }
154 }
155 }
156 }
157 }
158 }
159 if (\is_plugin_active('wp-hide-security-enhancer/wp-hide.php')) {
160 $settings = \get_option('wph_settings');
161 if (\array_key_exists('module_settings', $settings)) {
162 if (\array_key_exists('disable_json_rest_v2', $settings['module_settings'])) {
163 if ($settings['module_settings']['disable_json_rest_v2'] == 'yes') {
164 return ['plugin' => 'wp-hide', 'error' => \__('The "WP Hide" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the WP Hide > Rewrite URLs menu and switch the "Disable JSON REST V2 service" option to "No."', 'independent-analytics')];
165 }
166 }
167 if (\array_key_exists('block_json_rest', $settings['module_settings'])) {
168 if ($settings['module_settings']['block_json_rest'] == 'yes' || $settings['module_settings']['block_json_rest'] == 'non-logged-in') {
169 return ['plugin' => 'wp-hide', 'error' => \__('The "WP Hide" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the WP Hide > Rewrite URLs menu and switch the "Block any JSON REST calls" option to "No."', 'independent-analytics')];
170 }
171 }
172 }
173 }
174 if (\is_plugin_active('admin-site-enhancements/admin-site-enhancements.php')) {
175 $settings = \get_option('admin_site_enhancements');
176 if (\array_key_exists('disable_rest_api', $settings)) {
177 if ($settings['disable_rest_api']) {
178 return ['plugin' => 'admin-site-enhancements', 'error' => \__('The "Admin and Site Enhancements" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the Tools > Enhancements menu, click on the "Disable Components" section, and deselect the "Disable REST API" setting to allow Independent Analytics to track your visitors.', 'independent-analytics')];
179 }
180 }
181 }
182 if (\is_plugin_active('admin-site-enhancements-pro/admin-site-enhancements.php')) {
183 $settings = \get_option('admin_site_enhancements');
184 if (\is_array($settings) && \array_key_exists('disable_rest_api', $settings)) {
185 if ($settings['disable_rest_api']) {
186 if (\is_string($settings['disable_rest_api_excluded_routes']) && !String_Util::str_contains($settings['disable_rest_api_excluded_routes'], 'iawp/search')) {
187 return ['plugin' => 'admin-site-enhancements', 'error' => \__('The "Admin and Site Enhancements Pro" plugin is blocking the REST API, which Independent Analytics needs to record views. Please visit the Tools > Enhancements menu, click on the "Disable Components" section, and then click the "Expand" link under "Disable REST API." You can then enter "iawp/search" into the textarea to whitelist the route used by Independent Analytics.', 'independent-analytics')];
188 }
189 }
190 }
191 }
192 if (\is_plugin_active('autoptimize/autoptimize.php')) {
193 if (\get_option('autoptimize_js_aggregate') == 'on' && \get_option('autoptimize_js_include_inline') == 'on') {
194 return ['plugin' => 'autoptimize', 'error' => \__('A setting in the "Autoptimize" plugin is preventing Independent Analytics from tracking visitors. Please visit the Settings > Autoptimize menu and uncheck the "Also aggregate inline JS" option.', 'independent-analytics')];
195 }
196 }
197 if (\is_plugin_active('patchstack/patchstack.php')) {
198 if (\get_option('patchstack_json_is_disabled') == '1') {
199 return ['plugin' => 'patchstack', 'error' => \__('The Patchstack Security plugin has disabled the REST API, which Independent Analytics needs to record visitors. Please login to the Patchstack app, navigate to the Hardening menu for this site, and turn off the "Restrict WP REST API access" option.', 'independent-analytics')];
200 }
201 }
202 return null;
203 }
204 }
205