83% hygglig-checkout

Code Review | Hygglig Checkout

WordPress plugin Hygglig Checkout scored83%from 54 tests.

About plugin

  • Plugin page: hygglig-checkout
  • Plugin version: 3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.3
  • WordPress version: 6.3.1
  • First release: Jul 7, 2016
  • Latest release: Sep 13, 2023
  • Number of updates: 74
  • Update frequency: every 35.5 days
  • Top authors: hygglig (41.89%)olibre01 (40.54%)arashmaffins (20.27%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,839 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.22MB] [CPU: ▼24.25ms] Passed 4 tests

A check of server-side resources used by Hygglig Checkout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.25 ▼1.32
Dashboard /wp-admin3.09 ▼0.2631.24 ▼33.13
Posts /wp-admin/edit.php3.23 ▼0.1336.31 ▼28.49
Add New Post /wp-admin/post-new.php5.47 ▼0.4270.28 ▼24.85
Media Library /wp-admin/upload.php3.16 ▼0.0726.80 ▼10.52

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Hygglig Checkout
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4714.40 ▲0.261.74 ▲0.1042.57 ▲3.71
Dashboard /wp-admin2,217 ▲405.80 ▲0.1990.36 ▼32.4539.26 ▼2.97
Posts /wp-admin/edit.php2,124 ▲212.29 ▲0.1437.07 ▼7.7330.78 ▼11.18
Add New Post /wp-admin/post-new.php1,549 ▲2318.64 ▼4.79645.72 ▲28.3549.58 ▼1.19
Media Library /wp-admin/upload.php1,419 ▲194.40 ▲0.17100.92 ▼4.3941.76 ▼1.25

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/hygglig-checkout/classes/views/html-checkout-cart.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/hygglig-checkout/hygglig-checkout-template.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Hygglig' not found in wp-content/plugins/hygglig-checkout/classes/class-hygglig-checkout.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/hygglig-checkout/classes/views/html-thank-you.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/hygglig-checkout/autoload.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hygglig-checkout/classes/class-hygglig-ajax-handler.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hygglig-checkout/classes/views/html-checkout.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/hygglig-checkout/classes/views/html-admin-options.php:18
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hygglig-checkout/autoload.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/hygglig-checkout/classes/views/html-checkout-shipping-methods.php:7

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, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in hygglig-checkout/assets to your readme.txt
You can look at the official readme.txt

hygglig-checkout/gateway-hygglig.php 85% from 13 tests

The principal PHP file in "Hygglig Checkout" v. 3.7 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.8" instead of "3.0.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("hygglig-checkout.php" instead of "gateway-hygglig.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected20,120 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
SVG711613,403
CSS71,729663,921
PHP226906282,081
Sass5700376
JavaScript385130339

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity13.77
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods84
▷ Static methods5565.48%
▷ Public methods6982.14%
▷ Protected methods00.00%
▷ Private methods1517.86%
Functions18
▷ Named functions1477.78%
▷ Anonymous functions422.22%
Constants15
▷ Global constants1066.67%
▷ Class constants533.33%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/spinner.png1.33KB0.85KB▼ 36.24%
img/hygglig.png13.97KB5.37KB▼ 61.56%