84% contact-form-7-recaptcha

Code Review | Contact Form 7 reCAPTCHA

WordPress plugin Contact Form 7 reCAPTCHA scored 84% from 54 tests.

About plugin

  • Plugin page: contact-form-7-re...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2015
  • Latest release: Feb 6, 2016
  • Number of updates: 11
  • Update frequency: every 21.2 days
  • Top authors: iambriansreed (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

6,000+ active / 39,937 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

An overview of server-side resources used by Contact Form 7 reCAPTCHA
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.25 ▼3.02
Dashboard /wp-admin3.34 ▲0.0351.01 ▼0.63
Posts /wp-admin/edit.php3.39 ▲0.0350.72 ▲1.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0398.60 ▲2.39
Media Library /wp-admin/upload.php3.26 ▲0.0337.78 ▲1.79
reCAPTCHA /wp-admin/admin.php?page=wpcf7_recaptcha_settings3.2236.25

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Contact Form 7 reCAPTCHA: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▼0.181.66 ▼0.4541.56 ▼7.94
Dashboard /wp-admin2,209 ▲214.85 ▼0.04115.43 ▲3.2537.37 ▼4.91
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0740.65 ▲0.0135.68 ▼5.72
Add New Post /wp-admin/post-new.php1,514 ▼017.86 ▲0.24616.44 ▼56.6063.22 ▲14.17
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0299.28 ▼8.0743.55 ▼2.02
reCAPTCHA /wp-admin/admin.php?page=wpcf7_recaptcha_settings8062.0524.8328.56

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/contact-form-7-recaptcha/index.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: recaptcha, recaptcha v2, contact form 7

contact-form-7-recaptcha/index.php 92% from 13 tests

The main PHP script in "Contact Form 7 reCAPTCHA" version 1.2.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("contact-form-7-recaptcha.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin199 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1276185
JavaScript11014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There are no PNG files in this plugin