84% woo-coupons-by-categories-and-tags

Code Review | Coupons by Categories and Tags for WooCommerce

WordPress plugin Coupons by Categories and Tags for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-coupons-by-ca...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.7
  • WordPress version: 6.3.1
  • First release: Jul 11, 2017
  • Latest release: Nov 26, 2021
  • Number of updates: 15
  • Update frequency: every 106.7 days
  • Top authors: tychesoftwares (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,176 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼11.45ms] Passed 4 tests

A check of server-side resources used by Coupons by Categories and Tags for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.02 ▼6.62
Dashboard /wp-admin3.35 ▲0.0146.85 ▼11.39
Posts /wp-admin/edit.php3.40 ▲0.0539.89 ▼7.82
Add New Post /wp-admin/post-new.php5.93 ▲0.0577.11 ▼19.95
Media Library /wp-admin/upload.php3.27 ▲0.0538.23 ▲1.41
Coupon Categories /wp-admin/edit-tags.php?taxonomy=coupon_category3.2732.23

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Coupons by Categories and Tags for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲3914.47 ▲0.191.84 ▼0.3640.91 ▼10.34
Dashboard /wp-admin2,195 ▲185.62 ▼0.0484.60 ▼15.6439.36 ▼3.77
Posts /wp-admin/edit.php2,103 ▲61.98 ▼0.0236.76 ▼0.8032.03 ▼3.75
Add New Post /wp-admin/post-new.php1,527 ▲122.99 ▼0.07614.74 ▼37.6768.85 ▼0.51
Media Library /wp-admin/upload.php1,403 ▼04.18 ▼0.0099.28 ▼3.3444.88 ▼0.47
Coupon Categories /wp-admin/edit-tags.php?taxonomy=coupon_category1,2732.1229.9729.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-coupons-by-categories-and-tags/woocommerce-coupons-category-tag.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: organize coupons, coupon tag, group woocommerce coupons, coupon category, coupon taxonomy

woo-coupons-by-categories-and-tags/woocommerce-coupons-category-tag.php 92% from 13 tests

The primary PHP file in "Coupons by Categories and Tags for WooCommerce" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-coupons-by-categories-and-tags.php" instead of "woocommerce-coupons-category-tag.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 detected109 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1179109

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin