78% wpcf7-anti-spam

Code Review | WPCF7 Anti-spam

WordPress plugin WPCF7 Anti-spam scored78%from 54 tests.

About plugin

  • Plugin page: wpcf7-anti-spam
  • Plugin version: 1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2
  • WordPress version: 6.3.1
  • First release: Jan 21, 2020
  • Latest release: Apr 2, 2020
  • Number of updates: 3
  • Update frequency: every 24.3 days
  • Top authors: cronagency (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /435 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.07MB] [CPU: ▼5.36ms] Passed 4 tests

A check of server-side resources used by WPCF7 Anti-spam
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.25 ▼5.79
Dashboard /wp-admin3.38 ▲0.0754.01 ▲1.08
Posts /wp-admin/edit.php3.43 ▲0.0748.55 ▼3.83
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.32 ▼12.88
Media Library /wp-admin/upload.php3.30 ▲0.0738.75 ▲3.59
WPCF7 Anti-spam /wp-admin/options-general.php?page=wpcf7_antispam3.2430.20

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 16 new options
New WordPress options
wpcf7_antispam_hash
wpcf7_antispam_mail_cc
can_compress_scripts
widget_theysaidso_widget
wpcf7_antispam_collector
widget_recent-posts
widget_recent-comments
wpcf7_antispam_pass
wpcf7_antispam_mail_smtp_host
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPCF7 Anti-spam
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲3414.38 ▲0.013.12 ▲0.9841.59 ▼1.55
Dashboard /wp-admin2,202 ▲255.62 ▼0.0590.46 ▼5.2741.49 ▼4.51
Posts /wp-admin/edit.php2,104 ▲72.04 ▲0.0636.60 ▲0.3734.90 ▲0.46
Add New Post /wp-admin/post-new.php1,529 ▲323.39 ▲0.14654.04 ▼44.5855.65 ▲2.97
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.11106.31 ▼6.6246.12 ▲2.81
WPCF7 Anti-spam /wp-admin/options-general.php?page=wpcf7_antispam9832.0122.6229.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 16 options in the database
    • wpcf7_antispam_mail_cc
    • widget_recent-posts
    • wpcf7_antispam_mail_sender
    • wpcf7_antispam_mail_smtp_host
    • widget_theysaidso_widget
    • wpcf7_antispam_mail_recipient
    • theysaidso_admin_options
    • wpcf7_antispam_hash
    • wpcf7_antispam_mail_smtp_login
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wpcf7_antispam
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wpcf7_antispam
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpcf7-anti-spam/wpcf7_antispam.php:35

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: anti-spam, spam, cf7, contact form 7

wpcf7-anti-spam/wpcf7_antispam.php 92% from 13 tests

"WPCF7 Anti-spam" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpcf7-anti-spam.php" instead of "wpcf7_antispam.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected380 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14513319
JavaScript110461

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected