78% wc-bulk-assign-linked-products

Code Review | Bulk Assign Linked Products For WooCommerce

WordPress plugin Bulk Assign Linked Products For WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wc-bulk-assign-li...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.1
  • WordPress version: 6.3.1
  • First release: Apr 29, 2020
  • Latest release: Nov 14, 2022
  • Number of updates: 20
  • Update frequency: every 46.5 days
  • Top authors: vinodvaswani9 (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /2,630 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
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.28ms] Passed 4 tests

An overview of server-side resources used by Bulk Assign Linked Products For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.52 ▼5.64
Dashboard /wp-admin3.37 ▲0.0750.50 ▼7.00
Posts /wp-admin/edit.php3.42 ▲0.0649.87 ▼6.82
Add New Post /wp-admin/post-new.php5.97 ▲0.0897.55 ▼5.66
Media Library /wp-admin/upload.php3.30 ▲0.0639.63 ▼0.28
Bulk Assign Linked Products /wp-admin/admin.php?page=bulk-add-upsell-products3.2432.45
Update Upsell & Cross Sell /wp-admin/admin.php?page=show-assigned-products3.2429.00

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Bulk Assign Linked Products For WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.65 ▼0.731.78 ▼0.0041.97 ▼1.45
Dashboard /wp-admin2,210 ▲225.86 ▲0.95100.50 ▼15.6545.06 ▲7.53
Posts /wp-admin/edit.php2,099 ▲102.05 ▼0.0141.70 ▲2.3935.50 ▼1.69
Add New Post /wp-admin/post-new.php1,521 ▲223.20 ▲0.21631.57 ▼58.8461.07 ▲13.62
Media Library /wp-admin/upload.php1,392 ▲14.08 ▼0.17115.94 ▲3.7249.12 ▲2.06
Bulk Assign Linked Products /wp-admin/admin.php?page=bulk-add-upsell-products9172.1125.1843.18
Update Upsell & Cross Sell /wp-admin/admin.php?page=show-assigned-products8392.1024.9426.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=show-assigned-products
    • > Notice in wp-includes/class-walker-category-dropdown.php+76
    Trying to get property 'term_id' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=show-assigned-products
    • > Notice in wp-includes/class-walker-category-dropdown.php+65
    Trying to get property 'name' of non-object

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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-bulk-assign-linked-products/update-related-products.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-bulk-assign-linked-products/bulk_assign_linked_products_wc.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Select products from left section that you want to assign as linked products ( Cross-sell & Upsell ) and Select Products in right section to which you want to assign products selected from left section.), #2 (Now see the product edit page to which you linked the selected products, they will be displayed in cross-sell and upsell section of linked products.)
You can look at the official readme.txt

wc-bulk-assign-linked-products/bulk_assign_linked_products_wc.php 85% from 13 tests

The main file in "Bulk Assign Linked Products For WooCommerce" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-bulk-assign-linked-products.php" instead of "bulk_assign_linked_products_wc.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 174 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected898 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP26237394
JavaScript113229365
CSS1315139

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.24MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png14.89KB8.28KB▼ 44.39%
images/remove.png0.62KB0.61KB▼ 2.35%
screenshot-3.png98.85KB24.80KB▼ 74.91%
screenshot-1.png128.56KB39.16KB▼ 69.54%