Manual Related Posts Plugin throws errors when WP_DEBUG set to true
-
When your plugin is used with
WP_DEBUG===true
it throws errors.To reproduce, change your
wp-config.php
to include this setting:define( 'WP_DEBUG', true );
Next delete the record in
wp_options
whereoption_name='bawmrp'
just to be sure.Then visit your settings page and select “Posts” and click save.
Now visit any post on the front-end of the website. You will see something similar to the following:
<pre>Notice: Undefined index: in_content in /var/www/blog/content/plugins/baw-manual-related-posts/inc/frontend-noajax.inc.php on line 25 Call Stack: 0.0006 384160 1. {main}() /var/www/index.php:0 0.0014 384400 2. require('/var/www/blog/index.php') /var/www/index.php:8 0.0022 384760 3. require('/var/www/blog/wp/wp-blog-header.php') /var/www/blog/index.php:19 0.7763 6256816 4. require_once('/var/www/blog/wp/wp-includes/template-loader.php') /var/www/blog/wp/wp-blog-header.php:19 0.7843 6331016 5. apply_filters() /var/www/blog/wp/wp-includes/template-loader.php:73 0.7843 6331416 6. WP_Hook->apply_filters() /var/www/blog/wp/wp-includes/plugin.php:203 0.7843 6349360 7. MYLib\Expose_Theme_Object::_template_include_999() /var/www/blog/wp/wp-includes/class-wp-hook.php:286 0.7850 6353160 8. include('/var/www/blog/content/themes/mytheme/single.php') /var/www/blog/content/mu-plugins/mylib/modules/core-expose-theme-object.php:60 0.9461 9351976 9. get_template_part() /var/www/blog/content/themes/mytheme/single.php:87 0.9461 9352496 10. locate_template() /var/www/blog/wp/wp-includes/general-template.php:155 0.9466 9352576 11. load_template() /var/www/blog/wp/wp-includes/template.php:647 0.9482 9353208 12. require('/var/www/blog/content/themes/mytheme/content-single.php') /var/www/blog/wp/wp-includes/template.php:690 0.9551 9469928 13. the_content() /var/www/blog/content/themes/mytheme/content-single.php:205 0.9552 9482240 14. apply_filters() /var/www/blog/wp/wp-includes/post-template.php:240 0.9552 9482640 15. WP_Hook->apply_filters() /var/www/blog/wp/wp-includes/plugin.php:203 0.9553 9484680 16. bawmrp_the_content() /var/www/blog/wp/wp-includes/class-wp-hook.php:286</pre>
- This topic was modified 6 years, 9 months ago by . Reason: Formatting
- This topic was modified 6 years, 9 months ago by .
- This topic was modified 6 years, 9 months ago by .
- This topic was modified 6 years, 9 months ago by .
- This topic was modified 6 years, 9 months ago by .
- This topic was modified 6 years, 9 months ago by . Reason: Added plugin name to title
- The topic ‘Manual Related Posts Plugin throws errors when WP_DEBUG set to true’ is closed to new replies.