10% woo-domain-coupon

Code Review | Woocommerce Domain Coupon

WordPress plugin Woocommerce Domain Coupon scored10%from 54 tests.

About plugin

  • Plugin page: woo-domain-coupon
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 5, 2018
  • Latest release: Nov 5, 2018
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: usamafarooq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /498 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/woo-domain-coupon/Domain.php+30
    Use of undefined constant GIFT_BASEPATH - assumed 'GIFT_BASEPATH' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.90ms] Passed 4 tests

Analyzing server-side resources used by Woocommerce Domain Coupon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.449.40 ▼33.10
Dashboard /wp-admin2.05 ▼1.267.35 ▼43.36
Posts /wp-admin/edit.php2.05 ▼1.315.37 ▼38.24
Add New Post /wp-admin/post-new.php2.05 ▼3.845.76 ▼84.90
Media Library /wp-admin/upload.php2.05 ▼1.186.80 ▼28.48

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Woocommerce Domain Coupon: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.72 ▲0.511.84 ▲0.1842.25 ▼1.10
Dashboard /wp-admin2,205 ▲285.64 ▲0.0185.85 ▼11.4139.44 ▼5.92
Posts /wp-admin/edit.php2,113 ▲131.96 ▼0.0335.48 ▼1.4534.59 ▲1.55
Add New Post /wp-admin/post-new.php1,435 ▼9116.26 ▼6.80571.44 ▼123.5530.38 ▼33.05
Media Library /wp-admin/upload.php1,407 ▲44.18 ▼0.00106.21 ▲6.8040.52 ▼6.54

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/woo-domain-coupon/Domain.php+30
    Use of undefined constant GIFT_BASEPATH - assumed 'GIFT_BASEPATH' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woo-domain-coupon/woocommerce-domain-coupon.php:18

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: coupon, promotions, offers, wocommerce, ecommerce...

woo-domain-coupon/woocommerce-domain-coupon.php 77% from 13 tests

The main PHP script in "Woocommerce Domain Coupon" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "2.6")
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-domain-coupon.php" instead of "woocommerce-domain-coupon.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
No dangerous file extensions were detected117 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21126117

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin