80% product-percentage-coupon-woo

Code Review | Percentage Coupon per Product for WooCommerce

WordPress plugin Percentage Coupon per Product for WooCommerce scored80%from 54 tests.

About plugin

  • Plugin page: product-percentag...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2020
  • Latest release: Jul 17, 2023
  • Number of updates: 16
  • Update frequency: every 67.1 days
  • Top authors: webdados (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,354 total downloads

Benchmarks

Plugin footprint 65% from 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: ▼1.89MB] [CPU: ▼50.35ms] Passed 4 tests

A check of server-side resources used by Percentage Coupon per Product for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.64 ▼33.66
Dashboard /wp-admin2.12 ▼1.188.10 ▼40.69
Posts /wp-admin/edit.php2.12 ▼1.239.04 ▼39.65
Add New Post /wp-admin/post-new.php2.12 ▼3.778.05 ▼87.39
Media Library /wp-admin/upload.php2.12 ▼1.107.84 ▼25.62

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Percentage Coupon per Product for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲10913.29 ▼1.092.08 ▲0.2442.68 ▼4.58
Dashboard /wp-admin2,225 ▲404.87 ▼0.00106.91 ▲7.4337.39 ▼5.86
Posts /wp-admin/edit.php2,108 ▲192.01 ▲0.0040.13 ▲4.1937.60 ▲6.30
Add New Post /wp-admin/post-new.php1,558 ▲3918.20 ▼5.05604.18 ▼76.0955.51 ▼6.17
Media Library /wp-admin/upload.php1,407 ▲194.23 ▼0.0298.25 ▼10.3441.74 ▼5.47

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
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/product-percentage-coupon-woo/product-percentage-coupon-woo.php+30
    Undefined index: WC requires at least
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: coupon, marketing, woocommerce, discount

product-percentage-coupon-woo/product-percentage-coupon-woo.php Passed 13 tests

"Percentage Coupon per Product for WooCommerce" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
72 characters long description:
Create WooCommerce coupons with variable discount percentage per product

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
There were no executable files found in this plugin483 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34486483

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity65.00
▷ Minimum class complexity65.00
▷ Maximum class complexity65.00
Average method complexity4.76
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods17
▷ Static methods15.88%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin