84% wp-jshrink

Code Review | WP-JSHRINK

WordPress plugin WP-JSHRINK scored84%from 54 tests.

About plugin

  • Plugin page: wp-jshrink
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Dec 29, 2014
  • Latest release: Jan 6, 2015
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: vic-trigger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /911 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼12.04ms] Passed 4 tests

This is a short check of server-side resources used by WP-JSHRINK
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.75 ▼1.50
Dashboard /wp-admin3.31 ▼0.0444.04 ▼16.52
Posts /wp-admin/edit.php3.36 ▲0.0044.51 ▼3.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.44 ▼26.84
Media Library /wp-admin/upload.php3.23 ▲0.0039.76 ▲4.61

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-JSHRINK
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5113.64 ▼0.731.61 ▼0.0043.62 ▲3.43
Dashboard /wp-admin2,209 ▲245.97 ▲0.91100.83 ▼5.4438.68 ▼6.92
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0035.45 ▼4.9633.59 ▼5.29
Add New Post /wp-admin/post-new.php1,533 ▼923.37 ▲4.98653.84 ▲39.0352.09 ▼7.43
Media Library /wp-admin/upload.php1,391 ▲94.25 ▲0.05109.06 ▲11.3547.22 ▲6.54

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× 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/wp-jshrink/bootstrap.php:29
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-jshrink/vendor/tedivm/jshrink/src/JShrink/Minifier.php on line 227

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: minify, javascript

wp-jshrink/bootstrap.php 85% from 13 tests

Analyzing the main PHP file in "WP-JSHRINK" version 1.1.3
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-jshrink.php" instead of "bootstrap.php")

Code Analysis Passed 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
There were no executable files found in this plugin890 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP10225485706
JSON30080
Markdown247068
XML11022
YAML24014

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.41
Average class complexity23.00
▷ Minimum class complexity6.00
▷ Maximum class complexity54.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods52
▷ Static methods47.69%
▷ Public methods3771.15%
▷ Protected methods1426.92%
▷ Private methods11.92%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin