94% croprefine

Code Review | CropRefine

WordPress plugin CropRefine scored 94% from 54 tests.

About plugin

  • Plugin page: croprefine
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-5.3.2
  • WordPress version: 5.8.1
  • First release: Mar 11, 2015
  • Latest release: Jun 15, 2021
  • Number of updates: 30
  • Update frequency: every 76.3 days
  • Top authors: era404 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active / 2,972 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼140.27ms] Passed 4 tests

Server-side resources used by CropRefine
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2136.02 ▲12.37
Dashboard /wp-admin3.16 ▲0.1046.71 ▲2.52
Posts /wp-admin/edit.php3.21 ▲0.1047.43 ▲8.79
Add New Post /wp-admin/post-new.php5.53 ▲0.1094.56 ▼563.38
Media Library /wp-admin/upload.php3.10 ▲0.0934.90 ▼8.99

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by CropRefine
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲11015.88 ▲0.596.93 ▼0.8251.28 ▲5.13
Dashboard /wp-admin2,987 ▲536.16 ▲0.11136.09 ▼1.99132.96 ▲22.45
Posts /wp-admin/edit.php2,749 ▲102.62 ▼0.0758.35 ▼9.7596.39 ▲12.68
Add New Post /wp-admin/post-new.php1,899 ▲22719.34 ▲0.41372.18 ▲13.00118.12 ▲11.21
Media Library /wp-admin/upload.php1,779 ▼285.25 ▲0.27124.56 ▼40.17142.68 ▲19.29

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Even though no errors were found, 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/croprefine/croprefine.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: resize, media, upload, management, image...

croprefine/croprefine.php Passed 13 tests

The main PHP file in "CropRefine" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
78 characters long description:
Giving you greater control over how each of your media item sizes are cropped.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,084 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions1493.33%
▷ Anonymous functions16.67%
▷ Global constants1100.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
4 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_img/screenshot-2.png85.24KB29.67KB▼ 65.20%
_img/screenshot-1.png21.91KB8.72KB▼ 60.18%
admin_icon.png1.11KB0.16KB▼ 85.96%
_img/bulcclub.png2.74KB1.77KB▼ 35.19%