83% woo-gift-product

Code Review | Woocommerce Gifts Product

WordPress plugin Woocommerce Gifts Product scored83%from 54 tests.

About plugin

  • Plugin page: woo-gift-product
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 25, 2018
  • Latest release: Nov 5, 2018
  • Number of updates: 5
  • Update frequency: every 3.0 days
  • Top authors: usamafarooq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,313 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.36ms] Passed 4 tests

Server-side resources used by Woocommerce Gifts Product
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0032.43 ▼9.70
Dashboard /wp-admin3.31 ▲0.0045.72 ▼3.64
Posts /wp-admin/edit.php3.36 ▲0.0048.78 ▲0.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.02 ▼12.14
Media Library /wp-admin/upload.php3.23 ▲0.0036.15 ▲0.68

Server storage [IO: ▲0.02MB] [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: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Gifts Product
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼1.001.61 ▼0.1043.50 ▲3.28
Dashboard /wp-admin2,206 ▲184.89 ▼1.01108.16 ▼4.4242.56 ▼4.47
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0039.67 ▲2.2233.80 ▼0.17
Add New Post /wp-admin/post-new.php1,542 ▲2818.43 ▲0.82601.66 ▼24.5155.04 ▲1.87
Media Library /wp-admin/upload.php1,385 ▼34.19 ▲0.0393.16 ▼2.8841.03 ▼2.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woo-gift-product/woocommerce-gift-product.php:18

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 90% from 29 tests

readme.txt Passed 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
7 plugin tags: offers, ecommerce, gifts products, product, wocommerce...

woo-gift-product/woocommerce-gift-product.php 77% from 13 tests

The main file in "Woocommerce Gifts Product" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-gift-product.php" instead of "woocommerce-gift-product.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "2.6")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin449 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42141356
CSS110388
JavaScript12105

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected