84% background-image-cropper

Code Review | Background Image Cropper

WordPress plugin Background Image Cropper scored84%from 54 tests.

About plugin

  • Plugin page: background-image-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 6.3.1
  • First release: Jul 14, 2015
  • Latest release: Mar 30, 2020
  • Number of updates: 14
  • Update frequency: every 123.0 days
  • Top authors: celloexpressions (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /41,544 total downloads

Benchmarks

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 gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼5.79ms] Passed 4 tests

Server-side resources used by Background Image Cropper
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.54 ▼1.90
Dashboard /wp-admin3.31 ▼0.0347.19 ▼11.02
Posts /wp-admin/edit.php3.37 ▲0.0145.92 ▲1.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.36 ▼9.87
Media Library /wp-admin/upload.php3.24 ▲0.0134.44 ▼0.36

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Background Image Cropper
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.33 ▼1.094.43 ▲2.6843.31 ▲2.02
Dashboard /wp-admin2,206 ▲184.84 ▼0.95113.06 ▲9.7143.84 ▲2.42
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0233.14 ▼2.1234.93 ▼1.67
Add New Post /wp-admin/post-new.php1,533 ▼023.32 ▲0.11643.96 ▲6.1955.73 ▲7.06
Media Library /wp-admin/upload.php1,388 ▼04.14 ▼0.0995.84 ▲0.8244.23 ▲2.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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× 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/background-image-cropper/background-image-cropper.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: background image, cropping, custom background, customizer

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

The main file in "Background Image Cropper" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
77 characters long description:
Adds cropping to backgroud images in the Customizer, like header images have.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin72 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1124839
JavaScript1122533

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity2.50
▷ Minimum method complexity2.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected