84% hashcash-for-contact-form-7

Code Review | Hashcash for Contact Form 7

WordPress plugin Hashcash for Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: hashcash-for-cont...
  • Plugin version: 0.1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-3.8
  • WordPress version: 6.3.1
  • First release: Dec 2, 2012
  • Latest release: Dec 29, 2013
  • Number of updates: 12
  • Update frequency: every 32.7 days
  • Top authors: Abdussamad (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /2,682 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Hashcash for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.22 ▲1.36
Dashboard /wp-admin3.33 ▲0.0344.91 ▲1.51
Posts /wp-admin/edit.php3.38 ▲0.0347.55 ▼1.77
Add New Post /wp-admin/post-new.php5.91 ▲0.0379.40 ▼20.73
Media Library /wp-admin/upload.php3.25 ▲0.0333.90 ▲0.17

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
wpcf7_wphc_version
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Hashcash for Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.52 ▼1.161.70 ▲0.1239.08 ▼4.53
Dashboard /wp-admin2,206 ▲215.86 ▲0.01119.12 ▲16.1942.75 ▲5.10
Posts /wp-admin/edit.php2,089 ▲31.98 ▼0.0240.09 ▲0.2434.16 ▼1.04
Add New Post /wp-admin/post-new.php1,533 ▼023.60 ▲0.30666.09 ▲66.2060.07 ▲9.84
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0494.33 ▼5.7740.10 ▼3.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • wpcf7_wphc_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hashcash-for-contact-form-7/wpcf7_wphc.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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
6 plugin tags: contact form 7, anti-spam, hashcash, wp hashcash, spam prevention...

hashcash-for-contact-form-7/wpcf7_wphc.php 92% from 13 tests

The main file in "Hashcash for Contact Form 7" v. 0.1.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hashcash-for-contact-form-7.php" instead of "wpcf7_wphc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin162 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12025118
PO File1101844

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected