10% multiple-gift-product

Code Review | WooCommerce GiftProduct

WordPress plugin WooCommerce GiftProduct scored10%from 54 tests.

About plugin

  • Plugin page: multiple-gift-pro...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-5.2.1
  • WordPress version: 6.3.1
  • First release: Jul 31, 2019
  • Latest release: Jul 31, 2019
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: acespritech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /523 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/multiple-gift-product/WooCommerce-GiftProduct.php+312
    Undefined variable: order

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

Server-side resources used by WooCommerce GiftProduct
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.91 ▼6.42
Dashboard /wp-admin3.31 ▼0.0448.30 ▼17.29
Posts /wp-admin/edit.php3.36 ▲0.0050.25 ▼1.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.41 ▼6.48
Media Library /wp-admin/upload.php3.23 ▲0.0036.44 ▼0.75

Server storage [IO: ▲1.60MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/multiple-gift-product/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 24 new files
Database: 2 new tables, 6 new options
New tables
wp_woocommerce_gift_checkout_details
wp_woocommerce_gift_product
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce GiftProduct
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲4413.20 ▼1.392.00 ▲0.1043.00 ▼2.55
Dashboard /wp-admin2,215 ▲125.86 ▼0.01109.98 ▲2.6641.88 ▲6.41
Posts /wp-admin/edit.php2,100 ▼32.06 ▲0.0239.53 ▼2.1837.07 ▲0.10
Add New Post /wp-admin/post-new.php1,550 ▲1923.04 ▼0.28662.21 ▲28.2369.00 ▲10.58
Media Library /wp-admin/upload.php1,400 ▲34.25 ▼0.00104.13 ▼7.9546.41 ▼5.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_woocommerce_gift_product
    • wp_woocommerce_gift_checkout_details
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > AH01630
      client denied by server configuration: wp-content/plugins/multiple-gift-product/template/.php
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/multiple-gift-product/WooCommerce-GiftProduct.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/multiple-gift-product/template/default.php:6
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/multiple-gift-product/WooCommerce-GiftProduct.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multiple-gift-product/WooCommerce-GiftProduct.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/multiple-gift-product/WooCommerce-GiftProduct.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: woocommerce, giftwrap, product, giftproduct

multiple-gift-product/WooCommerce-GiftProduct.php 85% from 13 tests

"WooCommerce GiftProduct" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("multiple-gift-product.php" instead of "WooCommerce-GiftProduct.php")
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin7,205 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,959
CSS29132,654
PHP69078990
JavaScript13818602

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add_product.png27.55KB14.44KB▼ 47.60%
images/gift_banner.png83.63KB21.48KB▼ 74.31%
css/gift_banner.png83.63KB21.48KB▼ 74.31%