PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
← All changes | includes/Services/Analytics.php +22 -2 1.10.11.10.19 View file →
@@ -128,9 +128,13 @@
128 128 if ( null !== $this->enabled_cache ) {
129 129 return $this->enabled_cache;
130 130 }
131 131
132 - $consent = Settings::instance()->tracking_consent();
132 + // The PERSISTED consent, not the filtered read view — otherwise any
133 + // plugin filtering woocommerce_pos_general_settings could switch
134 + // telemetry on for a merchant who declined it. Same gate as
135 + // Services\Error_Reporter.
136 + $consent = Settings::instance()->raw_tracking_consent();
133 137 $this->enabled_cache = ( 'allowed' === $consent );
134 138
135 139 return $this->enabled_cache;
136 140 }
@@ -414,11 +418,27 @@
414 418 */
415 419 private function get_default_properties(): array {
416 420 return array(
417 421 'plugin_version' => PLUGIN_VERSION,
418 - 'pro_active' => class_exists( '\WCPOS\WooCommercePOSPro\WooCommercePOSPro' ),
422 + 'pro_active' => $this->is_pro_active(),
419 423 'locale' => get_locale(),
420 424 );
425 + }
426 +
427 + /**
428 + * Whether the Pro plugin is active, safe to call before Init has run.
429 + *
430 + * Same situation as get_site_id(): the deactivation hook can fire in a
431 + * request where the WooCommerce check failed, Init never ran, and
432 + * wcpos-functions.php is not loaded. Fall back to the constant the helper
433 + * itself reads rather than fataling on the way out.
434 + */
435 + private function is_pro_active(): bool {
436 + if ( ! \function_exists( 'wcpos_is_pro_active' ) ) {
437 + return \defined( 'WCPOS\WooCommercePOSPro\VERSION' );
438 + }
439 +
440 + return wcpos_is_pro_active();
421 441 }
422 442
423 443 /**
424 444 * Dispatch a non-blocking HTTPS POST to the PostHog ingestion host.