Skip to content

Commit

Permalink
address cr
Browse files Browse the repository at this point in the history
  • Loading branch information
Camwyn committed Apr 23, 2024
1 parent aa3f0f7 commit 9564da5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Telemetry/Opt_In/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,17 @@ public function get_opted_in_plugins() {
return $opted_in_plugins;
}

if ( ! isset( $option['plugins'] ) ) {
return $opted_in_plugins;
}

foreach ( $option['plugins'] as $stellar_slug => $plugin ) {
if ( ! isset( $plugin['wp_slug'] ) ) {
continue;
}
$plugin_path = trailingslashit( $site_plugins_dir ) . $plugin['wp_slug'];
if ( ! file_exists( $plugin_path ) ) {
continue;
}

$plugin_data = get_plugin_data( trailingslashit( $site_plugins_dir ) . $plugin['wp_slug'] );
$plugin_data = get_plugin_data( $plugin_path );

if ( isset( $plugin['optin'] ) && true === $plugin['optin'] ) {
$opted_in_plugins[] = [
Expand Down

0 comments on commit 9564da5

Please sign in to comment.