78% global-coupons-for-woocommerce

Code Review | Global Coupons for Woocommerce

WordPress plugin Global Coupons for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: global-coupons-fo...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-6.2
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Apr 2, 2023
  • Number of updates: 102
  • Update frequency: every 13.8 days
  • Top authors: mrebabi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,758 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Global Coupons for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0136.65 ▼5.64
Dashboard /wp-admin3.31 ▲0.0044.75 ▼5.46
Posts /wp-admin/edit.php3.36 ▲0.0044.76 ▲0.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.77 ▼2.06
Media Library /wp-admin/upload.php3.23 ▲0.0031.53 ▼5.89
Preview /wp-admin/admin.php?page=global-coupons-admin-submenu-23.0024.86
Reports /wp-admin/admin.php?page=global-coupons-admin-submenu-33.0021.42
Global Coupons /wp-admin/admin.php?page=global-coupons-admin-page3.0023.57
Coupon Operations /wp-admin/admin.php?page=global-coupons-admin-submenu-13.0022.27
Settings /wp-admin/admin.php?page=global-coupons-admin-submenu-43.0023.86

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
global_coupons
theysaidso_admin_options
global_coupons_menu
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Global Coupons for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.48 ▲0.101.63 ▼0.2340.08 ▼8.70
Dashboard /wp-admin2,209 ▲215.85 ▼0.05103.48 ▼9.3438.51 ▼5.34
Posts /wp-admin/edit.php2,086 ▼32.06 ▲0.0638.00 ▲1.3138.73 ▲0.59
Add New Post /wp-admin/post-new.php1,542 ▲2323.22 ▲0.16655.40 ▼31.7354.15 ▼6.01
Media Library /wp-admin/upload.php1,388 ▲64.21 ▼0.0798.33 ▼5.0044.58 ▼1.79
Preview /wp-admin/admin.php?page=global-coupons-admin-submenu-2280.440.104.19
Reports /wp-admin/admin.php?page=global-coupons-admin-submenu-3280.440.093.44
Global Coupons /wp-admin/admin.php?page=global-coupons-admin-page280.440.093.91
Coupon Operations /wp-admin/admin.php?page=global-coupons-admin-submenu-1280.440.073.40
Settings /wp-admin/admin.php?page=global-coupons-admin-submenu-4280.440.083.70

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • global_coupons
    • db_upgraded
    • global_coupons_menu
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/global-coupons-for-woocommerce/core/global-coupon-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/global-coupons-for-woocommerce/core/global-coupon-my-account.php:183

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=global-coupons-admin-submenu-2
    • > Network (severe)
    wp-admin/admin.php?page=global-coupons-admin-submenu-2 - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=global-coupons-admin-submenu-3
    • > Network (severe)
    wp-admin/admin.php?page=global-coupons-admin-submenu-3 - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=global-coupons-admin-page
    • > Network (severe)
    wp-admin/admin.php?page=global-coupons-admin-page - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=global-coupons-admin-submenu-1
    • > Network (severe)
    wp-admin/admin.php?page=global-coupons-admin-submenu-1 - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=global-coupons-admin-submenu-4
    • > Network (severe)
    wp-admin/admin.php?page=global-coupons-admin-submenu-4 - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: coupon plugin, dynamic coupons, woocommerce coupon, woocommerce coupons, extended coupons...

global-coupons-for-woocommerce/global-coupons.php 85% from 13 tests

The main PHP file in "Global Coupons for Woocommerce" ver. 1.3.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("3.1" instead of "2.5")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("global-coupons-for-woocommerce.php" instead of "global-coupons.php")

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
Everything looks great! No dangerous files found in this plugin6,214 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS17704,781
PHP72061081,433

PHP code Passed 2 tests

Analyzing 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.31
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected