78% add-to-order

Code Review | Add to order

WordPress plugin Add to order scored78%from 54 tests.

About plugin

  • Plugin page: add-to-order
  • Plugin version: 1.0.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.3
  • WordPress version: 6.3.1
  • 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 /477 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.03MB] [CPU: ▼1.61ms] Passed 4 tests

This is a short check of server-side resources used by Add to order
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0245.98 ▲0.14
Dashboard /wp-admin3.39 ▲0.0051.72 ▼13.22
Posts /wp-admin/edit.php3.51 ▲0.1156.07 ▲2.83
Add New Post /wp-admin/post-new.php5.97 ▲0.0499.68 ▲8.57
Media Library /wp-admin/upload.php3.32 ▲0.0439.61 ▲3.82
Add to order /wp-admin/options-general.php?page=mjato3.2634.13

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
recovery_mode_email_last_sent
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Add to order: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▼0.351.74 ▲0.0845.75 ▲4.76
Dashboard /wp-admin2,202 ▲255.60 ▼0.0586.15 ▼0.5340.16 ▲2.67
Posts /wp-admin/edit.php2,107 ▲41.97 ▲0.0040.66 ▲0.9638.14 ▲0.42
Add New Post /wp-admin/post-new.php1,529 ▼623.06 ▲4.82616.04 ▼23.6263.39 ▲2.96
Media Library /wp-admin/upload.php1,401 ▼24.11 ▼0.07103.16 ▲4.8044.77 ▲1.52
Add to order /wp-admin/options-general.php?page=mjato7041.516.8223.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded

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
Almost there, just 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(1824): MJATO\Options->default_status()
    #1 wp-admin/includes/template.php(1778): do_settings_fields()
    #2 wp-content/plugins/add-to-order/options.php(38): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(310): MJATO\Options->options_page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): 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}
    thrown
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mjato
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mjato
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: wc, add to cart, wc order, woocommerce order, order...

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

The main PHP file in "Add to order" ver. 1.0.0.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-to-order.php" instead of "add_to_order.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin185 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP21916148
PO File161031
Markdown1306

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
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
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin