10% cool-contact

Code Review | Cool Contact

WordPress plugin Cool Contact scored10%from 54 tests.

About plugin

  • Plugin page: cool-contact
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-4.4
  • WordPress version: 6.3.1
  • First release: Jun 26, 2014
  • Latest release: Jan 1, 2016
  • Number of updates: 28
  • Update frequency: every 19.8 days
  • Top authors: abdul202 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,071 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.

Server metrics [RAM: ▼1.94MB] [CPU: ▼51.35ms] Passed 4 tests

A check of server-side resources used by Cool Contact
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.98 ▼36.97
Dashboard /wp-admin2.06 ▼1.246.64 ▼41.39
Posts /wp-admin/edit.php2.06 ▼1.297.19 ▼43.39
Add New Post /wp-admin/post-new.php2.06 ▼3.825.78 ▼83.64
Media Library /wp-admin/upload.php2.06 ▼1.176.48 ▼28.58

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 52 new files
Database: no new tables, 16 new options
New WordPress options
email_subject
widget_recent-comments
can_compress_scripts
toemail
fromemail
used_name
requirename
db_upgraded
theysaidso_admin_options
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Cool Contact
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲19714.05 ▼0.6010.84 ▲9.0847.91 ▼0.43
Dashboard /wp-admin2,198 ▲215.88 ▲0.2593.12 ▼2.5469.66 ▲25.24
Posts /wp-admin/edit.php2,120 ▲202.32 ▲0.3241.84 ▲3.8047.46 ▲11.24
Add New Post /wp-admin/post-new.php1,693 ▲16422.80 ▼0.43619.15 ▼41.8157.64 ▼6.55
Media Library /wp-admin/upload.php1,415 ▲124.47 ▲0.2499.59 ▼3.9473.07 ▲24.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the validate_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cool-contact/securimage/example_form.ajax.php
    • > /wp-content/plugins/cool-contact/securimage/securimage_show.php
    • > /wp-content/plugins/cool-contact/securimage/example_form.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined method WavFileException::getcontent() in wp-content/plugins/cool-contact/securimage/securimage.php:2512
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cool-contact/includes/options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cool-contact/contact_admin.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cool-contact/form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/cool-contact/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: There are too many tags (24 tag instead of maximum 10)
You can take inspiration from this readme.txt

cool-contact/index.php 92% from 13 tests

The main PHP file in "Cool Contact" ver. 2.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cool-contact.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin3,871 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP139871,8003,597
PO File16467144
CSS3225119
HTML24110
JavaScript1031

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity109.60
▷ Minimum class complexity1.00
▷ Maximum class complexity289.00
Average method complexity5.56
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods119
▷ Static methods97.56%
▷ Public methods7260.50%
▷ Protected methods4739.50%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants42
▷ Global constants24.76%
▷ Class constants4095.24%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_inset-soft_100_f4f0ec_1x100.png0.39KB0.17KB▼ 56.33%
css/images/ui-bg_glass_25_cb842e_1x400.png0.33KB0.16KB▼ 51.04%
css/images/ui-icons_ff7519_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png0.32KB0.15KB▼ 53.82%
css/images/ui-icons_c47a23_256x240.png4.44KB4.17KB▼ 6.02%