84% hex-coupon-for-woocommerce

Code Review | HexCoupon – Create Smart & Advance Coupons For Your WooCommerce Store

WordPress plugin HexCoupon – Create Smart & Advance Coupons For Your WooCommerce Store scored84%from 54 tests.

About plugin

  • Plugin page: hex-coupon-for-wo...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2023
  • Latest release: Nov 17, 2023
  • Number of updates: 6
  • Update frequency: every 5.7 days
  • Top authors: wphex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /181 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲1.21MB] [CPU: ▲3.75ms] Passed 4 tests

This is a short check of server-side resources used by HexCoupon – Create Smart & Advance Coupons For Your WooCommerce Store
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.2144.31 ▲2.67
Dashboard /wp-admin4.57 ▲1.2356.43 ▼6.17
Posts /wp-admin/edit.php4.62 ▲1.2755.27 ▲14.18
Add New Post /wp-admin/post-new.php7.09 ▲1.2089.93 ▲7.58
Media Library /wp-admin/upload.php4.43 ▲1.2042.59 ▲10.91

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for HexCoupon – Create Smart & Advance Coupons For Your WooCommerce Store
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10214.24 ▼0.101.51 ▼0.2037.65 ▼5.81
Dashboard /wp-admin2,238 ▲575.52 ▼0.1594.53 ▼14.4577.30 ▲31.52
Posts /wp-admin/edit.php2,162 ▲621.96 ▲0.0139.88 ▲2.9140.31 ▲3.08
Add New Post /wp-admin/post-new.php1,734 ▲20222.60 ▼0.54766.42 ▲155.9560.77 ▼4.48
Media Library /wp-admin/upload.php1,452 ▲524.14 ▼0.0499.27 ▲2.8877.41 ▲37.04

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
The following issues need your attention
  • 61× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'CodesVault\\Howdyqb\\Api\\DropInterface' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/howdy-qb/src/Statement/Drop.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/howdy-qb/tests/SelectTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Codesvault\\Validator\\Rules\\Lib\\Rule' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/validator/src/Rules/MaxLength.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CodesVault\\Howdyqb\\Statement\\Update' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/howdy-qb/tests/Statement/UpdateApi.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'CodesVault\\Howdyqb\\Statement\\Select' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/howdy-qb/tests/Statement/SelectApi.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Codesvault\\Validator\\Rules\\Lib\\Rule' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/validator/src/Rules/Url.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Codesvault\\Validator\\Rules\\Lib\\Rule' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/validator/src/Rules/Mixedcase.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Kathamo\\Framework\\Lib\\Controller' not found in wp-content/plugins/hex-coupon-for-woocommerce/app/Controllers/AjaxApiController.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Codesvault\\Validator\\Rules\\Lib\\Rule' not found in wp-content/plugins/hex-coupon-for-woocommerce/vendor/codesvault/validator/src/Rules/MinLength.php:9
    • > PHP Fatal error
      Trait 'HexCoupon\\App\\Core\\Lib\\SingleTon' not found in wp-content/plugins/hex-coupon-for-woocommerce/app/Core/WooCommerce/CouponPaymentandShipping.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #15 (From sharable coupon tab users get the url that they want to share with the customers and customers can apply the coupon just by visiting this url.) image not found
The official readme.txt might help

hex-coupon-for-woocommerce/hex-coupon-for-woocommerce.php Passed 13 tests

The entry point to "HexCoupon – Create Smart & Advance Coupons For Your WooCommerce Store" version 1.0.8 is a PHP file that has certain tags in its header comment area
54 characters long description:
Extend coupon functionality in your Woocommerce store.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected13,910 lines of code in 193 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112,0633,0168,976
Sass30118292,050
JavaScript7233293768
CSS118716597
JSX16722526
Markdown51400489
JSON700450
HTML21027
SVG40027

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.86
▷ Minimum class complexity1.00
▷ Maximum class complexity118.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces23
Interfaces7
Traits2
Classes89
▷ Abstract classes00.00%
▷ Concrete classes89100.00%
▷ Final classes22.25%
Methods641
▷ Static methods619.52%
▷ Public methods48475.51%
▷ Protected methods345.30%
▷ Private methods12319.19%
Functions18
▷ Named functions1161.11%
▷ Anonymous functions738.89%
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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/img/gift2.png4.76KB2.54KB▼ 46.70%
src/logo.png6.03KB3.14KB▼ 47.82%
src/img/gift.png5.77KB2.48KB▼ 57.00%
assets/images/hexcoupon-notice-icon.png1.35KB0.79KB▼ 41.92%
src/img/logo.png3.38KB1.68KB▼ 50.36%