84% custom-background-101

Code Review | Custom Backgrounds

WordPress plugin Custom Backgrounds scored84%from 54 tests.

About plugin

  • Plugin page: custom-background...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2013
  • Latest release: Feb 13, 2013
  • Number of updates: 3
  • Update frequency: every 4.7 days
  • Top authors: jacky.smith5858 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /5,903 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

Analyzing server-side resources used by Custom Backgrounds
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.10 ▼2.11
Dashboard /wp-admin3.32 ▲0.0145.00 ▼1.21
Posts /wp-admin/edit.php3.37 ▲0.0148.53 ▲0.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.73 ▼5.86
Media Library /wp-admin/upload.php3.24 ▲0.0134.02 ▲0.19

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 10 new options
New WordPress options
bg
widget_recent-comments
repeat
bc
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
position
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Backgrounds
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.35 ▼1.021.55 ▼0.3641.59 ▼3.91
Dashboard /wp-admin2,232 ▲475.09 ▼0.77116.04 ▲14.0842.42 ▲0.32
Posts /wp-admin/edit.php2,134 ▲422.43 ▲0.4652.29 ▲5.8134.39 ▼7.19
Add New Post /wp-admin/post-new.php1,534 ▲617.88 ▼0.31604.14 ▼16.4250.93 ▼15.41
Media Library /wp-admin/upload.php1,415 ▲304.49 ▲0.32101.80 ▲0.3441.22 ▼2.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • repeat
    • bg
    • position
    • bc
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-background-101/custom_background.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-background-101/css.php:7
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-background-101/custom_background.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-background-101/css.php:7

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 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is how the slider will look on you post or page.), #2 (Go to wp-admin/admin.php?page=page=bc_options to configure the slider.)
The official readme.txt might help

custom-background-101/custom_background.php 92% from 13 tests

The primary PHP file in "Custom Backgrounds" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-background-101.php" instead of "custom_background.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected155 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22122155

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.30MB with 0.18MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png67.93KB26.16KB▼ 61.50%
screenshot-2.png238.84KB105.52KB▼ 55.82%