10% word-filter-plus

Code Review | Word Filter Plus

WordPress plugin Word Filter Plus scored10%from 54 tests.

About plugin

  • Plugin page: word-filter-plus
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 29, 2012
  • Latest release: Mar 21, 2014
  • Number of updates: 11
  • Update frequency: every 69.6 days
  • Top authors: BrianLayman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /6,898 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+36
    Use of undefined constant WFP_DEBUG - assumed 'WFP_DEBUG' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.74MB] [CPU: ▼51.04ms] Passed 4 tests

An overview of server-side resources used by Word Filter Plus
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.215.73 ▼35.90
Dashboard /wp-admin2.27 ▼1.0412.85 ▼38.97
Posts /wp-admin/edit.php2.27 ▼1.095.92 ▼41.14
Add New Post /wp-admin/post-new.php2.27 ▼3.626.69 ▼88.16
Media Library /wp-admin/upload.php2.27 ▼0.966.56 ▼27.35
Word Filter Plus /wp-admin/tools.php?page=wordfilterplus2.275.75

Server storage [IO: ▲0.55MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_word_filter_plus
New WordPress options
wfp_version
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Word Filter Plus: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.28 ▼1.061.88 ▲0.1743.44 ▼7.09
Dashboard /wp-admin2,210 ▲224.86 ▼1.01112.53 ▼4.3342.52 ▼4.19
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0235.06 ▼0.9335.83 ▲0.53
Add New Post /wp-admin/post-new.php1,537 ▲423.04 ▼0.11668.16 ▲68.3343.88 ▼6.98
Media Library /wp-admin/upload.php1,395 ▲134.27 ▲0.0793.93 ▼4.4241.02 ▼1.39
Word Filter Plus /wp-admin/tools.php?page=wordfilterplus8361.7226.2131.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+36
    Use of undefined constant WFP_DEBUG - assumed 'WFP_DEBUG' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_word_filter_plus
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • wfp_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+36
    Use of undefined constant WFP_DEBUG - assumed 'WFP_DEBUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+81
    Use of undefined constant WFP_MODE_OFF - assumed 'WFP_MODE_OFF' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+82
    Use of undefined constant WFP_MODE_PASSIVE - assumed 'WFP_MODE_PASSIVE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+83
    Use of undefined constant WFP_MODE_ACTIVE - assumed 'WFP_MODE_ACTIVE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+85
    Use of undefined constant WFP_OPTION_BATCH_SCHEDULE - assumed 'WFP_OPTION_BATCH_SCHEDULE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+86
    Use of undefined constant WFP_OPTION_MODE - assumed 'WFP_OPTION_MODE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+87
    Use of undefined constant WFP_OPTION_VER - assumed 'WFP_OPTION_VER' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+88
    Use of undefined constant WFP_OPTION_BATCH_SIZE - assumed 'WFP_OPTION_BATCH_SIZE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+89
    Use of undefined constant WFP_OPTION_BATCH_SLEEP - assumed 'WFP_OPTION_BATCH_SLEEP' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+90
    Use of undefined constant WFP_OPTION_ITERATION - assumed 'WFP_OPTION_ITERATION' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+92
    Use of undefined constant DEFAULT_BATCH_SIZE - assumed 'DEFAULT_BATCH_SIZE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+93
    Use of undefined constant DEFAULT_BATCH_SLEEP - assumed 'DEFAULT_BATCH_SLEEP' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+95
    Use of undefined constant WFP_SCHEDULE_FIVE - assumed 'WFP_SCHEDULE_FIVE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+96
    Use of undefined constant WFP_SCHEDULE_FIFTEEN - assumed 'WFP_SCHEDULE_FIFTEEN' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+97
    Use of undefined constant WFP_SCHEDULE_THIRTY - assumed 'WFP_SCHEDULE_THIRTY' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+98
    Use of undefined constant WFP_SCHEDULE_SIXTY - assumed 'WFP_SCHEDULE_SIXTY' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+100
    Use of undefined constant WFP_POST_EVENT - assumed 'WFP_POST_EVENT' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/word-filter-plus.php+101
    Use of undefined constant WFP_COMMENT_EVENT - assumed 'WFP_COMMENT_EVENT' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+36
    Use of undefined constant WFP_PLUGIN_TAB1_SLUG - assumed 'WFP_PLUGIN_TAB1_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+37
    Use of undefined constant WFP_TAB1_SLUG - assumed 'WFP_TAB1_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+38
    Use of undefined constant WFP_TAB1_LABEL - assumed 'WFP_TAB1_LABEL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+40
    Use of undefined constant WFP_PLUGIN_TAB2_SLUG - assumed 'WFP_PLUGIN_TAB2_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+41
    Use of undefined constant WFP_TAB2_SLUG - assumed 'WFP_TAB2_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+42
    Use of undefined constant WFP_TAB2_LABEL - assumed 'WFP_TAB2_LABEL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+44
    Use of undefined constant WFP_PLUGIN_TAB3_SLUG - assumed 'WFP_PLUGIN_TAB3_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+45
    Use of undefined constant WFP_TAB3_SLUG - assumed 'WFP_TAB3_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+46
    Use of undefined constant WFP_TAB3_LABEL - assumed 'WFP_TAB3_LABEL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+48
    Use of undefined constant WFP_PLUGIN_TAB4_SLUG - assumed 'WFP_PLUGIN_TAB4_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+49
    Use of undefined constant WFP_TAB4_SLUG - assumed 'WFP_TAB4_SLUG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+50
    Use of undefined constant WFP_TAB4_LABEL - assumed 'WFP_TAB4_LABEL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+52
    Use of undefined constant WFP_START_POST_NONCE - assumed 'WFP_START_POST_NONCE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+53
    Use of undefined constant WFP_START_COMMENT_NONCE - assumed 'WFP_START_COMMENT_NONCE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+54
    Use of undefined constant WFP_CANCEL_POST_NONCE - assumed 'WFP_CANCEL_POST_NONCE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Warning in wp-content/plugins/word-filter-plus/wfp-settings.php+55
    Use of undefined constant WFP_CANCEL_COMMENT_NONCE - assumed 'WFP_CANCEL_COMMENT_NONCE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/tools.php?page=wordfilterplus
    • > Notice in wp-content/plugins/word-filter-plus/wfp-settings.php+384
    Undefined index: updated

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The Options page which controls which mode (Off/Active/Passive) under which the plugin will operate.), #2 (The Replacement screen with some examples of use.), #3 (The Replacement screen with the inline help displayed), #4 (The Batch screen which allows you to update all existing content on your site at once. This screen lets you configure, start and cancel batch operations.), #5 (The Import/Export screen which allows you to upload a CSV file, or save the existing replacement data to your computer.)
Please take inspiration from this readme.txt

word-filter-plus/word-filter-plus.php Passed 13 tests

Analyzing the main PHP file in "Word Filter Plus" version 2.0
85 characters long description:
Filter or replace words or phrases in posts, pages, excerpts, titles and/or comments.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,167 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP41591231,167

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity61.00
▷ Minimum class complexity39.00
▷ Maximum class complexity73.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods52
▷ Static methods00.00%
▷ Public methods4790.38%
▷ Protected methods00.00%
▷ Private methods59.62%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants34
▷ Global constants34100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.48MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png111.79KB35.65KB▼ 68.11%
screenshot-5.png68.77KB21.39KB▼ 68.90%
screenshot-1.png98.61KB30.27KB▼ 69.30%
screenshot-3.png119.45KB39.65KB▼ 66.81%
screenshot-2.png94.96KB28.48KB▼ 70.01%