83% color-changer

Code Review | Color Changer

WordPress plugin Color Changer scored83%from 54 tests.

About plugin

  • Plugin page: color-changer
  • Plugin version: 1.5
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Mar 1, 2018
  • Number of updates: 21
  • Update frequency: every 1.8 days
  • Top authors: rahulraykor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,033 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Color Changer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.89 ▼4.34
Dashboard /wp-admin3.32 ▲0.0144.58 ▼5.59
Posts /wp-admin/edit.php3.37 ▲0.0150.23 ▲2.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.84 ▲0.25
Media Library /wp-admin/upload.php3.24 ▲0.0134.70 ▼1.38

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Color Changer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.55 ▼0.831.96 ▲0.2842.01 ▲0.95
Dashboard /wp-admin2,209 ▲215.86 ▲0.9899.98 ▼9.9540.12 ▼2.55
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0440.25 ▼1.5836.07 ▼2.59
Add New Post /wp-admin/post-new.php1,542 ▲1418.71 ▲0.49644.73 ▲24.1854.27 ▼6.33
Media Library /wp-admin/upload.php1,388 ▲34.21 ▼0.0899.20 ▼2.9542.85 ▼0.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/color-changer/class.color-changer.php:16

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

color-changer/class.color-changer.php 85% from 13 tests

The primary PHP file in "Color Changer" version 1.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 245 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("color-changer.php" instead of "class.color-changer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin96 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1141568
PHP1113328

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
plugin/img/colorChanger.png37.89KB8.19KB▼ 78.40%