90% woo-force-coupon

Code Review | Woo Force Coupon

WordPress plugin Woo Force Coupon scored 90% from 54 tests.

About plugin

  • Plugin page: woo-force-coupon
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Dec 21, 2015
  • Latest release: May 8, 2019
  • Number of updates: 9
  • Update frequency: every 137.2 days
  • Top authors: kowsar89 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 1,757 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
Install script ran successfully

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

Analyzing server-side resources used by Woo Force Coupon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.24 ▼1.16
Dashboard /wp-admin3.31 ▲0.0048.99 ▼1.34
Posts /wp-admin/edit.php3.36 ▲0.0044.01 ▼5.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.93 ▼5.10
Media Library /wp-admin/upload.php3.23 ▲0.0034.94 ▼2.35

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Woo Force Coupon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.78 ▲0.372.01 ▲0.1944.90 ▼3.53
Dashboard /wp-admin2,209 ▲245.91 ▲1.0796.61 ▼20.4137.07 ▼12.83
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0434.69 ▼2.6634.93 ▲1.57
Add New Post /wp-admin/post-new.php1,521 ▼822.94 ▼0.16653.66 ▼33.8551.32 ▼9.23
Media Library /wp-admin/upload.php1,385 ▼04.15 ▼0.03101.29 ▼11.1843.41 ▼5.61

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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: force, woocommerce, checkout, coupon, woo

woo-force-coupon/woo-force-coupon.php Passed 13 tests

The main PHP script in "Woo Force Coupon" version 1.0.0 is automatically included on every request by WordPress
99 characters long description:
A lightweight WooCommerce based plugin to force the customer to enter a coupon code during checkout

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin450 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP542182450

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity20.33
▷ Minimum class complexity4.00
▷ Maximum class complexity52.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods3995.12%
▷ Protected methods00.00%
▷ Private methods24.88%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected