74% product-batch-for-woocommerce

Code Review | Product Batch for WooCommerce

WordPress plugin Product Batch for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: product-batch-for...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Aug 25, 2017
  • Latest release: Aug 24, 2018
  • Number of updates: 5
  • Update frequency: every 74.0 days
  • Top authors: shadim (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /1,459 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼13.24ms] Passed 4 tests

Server-side resources used by Product Batch for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.99 ▼10.65
Dashboard /wp-admin3.32 ▼0.0349.67 ▼19.94
Posts /wp-admin/edit.php3.37 ▲0.0154.56 ▲0.36
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.69 ▼22.71
Media Library /wp-admin/upload.php3.24 ▲0.0139.78 ▲4.70

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: 1 new table, 6 new options
New tables
wp_woocommerce_product_batch
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Product Batch for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.23 ▲0.101.94 ▲0.0542.30 ▼4.64
Dashboard /wp-admin2,192 ▲155.51 ▼0.0787.92 ▼8.3039.23 ▼5.49
Posts /wp-admin/edit.php2,100 ▼02.03 ▼0.0035.77 ▼0.8834.94 ▼3.07
Add New Post /wp-admin/post-new.php1,526 ▼023.42 ▲0.80670.34 ▲65.7858.17 ▲8.95
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0097.61 ▲0.1444.52 ▼1.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_woocommerce_product_batch
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/product-batch-for-woocommerce/classes/includes/admin-screen-edit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/product-batch-for-woocommerce/product-batch-wc.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/product-batch-for-woocommerce/classes/class-wc-product-batch-table.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/product-batch-for-woocommerce/classes/includes/admin-screen.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/product-batch-for-woocommerce/classes/class-wc-product-batch.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: batches, order batch, product batch, manufacturing batch, batch

product-batch-for-woocommerce/product-batch-wc.php 85% from 13 tests

"Product Batch for WooCommerce" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("product-batch-for-woocommerce.php" instead of "product-batch-wc.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 180 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected666 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9220222658
CSS1106
Markdown1002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.50
▷ Minimum class complexity3.00
▷ Maximum class complexity30.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods34
▷ Static methods411.76%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin