10% custom-background-for-post-and-page

Code Review | Custom Background for Post and Page

WordPress plugin Custom Background for Post and Page scored 10% from 54 tests.

About plugin

  • Plugin page: custom-background...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-3.6.1
  • WordPress version: 5.8.1
  • First release: Oct 1, 2013
  • Latest release: Oct 19, 2013
  • Number of updates: 5
  • Update frequency: every 3.6 days
  • Top authors: mesunil2010 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 7,265 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Parse error in wp-content/plugins/custom-background-for-post-and-page/custombg.php+428
    syntax error, unexpected end of file

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

An overview of server-side resources used by Custom Background for Post and Page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1237.43 ▲14.98
Dashboard /wp-admin3.06 ▲0.0046.00 ▼3.32
Posts /wp-admin/edit.php3.11 ▲0.0043.84 ▼3.72
Add New Post /wp-admin/post-new.php5.42 ▼0.0287.39 ▼582.36
Media Library /wp-admin/upload.php3.00 ▲0.0028.17 ▼7.14

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Background for Post and Page
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.32 ▲0.899.62 ▼0.4447.46 ▲1.09
Dashboard /wp-admin2,967 ▲365.95 ▼0.05143.77 ▼13.67100.09 ▼10.14
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0078.09 ▲9.3587.76 ▲2.66
Add New Post /wp-admin/post-new.php1,683 ▲18318.78 ▲0.12394.33 ▼2.52111.18 ▲4.98
Media Library /wp-admin/upload.php1,810 ▲35.05 ▲0.03148.29 ▼16.28116.29 ▲6.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

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
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/custom-background-for-post-and-page/custombg.php on line 428

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
Please take inspiration from this readme.txt

custom-background-for-post-and-page/custombg.php 92% from 13 tests

The main PHP script in "Custom Background for Post and Page" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-background-for-post-and-page.php" instead of "custombg.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,061 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113837778
PHP110936283

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
hs.png2.62KB7.54KB0.00%
hv.png2.80KB7.32KB0.00%