74% contact-form-7-add-confirm

Code Review | Contact Form 7 add confirm

WordPress plugin Contact Form 7 add confirm scored74%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ad...
  • Plugin version: 5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.3
  • WordPress version: 6.3.1
  • First release: Mar 28, 2014
  • Latest release: Feb 27, 2018
  • Number of updates: 72
  • Update frequency: every 19.9 days
  • Top authors: Yuichiro ABE (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60,000+ active /245,581 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.79MB] [CPU: ▼50.10ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 add confirm
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.316.04 ▼35.64
Dashboard /wp-admin2.23 ▼1.078.81 ▼42.18
Posts /wp-admin/edit.php2.24 ▼1.127.73 ▼41.04
Add New Post /wp-admin/post-new.php2.23 ▼3.6511.04 ▼81.55
Media Library /wp-admin/upload.php2.24 ▼0.997.10 ▼27.61

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

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

Browser metrics Passed 4 tests

Contact Form 7 add confirm: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.33 ▼0.052.01 ▲0.2944.35 ▲0.56
Dashboard /wp-admin2,195 ▲185.61 ▼0.0595.43 ▼9.9243.83 ▼4.01
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0234.17 ▼7.9033.54 ▼6.21
Add New Post /wp-admin/post-new.php1,526 ▼1123.12 ▲4.79637.45 ▲4.4955.50 ▼21.69
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.04103.11 ▼8.1944.35 ▼2.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/contact-form-7-add-confirm/modules/confirm.php+51
    Use of undefined constant WPCF7_VERSION - assumed 'WPCF7_VERSION' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'WPCF7C_PLUGIN_DIR/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-7-add-confirm/settings.php on line 13
    • > PHP Warning
      Use of undefined constant WPCF7C_PLUGIN_DIR - assumed 'WPCF7C_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-7-add-confirm/settings.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-add-confirm/modules/back.php:8
    • > PHP Warning
      require_once(WPCF7C_PLUGIN_DIR/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-7-add-confirm/settings.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-7-add-confirm/contact-form-7-confirm.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-add-confirm/modules/confirm.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-add-confirm/includes/controller.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

contact-form-7-add-confirm/contact-form-7-confirm.php 92% from 13 tests

The main PHP file in "Contact Form 7 add confirm" ver. 5.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-7-add-confirm.php" instead of "contact-form-7-confirm.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected744 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP618895559
JavaScript15826146
PO File181433
CSS1106

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
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%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
PNG images were not found in this plugin