79% truncate-comments

Code Review | Truncate Comments

WordPress plugin Truncate Comments scored79%from 54 tests.

About plugin

  • Plugin page: truncate-comments
  • Plugin version: 2.00
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 2, 2015
  • Latest release: Oct 30, 2022
  • Number of updates: 35
  • Update frequency: every 77.4 days
  • Top authors: Flector (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,254 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: ▲0.06MB] [CPU: ▼6.29ms] Passed 4 tests

This is a short check of server-side resources used by Truncate Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.46 ▼5.43
Dashboard /wp-admin3.37 ▲0.0649.21 ▼5.05
Posts /wp-admin/edit.php3.42 ▲0.0652.11 ▼0.36
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.40 ▼13.33
Media Library /wp-admin/upload.php3.29 ▲0.0637.08 ▼1.34

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
tc_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Truncate Comments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13714.10 ▼0.487.97 ▲5.9941.93 ▼7.23
Dashboard /wp-admin2,210 ▲224.87 ▼1.02109.30 ▼11.7238.53 ▼6.00
Posts /wp-admin/edit.php2,096 ▲41.99 ▼0.0439.80 ▲1.2137.10 ▲2.07
Add New Post /wp-admin/post-new.php1,540 ▲723.17 ▲0.18661.43 ▼1.7368.85 ▲10.99
Media Library /wp-admin/upload.php1,389 ▼24.20 ▼0.0499.37 ▼15.2044.10 ▼6.99
Truncate Comments /wp-admin/truncate-comments.php260.440.0813.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/truncate-comments/truncate-comments.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/truncate-comments.php
    • > Network (severe)
    wp-admin/truncate-comments.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: comment, hide content, collapse, amazon, comments

truncate-comments/truncate-comments.php Passed 13 tests

"Truncate Comments" version 2.00's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
73 characters long description:
The plugin uses Javascript to hide long comments (Amazon-style comments).

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
Good job! No executable or dangerous file extensions detected620 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript46727306
PHP15645279
CSS22735

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon_coffee.png5.14KB5.32KB0.00%