78% ultimate-coupon-for-woocommerce

Code Review | Ultimate Coupons for WooCommerce Free

WordPress plugin Ultimate Coupons for WooCommerce Free scored78%from 54 tests.

About plugin

  • Plugin page: ultimate-coupon-f...
  • Plugin version: 1.1.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 14, 2021
  • Latest release: Jan 30, 2023
  • Number of updates: 28
  • Update frequency: every 19.2 days
  • Top authors: jompha (96.43%)mashiurz (7.14%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /3,678 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.25ms] Passed 4 tests

Analyzing server-side resources used by Ultimate Coupons for WooCommerce Free
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0633.14 ▼2.25
Dashboard /wp-admin3.36 ▲0.0646.21 ▲1.36
Posts /wp-admin/edit.php3.48 ▲0.1243.80 ▼4.43
Add New Post /wp-admin/post-new.php5.94 ▲0.0679.22 ▼15.67
Media Library /wp-admin/upload.php3.28 ▲0.0637.80 ▲6.37

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 524 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Ultimate Coupons for WooCommerce Free
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.25 ▼0.101.75 ▼0.0736.21 ▼3.78
Dashboard /wp-admin2,214 ▲405.68 ▲0.1081.92 ▼3.5667.51 ▲28.92
Posts /wp-admin/edit.php2,114 ▲141.97 ▼0.0235.17 ▼5.1435.12 ▼4.90
Add New Post /wp-admin/post-new.php1,695 ▲16922.45 ▼1.01681.81 ▲48.1862.78 ▲17.11
Media Library /wp-admin/upload.php1,419 ▲224.06 ▼0.2199.13 ▲0.7384.25 ▲39.39

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
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 117× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Container\\Fulfillable\\Fulfillable' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Fulfillable_Collection.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Term_Condition' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Container/Condition/Term_Parent_Condition.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/ultimate-coupon-for-woocommerce/render/Front/markup/template-snackbar-blackfriday-1.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Field/Color_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Scalar_Comparer.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/templates/Container/comment_meta.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ultimate-coupon-for-woocommerce/render/Admin/js/conditions.js.php:6
    • > PHP Notice
      Undefined variable: errors in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php on line 35
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Theme_Options_Container' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Container/Network_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/ultimate-coupon-for-woocommerce/vendor/htmlburger/carbon-fields/core/Service/REST_API_Service.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: You can look at the official readme.txt

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

Analyzing the main PHP file in "Ultimate Coupons for WooCommerce Free" version 1.1.9
79 characters long description:
An e-commerce discount and marketing plugin for WooCommerce. Powered by Jompha.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin84,242 lines of code in 442 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1766,7629,11233,314
CSS148,3705,76730,802
PHP1693,3287,30912,846
SVG30122,880
PO File268191,0202,202
Sass4833801,764
JSON300366
Markdown324068

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.38
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces26
Interfaces5
Traits0
Classes139
▷ Abstract classes117.91%
▷ Concrete classes12892.09%
▷ Final classes21.56%
Methods1,085
▷ Static methods12711.71%
▷ Public methods88381.38%
▷ Protected methods16515.21%
▷ Private methods373.41%
Functions102
▷ Named functions2221.57%
▷ Anonymous functions8078.43%
Constants47
▷ Global constants1634.04%
▷ Class constants3165.96%
▷ Public constants31100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.97MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/semantic/themes/default/assets/images/flags.png27.46KB29.21KB0.00%
resources/images/preview-template-snackbar-christmas-1.png64.49KB19.79KB▼ 69.31%
resources/images/template-snackbar-blackfriday-1-background.png198.33KB121.66KB▼ 38.66%
resources/images/preview-template-snackbar-blackfriday-1.png192.67KB99.03KB▼ 48.60%
resources/images/ucfw-icon.png4.14KB2.23KB▼ 46.10%