57% crop-express

Code Review | Crop Express - For Featured Images, Media Library + Image Cropper Block

WordPress plugin Crop Express - For Featured Images, Media Library + Image Cropper Block scored57%from 54 tests.

About plugin

  • Plugin page: crop-express
  • Plugin version: 0.0.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 26, 2023
  • Latest release: Mar 25, 2023
  • Number of updates: 12
  • Update frequency: every 4.9 days
  • Top authors: gelform (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /400 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼4.80ms] Passed 4 tests

An overview of server-side resources used by Crop Express - For Featured Images, Media Library + Image Cropper Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1444.69 ▲7.05
Dashboard /wp-admin3.45 ▲0.1048.86 ▼10.23
Posts /wp-admin/edit.php3.57 ▲0.2147.07 ▼0.26
Add New Post /wp-admin/post-new.php6.06 ▲0.1784.42 ▼14.84
Media Library /wp-admin/upload.php3.40 ▲0.1638.46 ▲6.14
Add New /wp-admin/upload.php?crop-express3.4036.67
crop.express /wp-admin/options-general.php?page=crop-express-settings3.3229.46

Server storage [IO: ▲0.63MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Crop Express - For Featured Images, Media Library + Image Cropper Block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.21 ▼1.394.67 ▲3.0843.90 ▲4.59
Dashboard /wp-admin2,210 ▲185.86 ▲0.90113.26 ▲10.7243.35 ▼0.46
Posts /wp-admin/edit.php2,093 ▲72.01 ▼0.0334.65 ▼3.5733.66 ▼2.17
Add New Post /wp-admin/post-new.php6,190 ▲4,67019.94 ▼3.15963.20 ▲272.8538.72 ▼15.47
Media Library /wp-admin/upload.php1,393 ▲54.24 ▲0.0297.26 ▼4.8542.16 ▼2.48
Add New /wp-admin/upload.php?crop-express1,3994.2491.6036.43
crop.express /wp-admin/options-general.php?page=crop-express-settings8032.0524.7231.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/crop-express/inc/Admin.php+108
    Undefined index: _wpnonce
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?crop-express
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/crop-express/inc/Admin.php+82
    Undefined index: _wpnonce
    • > GET request to /wp-admin/options-general.php?page=crop-express-settings
    • > Notice in wp-content/plugins/crop-express/inc/Admin.php+205
    Undefined index: screen
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=crop-express-settings
    • > Notice in wp-content/plugins/crop-express/inc/Admin.php+76
    Undefined index: welcome
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=crop-express-settings
    • > Notice in wp-content/plugins/crop-express/inc/Admin.php+76
    Trying to access array offset on value of type null

SRP 0% 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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/crop-express/settings/html/settings/welcome.php
    • > /wp-content/plugins/crop-express/settings/html/settings/site-wide.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CROPEXPRESS\\Singleton' not found in wp-content/plugins/crop-express/inc/Scripts.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Cropexpress() in wp-content/plugins/crop-express/settings/html/settings/media-library.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/crop-express/settings/html/settings/html/sizes.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CROPEXPRESS\\Singleton' not found in wp-content/plugins/crop-express/inc/Block.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CROPEXPRESS\\Singleton' not found in wp-content/plugins/crop-express/inc/MediaLibrary.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'CROPEXPRESS\\Singleton' not found in wp-content/plugins/crop-express/inc/Admin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Cropexpress() in wp-content/plugins/crop-express/settings/html/settings/featured-image.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/crop-express/settings/html/settings/html/presets.php:95
    • > PHP Fatal error
      Uncaught Error: Class 'CROPEXPRESS\\Singleton' not found in wp-content/plugins/crop-express/inc/Util.php:5
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/crop-express/settings/html/settings/html/presets.php on line 26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/upload.php?crop-express
    • > Network (severe)
    https://localhost:3000/static/js/bundle.js?ver=0.0.4 - Failed to load resource: net::ERR_CONNECTION_REFUSED

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: image editing, image crop, cropping, image optimization, thumbnails...

crop-express/crop-express.php 92% from 13 tests

The main file in "Crop Express - For Featured Images, Media Library + Image Cropper Block" v. 0.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,286 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP282744511,275
JavaScript3788793
CSS111177
JSON20041

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity12.55
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods72
▷ Static methods2230.56%
▷ Public methods6286.11%
▷ Protected methods68.33%
▷ Private methods45.56%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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