77% add-coupon-by-link-for-woocommerce

Code Review | Add coupon by link / URL coupons / Add coupon by Qr Code for Woocommerce

WordPress plugin Add coupon by link / URL coupons / Add coupon by Qr Code for Woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: add-coupon-by-lin...
  • Plugin version: 1.1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Jul 24, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 80
  • Update frequency: every 10.6 days
  • Top authors: rajeshsingh520 (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

300+ active /9,536 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Add coupon by link / URL coupons / Add coupon by Qr Code for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.23 ▼7.37
Dashboard /wp-admin3.31 ▲0.0047.74 ▼5.47
Posts /wp-admin/edit.php3.36 ▲0.0047.11 ▼4.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.37 ▼5.55
Media Library /wp-admin/upload.php3.23 ▲0.0032.71 ▲0.17

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 47 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add coupon by link / URL coupons / Add coupon by Qr Code for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.14 ▼0.101.68 ▼0.0837.51 ▼5.74
Dashboard /wp-admin2,204 ▲245.59 ▼0.0598.91 ▼2.6942.04 ▲0.02
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0039.66 ▼1.0436.77 ▲2.70
Add New Post /wp-admin/post-new.php1,532 ▲123.35 ▲0.63648.62 ▲32.5650.52 ▼8.07
Media Library /wp-admin/upload.php1,403 ▲64.21 ▼0.0997.34 ▼1.5641.36 ▼0.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/add-coupon-by-link-for-woocommerce/includes/pisol.class.form.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/qr-code.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-coupon-by-link-for-woocommerce/public/auto-apply-product-coupon.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/class-category-option.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-coupon-by-link-for-woocommerce/includes/includes.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/option.php:104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/class-product-option.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/coupon-options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pisol_acblw_get_option() in wp-content/plugins/add-coupon-by-link-for-woocommerce/public/session.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/add-coupon-by-link-for-woocommerce/public/notice.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-coupon-by-link-for-woocommerce/admin/plugins.php:92

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

readme.txt 88% from 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
These attributes need to be fixed: Please take inspiration from this readme.txt

add-coupon-by-link-for-woocommerce/add-coupon-by-link-woocommerce.php 85% from 13 tests

The main file in "Add coupon by link / URL coupons / Add coupon by Qr Code for Woocommerce" v. 1.1.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("add-coupon-by-link-for-woocommerce.php" instead of "add-coupon-by-link-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin10,983 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS32,022189,259
PHP313934281,218
SVG322444
JavaScript4116062

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.91
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods94
▷ Static methods66.38%
▷ Public methods8994.68%
▷ Protected methods00.00%
▷ Private methods55.32%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin