93% color-changer

Code Review | Color Changer

WordPress plugin Color Changer scored 93% 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: 5.8.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 / 811 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Server-side resources used by Color Changer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1327.51 ▲13.08
Dashboard /wp-admin3.07 ▲0.0135.98 ▼8.47
Posts /wp-admin/edit.php3.12 ▲0.0134.39 ▼7.98
Add New Post /wp-admin/post-new.php5.43 ▼0.0074.65 ▼577.31
Media Library /wp-admin/upload.php3.01 ▲0.0126.95 ▲0.08

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Color Changer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,667 ▲6615.69 ▼0.324.92 ▼1.4775.34 ▲0.36
Dashboard /wp-admin2,929 ▲376.03 ▼0.13115.72 ▼74.72167.53 ▼56.39
Posts /wp-admin/edit.php2,740 ▼03.22 ▼0.0163.49 ▼7.88138.15 ▼30.37
Add New Post /wp-admin/post-new.php3,741 ▼018.99 ▲1.12437.09 ▼28.48161.71 ▲7.53
Media Library /wp-admin/upload.php1,752 ▲35.48 ▲0.03154.66 ▲2.54189.35 ▲2.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt might help

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

"Color Changer" version 1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 245 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected96 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
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
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ 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
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%