83% flance-add-multiple-products-order-form-for-woocommerce

Code Review | Flance Add Multiple Products order form for Woocommerce

WordPress plugin Flance Add Multiple Products order form for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: flance-add-multip...
  • Plugin version: 4.1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 29, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 16
  • Update frequency: every 157.4 days
  • Top authors: flance (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,619 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.26ms] Passed 4 tests

This is a short check of server-side resources used by Flance Add Multiple Products order form for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.72 ▼6.08
Dashboard /wp-admin3.33 ▲0.0346.94 ▼8.01
Posts /wp-admin/edit.php3.38 ▲0.0347.96 ▼4.02
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.07 ▼6.72
Media Library /wp-admin/upload.php3.26 ▲0.0332.51 ▼4.22

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
flance_amp_product_cat
flance_amp_do_activation_redirect
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Flance Add Multiple Products order form for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.33 ▼0.031.67 ▼0.1237.51 ▼7.51
Dashboard /wp-admin2,209 ▲325.62 ▼0.0295.50 ▼9.0644.15 ▼2.37
Posts /wp-admin/edit.php2,115 ▲152.00 ▲0.0041.44 ▲2.7435.90 ▲0.57
Add New Post /wp-admin/post-new.php1,535 ▲923.33 ▼0.13597.17 ▼69.4054.51 ▼6.79
Media Library /wp-admin/upload.php1,414 ▲144.17 ▼0.0895.59 ▼0.5244.01 ▲3.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • flance_amp_product_cat
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • flance_amp_do_activation_redirect
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-calculas.php on line 66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/widget/partials/html-public-view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_cart_url() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-calculas.php:168
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-public-table.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/widget/class-flance-add-multiple-products-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/widget/partials/html-admin-view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-public-shortcode-input-field.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/admin/partials/html-admin-form.php:2
    • > PHP Notice
      Undefined variable: idi in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-calculas.php on line 14
    • > PHP Notice
      Undefined variable: formclass in wp-content/plugins/flance-add-multiple-products-order-form-for-woocommerce/public/partials/html-calculas.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #2 (Settings page. You can change or set the necessary settings form this page.)
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Requires at least: Version format is invalid
The official readme.txt might help

flance-add-multiple-products-order-form-for-woocommerce/flance_add_multiple_products_order_form_woocommerce.php 77% from 13 tests

The main PHP script in "Flance Add Multiple Products order form for Woocommerce" version 4.1.0 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("flance-add-multiple-products-order-form-for-woocommerce.php" instead of "flance_add_multiple_products_order_form_woocommerce.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 195 characters long)

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
Everything looks great! No dangerous files found in this plugin1,015 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP18207575905
CSS219591
JavaScript13119

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.25
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods40
▷ Static methods512.50%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.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
4 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/sodathemes-typw.png9.64KB5.05KB▼ 47.56%
admin/img/logo.png67.70KB40.89KB▼ 39.59%
admin/img/sodathemes-wsc.png6.94KB3.49KB▼ 49.66%
admin/img/sodathemes-wamp.png5.63KB2.96KB▼ 47.41%