89% woopos-gift-cards-for-woocommerce

Code Review | WooPOS Gift Cards for WooCommerce

WordPress plugin WooPOS Gift Cards for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woopos-gift-cards...
  • Plugin version: 2.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 27, 2018
  • Latest release: Feb 20, 2023
  • Number of updates: 105
  • Update frequency: every 16.9 days
  • Top authors: woopos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,842 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.54MB] [CPU: ▼23.54ms] Passed 4 tests

A check of server-side resources used by WooPOS Gift Cards for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.55 ▼1.97
Dashboard /wp-admin3.38 ▲0.0348.99 ▼20.40
Posts /wp-admin/edit.php3.49 ▲0.1343.34 ▼4.42
Add New Post /wp-admin/post-new.php3.55 ▼2.3436.23 ▼67.38
Media Library /wp-admin/upload.php3.30 ▲0.0736.13 ▲2.27

Server storage [IO: ▲0.49MB] [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: 47 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooPOS Gift Cards for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.35 ▼0.001.86 ▲0.3041.98 ▲5.69
Dashboard /wp-admin2,201 ▲245.54 ▼0.0885.07 ▼0.0937.24 ▼9.15
Posts /wp-admin/edit.php2,106 ▲92.03 ▲0.0135.00 ▼0.7534.35 ▲0.05
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼22.600.07 ▼666.149.29 ▼43.89
Media Library /wp-admin/upload.php1,406 ▲64.16 ▼0.04106.53 ▲15.1368.29 ▲24.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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)
No browser errors were detected

Optimizations

Plugin configuration 90% 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:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt might help

woopos-gift-cards-for-woocommerce/giftcards.php 85% from 13 tests

The main PHP file in "WooPOS Gift Cards for WooCommerce" ver. 2.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woopos-gift-cards-for-woocommerce.php" instead of "giftcards.php")

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
No dangerous file extensions were detected4,862 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,6242,7394,741
JavaScript3240108
CSS33013

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.24
▷ Minimum class complexity4.00
▷ Maximum class complexity93.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods170
▷ Static methods137.65%
▷ Public methods13881.18%
▷ Protected methods2414.12%
▷ Private methods84.71%
Functions71
▷ Named functions71100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
7 PNG files occupy 0.21MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png35.98KB20.42KB▼ 43.23%
assets/banner-772x250.png86.68KB33.48KB▼ 61.37%
assets/screenshot-1.png39.45KB19.49KB▼ 50.58%
assets/icon-256x256.png19.59KB8.40KB▼ 57.12%
assets/icon-128x128.png6.96KB3.35KB▼ 51.89%