83% wp-image-cropper

Code Review | WP Image Cropper

WordPress plugin WP Image Cropper scored83%from 54 tests.

About plugin

  • Plugin page: wp-image-cropper
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 18, 2017
  • Latest release: Apr 25, 2020
  • Number of updates: 10
  • Update frequency: every 101.2 days
  • Top authors: hk1993 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /2,932 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.16ms] Passed 4 tests

Analyzing server-side resources used by WP Image Cropper
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.39 ▼1.47
Dashboard /wp-admin3.32 ▲0.0250.54 ▼0.61
Posts /wp-admin/edit.php3.37 ▲0.0148.48 ▼4.33
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.47 ▼6.21
Media Library /wp-admin/upload.php3.24 ▲0.0145.67 ▲10.56

Server storage [IO: ▲1.44MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

WP Image Cropper: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲17613.84 ▼0.8210.21 ▲8.5950.95 ▲6.64
Dashboard /wp-admin2,217 ▲425.78 ▼0.0293.24 ▼16.8240.25 ▼2.75
Posts /wp-admin/edit.php2,119 ▲192.41 ▲0.3937.72 ▲1.0933.71 ▼1.15
Add New Post /wp-admin/post-new.php1,701 ▲17023.03 ▼0.15682.07 ▲26.4842.01 ▼14.48
Media Library /wp-admin/upload.php1,425 ▲254.47 ▲0.20102.30 ▲2.8947.24 ▲1.59

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-image-cropper/public/partials/wp-image-cropper-public-display.php
    • > /wp-content/plugins/wp-image-cropper/admin/partials/wp-image-cropper-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add descriptions for screenshots #3, #4, #5, #6 in wp-image-cropper/assets to your readme.txt
  • Tags: Too many tags (23 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires at least: Version format is invalid
You can look at the official readme.txt

wp-image-cropper/wp-image-cropper.php Passed 13 tests

"WP Image Cropper" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

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
No dangerous file extensions were detected2,168 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript73621491,426
CSS912047588
PHP12139951154

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon.png99.16KB23.76KB▼ 76.04%