84% woo-product-category-discount

Code Review | Category Discount Woocommerce

WordPress plugin Category Discount Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-product-categ...
  • Plugin version: 4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 15, 2015
  • Latest release: Oct 17, 2023
  • Number of updates: 117
  • Update frequency: every 24.5 days
  • Top authors: vidishp (100%)

Code review

54 tests

User reviews

59 reviews

Install metrics

6,000+ active /66,639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Category Discount Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.91 ▼1.33
Dashboard /wp-admin3.31 ▼0.0454.23 ▼4.45
Posts /wp-admin/edit.php3.36 ▲0.0047.13 ▼1.90
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.37 ▼7.81
Media Library /wp-admin/upload.php3.23 ▲0.0036.35 ▲4.97

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Category Discount Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.391.69 ▼0.0238.83 ▼3.17
Dashboard /wp-admin2,189 ▲125.54 ▼0.0184.72 ▼3.2940.04 ▼3.38
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0233.98 ▼1.6533.81 ▼1.25
Add New Post /wp-admin/post-new.php1,526 ▼223.58 ▲0.37687.52 ▲32.1152.88 ▲0.05
Media Library /wp-admin/upload.php1,397 ▼34.25 ▲0.0795.94 ▼5.9340.98 ▼0.71

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just 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 apply_filters() in wp-content/plugins/woo-product-category-discount/woo-product-category-discount.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-product-category-discount === )
Please take inspiration from this readme.txt

woo-product-category-discount/woo-product-category-discount.php 92% from 13 tests

"Category Discount Woocommerce" version 4.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,253 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP211666584
CSS17221565
JavaScript1305104

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/complete.png3.37KB1.83KB▼ 45.74%