93% add-gift-wrapper-for-woocommerce

Code Review | Add Gift Wrapper For Woocommerce

WordPress plugin Add Gift Wrapper For Woocommerce scored 93% from 54 tests.

About plugin

  • Plugin page: add-gift-wrapper-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Aug 21, 2021
  • Latest release: Jan 22, 2022
  • Number of updates: 5
  • Update frequency: every 32.4 days
  • Top authors: elegantapps27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 331 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼289.06ms] Passed 4 tests

Analyzing server-side resources used by Add Gift Wrapper For Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0155.97 ▲3.87
Dashboard /wp-admin3.41 ▲0.00104.07 ▲72.40
Posts /wp-admin/edit.php3.64 ▲0.0039.74 ▲3.46
Add New Post /wp-admin/post-new.php6.88 ▼0.0995.69 ▼1,162.76
Media Library /wp-admin/upload.php3.29 ▲0.0023.27 ▼0.79

Server storage [IO: ▲0.32MB] [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: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Add Gift Wrapper For Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,827 ▲7316.63 ▲1.476.63 ▼0.892.26 ▼0.63
Dashboard /wp-admin2,892 ▲346.13 ▼0.06117.62 ▼20.03154.41 ▼15.39
Posts /wp-admin/edit.php2,657 ▼343.24 ▲0.0267.01 ▼3.62154.30 ▼47.74
Add New Post /wp-admin/post-new.php1,758 ▲9721.34 ▲5.84486.17 ▲46.57163.22 ▼21.32
Media Library /wp-admin/upload.php1,694 ▼45.54 ▲0.01181.22 ▲37.11194.87 ▲3.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/add-gift-wrapper-for-woocommerce/woo-gift-wrapper-main.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed: You can look at the official readme.txt

add-gift-wrapper-for-woocommerce/woo-gift-wrapper-main.php 85% from 13 tests

This is the main PHP file of "Add Gift Wrapper For Woocommerce" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-gift-wrapper-for-woocommerce.php" instead of "woo-gift-wrapper-main.php")

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
There were no executable files found in this plugin4,292 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript55981,1142,469
PHP4321251,084
CSS83564738
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity30.25
▷ Minimum class complexity3.00
▷ Maximum class complexity65.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods38
▷ Static methods513.16%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/star.png39.75KB10.35KB▼ 73.95%
includes/images/support.png6.44KB5.59KB▼ 13.09%
includes/images/review.png15.87KB11.90KB▼ 25.01%
includes/js/owlcarousel/assets/owl.video.play.png4.86KB2.74KB▼ 43.61%