Undefined variable warnings in 1.2.0
-
The plug-in may generate undefined variable warnings. Here are to examples:
Notice: Undefined variable: meta_title in /nfs/c08/h03/mnt/118357/domains/test.getawaygrey.com/html/blog/wp-content/plugins/wp-social-seo-booster/includes/wps-seo-booster-ogp.php on line 429
Notice: Undefined variable: meta_description in /nfs/c08/h03/mnt/118357/domains/test.getawaygrey.com/html/blog/wp-content/plugins/wp-social-seo-booster/includes/wps-seo-booster-ogp.php on line 430The relevant lines are:
if( $meta_title ) echo '<meta itemprop="name" content="' . esc_attr( $meta_title ) . '">' . "\n";
if( $meta_description ) echo '<meta itemprop="description" content="' . esc_attr( $meta_description ) . '">' . "\n";
if( $meta_image ) echo '<meta itemprop="image" content="' . esc_url( $meta_image ) . '" />' . "\n";
These lines test the variable value directly, rather than whether the variable is set.
isset($meta_...)or! empty($meta_...)would prevent the warnings. Other lines also test variables directly but did not generate warnings on my WP installation.
The topic ‘Undefined variable warnings in 1.2.0’ is closed to new replies.