84% jagif-woo-free-gift

Code Review | Jagif - WooCommerce Free Gift

WordPress plugin Jagif - WooCommerce Free Gift scored84%from 54 tests.

About plugin

  • Plugin page: jagif-woo-free-gift
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 24, 2021
  • Latest release: Sep 18, 2023
  • Number of updates: 14
  • Update frequency: every 47.4 days
  • Top authors: vietmike (78.57%)jackvu99 (21.43%)villatheme (14.29%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,496 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.88ms] Passed 4 tests

Server-side resources used by Jagif - WooCommerce Free Gift
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.36 ▼3.03
Dashboard /wp-admin3.32 ▲0.0148.43 ▼3.41
Posts /wp-admin/edit.php3.43 ▲0.0751.60 ▼0.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.10 ▼28.72
Media Library /wp-admin/upload.php3.24 ▲0.0138.04 ▼0.34

Server storage [IO: ▲3.53MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 176 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Jagif - WooCommerce Free Gift
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.26 ▼1.114.73 ▲2.8941.58 ▼11.19
Dashboard /wp-admin2,215 ▲274.87 ▼1.00109.59 ▲4.3741.41 ▼6.19
Posts /wp-admin/edit.php2,098 ▲92.01 ▼0.0342.70 ▲4.1235.27 ▲2.64
Add New Post /wp-admin/post-new.php1,544 ▲1623.20 ▲5.02698.76 ▲51.2457.88 ▲2.86
Media Library /wp-admin/upload.php1,397 ▲94.32 ▲0.15106.70 ▲2.8644.59 ▲3.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% 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 50% from 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/jagif-woo-free-gift/templates/jagif-template-popup-gift.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

jagif-woo-free-gift/jagif-woo-free-gift.php 92% from 13 tests

The primary PHP file in "Jagif - WooCommerce Free Gift" version 1.1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 151 characters long)

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 plugin33,657 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript302,25669915,781
PHP206612548,560
CSS493132263,634
Sass847903,504
SVG190132,178

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity79.74
▷ Minimum class complexity1.00
▷ Maximum class complexity706.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods215
▷ Static methods2210.23%
▷ Public methods19791.63%
▷ Protected methods136.05%
▷ Private methods52.33%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants13
▷ Global constants13100.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
19 PNG files occupy 0.21MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-gift/gift-box-25.png8.23KB8.27KB0.00%
assets/images/icon-gift/gift-box-10.png8.30KB8.31KB0.00%
assets/images/icon-gift/gift-box-22.png27.02KB10.81KB▼ 59.97%
assets/images/001-giftbox.png0.40KB0.44KB0.00%
assets/images/icon-gift/gift-box-13.png10.58KB5.36KB▼ 49.39%