• Resolved rafamem

    (@rafamem)


    First of all, thanks for this amazing plugin!

    These messages appear after installing the Yoast SEO plugin…

    Notice: Undefined index: description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_title in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_image in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_title in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_image in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_title in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_description in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Notice: Undefined index: twitter_image in /home/your-website/wp-content/plugins/directorist/includes/classes/class-seo.php on line 1372

    Possible solution:

    `foreach ( $yoast_seo_meta as $yoast_meta_key => $yoast_meta_value ) {
    if(!empty($yoast_meta_value)) {
    $seo_meta[$yoast_meta_key] = $yoast_meta_value;
    } else {
    $seo_meta[$yoast_meta_key] = (!empty($seo_meta[$yoast_meta_key])) ? $seo_meta[$yoast_meta_key] : [];
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Vijay Hardaha

    (@vijayhardaha)

    One line fix

    $seo_meta[ $yoast_meta_key ] = ! empty( $yoast_meta_value ) ? $yoast_meta_value : ( isset( $seo_meta[ $yoast_meta_key ] ) ? $seo_meta[ $yoast_meta_key ] : '' );

    error is coming because of calling $seo_meta[ $yoast_meta_key ] without checking if the key exists or not.

    another way is to define a new variable with meta keys and empty values and then use wp_parse_args merge values

    $default_meta = [META_KEYS_GOES_HERE];
    $seo_meta = wp_parse_args( (array)$args['seo_meta'], $default_meta );
    Thread Starter rafamem

    (@rafamem)

    Great! We await the update ??

    Plugin Support Rafiz Sejim

    (@rafizsejim)

    Greetings,

    Thank you @vijayhardaha for your contribution.

    We have noted it down and will proceed with it in the coming updates. Let us know if you guys run into any issues.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Yoast Warnings in debug mode’ is closed to new replies.