78% cf7-email-add-on

Code Review | Contact Form 7 Email Add on

WordPress plugin Contact Form 7 Email Add on scored78%from 54 tests.

About plugin

  • Plugin page: cf7-email-add-on
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2018
  • Latest release: Nov 18, 2022
  • Number of updates: 26
  • Update frequency: every 58.0 days
  • Top authors: krishaweb (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

5,000+ active /28,558 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.87ms] Passed 4 tests

A check of server-side resources used by Contact Form 7 Email Add on
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.44 ▼1.91
Dashboard /wp-admin3.31 ▲0.0044.44 ▼8.54
Posts /wp-admin/edit.php3.36 ▲0.0047.74 ▲0.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.76 ▼17.52
Media Library /wp-admin/upload.php3.23 ▲0.0035.38 ▲1.42

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 131 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form 7 Email Add on
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.564.72 ▲2.9744.35 ▼0.64
Dashboard /wp-admin2,206 ▲184.84 ▼1.00107.17 ▲1.8137.66 ▼5.37
Posts /wp-admin/edit.php2,089 ▼02.07 ▲0.0240.33 ▲2.9535.77 ▲1.02
Add New Post /wp-admin/post-new.php1,533 ▲1423.17 ▼0.22584.43 ▼45.5149.83 ▼2.74
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0595.27 ▼0.3241.64 ▲0.71

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% 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
  • 11× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/gradient.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/user/donate-text.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/user/interview-box.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/default.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/user/default.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/purple-moon.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/user/space.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/space.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/typewriter.php
    • > /wp-content/plugins/cf7-email-add-on/admin/email-templates/user/typewriter.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/user/typewriter.php:102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/space.php:125
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/user/purple-moon.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/user/meeting.php:118
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/typewriter.php:149
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cf7-email-add-on/admin/contact-form-7-email-add-on-templates.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/user/gradient.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/user/donate-text.php:107
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/purple-moon.php:122
    • > PHP Fatal error
      Uncaught Error: Call to undefined function date_i18n() in wp-content/plugins/cf7-email-add-on/admin/email-templates/admin/default.php:120

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

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7 in cf7-email-add-on/assets to your readme.txt
The official readme.txt is a good inspiration

cf7-email-add-on/contact-form-7-email-add-on.php 92% from 13 tests

The main PHP script in "Contact Form 7 Email Add on" version 1.9 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cf7-email-add-on.php" instead of "contact-form-7-email-add-on.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
Success! There were no dangerous files found in this plugin4,734 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP17411092,254
JavaScript23821691,446
CSS256521,034

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
76 PNG files occupy 1.81MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/meeting/logo.png7.50KB3.76KB▼ 49.89%
admin/assets/images/gradient/facebook-icon.png1.21KB0.32KB▼ 73.20%
admin/assets/images/send-btn.png2.89KB1.46KB▼ 49.41%
admin/assets/images/interview/map-pin-icon.png1.97KB1.30KB▼ 33.83%
admin/assets/images/interview/linkedin-icon.png1.64KB0.67KB▼ 58.94%