| @@ -170,9 +170,9 @@ | ||
| 170 | 170 | 'woocommerce.php', |
| 171 | 171 | ); |
| 172 | 172 | |
| 173 | 173 | $path_parts = explode( '/', $plugin ); |
| 174 | - $plugin_file = $path_parts ? array_pop( $path_parts ) : $plugin; | |
| 174 | + $plugin_file = array_pop( $path_parts ); | |
| 175 | 175 | |
| 176 | 176 | if ( ! in_array( $plugin_file, $plugin_whitelist, true ) ) { |
| 177 | 177 | $products = array_column( Jetpack_Plan::get_products(), 'product_slug' ); |
| 178 | 178 | |
| @@ -381,9 +381,9 @@ | ||
| 381 | 381 | */ |
| 382 | 382 | public static function get_new_conditional_recommendations() { |
| 383 | 383 | $conditional_recommendations = self::get_conditional_recommendations(); |
| 384 | 384 | $recommendations_data = Jetpack_Options::get_option( 'recommendations_data', array() ); |
| 385 | - $viewed_recommendations = isset( $recommendations_data['viewedRecommendations'] ) ? $recommendations_data['viewedRecommendations'] : array(); | |
| 385 | + $viewed_recommendations = $recommendations_data['viewedRecommendations'] ?? array(); | |
| 386 | 386 | |
| 387 | 387 | // array_diff returns a keyed array - reduce to unique values. |
| 388 | 388 | return array_unique( array_values( array_diff( $conditional_recommendations, $viewed_recommendations ) ) ); |
| 389 | 389 | } |