84% coupon-for-woocommerce

Code Review | Coupon for WooCommerce

WordPress plugin Coupon for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: coupon-for-woocom...
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.6
  • WordPress version: 6.3.1
  • First release: Nov 23, 2020
  • Latest release: Nov 25, 2020
  • Number of updates: 23
  • Update frequency: every 0.3 days
  • Top authors: provalis2020 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /499 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.96ms] Passed 4 tests

This is a short check of server-side resources used by Coupon for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.06 ▼5.28
Dashboard /wp-admin3.37 ▲0.0650.72 ▲0.13
Posts /wp-admin/edit.php3.42 ▲0.0646.57 ▼4.66
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.20 ▼9.24
Media Library /wp-admin/upload.php3.29 ▲0.0639.72 ▼0.66

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Coupon for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2913.67 ▼0.691.66 ▼0.3039.79 ▼2.55
Dashboard /wp-admin2,224 ▲244.89 ▼0.9898.48 ▼2.6438.24 ▼6.38
Posts /wp-admin/edit.php2,103 ▲32.05 ▲0.0335.56 ▼6.7633.25 ▼4.23
Add New Post /wp-admin/post-new.php1,545 ▼023.18 ▼0.02672.54 ▼15.3164.19 ▲0.20
Media Library /wp-admin/upload.php1,400 ▼04.27 ▲0.0998.23 ▼8.2843.34 ▼5.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
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 add_action() in wp-content/plugins/coupon-for-woocommerce/coupon-for-woocommerce.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: coupons, voucher, coupon, gutscheine, woocommerce...

coupon-for-woocommerce/coupon-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Coupon for WooCommerce" version 1.3.0
111 characters long description:
Generate automatically coupon codes in WooCommerce. Compatible with the vouchers of Germanized for WooCommerce.

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 plugin398 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15121270
PO File14041128

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity7.33
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.16MB with 0.13MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png105.93KB33.88KB▼ 68.02%
images/coupon-for-woocommerce.png55.46KB2.55KB▼ 95.41%