62% better-comments

Code Review | Better Comments

WordPress plugin Better Comments scored62%from 54 tests.

About plugin

  • Plugin page: better-comments
  • Plugin version: 1.5.5
  • PHP compatiblity: 7+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 9, 2020
  • Latest release: Sep 8, 2023
  • Number of updates: 18
  • Update frequency: every 59.1 days
  • Top authors: skyminds (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,091 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.12MB] [CPU: ▲7.22ms] Passed 4 tests

A check of server-side resources used by Better Comments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.53 ▲1.0645.19 ▲3.12
Dashboard /wp-admin4.41 ▲1.1159.94 ▲8.60
Posts /wp-admin/edit.php4.63 ▲1.2761.90 ▲19.04
Add New Post /wp-admin/post-new.php7.11 ▲1.22100.18 ▲7.76
Media Library /wp-admin/upload.php4.31 ▲1.0843.96 ▲9.39
Better Comments /wp-admin/admin.php?page=better-comments4.6272.28
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.6946.56

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 662 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
fs_active_plugins
fs_debug_mode
widget_theysaidso_widget
can_compress_scripts
fs_accounts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Better Comments: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,006 ▲24518.70 ▲4.111.95 ▲0.2330.19 ▼13.91
Dashboard /wp-admin2,394 ▲2148.96 ▲3.37199.96 ▲102.5742.03 ▼0.94
Posts /wp-admin/edit.php2,336 ▲2366.15 ▲4.1489.74 ▲46.1239.49 ▼2.14
Add New Post /wp-admin/post-new.php1,604 ▲6019.82 ▲1.74668.36 ▲11.4748.12 ▼18.24
Media Library /wp-admin/upload.php1,487 ▲846.60 ▲2.39109.97 ▲0.6844.46 ▼0.09
Better Comments /wp-admin/admin.php?page=better-comments1,2086.6286.8177.50
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,3166.0970.6127.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/better-comments/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • fs_active_plugins
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_debug_mode
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • fs_accounts

Smoke tests 25% 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 | 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 117× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Container/Condition/User_Capability_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Container/Theme_Options_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Field/Complex_Field.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Scripts_Field' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Field/Footer_Scripts_Field.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Service/Meta_Query_Service.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Select_Field' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Field/Radio_Image_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Field/Html_Field.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/templates/Container/post_meta.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Key_Value_Datastore' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Datastore/Theme_Options_Datastore.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Any_Equality_Comparer.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Console-api (warning) in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/build/classic/vendor.min.js?ver=3.6.0+48:54975
    wp.compose.withState is deprecated since version 5.8. Please use wp.element.useState instead.
    • > GET request to /wp-admin/admin.php?page=better-comments
    • > Console-api (severe) in wp-content/plugins/better-comments/vendor/htmlburger/carbon-fields/build/classic/metaboxes.min.js?ver=3.6.0+0:3994
    Could not find DOM element for container \"carbon_fields_container_better_comments\".

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Requires php: Invalid plugin version format
Please take inspiration from this readme.txt

better-comments/better-comments.php 92% from 13 tests

The main file in "Better Comments" v. 1.5.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "7")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected67,385 lines of code in 559 files:
LanguageFilesBlank linesComment linesLines of code
PHP27110,80824,61943,210
JavaScript1787,14911,00116,440
PO File291,0041,2232,666
CSS222641,2152,654
Sass4936531,868
JSON500462
Markdown324068
XML13016
SVG1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity30.98
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces26
Interfaces5
Traits0
Classes176
▷ Abstract classes137.39%
▷ Concrete classes16392.61%
▷ Final classes21.23%
Methods2,194
▷ Static methods30513.90%
▷ Public methods1,63374.43%
▷ Protected methods1828.30%
▷ Private methods37917.27%
Functions230
▷ Named functions14462.61%
▷ Anonymous functions8637.39%
Constants178
▷ Global constants10659.55%
▷ Class constants7240.45%
▷ Public constants72100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/wordpress-sdk/assets/img/better-comments.png10.00KB5.28KB▼ 47.14%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/wordpress-sdk/assets/img/sky-login-redirect.png12.44KB7.61KB▼ 38.85%