89% woo-dynamic-coupons

Code Review | WooCommerce Dynamic Coupons

WordPress plugin WooCommerce Dynamic Coupons scored89%from 54 tests.

About plugin

  • Plugin page: woo-dynamic-coupons
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1
  • WordPress version: 6.3.1
  • First release: Mar 19, 2019
  • Latest release: Mar 19, 2019
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: 2cloud (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /546 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.51ms] Passed 4 tests

A check of server-side resources used by WooCommerce Dynamic Coupons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.02 ▼2.57
Dashboard /wp-admin3.31 ▲0.0147.50 ▼2.64
Posts /wp-admin/edit.php3.36 ▲0.0048.34 ▲1.69
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.81 ▼3.94
Media Library /wp-admin/upload.php3.23 ▲0.0031.16 ▼0.89

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 90 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

WooCommerce Dynamic Coupons: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.26 ▼1.121.60 ▼0.3640.66 ▼2.28
Dashboard /wp-admin2,209 ▲174.85 ▼0.0498.33 ▼10.4238.23 ▼0.45
Posts /wp-admin/edit.php2,089 ▼01.99 ▲0.0039.71 ▲0.3935.79 ▲2.19
Add New Post /wp-admin/post-new.php1,533 ▲1923.29 ▲5.55580.52 ▼98.7953.17 ▼8.84
Media Library /wp-admin/upload.php1,385 ▼34.21 ▼0.0095.95 ▼8.3343.87 ▲0.61

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed: The official readme.txt is a good inspiration

woo-dynamic-coupons/woocommerce-dynamic-coupons.php 77% from 13 tests

The main PHP script in "WooCommerce Dynamic Coupons" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-dynamic-coupons.php" instead of "woocommerce-dynamic-coupons.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.0")

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
Good job! No executable or dangerous file extensions detected11,053 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
Sass751,2191,5585,597
CSS1174,880
SVG100288
PHP4130102236
JavaScript142142
Markdown13010

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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