← All changes
|
vendor/codeinwp/themeisle-sdk/src/Modules/Logger.php
+4
-18
4.0.8
→
3.11.14
View file →
| @@ -101,33 +101,19 @@ | ||
| 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 ) { | |
| 119 | 105 | if ( apply_filters( 'themeisle_sdk_disable_telemetry', false ) ) { |
| 120 | 106 | return false; |
| 121 | 107 | } |
| 122 | 108 | $default = 'no'; |
| 123 | 109 | |
| 124 | - if ( ! $product->is_wordpress_available() ) { | |
| 110 | + if ( ! $this->product->is_wordpress_available() ) { | |
| 125 | 111 | $default = 'yes'; |
| 126 | 112 | } else { |
| 127 | 113 | $all_products = Loader::get_products(); |
| 128 | - foreach ( $all_products as $registered_product ) { | |
| 129 | - if ( $registered_product->requires_license() ) { | |
| 114 | + foreach ( $all_products as $product ) { | |
| 115 | + if ( $product->requires_license() ) { | |
| 130 | 116 | $default = 'yes'; |
| 131 | 117 | break; |
| 132 | 118 | } |
| 133 | 119 | } |
| @@ -133,9 +119,9 @@ | ||
| 133 | 119 | } |
| 134 | 120 | } |
| 135 | 121 | |
| 136 | 122 | |
| 137 | - return ( get_option( $product->get_key() . '_logger_flag', $default ) === 'yes' ); | |
| 123 | + return ( get_option( $this->product->get_key() . '_logger_flag', $default ) === 'yes' ); | |
| 138 | 124 | } |
| 139 | 125 | /** |
| 140 | 126 | * Add notification to queue. |
| 141 | 127 | * |