PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
1.10.20 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 All 164 releases
← All changes | includes/Services/Landing_Profile.php +8 -4 1.9.15 → 1.10.20 View file →
@@ -59,9 +59,9 @@
59 59 return array(
60 60 'schema_version' => 2, // bumped: anon_id added (landing-experiments spec §5.1).
61 61 'locale' => get_locale(),
62 62 'plugin_version' => PLUGIN_VERSION,
63 - 'pro_active' => class_exists( '\WCPOS\WooCommercePOSPro\WooCommercePOSPro' ),
63 + 'pro_active' => wcpos_is_pro_active(),
64 64 'anon_id' => $anon_id,
65 65 'bootstrap_flags' => ( new Feature_Flags() )->get_landing_bootstrap_flags( $anon_id ),
66 66 );
67 67 }
@@ -88,9 +88,9 @@
88 88 *
89 89 * @return array
90 90 */
91 91 public function get_profile(): array {
92 - $cached = $this->get_cached_metrics();
92 + $cached = $this->get_metrics();
93 93 $user = wp_get_current_user();
94 94
95 95 return array_merge(
96 96 $cached,
@@ -96,9 +96,9 @@
96 96 $cached,
97 97 array(
98 98 'wc_version' => WC()->version,
99 99 'php_version' => PHP_VERSION,
100 - 'site_uuid' => get_option( 'woocommerce_pos_uuid', '' ),
100 + 'site_uuid' => wcpos_get_site_uuid(),
101 101 'user_uuid' => get_user_meta( $user->ID, '_woocommerce_pos_uuid', true ),
102 102 'user_role' => ! empty( $user->roles ) ? $user->roles[0] : '',
103 103 'site_domain' => $this->get_url_host( home_url() ),
104 104 'admin_domain' => $this->get_url_host( admin_url() ),
@@ -150,11 +150,15 @@
150 150
151 151 /**
152 152 * Get cached expensive metrics, computing them if the cache is stale.
153 153 *
154 + * Public because the analytics site profile reports the same store-size
155 + * numbers; sharing the cache keeps the count queries to one per hour
156 + * instead of one per consumer.
157 + *
154 158 * @return array
155 159 */
156 - private function get_cached_metrics(): array {
160 + public function get_metrics(): array {
157 161 $cached = get_transient( self::TRANSIENT_KEY );
158 162
159 163 if ( false !== $cached ) {
160 164 return $cached;