84% custom-background-changer

Code Review | Custom Background Changer

WordPress plugin Custom Background Changer scored84%from 54 tests.

About plugin

  • Plugin page: custom-background...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.4
  • WordPress version: 6.3.1
  • First release: Jun 3, 2016
  • Latest release: Mar 26, 2018
  • Number of updates: 6
  • Update frequency: every 110.5 days
  • Top authors: anshuln90 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /43,517 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.23MB] [CPU: ▼18.60ms] Passed 4 tests

Analyzing server-side resources used by Custom Background Changer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.01 ▼1.49
Dashboard /wp-admin3.22 ▼0.0925.96 ▼17.81
Posts /wp-admin/edit.php3.29 ▼0.0631.24 ▼18.43
Add New Post /wp-admin/post-new.php5.18 ▼0.7158.42 ▼27.72
Media Library /wp-admin/upload.php3.17 ▼0.0623.97 ▼10.44

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Background Changer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲16814.67 ▲0.071.64 ▼0.2741.03 ▲1.42
Dashboard /wp-admin2,351 ▲1736.50 ▲0.77106.60 ▼2.4838.73 ▲0.13
Posts /wp-admin/edit.php2,294 ▲1943.60 ▲1.6247.20 ▲8.2931.45 ▼8.30
Add New Post /wp-admin/post-new.php6,425 ▲4,89926.18 ▲2.85908.30 ▲226.4650.84 ▼6.86
Media Library /wp-admin/upload.php1,422 ▲224.41 ▲0.1681.57 ▼21.9241.35 ▼2.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-background-changer/custom-background-changer.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (21 tag instead of maximum 10)
Please take inspiration from this readme.txt

custom-background-changer/custom-background-changer.php Passed 13 tests

The main file in "Custom Background Changer" v. 3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
81 characters long description:
A WordPress plugin to change different background color or image on post or page.

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
Success! There were no dangerous files found in this plugin248 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP13060183
CSS11341
JavaScript1111924

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
No PNG images were found in this plugin