83% gift-up

Code Review | Gift Up Gift Cards for WordPress and WooCommerce

WordPress plugin Gift Up Gift Cards for WordPress and WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: gift-up
  • Plugin version: 2.20.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 17, 2018
  • Latest release: Oct 2, 2023
  • Number of updates: 221
  • Update frequency: every 9.5 days
  • Top authors: KoanLeeroy (100%)

Code review

54 tests

User reviews

211 reviews

Install metrics

5,000+ active /133,462 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 gracefully, with no errors

Server metrics [RAM: ▲0.25MB] [CPU: ▲1.29ms] Passed 4 tests

An overview of server-side resources used by Gift Up Gift Cards for WordPress and WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.45 ▲0.45
Dashboard /wp-admin3.60 ▲0.3051.47 ▲1.58
Posts /wp-admin/edit.php3.65 ▲0.3052.13 ▲3.79
Add New Post /wp-admin/post-new.php6.12 ▲0.2495.00 ▲3.97
Media Library /wp-admin/upload.php3.46 ▲0.2334.72 ▼0.65
Gift Up! /wp-admin/options-general.php?page=giftup-settings3.4936.30

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 63 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
giftup_woocommerce_operating_mode
widget_theysaidso_widget
giftup_version

Browser metrics Passed 4 tests

Checking browser requirements for Gift Up Gift Cards for WordPress and WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲4813.30 ▼1.004.97 ▲2.7943.08 ▼1.92
Dashboard /wp-admin2,228 ▲405.86 ▼0.02113.63 ▲0.7540.70 ▼1.12
Posts /wp-admin/edit.php2,110 ▲182.01 ▼0.0942.76 ▲1.7538.63 ▼0.02
Add New Post /wp-admin/post-new.php1,555 ▲2723.14 ▲4.82602.42 ▼0.8449.08 ▼10.40
Media Library /wp-admin/upload.php1,407 ▲164.19 ▼0.0599.88 ▲0.1444.23 ▲2.26
Gift Up! /wp-admin/options-general.php?page=giftup-settings8482.2026.3426.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: giftup_dashboard_root in wp-content/plugins/gift-up/view/giftup-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'giftup_options' not found in wp-content/plugins/gift-up/includes/giftup-woocommerce-hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/gift-up/view/giftup-settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: gift certificates, gift certificate, woocommerce, gift cards, gift vouchers...

gift-up/giftup.php 77% from 13 tests

"Gift Up Gift Cards for WordPress and WooCommerce" version 2.20.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.2.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 186 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gift-up.php" instead of "giftup.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,944 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP103941721,663
PO File253254751,281

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods67
▷ Static methods6394.03%
▷ Public methods5582.09%
▷ Protected methods00.00%
▷ Private methods1217.91%
Functions17
▷ Named functions1588.24%
▷ Anonymous functions211.76%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
view/images/logo.png6.54KB3.50KB▼ 46.42%