84% generate-random-orders-for-woocommerce

Code Review | Generate Random Orders For WooCommerce

WordPress plugin Generate Random Orders For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: generate-random-o...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Jul 6, 2023
  • Latest release: Jul 6, 2023
  • Number of updates: 2
  • Update frequency: every 10.0 days
  • Top authors: aspengrovestudios (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /337 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.00MB] [CPU: ▼9.28ms] Passed 4 tests

A check of server-side resources used by Generate Random Orders For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.97 ▲2.07
Dashboard /wp-admin3.31 ▼0.0347.64 ▼16.79
Posts /wp-admin/edit.php3.36 ▲0.0144.33 ▼4.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.43 ▼16.14
Media Library /wp-admin/upload.php3.23 ▲0.0138.26 ▲0.04

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Generate Random Orders For WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.291.93 ▲0.2345.99 ▲3.51
Dashboard /wp-admin2,195 ▲155.53 ▼0.1387.77 ▼4.5038.85 ▼6.16
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0335.07 ▼3.6035.01 ▲0.13
Add New Post /wp-admin/post-new.php1,526 ▼2917.68 ▼5.26630.31 ▼50.8552.11 ▼4.08
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.01100.87 ▼3.8444.10 ▲1.41

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/generate-random-orders-for-woocommerce/includes/admin/admin.php:7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 22
    • > PHP Warning
      file_put_contents(ABSPATH/orders.json): failed to open stream: No such file or directory in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 244
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/generate-random-orders-for-woocommerce/includes/create-test-order.php on line 244

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: random, sample orders, orders, woocommerce, generate

generate-random-orders-for-woocommerce/wpz-woocommerce-random-orders.php 85% from 13 tests

"Generate Random Orders For WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("generate-random-orders-for-woocommerce.php" instead of "wpz-woocommerce-random-orders.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 review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,305 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
Sass11193481,018
CSS42018626
PHP5139118508
SVG40284
JavaScript44269

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.67
▷ Minimum class complexity4.00
▷ Maximum class complexity12.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods17100.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected