Skip to content

Commit

Permalink
[static-analysis] Fix rule - Access to an undefined property object .
Browse files Browse the repository at this point in the history
  • Loading branch information
bahiirwa committed Sep 10, 2024
1 parent 0ebb174 commit 5999f7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion includes/fs-plugin-info-dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ function _get_addon_info_filter( $data, $action = '', $args = null ) {
} else {
// Couldn't find plugin on .org.
$selected_addon->is_wp_org_compliant = false;
$data->wp_org_missing = true;

// Plugin is missing, not on Freemius nor WP.org.
$data->wp_org_missing = true;
}

$data->fs_missing = ( ! $has_free_plan || $data->wp_org_missing );
Expand Down
10 changes: 6 additions & 4 deletions templates/plugin-info/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@

$features_plan_map = array();
foreach ( $plans as $plan ) {
/**
* @var FS_Plugin_Plan $plan
*/
if (!empty($plan->features) && is_array($plan->features)) {
foreach ( $plan->features as $feature ) {
$features_plan_map[ $feature->id ] = array( 'feature' => $feature, 'plans' => array() );

if ( ! empty( $plan->id ) ) {
$features_plan_map[ $feature->id ]['plans'][ $plan->id ] = $feature;
if ( ! isset( $features_plan_map[ $feature->id ] ) ) {
$features_plan_map[ $feature->id ] = array( 'feature' => $feature, 'plans' => array() );
}
$features_plan_map[ $feature->id ]['plans'][ $plan->id ] = $feature;
}
}

Expand Down

0 comments on commit 5999f7f

Please sign in to comment.