PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / trunk
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization vtrunk
4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 All 135 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Modules/Logger.php +18 -4 4.2.6 → trunk View file →
@@ -101,19 +101,33 @@
101 101 *
102 102 * @return bool Is logger active?
103 103 */
104 104 private function is_logger_active() {
105 + return self::is_logging_active( $this->product );
106 + }
107 +
108 + /**
109 + * Check if the logging consent is granted for a product.
110 + *
111 + * Shared with the other telemetry modules (e.g. the crash reporter) so the
112 + * consent semantics live in a single place.
113 + *
114 + * @param \ThemeisleSDK\Product $product Product to check.
115 + *
116 + * @return bool Is logging active for the product?
117 + */
118 + public static function is_logging_active( $product ) {
105 119 if ( apply_filters( 'themeisle_sdk_disable_telemetry', false ) ) {
106 120 return false;
107 121 }
108 122 $default = 'no';
109 123
110 - if ( ! $this->product->is_wordpress_available() ) {
124 + if ( ! $product->is_wordpress_available() ) {
111 125 $default = 'yes';
112 126 } else {
113 127 $all_products = Loader::get_products();
114 - foreach ( $all_products as $product ) {
115 - if ( $product->requires_license() ) {
128 + foreach ( $all_products as $registered_product ) {
129 + if ( $registered_product->requires_license() ) {
116 130 $default = 'yes';
117 131 break;
118 132 }
119 133 }
@@ -119,9 +133,9 @@
119 133 }
120 134 }
121 135
122 136
123 - return ( get_option( $this->product->get_key() . '_logger_flag', $default ) === 'yes' );
137 + return ( get_option( $product->get_key() . '_logger_flag', $default ) === 'yes' );
124 138 }
125 139 /**
126 140 * Add notification to queue.
127 141 *