78% add-background-size-to-customizer

Code Review | Add Background-Size to Customizer

WordPress plugin Add Background-Size to Customizer scored 78% from 54 tests.

About plugin

  • Plugin page: add-background-si...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-4.2.3
  • WordPress version: 5.9.2
  • First release: Jul 26, 2015
  • Latest release: Jul 26, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: cmborchert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Add Background-Size to Customizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0257.67 ▲3.27
Dashboard /wp-admin3.42 ▲0.0132.28 ▼2.00
Posts /wp-admin/edit.php3.65 ▲0.0137.31 ▼1.24
Add New Post /wp-admin/post-new.php6.89 ▼0.0892.58 ▼1,210.16
Media Library /wp-admin/upload.php3.30 ▲0.0124.38 ▼1.99
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php4.5744.93

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 2 new options
New WordPress options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Add Background-Size to Customizer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲6315.83 ▲0.055.84 ▼0.162.78 ▲0.15
Dashboard /wp-admin2,897 ▲436.10 ▼0.09119.03 ▼12.59154.15 ▼8.62
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0163.89 ▼0.02137.64 ▼5.61
Add New Post /wp-admin/post-new.php1,664 ▼8816.29 ▼4.73410.22 ▼46.24154.62 ▼4.79
Media Library /wp-admin/upload.php1,706 ▲85.47 ▼0.07145.56 ▲8.01182.44 ▼1.62
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php5,51618.32524.80155.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-background-size-to-customizer/add-bg-size-to-customizer.php:61

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: css, background, appearance, image, customizer

add-background-size-to-customizer/add-bg-size-to-customizer.php 85% from 13 tests

Analyzing the main PHP file in "Add Background-Size to Customizer" version 0.0.1
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 312 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-background-size-to-customizer.php" instead of "add-bg-size-to-customizer.php")

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
No dangerous file extensions were detected53 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151653

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin