78% click-to-mail

Code Review | Click To Email - MailTo Chat Bubble and Button for WordPress

WordPress plugin Click To Email - MailTo Chat Bubble and Button for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: click-to-mail
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 12, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 15
  • Update frequency: every 20.5 days
  • Top authors: themeatelier (86.67%)fixolab (20%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.23MB] [CPU: ▲1.41ms] Passed 4 tests

Server-side resources used by Click To Email - MailTo Chat Bubble and Button for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.02 ▲1.5556.49 ▲13.32
Dashboard /wp-admin4.83 ▲1.5258.44 ▲11.32
Posts /wp-admin/edit.php4.88 ▲1.5263.01 ▲14.39
Add New Post /wp-admin/post-new.php6.34 ▲0.4568.62 ▼33.40
Media Library /wp-admin/upload.php4.69 ▲1.4551.58 ▲20.87

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 171 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
ctm-opt
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Click To Email - MailTo Chat Bubble and Button for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,162 ▲40015.75 ▲1.4128.28 ▲26.53101.92 ▲57.94
Dashboard /wp-admin2,244 ▲675.55 ▼0.1488.72 ▼14.8041.53 ▼2.49
Posts /wp-admin/edit.php2,159 ▲592.07 ▲0.0640.26 ▲0.8436.01 ▲1.97
Add New Post /wp-admin/post-new.php1,731 ▲20523.90 ▲1.02658.01 ▼65.8760.43 ▲0.31
Media Library /wp-admin/upload.php1,446 ▲434.25 ▲0.0198.34 ▼2.0443.35 ▼2.28
Buttons shortcodes /wp-admin/admin.php?page=ctm#tab=buttons-shortcodes4,1403.5993.4651.44
Backup /wp-admin/admin.php?page=ctm#tab=backup4,1383.4056.6871.64
CTM settings /wp-admin/admin.php?page=ctm#tab=ctm-settings4,2784.0772.8178.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • ctm-opt
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/click-to-mail/inc/class-enqueue.php
    • > /wp-content/plugins/click-to-mail/inc/functions.php
    • > /wp-content/plugins/click-to-mail/click-to-mail.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant CTM_ALERT_MSG - assumed 'CTM_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/click-to-mail/inc/functions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/click-to-mail/view/chat-bubbles/chat-bubbles.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/click-to-mail/view/shortcodes/custom-shortcode.php:11
    • > PHP Warning
      Use of undefined constant CTM_ALERT_MSG - assumed 'CTM_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/click-to-mail/inc/class-enqueue.php on line 11

User-side errors Passed 1 test

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

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
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7 in click-to-mail/assets to your readme.txt
The official readme.txt is a good inspiration

click-to-mail/click-to-mail.php 92% from 13 tests

This is the main PHP file of "Click To Email - MailTo Chat Bubble and Button for WordPress" version 1.1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin25,552 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
PHP712,1061,4539,243
PO File203,1983,5916,500
JavaScript9991406,126
Sass33141,786
CSS791211,406
Markdown1580281
JSON220208
SVG2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity20.58
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes11.75%
Methods246
▷ Static methods3012.20%
▷ Public methods22491.06%
▷ Protected methods72.85%
▷ Private methods156.10%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.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
12 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/bubble-3.png6.13KB2.79KB▼ 54.47%
assets/image/bubble-1.png1.33KB1.02KB▼ 22.88%
assets/image/bubble-4.png7.77KB3.47KB▼ 55.33%
assets/image/bubble-5.png7.49KB3.08KB▼ 58.82%
assets/image/bubble-9.png6.21KB2.69KB▼ 56.66%