84% brand-coupons-for-woocommerce

Code Review | Brand Coupons for WooCommerce

WordPress plugin Brand Coupons for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: brand-coupons-for...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 23, 2021
  • Latest release: Jan 28, 2021
  • Number of updates: 20
  • Update frequency: every 0.5 days
  • Top authors: ampersandfactory (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /723 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Brand Coupons for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.90 ▼3.90
Dashboard /wp-admin3.41 ▲0.1149.45 ▼5.19
Posts /wp-admin/edit.php3.52 ▲0.1752.05 ▲2.94
Add New Post /wp-admin/post-new.php6.00 ▲0.1298.50 ▼1.92
Media Library /wp-admin/upload.php3.33 ▲0.1041.65 ▲5.20

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Brand Coupons for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,936 ▲17514.53 ▲0.184.98 ▲3.4438.83 ▼2.23
Dashboard /wp-admin2,234 ▲575.62 ▲0.0584.71 ▼5.7241.98 ▼4.78
Posts /wp-admin/edit.php2,153 ▲502.09 ▲0.1241.01 ▲4.1736.98 ▲1.54
Add New Post /wp-admin/post-new.php1,575 ▲4718.37 ▼4.76650.78 ▼40.3373.55 ▲19.66
Media Library /wp-admin/upload.php1,449 ▲494.28 ▲0.05104.89 ▼2.3652.72 ▲7.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/brand-coupons-for-woocommerce/public/partials/woocommerce-brand-coupons-public-display.php
    • > /wp-content/plugins/brand-coupons-for-woocommerce/admin/partials/woocommerce-brand-coupons-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: woocommerce brands, coupons, product brands, coupon codes, coupon banner...

brand-coupons-for-woocommerce/brand-coupons-for-woocommerce.php 92% from 13 tests

The main PHP script in "Brand Coupons for WooCommerce" version 1.0.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected673 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP12258548489
PO File24044100
CSS2131166
SVG10012
JavaScript24546

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3286.49%
▷ Protected methods00.00%
▷ Private methods513.51%
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

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin