83% wc-pre-order

Code Review | Pre Order Addon for WooCommerce - Advance Order/Backorder Plugin

WordPress plugin Pre Order Addon for WooCommerce - Advance Order/Backorder Plugin scored83%from 54 tests.

About plugin

  • Plugin page: wc-pre-order
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 19, 2021
  • Latest release: Mar 12, 2023
  • Number of updates: 16
  • Update frequency: every 39.5 days
  • Top authors: ok9xnirab (56.25%)istiaqnirab (43.75%)springdevs (12.5%)

Code review

54 tests

User reviews

4 reviews

Install metrics

80+ active /1,676 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.61ms] Passed 4 tests

Analyzing server-side resources used by Pre Order Addon for WooCommerce - Advance Order/Backorder Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.86 ▲5.50
Dashboard /wp-admin3.38 ▲0.0846.08 ▼6.69
Posts /wp-admin/edit.php3.50 ▲0.1448.37 ▲2.31
Add New Post /wp-admin/post-new.php5.96 ▲0.0885.38 ▼15.40
Media Library /wp-admin/upload.php3.31 ▲0.0833.76 ▲1.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 48 new files
Database: no new tables, 9 new options
New WordPress options
woocommerce_sdevs-preorder-gateway_settings
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
sdevs_preorder_installed
sdevs_preorder_version

Browser metrics Passed 4 tests

A check of browser resources used by Pre Order Addon for WooCommerce - Advance Order/Backorder Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7413.20 ▼1.061.63 ▼0.0738.33 ▼8.33
Dashboard /wp-admin2,223 ▲325.84 ▼0.0794.15 ▼14.0140.43 ▲3.56
Posts /wp-admin/edit.php2,108 ▲162.04 ▼0.0134.05 ▼0.5736.93 ▲2.55
Add New Post /wp-admin/post-new.php1,557 ▲2918.77 ▲0.49608.17 ▼11.7562.60 ▲9.72
Media Library /wp-admin/upload.php1,408 ▲204.22 ▼0.0294.55 ▼7.9043.12 ▲0.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • woocommerce_sdevs-preorder-gateway_settings
    • db_upgraded
    • theysaidso_admin_options
    • sdevs_preorder_installed
    • sdevs_preorder_version
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wc-pre-order/includes/Admin/views/order-column.php:1
    • > PHP Notice
      Undefined variable: confirmed_items in wp-content/plugins/wc-pre-order/includes/Admin/views/widget.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-pre-order/includes/Admin/views/plugin-notice.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wc-pre-order/includes/Admin/views/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-pre-order/includes/Admin/views/form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-pre-order/includes/Admin/views/pre-order-details.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/wc-pre-order/includes/Admin/views/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/wc-pre-order/templates/myaccount/preorders.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-pre-order/includes/Admin/views/pre-order-customer.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in wc-pre-order/assets to your readme.txt
You can take inspiration from this readme.txt

wc-pre-order/pre-order.php 77% from 13 tests

The entry point to "Pre Order Addon for WooCommerce - Advance Order/Backorder Plugin" version 1.0.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-pre-order.php" instead of "pre-order.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
Good job! No executable or dangerous file extensions detected1,992 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP433538111,954
CSS16030
JSON1005
JavaScript1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.08
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes14.00%
Methods136
▷ Static methods2115.44%
▷ Public methods13095.59%
▷ Protected methods00.00%
▷ Private methods64.41%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.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
PNG images were not found in this plugin