67% gift-message-for-woocommerce

Code Review | Gift Message for WooCommerce

WordPress plugin Gift Message for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: gift-message-for-...
  • Plugin version: 1.7.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 1, 2020
  • Latest release: Jul 7, 2023
  • Number of updates: 25
  • Update frequency: every 40.4 days
  • Top authors: powerfulwp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /5,294 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.02MB] [CPU: ▲18.39ms] 75% from 4 tests

Analyzing server-side resources used by Gift Message for WooCommerce
It is recommended to improve the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.02MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.88 ▲5.4155.03 ▲13.87
Dashboard /wp-admin8.90 ▲5.5579.91 ▲10.15
Posts /wp-admin/edit.php8.90 ▲5.5485.84 ▲33.63
Add New Post /wp-admin/post-new.php9.45 ▲3.56125.67 ▲15.90
Media Library /wp-admin/upload.php8.90 ▲5.6778.99 ▲40.32
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9067.37

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 198 new files
Database: no new tables, 11 new options
New WordPress options
fs_active_plugins
gmfw_activation_date
fs_accounts
db_upgraded
widget_recent-comments
can_compress_scripts
gmfw_enable_gift_message
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Gift Message for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,487 ▼29914.65 ▲0.240.45 ▼1.618.40 ▼36.89
Dashboard /wp-admin2,231 ▲575.64 ▼0.0293.41 ▼1.8846.87 ▼0.27
Posts /wp-admin/edit.php2,134 ▲342.02 ▼0.0139.51 ▲3.8138.21 ▲2.11
Add New Post /wp-admin/post-new.php1,544 ▲1822.95 ▼0.16705.53 ▲10.8268.94 ▲10.16
Media Library /wp-admin/upload.php1,427 ▲274.10 ▼0.1197.18 ▼20.3449.78 ▲1.36
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0981.6927.1132.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/gift-message-for-woocommerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_recent-posts
    • db_upgraded
    • gmfw_activation_date
    • fs_debug_mode
    • widget_recent-comments
    • fs_accounts
    • fs_active_plugins
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gift-message-for-woocommerce/admin/partials/gmfw-admin-display.php
    • > /wp-content/plugins/gift-message-for-woocommerce/public/partials/gmfw-public-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gift-message-for-woocommerce/includes/class-gmfw-metaboxes.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: occasions, woocommerce, checkout, gift, gift message

gift-message-for-woocommerce/gift-message-for-woocommerce.php 85% from 13 tests

The main PHP script in "Gift Message for WooCommerce" version 1.7.5 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "3.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin34,240 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1308,10017,96633,774
JavaScript55959286
CSS15408180

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity82.24
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods1,317
▷ Static methods20015.19%
▷ Public methods92370.08%
▷ Protected methods171.29%
▷ Private methods37728.63%
Functions106
▷ Named functions106100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%