84% woo-giftcards

Code Review | Gift Cards for WooCommerce

WordPress plugin Gift Cards for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: woo-giftcards
  • Plugin version: 1.5.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Nov 5, 2018
  • Latest release: Aug 15, 2023
  • Number of updates: 43
  • Update frequency: every 40.6 days
  • Top authors: ahmadshyk (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

300+ active / 10,246 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.13MB] [CPU: ▼2.02ms] Passed 4 tests

Server-side resources used by Gift Cards for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.62 ▼5.73
Dashboard /wp-admin3.44 ▲0.1345.30 ▲2.06
Posts /wp-admin/edit.php3.55 ▲0.1947.47 ▲5.79
Add New Post /wp-admin/post-new.php6.02 ▲0.1382.22 ▼4.23
Media Library /wp-admin/upload.php3.36 ▲0.1331.90 ▼0.18

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Gift Cards for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.26 ▼1.112.24 ▲0.4945.78 ▲6.42
Dashboard /wp-admin2,215 ▲305.79 ▼0.06114.46 ▲11.7651.98 ▲10.10
Posts /wp-admin/edit.php2,095 ▲62.00 ▲0.0138.15 ▼5.0034.60 ▼3.20
Add New Post /wp-admin/post-new.php1,520 ▲617.71 ▲0.22643.95 ▲28.1055.56 ▲1.12
Media Library /wp-admin/upload.php1,394 ▲34.28 ▲0.11104.68 ▲4.8444.28 ▼1.27

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

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

Smoke tests 75% from 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)
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-giftcards/inc/woo-giftcards-email-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/woo-giftcards/inc/woo-giftcards-email.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: gift card, woocommerce, giftcard, woocommerce giftcard, gift vouchers

woo-giftcards/woo-giftcards.php Passed 13 tests

"Gift Cards for WooCommerce" version 1.5.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
43 characters long description:
Sell giftcards on your WooCommerce website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,114 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
CSS264491,377
PHP68325672
JavaScript210165

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity29.50
▷ Minimum class complexity3.00
▷ Maximum class complexity56.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
7 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
imgs/gift-icon.png2.40KB1.47KB▼ 38.65%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%