77% gift-card-for-woocommerce

Code Review | Gift Card For Woocommerce

WordPress plugin Gift Card For Woocommerce scored 77% from 54 tests.

About plugin

  • Plugin page: gift-card-for-woo...
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 3, 2018
  • Latest release: Dec 28, 2020
  • Number of updates: 43
  • Update frequency: every 25.4 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active / 5,601 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.10MB] [CPU: ▼6.15ms] Passed 4 tests

A check of server-side resources used by Gift Card For Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.95 ▼7.27
Dashboard /wp-admin3.40 ▲0.1046.88 ▼2.54
Posts /wp-admin/edit.php3.45 ▲0.1051.81 ▲5.86
Add New Post /wp-admin/post-new.php5.98 ▲0.1083.49 ▼11.99
Media Library /wp-admin/upload.php3.32 ▲0.1033.47 ▼2.78

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Gift Card For Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.64 ▼1.041.85 ▲0.0442.07 ▼1.88
Dashboard /wp-admin2,212 ▲274.87 ▲0.02112.02 ▲4.4844.79 ▼2.51
Posts /wp-admin/edit.php2,094 ▲52.03 ▼0.0135.53 ▼1.3235.07 ▲0.29
Add New Post /wp-admin/post-new.php1,526 ▲1223.18 ▲5.54670.70 ▼20.9656.29 ▲3.04
Media Library /wp-admin/upload.php1,394 ▲94.22 ▲0.0596.97 ▲0.2544.85 ▼1.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php
  • 24× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 71
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 174
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 215
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php:225
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 77
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 79
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 66
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 78
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 74
    • > PHP Warning
      Use of undefined constant PHOENI_GIFT_CARD_ARBPRPLUGURL - assumed 'PHOENI_GIFT_CARD_ARBPRPLUGURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gift-card-for-woocommerce/includes/admin/phoeniixx_premium_styling.php on line 68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 80% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
Please take inspiration from this readme.txt

gift-card-for-woocommerce/phoen_gift_card.php 62% from 13 tests

The main PHP file in "Gift Card For Woocommerce" ver. 1.2.8 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 242 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("gift-card-for-woocommerce.php" instead of "phoen_gift_card.php")
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

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
Everything looks great! No dangerous files found in this plugin3,085 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,3371891,943
CSS2168201,045
JavaScript4531097

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/aaa2.png1.20KB0.57KB▼ 52.72%
assets/images/head-arrow.png1.68KB1.43KB▼ 14.83%
assets/images/button2.png3.58KB2.59KB▼ 27.61%
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%
assets/images/premium-btn.png5.72KB5.28KB▼ 7.69%