74% change-background-color-for-pages-posts-widgets

Code Review | Change Background Color for Pages, Posts, Widgets

WordPress plugin Change Background Color for Pages, Posts, Widgets scored74%from 54 tests.

About plugin

  • Plugin page: change-background...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 16, 2021
  • Latest release: Nov 7, 2021
  • Number of updates: 7
  • Update frequency: every 3.2 days
  • Top authors: andybruce11 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active /3,905 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.84MB] [CPU: ▼51.03ms] Passed 4 tests

An overview of server-side resources used by Change Background Color for Pages, Posts, Widgets
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.325.16 ▼29.65
Dashboard /wp-admin2.16 ▼1.146.61 ▼40.74
Posts /wp-admin/edit.php2.16 ▼1.195.30 ▼45.16
Add New Post /wp-admin/post-new.php2.16 ▼3.725.90 ▼88.57
Media Library /wp-admin/upload.php2.16 ▼1.076.12 ▼29.61

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Change Background Color for Pages, Posts, Widgets
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.32 ▼1.061.71 ▼0.3142.90 ▼1.33
Dashboard /wp-admin2,238 ▲535.10 ▼0.7597.46 ▼10.6638.77 ▼1.69
Posts /wp-admin/edit.php2,126 ▲372.30 ▲0.2636.72 ▼3.2431.88 ▼5.44
Add New Post /wp-admin/post-new.php6,349 ▲4,83526.27 ▲8.72945.82 ▲257.1143.37 ▼15.78
Media Library /wp-admin/upload.php1,417 ▲294.49 ▲0.27106.14 ▼2.7245.30 ▼0.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/change-background-color-for-pages-posts-widgets/index.php:50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: You can look at the official readme.txt

change-background-color-for-pages-posts-widgets/index.php 92% from 13 tests

This is the main PHP file of "Change Background Color for Pages, Posts, Widgets" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("change-background-color-for-pages-posts-widgets.php" instead of "index.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
There were no executable files found in this plugin242 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP19470237
JavaScript1215

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity14.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected