JSM's Block Filter Output – Monitor and Fix Incorrectly Coded Content Filters (and More)

Description

Monitor the content filter and fix incorrectly coded filter hooks (that send text to the webpage instead of returning it, as all filter hooks must).

Read about the issue in the official blog for the Plugin Review Team.

A notice is sent to the PHP error log when webpage output is detected:

[01-Oct-2017 01:48:28 UTC] Block Filter Output: The “ClassName::echoText” filter hook with priority 10 in the “the_content” filter has mistakenly provided some webpage output. All WordPress filter hooks must return their text – not send it to the webpage output. Please contact the author of that filter hook and report this issue as a coding error / bug. Incorrect webpage output:
—–BEGIN OUTPUT—–
<strong>Some output that should have been returned instead of echo’ed.</strong>
—–END OUTPUT—–

The plugin is fully tested and compatible with PHP v7.x (PHP v5.3 or better required).

Power-users / Developers

If you haven’t enabled the WP_DEBUG constant yet, you should set the WP_DEBUG constant to true in your wp-config.php file to find out about these and any other PHP / WordPress coding errors. 😉

The plugin only monitors the “the_content” filter by default. You can customize the list of monitored filters by defining the JSM_BFO_FILTER_NAMES constant.

define( 'JSM_BFO_FILTER_NAMES', array(
    'the_title',
    'the_content',
    'the_excerpt',
    'comment_text',
    'widget_title',
    'widget_text',
) );

You can also monitor the special WordPress “all” filter, although this is not recommended as it may have a negative effect on your site’s performance:

define( 'JSM_BFO_FILTER_NAMES', 'all' );

Plugins Using the BFO Library

The WPSSO Core plugin uses the BFO library when the “Apply WordPress Content Filters” option is enabled (default) in its Advanced settings page.

Additional Documentation

  • None

Installation

Automated Install

  1. Go to the wp-admin/ section of your website.
  2. Select the Plugins menu item.
  3. Select the Add New sub-menu item.
  4. In the Search box, enter the plugin name.
  5. Click the Search Plugins button.
  6. Click the Install Now link for the plugin.
  7. Click the Activate Plugin link.

Semi-Automated Install

  1. Download the plugin archive file.
  2. Go to the wp-admin/ section of your website.
  3. Select the Plugins menu item.
  4. Select the Add New sub-menu item.
  5. Click on Upload link (just under the Install Plugins page title).
  6. Click the Browse… button.
  7. Navigate your local folders / directories and choose the zip file you downloaded previously.
  8. Click on the Install Now button.
  9. Click the Activate Plugin link.

FAQ

Frequently Asked Questions

  • None
Installation Instructions

Automated Install

  1. Go to the wp-admin/ section of your website.
  2. Select the Plugins menu item.
  3. Select the Add New sub-menu item.
  4. In the Search box, enter the plugin name.
  5. Click the Search Plugins button.
  6. Click the Install Now link for the plugin.
  7. Click the Activate Plugin link.

Semi-Automated Install

  1. Download the plugin archive file.
  2. Go to the wp-admin/ section of your website.
  3. Select the Plugins menu item.
  4. Select the Add New sub-menu item.
  5. Click on Upload link (just under the Install Plugins page title).
  6. Click the Browse… button.
  7. Navigate your local folders / directories and choose the zip file you downloaded previously.
  8. Click on the Install Now button.
  9. Click the Activate Plugin link.

Contributors & Developers

“JSM's Block Filter Output – Monitor and Fix Incorrectly Coded Content Filters (and More)” is open source software. The following people have contributed to this plugin.

Contributors

“JSM's Block Filter Output – Monitor and Fix Incorrectly Coded Content Filters (and More)” has been translated into 3 locales. Thank you to the translators for their contributions.

Translate “JSM's Block Filter Output – Monitor and Fix Incorrectly Coded Content Filters (and More)” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

Repositories

Version Numbering

Version components: {major}.{minor}.{bugfix}[-{stage}.{level}]

  • {major} = Major structural code changes / re-writes or incompatible API changes.
  • {minor} = New functionality was added or improved in a backwards-compatible manner.
  • {bugfix} = Backwards-compatible bug fixes or small improvements.
  • {stage}.{level} = Pre-production release: dev < a (alpha) < b (beta) < rc (release candidate).

Changelog / Release Notes

Version 1.1.2 (2017/10/28)

  • New Features
    • None
  • Improvements
    • Updated the notice CSS to fit within the Gutenberg editor container.
  • Bugfixes
    • None
  • Developer Notes
    • None