68% contact-form-to-email

Code Review | Contact Form Email

WordPress plugin Contact Form Email scored68%from 54 tests.

About plugin

  • Plugin page: contact-form-to-e...
  • Plugin version: 1.3.44
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.3
  • WordPress version: 6.3.1
  • First release: Apr 11, 2013
  • Latest release: Nov 4, 2023
  • Number of updates: 505
  • Update frequency: every 7.6 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

101 reviews

Install metrics

10,000+ active /1,553,449 total downloads

Benchmarks

Plugin footprint 65% 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.05MB] [CPU: ▼3.13ms] Passed 4 tests

A check of server-side resources used by Contact Form Email
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.35 ▼4.53
Dashboard /wp-admin3.35 ▲0.0544.25 ▼5.95
Posts /wp-admin/edit.php3.46 ▲0.1151.41 ▲4.27
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.76 ▼1.93
Media Library /wp-admin/upload.php3.27 ▲0.0433.87 ▼0.12
Contact Form to Email /wp-admin/options-general.php?page=cp_contactformtoemail3.4935.51
Contact Form to Email /wp-admin/admin.php?page=cp_contactformtoemail3.2535.16
Upgrade /wp-admin/admin.php?page=cp_contactformtoemail_upgrade3.2229.11
Help: Documentation /wp-admin/admin.php?page=cp_contactformtoemail_docs3.2228.35
Help: Free support /wp-admin/admin.php?page=cp_contactformtoemail_fsupport3.2232.35
Help: Online demo /wp-admin/admin.php?page=cp_contactformtoemail_demo3.2229.53

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 171 new files
Database: 2 new tables, 9 new options
New tables
wp_cftemail_messages
wp_cftemail_forms
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
installed_contact-form-to-email
autoptimize_js_exclude
can_compress_scripts
cp_cfte_last_verified

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form Email
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7114.04 ▼0.091.62 ▼0.2537.31 ▼4.67
Dashboard /wp-admin2,241 ▲615.62 ▼0.0288.63 ▼11.5040.38 ▼3.98
Posts /wp-admin/edit.php2,143 ▲431.94 ▼0.0638.90 ▲2.3336.21 ▲0.14
Add New Post /wp-admin/post-new.php6,242 ▲4,71619.00 ▼4.11937.32 ▲202.6336.62 ▼28.70
Media Library /wp-admin/upload.php1,446 ▲464.28 ▲0.1199.11 ▼2.0542.52 ▼0.22
Contact Form to Email /wp-admin/options-general.php?page=cp_contactformtoemail1,5742.2643.7333.63
Contact Form to Email /wp-admin/admin.php?page=cp_contactformtoemail1,5742.1241.5032.83
Upgrade /wp-admin/admin.php?page=cp_contactformtoemail_upgrade2,8924.0275.67120.06
Help: Documentation /wp-admin/admin.php?page=cp_contactformtoemail_docs4,3063.5280.82105.00
Help: Free support /wp-admin/admin.php?page=cp_contactformtoemail_fsupport3,5534.84101.41110.51
Help: Online demo /wp-admin/admin.php?page=cp_contactformtoemail_demo2,1143.9365.6086.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_cftemail_forms
    • wp_cftemail_messages
  • The uninstall procedure has failed, leaving 9 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • installed_contact-form-to-email
    • autoptimize_js_exclude
    • widget_theysaidso_widget
    • widget_recent-posts
    • cp_cfte_last_verified

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/contact-form-to-email/cp-public-int.inc.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-to-email/cp-admin-int.inc.php:3
    • > PHP Notice
      Undefined index: cal in wp-content/plugins/contact-form-to-email/cp-admin-int-add-booking.inc.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/contact-form-to-email/cp-admin-int-add-booking.inc.php:3
    • > PHP Notice
      Undefined index: cal in wp-content/plugins/contact-form-to-email/cp-admin-int-edit-booking.inc.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-to-email/controllers/elementor/cp-elementor-widget.inc.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-to-email/cp-publish-wizzard.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-to-email/cp-admin-int-message-list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CP_CFTEMAIL_BaseClass' not found in wp-content/plugins/contact-form-to-email/cp-main-class.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-to-email/cp-admin-int-list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-to-email/cp-admin-int-report.inc.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

contact-form-to-email/form-to-email.php 92% from 13 tests

The main file in "Contact Form Email" v. 1.3.44 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("contact-form-to-email.php" instead of "form-to-email.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
No dangerous file extensions were detected9,978 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP187202004,086
PO File589605062,725
JavaScript71641392,430
CSS474162737

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity79.00
▷ Minimum class complexity3.00
▷ Maximum class complexity276.00
Average method complexity7.24
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods00.00%
▷ Public methods4488.00%
▷ Protected methods36.00%
▷ Private methods36.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants42
▷ Global constants42100.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
16 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/cupertino/images/ui-icons_ffffff_256x240.png4.27KB4.11KB▼ 3.78%
css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png0.10KB0.14KB0.00%
css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png0.18KB0.08KB▼ 51.93%
controllers/help/elementor.png46.11KB15.20KB▼ 67.04%
css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png0.12KB0.15KB0.00%