79% product-color

Code Review | Product Color

WordPress plugin Product Color scored 79% from 54 tests.

About plugin

  • Plugin page: product-color
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 11, 2023
  • Latest release: Apr 11, 2023
  • Number of updates: 9
  • Update frequency: every 2.0 days
  • Top authors: vijayrathod245 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 116 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.78ms] Passed 4 tests

An overview of server-side resources used by Product Color
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1341.95 ▲1.46
Dashboard /wp-admin3.40 ▲0.0946.43 ▼3.39
Posts /wp-admin/edit.php3.51 ▲0.1647.03 ▲1.49
Add New Post /wp-admin/post-new.php6.00 ▲0.1193.79 ▼2.68
Media Library /wp-admin/upload.php3.32 ▲0.0934.56 ▲2.76

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Product Color
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲21113.78 ▼0.975.60 ▲3.8162.43 ▲19.00
Dashboard /wp-admin2,238 ▲505.02 ▼0.87109.89 ▲7.5044.34 ▼1.52
Posts /wp-admin/edit.php2,129 ▲402.33 ▲0.2940.26 ▲3.5643.18 ▲9.13
Add New Post /wp-admin/post-new.php1,447 ▼9122.48 ▼0.63560.59 ▼115.9636.70 ▼18.44
Media Library /wp-admin/upload.php1,423 ▲354.46 ▲0.29101.64 ▼0.2746.32 ▲0.09

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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 0% 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/product-color/public/partials/product-color-public-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Color_Admin' not found in wp-content/plugins/product-color/admin/partials/product-color-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-color/product-color.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: woocommerce, color, products, tags, categories

product-color/product-color.php Passed 13 tests

This is the main PHP file of "Product Color" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
13 characters long description:
Product color

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected517 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12161616475
CSS20833
JavaScript25549

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.71
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/placeholder.png13.10KB6.84KB▼ 47.76%