56% comment-mail

Code Review | Comment Mail

WordPress plugin Comment Mail scored56%from 54 tests.

About plugin

  • Plugin page: comment-mail
  • Plugin version: 161213...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: May 20, 2019
  • Number of updates: 28
  • Update frequency: every 50.4 days
  • Top authors: raamdev (78.57%)JasWSInc (14.29%)clavaque (10.71%)KristineDS (7.14%)

Code review

54 tests

User reviews

13 reviews

Install metrics

200+ active /11,354 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Comment Mail
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2035.76 ▼8.53
Dashboard /wp-admin3.67 ▲0.3256.12 ▼13.96
Posts /wp-admin/edit.php3.72 ▲0.3658.18 ▲8.25
Add New Post /wp-admin/post-new.php6.18 ▲0.2993.97 ▼11.77
Media Library /wp-admin/upload.php3.51 ▲0.2943.95 ▲6.80
꜖ Site Templates /wp-admin/admin.php?page=comment_mail_site_templates7.2764.11
Subscriptions /wp-admin/admin.php?page=comment_mail_subs4.5150.49
꜖ Event Log /wp-admin/admin.php?page=comment_mail_queue_event_log3.6944.19
Config. Options /wp-admin/admin.php?page=comment_mail3.4940.22
꜖ Email Templates /wp-admin/admin.php?page=comment_mail_email_templates3.4937.63
꜖ Event Log /wp-admin/admin.php?page=comment_mail_sub_event_log3.7249.46
Mail Queue /wp-admin/admin.php?page=comment_mail_queue3.6041.22

Server storage [IO: ▲4.03MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 230 new files
Database: 4 new tables, 9 new options
New tables
wp_comment_mail_subs
wp_comment_mail_queue_event_log
wp_comment_mail_sub_event_log
wp_comment_mail_queue
New WordPress options
comment_mail_options
widget_theysaidso_widget
can_compress_scripts
comment_mail_notices
widget_recent-posts
comment_mail_install_time
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Comment Mail
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲12214.26 ▼0.101.57 ▼0.5741.64 ▼0.67
Dashboard /wp-admin2,287 ▲1075.60 ▲0.0287.86 ▼10.9652.17 ▲6.46
Posts /wp-admin/edit.php2,192 ▲922.02 ▼0.0039.29 ▲4.7853.39 ▲17.62
Add New Post /wp-admin/post-new.php1,591 ▲5823.17 ▲0.40667.84 ▲9.1671.78 ▲8.31
Media Library /wp-admin/upload.php1,492 ▲924.24 ▲0.12102.73 ▲0.3853.82 ▲4.69
꜖ Site Templates /wp-admin/admin.php?page=comment_mail_site_templates1,9973.5758.47101.80
Subscriptions /wp-admin/admin.php?page=comment_mail_subs1,4312.9345.6058.48
꜖ Event Log /wp-admin/admin.php?page=comment_mail_queue_event_log1,4392.8945.4258.56
Config. Options /wp-admin/admin.php?page=comment_mail2,8143.6161.6876.30
꜖ Email Templates /wp-admin/admin.php?page=comment_mail_email_templates2,1313.6459.6876.40
꜖ Event Log /wp-admin/admin.php?page=comment_mail_sub_event_log1,7342.8946.6860.52
Mail Queue /wp-admin/admin.php?page=comment_mail_queue1,2792.8845.2558.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 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
  • Zombie tables detected upon uninstall: 4 tables
    • wp_comment_mail_queue
    • wp_comment_mail_subs
    • wp_comment_mail_queue_event_log
    • wp_comment_mail_sub_event_log
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • comment_mail_install_time
    • widget_theysaidso_widget
    • comment_mail_notices
    • comment_mail_options
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 64 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=comment_mail_email_templates
    • > Deprecated in wp-content/plugins/comment-mail/src/includes/classes/UtilsFs.php+103
    strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
    • > GET request to /wp-admin/admin.php?page=comment_mail
    • > User deprecated in wp-includes/functions.php+5737
    Function get_option was called with an argument that is deprecated since version 5.5.0! The "comment_whitelist" option key has been renamed to "comment_previously_approved".

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 33× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/site/comment-form/snippet/sso-ops.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/email/sub-confirmation/snippet/message.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/email/snippet/footer-tag.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/email/comment-notification/snippet/message-comment-from.php
    • > /wp-content/plugins/comment-mail/plugin.php
    • > /wp-content/plugins/comment-mail/src/includes/stcr.php
    • > /wp-content/plugins/comment-mail/src/vendor/websharks/wp-php-rv/src/includes/check.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/site/login-form/snippet/sso-ops.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/site/snippet/footer-tag.php
    • > /wp-content/plugins/comment-mail/src/includes/templates/type-s/email/header-scripts.php
  • 129× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/UtilsIp.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/PostSmallMetaBox.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WebSharks\\CommentMail\\__() in wp-content/plugins/comment-mail/src/includes/templates/type-s/site/sub-actions/manage-sub-form.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/Template.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/UserDelete.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/MenuPage.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WebSharks\\CommentMail\\__() in wp-content/plugins/comment-mail/src/includes/templates/type-s/site/sub-actions/confirmed.php:28
    • > PHP Notice
      Undefined variable: sso_services in wp-content/plugins/comment-mail/src/includes/templates/type-s/site/comment-form/sso-ops.php on line 73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WebSharks\\CommentMail\\esc_attr() in wp-content/plugins/comment-mail/src/includes/templates/type-s/site/comment-form/sub-ops.php:100
    • > PHP Fatal error
      Uncaught Error: Class 'WebSharks\\CommentMail\\AbsBase' not found in wp-content/plugins/comment-mail/src/includes/classes/UtilsPhp.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=comment_mail_queue
    • > Javascript (severe) in unknown
    http://www.google.com/jsapi?autoload=%7B%27modules%27%3A%5B%7B%27name%27%3A%27visualization%27%2C%27version%27%3A%271%27%2C%27packages%27%3A%5B%27geochart%27%5D%7D%5D%7D 150:139 Uncaught Error: Autoload failed with: SyntaxError: Expected proper…me or '}' in JSON at position 1 (line 1 column 2)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can look at the official readme.txt

comment-mail/plugin.php 85% from 13 tests

The main PHP script in "Comment Mail" version 161213... is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("comment-mail.php" instead of "plugin.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "161213...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin28,435 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
PHP1544,99211,92923,738
JavaScript4298622,284
SVG200784
CSS57217466
JSON400450
Markdown91660402
HTML2181202
SQL40093
XML20016

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 380)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity40.02
▷ Minimum class complexity1.00
▷ Maximum class complexity477.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity380.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes87
▷ Abstract classes33.45%
▷ Concrete classes8496.55%
▷ Final classes00.00%
Methods891
▷ Static methods495.50%
▷ Public methods56863.75%
▷ Protected methods32136.03%
▷ Private methods20.22%
Functions61
▷ Named functions1422.95%
▷ Anonymous functions4777.05%
Constants12
▷ Global constants1083.33%
▷ Class constants216.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 PNG files occupy 0.49MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/vendor/package/datetimepicker/screen/4.png12.29KB5.50KB▼ 55.26%
src/client-s/images/sub-ops-ss.png17.34KB6.50KB▼ 62.53%
src/client-s/images/aws-ses-rec.png32.59KB11.91KB▼ 63.45%
src/client-s/images/sso-linkedin.png1.63KB1.00KB▼ 38.26%
src/client-s/images/trans-bg.png0.09KB0.12KB0.00%