79% next-order-coupon-woocommerce

Code Review | WooCommerce Next Order Coupon

WordPress plugin WooCommerce Next Order Coupon scored 79% from 54 tests.

About plugin

  • Plugin page: next-order-coupon...
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.8
  • WordPress version: 5.9.2
  • First release: Feb 7, 2017
  • Latest release: Sep 28, 2018
  • Number of updates: 16
  • Update frequency: every 37.3 days
  • Top authors: kenanfallon (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 3,627 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼291.58ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Next Order Coupon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.2854.02 ▲7.37
Dashboard /wp-admin3.66 ▲0.2634.69 ▲1.34
Posts /wp-admin/edit.php3.97 ▲0.3340.36 ▲4.26
Add New Post /wp-admin/post-new.php7.21 ▲0.2492.90 ▼1,174.03
Media Library /wp-admin/upload.php3.61 ▲0.3227.01 ▲2.11
Freemius Debug [v.1.2.1.5] /wp-admin/admin.php?page=freemius3.7524.16

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 126 new files
Database: no new tables, 4 new options
New WordPress options
fs_accounts
fs_debug_mode
fs_api_cache
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Next Order Coupon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,857 ▲11216.03 ▲0.295.82 ▼1.293.05 ▲0.28
Dashboard /wp-admin2,958 ▲1006.12 ▼0.08116.75 ▼19.68170.92 ▲8.89
Posts /wp-admin/edit.php2,754 ▲603.24 ▲0.0163.69 ▲0.30154.17 ▲12.91
Add New Post /wp-admin/post-new.php1,821 ▲10217.11 ▼4.79397.92 ▼27.12159.66 ▼2.48
Media Library /wp-admin/upload.php1,761 ▲635.54 ▲0.04148.75 ▲1.02207.38 ▲9.88
Freemius Debug [v.1.2.1.5] /wp-admin/admin.php?page=freemius1,4092.5056.39128.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/next-order-coupon-woocommerce/freemius/includes/class-freemius.php+4348
    First parameter must either be an object or the name of an existing class
  • The uninstall procedure has failed, leaving 4 options in the database
    • fs_api_cache
    • fs_active_plugins
    • fs_debug_mode
    • fs_accounts

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
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === next-order-coupon-woocommerce === )
The official readme.txt might help

next-order-coupon-woocommerce/woocommerce-next-order-coupon.php 77% from 13 tests

The main PHP file in "WooCommerce Next Order Coupon" ver. 0.4.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "3.0.0")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Name the main plugin file the same as the plugin slug ("next-order-coupon-woocommerce.php" instead of "woocommerce-next-order-coupon.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin20,268 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PHP753,3508,05614,398
PO File51,4381,4603,710
Sass15267821,636
JavaScript43763229
Markdown2680214
JSON20042
YAML22028
CSS90011

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,019)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity42.51
▷ Minimum class complexity1.00
▷ Maximum class complexity1,019.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes25.41%
▷ Concrete classes3594.59%
▷ Final classes00.00%
Methods669
▷ Static methods10415.55%
▷ Public methods49774.29%
▷ Protected methods142.09%
▷ Private methods15823.62%
Functions53
▷ Named functions53100.00%
▷ Anonymous functions00.00%
Constants93
▷ Global constants7681.72%
▷ Class constants1718.28%
▷ Public constants17100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%