84% cf7-manual-spam-blocker

Code Review | WordPress Spam Blocker | Stop Spam for Contact Form 7, WP Forms and Formidable Forms

WordPress plugin WordPress Spam Blocker | Stop Spam for Contact Form 7, WP Forms and Formidable Forms scored84%from 54 tests.

About plugin

  • Plugin page: cf7-manual-spam-b...
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 19, 2019
  • Latest release: Sep 8, 2023
  • Number of updates: 25
  • Update frequency: every 65.4 days
  • Top authors: ak.singla (72%)tjomak (32%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /3,411 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼3.26ms] Passed 4 tests

An overview of server-side resources used by WordPress Spam Blocker | Stop Spam for Contact Form 7, WP Forms and Formidable Forms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3341.85 ▲1.56
Dashboard /wp-admin3.62 ▲0.3146.73 ▼1.23
Posts /wp-admin/edit.php3.73 ▲0.3747.29 ▼2.18
Add New Post /wp-admin/post-new.php6.22 ▲0.3387.83 ▼11.17
Media Library /wp-admin/upload.php3.54 ▲0.3140.26 ▲2.68
WordPress Spam Blocker /wp-admin/admin.php?page=cf7msb-settings3.5133.75

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 10 new options
New WordPress options
cf7msb_settings
db_upgraded
widget_theysaidso_widget
cf7msb_cf7
widget_recent-comments
widget_recent-posts
cf7msb_version_lite
can_compress_scripts
cf7msb_install_date
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Spam Blocker | Stop Spam for Contact Form 7, WP Forms and Formidable Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲9913.36 ▼1.051.63 ▼0.5030.35 ▼20.54
Dashboard /wp-admin2,227 ▲395.88 ▲0.9896.28 ▼9.4238.06 ▼2.95
Posts /wp-admin/edit.php2,110 ▲182.04 ▼0.0240.32 ▲0.6133.12 ▼0.93
Add New Post /wp-admin/post-new.php1,543 ▲123.39 ▲5.12684.32 ▲79.7051.77 ▼5.45
Media Library /wp-admin/upload.php1,409 ▲244.37 ▲0.1999.56 ▼20.2241.90 ▼4.41
WordPress Spam Blocker /wp-admin/admin.php?page=cf7msb-settings1,0921.7024.3736.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/class.wpforms.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/class.formidable-forms.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/support-page.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/class.wpforms.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/cf7-manual-spam-blocker/cf7-manual-spam-blocker.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/admin-pages.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/admin-functions.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/cf7msb-integrate-honeypot.php:42
    • > PHP Warning
      Use of undefined constant CF7Msb_PLUGIN_PREFIX - assumed 'CF7Msb_PLUGIN_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-manual-spam-blocker/libs/admin/support-page.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

cf7-manual-spam-blocker/cf7-manual-spam-blocker.php 92% from 13 tests

The entry point to "WordPress Spam Blocker | Stop Spam for Contact Form 7, WP Forms and Formidable Forms" version 2.0.3 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 306 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,866 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP133972321,685
JavaScript22210104
CSS26777

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.22
▷ Minimum class complexity3.00
▷ Maximum class complexity83.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods42
▷ Static methods1126.19%
▷ Public methods4197.62%
▷ Protected methods00.00%
▷ Private methods12.38%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.34MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/js/img/Cover-800x250.png117.39KB54.44KB▼ 53.62%
libs/js/img/icon-check.png2.24KB2.23KB0.17%
libs/js/img/Cover-800x225.png107.07KB48.56KB▼ 54.65%
libs/js/img/plugin-notice-logo.png22.18KB6.58KB▼ 70.31%
libs/js/img/Cover-800x200.png99.87KB45.25KB▼ 54.69%