73% linked-orders-for-woocommerce

Code Review | Linked Orders for WooCommerce

WordPress plugin Linked Orders for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: linked-orders-for...
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 25, 2021
  • Latest release: Jul 12, 2022
  • Number of updates: 7
  • Update frequency: every 47.0 days
  • Top authors: deepwebsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,220 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲6.28MB] [CPU: ▲39.34ms] 50% from 4 tests

Analyzing server-side resources used by Linked Orders for WooCommerce
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,956.75ms on /wp-admin/admin.php?page=linked-orders-for-woocommerce)
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.28MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.75 ▲6.2981.67 ▲39.50
Dashboard /wp-admin9.60 ▲6.2595.71 ▲39.92
Posts /wp-admin/edit.php9.72 ▲6.3688.81 ▲44.29
Add New Post /wp-admin/post-new.php12.18 ▲6.30139.49 ▲33.65
Media Library /wp-admin/upload.php9.53 ▲6.3087.37 ▲52.24
Linked Orders for WooCommerce /wp-admin/admin.php?page=linked-orders-for-woocommerce9.781,956.75
Freemius Debug [v.2.4.4] /wp-admin/admin.php?page=freemius9.7586.00

Server storage [IO: ▲4.58MB] [DB: ▲0.08MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 724 new files
Database: no new tables, 11 new options
New WordPress options
fs_accounts
fs_active_plugins
can_compress_scripts
fs_gdpr
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
linked_orders_for_woocommerce_original_version
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for Linked Orders for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.28 ▼0.281.53 ▲0.0327.65 ▼15.77
Dashboard /wp-admin2,220 ▲435.50 ▼0.1787.45 ▼0.7339.46 ▲1.77
Posts /wp-admin/edit.php2,129 ▲292.11 ▲0.1337.46 ▼0.7133.27 ▼6.95
Add New Post /wp-admin/post-new.php1,542 ▲1620.80 ▼2.77605.63 ▼9.9559.75 ▼18.24
Media Library /wp-admin/upload.php1,425 ▲254.17 ▼0.04100.00 ▼2.4046.24 ▼0.89
Linked Orders for WooCommerce /wp-admin/admin.php?page=linked-orders-for-woocommerce1,0232.1929.4950.87
Freemius Debug [v.2.4.4] /wp-admin/admin.php?page=freemius1,0571.6527.6731.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/linked-orders-for-woocommerce/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 11 options in the database
    • theysaidso_admin_options
    • linked_orders_for_woocommerce_original_version
    • widget_recent-posts
    • fs_gdpr
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • fs_accounts
    • fs_debug_mode
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 fix the following
  • 59× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/invoker/src/ParameterResolver/ResolverChain.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\DI\\Definition\\Definition' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/Definition/FactoryDefinition.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\DI\\Definition\\Definition' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/Definition/ValueDefinition.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'DWS_LOWC_Deps\\Invoker\\Exception\\InvocationException' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/invoker/src/Exception/NotCallableException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\DI\\Definition\\Definition' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/Definition/StringDefinition.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/invoker/src/ParameterResolver/TypeHintResolver.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DWS_LOWC_Deps\\DI\\Definition\\Exception\\InvalidDefinition' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/DependencyException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'DWS_LOWC_Deps\\DI\\Definition\\Helper\\DefinitionHelper' not found in wp-content/plugins/linked-orders-for-woocommerce/dependencies/dependency-injection/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php:14

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 Passed 29 tests

readme.txt Passed 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
2 plugin tags: linked orders, woocommerce

linked-orders-for-woocommerce/linked-orders-for-woocommerce.php Passed 13 tests

The entry point to "Linked Orders for WooCommerce" version 1.2.2 is a PHP file that has certain tags in its header comment area
90 characters long description:
A WooCommerce extension for creating orders that are logically connected to existing ones.

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin47,533 lines of code in 561 files:
LanguageFilesBlank linesComment linesLines of code
PHP5368,83233,81046,850
PO File2136238346
JavaScript53561201
JSON10048
SVG11030
CSS131224
Markdown14017
Sass10011
TypeScript1106

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity15.29
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces102
Interfaces81
Traits98
Classes256
▷ Abstract classes3814.84%
▷ Concrete classes21885.16%
▷ Final classes219.63%
Methods2,590
▷ Static methods32612.59%
▷ Public methods2,04078.76%
▷ Protected methods1686.49%
▷ Private methods38214.75%
Functions232
▷ Named functions17876.72%
▷ Anonymous functions5423.28%
Constants222
▷ Global constants15971.62%
▷ Class constants6328.38%
▷ Public constants6196.83%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/wordpress-sdk/assets/img/linked-orders-for-woocommerce.png11.90KB4.37KB▼ 63.27%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%