83% bfpc-image-cropper

Code Review | BFPC Image Cropper

WordPress plugin BFPC Image Cropper scored83%from 54 tests.

About plugin

  • Plugin page: bfpc-image-cropper
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2
  • WordPress version: 6.3.1
  • First release: Jan 29, 2020
  • Latest release: Jan 29, 2020
  • Number of updates: 16
  • Update frequency: every 0.4 days
  • Top authors: vasantrajput (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /453 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by BFPC Image Cropper
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.66 ▼4.75
Dashboard /wp-admin3.33 ▼0.0246.16 ▼14.16
Posts /wp-admin/edit.php3.38 ▲0.0243.56 ▲0.98
Add New Post /wp-admin/post-new.php5.91 ▲0.0276.49 ▼23.64
Media Library /wp-admin/upload.php3.25 ▲0.0233.75 ▼2.92

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

BFPC Image Cropper: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.89 ▲0.0744.43 ▲2.37
Dashboard /wp-admin2,192 ▲125.48 ▼0.1084.44 ▼10.8437.01 ▼4.85
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0334.52 ▼3.3541.25 ▲1.64
Add New Post /wp-admin/post-new.php1,526 ▼2423.15 ▲4.94671.31 ▲10.7253.49 ▼22.00
Media Library /wp-admin/upload.php1,397 ▼34.20 ▼0.02101.24 ▼6.4145.85 ▲0.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bfpc-image-cropper/bfpc-image-cropper/includes/template/bfpc-image-cropper-view.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bfpc-image-cropper/includes/template/bfpc-image-cropper-view.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bfpc-image-cropper/bfpc-image-cropper.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/bfpc-image-cropper/bfpc-image-cropper/includes/template/bfpc-image-cropper-template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/bfpc-image-cropper/includes/template/bfpc-image-cropper-template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bfpc-image-cropper/bfpc-image-cropper/bfpc-image-cropper.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Contributors: Contributors not specified
  • Contributors: No valid plugin tags found
The official readme.txt is a good inspiration

bfpc-image-cropper/bfpc-image-cropper.php 92% from 13 tests

The main PHP file in "BFPC Image Cropper" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • 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 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,273 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS23981954
JavaScript22924195
PHP64049118
SVG1006

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.50
▷ Minimum class complexity5.00
▷ Maximum class complexity10.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
6 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/icon.png11.81KB5.82KB▼ 50.72%
bfpc-image-cropper/includes/images/icon-white.png11.51KB5.82KB▼ 49.47%
includes/images/icon-light.png11.82KB5.82KB▼ 50.78%
bfpc-image-cropper/includes/images/icon.png11.81KB5.82KB▼ 50.72%
bfpc-image-cropper/includes/images/icon-light.png11.82KB5.82KB▼ 50.78%