78% add-to-order

Code Review | Add to order

WordPress plugin Add to order scored 78% from 54 tests.

About plugin

  • Plugin page: add-to-order
  • Plugin version:
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.3
  • WordPress version: 5.9.2
  • First release: Apr 6, 2021
  • Latest release: Jan 21, 2022
  • Number of updates: 7
  • Update frequency: every 41.6 days
  • Top authors: mjkhajeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 246 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼301.06ms] Passed 4 tests

An overview of server-side resources used by Add to order
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0350.65 ▼1.63
Dashboard /wp-admin3.46 ▲0.0533.29 ▼4.09
Posts /wp-admin/edit.php3.68 ▲0.0539.31 ▲0.98
Add New Post /wp-admin/post-new.php6.95 ▼0.0595.50 ▼1,198.60
Media Library /wp-admin/upload.php3.34 ▲0.0424.07 ▲0.09
Add to order /wp-admin/options-general.php?page=mjato3.2824.39

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add to order
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1415.98 ▲0.276.03 ▼0.332.37 ▼0.36
Dashboard /wp-admin2,897 ▲366.13 ▼0.04120.61 ▼15.35155.14 ▼10.33
Posts /wp-admin/edit.php2,693 ▲23.23 ▼0.0263.71 ▲0.76139.99 ▼4.96
Add New Post /wp-admin/post-new.php1,714 ▲4620.85 ▲2.28431.85 ▲25.00161.07 ▲5.36
Media Library /wp-admin/upload.php1,703 ▲55.51 ▼0.02136.53 ▼1.37186.99 ▲3.20
Add to order /wp-admin/options-general.php?page=mjato8572.1542.3996.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=mjato
    • > Error in wp-content/plugins/add-to-order/options.php+73
    Uncaught Error: Call to undefined function MJATO\wc_get_order_statuses() in wp-content/plugins/add-to-order/options.php:73
    Stack trace:
    #0 wp-admin/includes/template.php(1743): MJATO\Options->default_status()
    #1 wp-admin/includes/template.php(1701): do_settings_fields()
    #2 wp-content/plugins/add-to-order/options.php(38): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(307): MJATO\Options->options_page()
    #4 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(474): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MJATO\\add_action() in wp-content/plugins/add-to-order/options.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side


Plugin configuration 93% 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
6 plugin tags: woocommerce order, wc, add to cart, woocommerce, order...

add-to-order/add_to_order.php 85% from 13 tests

"Add to order" version's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-to-order.php" instead of "add_to_order.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected185 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PO File161031

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods216.67%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.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
There were not PNG files found in your plugin