83% js-crop

Code Review | JS Crop

WordPress plugin JS Crop scored83%from 54 tests.

About plugin

  • Plugin page: js-crop
  • Plugin version: 2.5.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 20, 2020
  • Latest release: Oct 2, 2023
  • Number of updates: 19
  • Update frequency: every 59.9 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,137 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.76ms] Passed 4 tests

Server-side resources used by JS Crop
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0444.41 ▲1.00
Dashboard /wp-admin3.34 ▲0.0352.90 ▼2.44
Posts /wp-admin/edit.php3.39 ▲0.0352.48 ▼0.15
Add New Post /wp-admin/post-new.php5.92 ▲0.03100.78 ▲0.79
Media Library /wp-admin/upload.php3.26 ▲0.0335.91 ▼1.24

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

JS Crop: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.37 ▲0.022.41 ▲0.5843.09 ▼1.05
Dashboard /wp-admin2,189 ▲155.64 ▲0.1293.66 ▼0.5038.80 ▼5.08
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0135.82 ▼6.2834.65 ▼0.61
Add New Post /wp-admin/post-new.php1,696 ▲16821.77 ▼1.25597.42 ▼99.6851.84 ▼3.55
Media Library /wp-admin/upload.php1,403 ▲64.23 ▼0.02103.98 ▼2.6645.82 ▼1.85

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/js-crop/js-crop.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Js Crop block on blocks section), #2 (JS Crop in effect)
You can look at the official readme.txt

js-crop/js-crop.php 85% from 13 tests

This is the main PHP file of "JS Crop" version 2.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Git Repository: A Git repository was detected inside this plugin
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected16,329 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 6.91MB with 4.61MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png365.07KB110.61KB▼ 69.70%
screenshot-2.png6,709.25KB2,438.62KB▼ 63.65%