89% woocommerce-gift-wrapper

Code Review | Gift Wrapper for WooCommerce

WordPress plugin Gift Wrapper for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-gift-...
  • Plugin version: 6.1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2014
  • Latest release: Nov 22, 2023
  • Number of updates: 259
  • Update frequency: every 12.8 days
  • Top authors: littlepackage (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

4,000+ active /169,361 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.00MB] [CPU: ▼6.29ms] Passed 4 tests

A check of server-side resources used by Gift Wrapper for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.11 ▼7.03
Dashboard /wp-admin3.31 ▲0.0046.22 ▼2.27
Posts /wp-admin/edit.php3.36 ▲0.0048.13 ▼6.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.05 ▼9.82
Media Library /wp-admin/upload.php3.23 ▲0.0032.86 ▼1.64

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Gift Wrapper for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.30 ▲0.031.81 ▲0.1736.88 ▼9.09
Dashboard /wp-admin2,195 ▲155.64 ▲0.0496.42 ▲2.7839.82 ▲0.01
Posts /wp-admin/edit.php2,100 ▼01.95 ▲0.0140.48 ▲1.0837.89 ▲1.36
Add New Post /wp-admin/post-new.php1,526 ▼022.95 ▼0.78632.58 ▲5.6752.33 ▲1.88
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.0395.62 ▼0.8441.19 ▼2.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 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 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 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
The official readme.txt might help

woocommerce-gift-wrapper/woocommerce-gift-wrapper.php 92% from 13 tests

"Gift Wrapper for WooCommerce" version 6.1.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: The required version number must match the one declared in readme.txt ("6.0" instead of "5.6")

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
Success! There were no dangerous files found in this plugin3,625 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP175848842,219
PO File24221,354630
CSS89727611
JavaScript869165

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity21.20
▷ Minimum class complexity2.00
▷ Maximum class complexity112.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes110.00%
Methods93
▷ Static methods55.38%
▷ Public methods8389.25%
▷ Protected methods44.30%
▷ Private methods66.45%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin