84% order-coupon-field-for-woocommerce

Code Review | Order Coupon Field for WooCommerce

WordPress plugin Order Coupon Field for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: order-coupon-fiel...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Jul 29, 2016
  • Latest release: Jun 17, 2017
  • Number of updates: 5
  • Update frequency: every 64.6 days
  • Top authors: hearken (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /897 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.79ms] Passed 4 tests

A check of server-side resources used by Order Coupon Field for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.59 ▼5.88
Dashboard /wp-admin3.34 ▼0.0149.08 ▼17.62
Posts /wp-admin/edit.php3.39 ▲0.0353.63 ▼0.78
Add New Post /wp-admin/post-new.php5.92 ▲0.0398.37 ▼10.88
Media Library /wp-admin/upload.php3.26 ▲0.0341.40 ▲4.59

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/order-coupon-field-for-woocommerce/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Order Coupon Field for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.26 ▼1.321.75 ▼0.0140.96 ▼5.94
Dashboard /wp-admin2,218 ▲155.76 ▲0.9097.51 ▼19.2538.77 ▼5.27
Posts /wp-admin/edit.php2,103 ▲62.15 ▲0.1142.69 ▲8.7037.03 ▲0.42
Add New Post /wp-admin/post-new.php1,526 ▼1917.88 ▼5.27655.14 ▼39.3261.57 ▼15.16
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.04111.54 ▲10.0448.42 ▲0.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: potent_slug in wp-content/plugins/order-coupon-field-for-woocommerce/plugin-credit.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/order-coupon-field-for-woocommerce/plugin-credit.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: completed, status, complete, woocommerce, order

order-coupon-field-for-woocommerce/order-coupon-field-for-woocommerce.php Passed 13 tests

The main file in "Order Coupon Field for WooCommerce" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
89 characters long description:
Records each coupon code used for an order in an order meta field for reporting purposes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected167 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22216167

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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
images/potent-logo.png7.60KB5.27KB▼ 30.74%