PHP notices on frontend and admin
-
Frontend:
Notice: Trying to access array offset on value of type bool in C:\Users\helga\Local Sites\sandbox\app\public\wp-content\plugins\wpstream\wpstream.php on line 89
Issue appears to be from calling
$share_img[0]
when$share_img
does not return a value.I would probably consider updating to something like:
add_action('wp_head', 'wpestate_add_custom_meta_to_header'); function wpestate_add_custom_meta_to_header(){ global $post; if ( is_singular('product') || is_singular('wpstream_product') ) { $share_img = get_the_post_thumbnail_url( $post, 'full' ); ?> <meta property='og:title' content="<?php print esc_html(get_the_title($post->ID)); ?>"/> <meta property="og:image" content="<?php print esc_url($share_img); ?>"/> <meta property="og:image:secure_url" content="<?php print esc_url($share_img); ?>" /> <meta property="og:description" content=" <?php print wp_strip_all_tags( $post->post_content);?>" /> <?php } }
Admin:
Notice: Undefined index: default in C:\Users\helga\Local Sites\sandbox\app\public\wp-content\plugins\wpstream\admin\class-wpstream-admin.php on line 852
`
and lastly, I noticed that the
wpstream_hide_buy_now_subscription_mode
function has a variable called$subscription_model = esc_html( get_option('wpstream_global_sub',true)) ;
and this is returning1
even when the plugin is newly installed and has no options saved. So the admin shows “global subscriptions” as off, but the front-end behaves as if it’s true.
- The topic ‘PHP notices on frontend and admin’ is closed to new replies.