83% yith-pre-order-for-woocommerce

Code Review | YITH Pre-Order for WooCommerce

WordPress plugin YITH Pre-Order for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: yith-pre-order-fo...
  • Plugin version: 2.18.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Nov 28, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 75
  • Update frequency: every 34.1 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

8,000+ active /292,463 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by YITH Pre-Order for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.95 ▼4.32
Dashboard /wp-admin3.33 ▼0.0147.83 ▼15.59
Posts /wp-admin/edit.php3.38 ▲0.0247.94 ▲3.04
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.23 ▲1.07
Media Library /wp-admin/upload.php3.25 ▲0.0235.26 ▲4.58

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 339 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for YITH Pre-Order for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.15 ▼0.201.64 ▼0.0237.01 ▼10.53
Dashboard /wp-admin2,198 ▲205.59 ▲0.0194.43 ▼19.4342.60 ▼0.40
Posts /wp-admin/edit.php2,107 ▲71.97 ▲0.0339.25 ▲2.4736.79 ▲0.50
Add New Post /wp-admin/post-new.php1,532 ▼323.61 ▲0.61593.13 ▲5.6756.59 ▼0.09
Media Library /wp-admin/upload.php1,409 ▲64.18 ▲0.0395.64 ▼3.9741.10 ▼0.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-my-account.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-product.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-edit-product-page.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/emails/class-yith-pre-order-confirmed-email.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-download-links.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/emails/class-yith-pre-order-new-pre-order-email.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-frontend.php
    • > /wp-content/plugins/yith-pre-order-for-woocommerce/includes/class-yith-pre-order-admin.php

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

yith-pre-order-for-woocommerce/init.php 77% from 13 tests

The main PHP script in "YITH Pre-Order for WooCommerce" version 2.18.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 361 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yith-pre-order-for-woocommerce.php" instead of "init.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("6.2" instead of "8.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected44,361 lines of code in 267 files:
LanguageFilesBlank linesComment linesLines of code
PHP1812,9886,37516,685
JavaScript511,5311,13711,132
CSS201,6782449,271
PO File61,5661,9204,307
SVG8012,926
XML112940

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity41.60
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes12.86%
▷ Concrete classes3497.14%
▷ Final classes00.00%
Methods484
▷ Static methods6112.60%
▷ Public methods41084.71%
▷ Protected methods5310.95%
▷ Private methods214.34%
Functions160
▷ Named functions15295.00%
▷ Anonymous functions85.00%
Constants19
▷ Global constants1894.74%
▷ Class constants15.26%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
51 PNG files occupy 0.73MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%
assets/images/03-icon.png1.62KB0.91KB▼ 44.04%
assets/images/06-bg.png5.47KB2.77KB▼ 49.40%
assets/images/upgrade.png1.65KB1.17KB▼ 28.95%
assets/images/02-icon.png1.42KB0.38KB▼ 73.63%