84% smntcs-woocommerce-free-gift

Code Review | SMNTCS Free Gift for WooCommerce

WordPress plugin SMNTCS Free Gift for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: smntcs-woocommerc...
  • Plugin version: 1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.3
  • WordPress version: 5.9.2
  • First release: Jul 21, 2016
  • Latest release: Apr 14, 2020
  • Number of updates: 28
  • Update frequency: every 48.7 days
  • Top authors: nielslange (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active / 2,552 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 gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼283.87ms] Passed 4 tests

This is a short check of server-side resources used by SMNTCS Free Gift for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.0460.78 ▲4.23
Dashboard /wp-admin4.06 ▲0.0383.00 ▲26.57
Posts /wp-admin/edit.php4.36 ▲0.0338.77 ▼3.13
Add New Post /wp-admin/post-new.php7.60 ▲0.0095.74 ▼1,137.06
Media Library /wp-admin/upload.php4.01 ▲0.0329.11 ▲0.50
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php5.2658.53

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 2 new options
New WordPress options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by SMNTCS Free Gift for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲7315.76 ▲0.176.33 ▲0.342.09 ▼0.33
Dashboard /wp-admin2,911 ▲576.14 ▼0.03120.08 ▼12.38162.71 ▼2.04
Posts /wp-admin/edit.php2,704 ▲133.25 ▲0.0079.74 ▼9.76210.44 ▲57.78
Add New Post /wp-admin/post-new.php1,721 ▼5220.66 ▼0.79463.33 ▼9.63209.76 ▲48.36
Media Library /wp-admin/upload.php1,717 ▲195.55 ▲0.03155.22 ▼16.45192.92 ▼12.00
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php7,19919.54508.24224.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: woocommerce, free gift, woocommerce gift

smntcs-woocommerce-free-gift/smntcs-woocommerce-free-gift.php 92% from 13 tests

The entry point to "SMNTCS Free Gift for WooCommerce" version 1.6 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected12,350 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JSON30012,018
PHP13084216
XML1131451
Markdown114036
YAML1111129

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin