10% bgcolor-setter

Code Review | BGColor Setter

WordPress plugin BGColor Setter scored 10% from 54 tests.

About plugin

  • Plugin page: bgcolor-setter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.5.1
  • WordPress version: 5.8.1
  • First release: Mar 25, 2013
  • Latest release: Mar 25, 2013
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: grigori991 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,151 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/bgcolor-setter/bgcolor_setter.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Bgcolor_Setter has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼189.12ms] Passed 4 tests

This is a short check of server-side resources used by BGColor Setter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.78 ▼0.944.79 ▼15.28
Dashboard /wp-admin1.80 ▼1.264.79 ▼40.88
Posts /wp-admin/edit.php1.80 ▼1.315.67 ▼37.75
Add New Post /wp-admin/post-new.php1.80 ▼3.644.31 ▼653.50
Media Library /wp-admin/upload.php1.80 ▼1.205.29 ▼24.33

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
widget_bgcolor_setter

Browser metrics Passed 4 tests

A check of browser resources used by BGColor Setter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲9516.28 ▲0.6711.60 ▲1.5147.56 ▲0.36
Dashboard /wp-admin2,973 ▲425.93 ▼0.19132.47 ▼22.43115.12 ▲1.24
Posts /wp-admin/edit.php2,739 ▼02.73 ▲0.0264.19 ▼1.2889.37 ▲4.24
Add New Post /wp-admin/post-new.php1,876 ▲37819.14 ▲0.30378.55 ▲11.78115.11 ▲3.83
Media Library /wp-admin/upload.php1,807 ▼35.02 ▼0.01147.44 ▼6.78119.25 ▲2.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/bgcolor-setter/bgcolor_setter.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Bgcolor_Setter has a deprecated constructor
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_bgcolor_setter

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
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: Class 'WP_Widget' not found in wp-content/plugins/bgcolor-setter/bgcolor_setter.php:10

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: background, cookie, widget, wordpress, color...

bgcolor-setter/bgcolor_setter.php 92% from 13 tests

The principal PHP file in "BGColor Setter" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bgcolor-setter.php" instead of "bgcolor_setter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin107 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript12361
PHP14946

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected