84% wpcf7-recaptcha

Code Review | ReCaptcha v2 for Contact Form 7

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

About plugin

  • Plugin page: wpcf7-recaptcha
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2018
  • Latest release: Aug 9, 2023
  • Number of updates: 104
  • Update frequency: every 16.2 days
  • Top authors: IQComputing (100%)

Code review

54 tests

User reviews

86 reviews

Install metrics

300,000+ active /2,718,874 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by ReCaptcha v2 for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.36 ▼1.87
Dashboard /wp-admin3.35 ▲0.0546.71 ▲0.57
Posts /wp-admin/edit.php3.40 ▲0.0445.26 ▲1.98
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.12 ▼17.05
Media Library /wp-admin/upload.php3.27 ▲0.0433.70 ▼2.60

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for ReCaptcha v2 for Contact Form 7
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.20 ▼1.171.68 ▼0.1947.71 ▲4.42
Dashboard /wp-admin2,203 ▲125.86 ▼0.0394.92 ▼7.7335.91 ▼2.31
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0147.10 ▲7.2837.80 ▲3.44
Add New Post /wp-admin/post-new.php1,542 ▼018.29 ▼0.04591.54 ▼24.7754.50 ▼12.57
Media Library /wp-admin/upload.php1,382 ▼34.17 ▼0.0396.94 ▼5.6442.88 ▼1.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wpcf7-recaptcha/recaptcha-v2.php
    • > /wp-content/plugins/wpcf7-recaptcha/flamingo.php
    • > /wp-content/plugins/wpcf7-recaptcha/wpcf7-recaptcha.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: recaptcha, contact-form-7-recaptcha, spam, contact-form-7

wpcf7-recaptcha/wpcf7-recaptcha.php Passed 13 tests

This is the main PHP file of "ReCaptcha v2 for Contact Form 7" version 1.4.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
50 characters long description:
ReCaptcha v2 Fix for Contact Form 7 5.1 and later.

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
There were no executable files found in this plugin622 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3263333577
JavaScript112845

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.33
▷ Minimum class complexity4.00
▷ Maximum class complexity36.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods421.05%
▷ Public methods1368.42%
▷ Protected methods00.00%
▷ Private methods631.58%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/facebook-like.png44.25KB19.51KB▼ 55.91%