84% wc-bulk-add-custom-related-products

Code Review | WC Bulk Custom Add Related Products

WordPress plugin WC Bulk Custom Add Related Products scored84%from 54 tests.

About plugin

  • Plugin page: wc-bulk-add-custo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.3
  • WordPress version: 6.3.1
  • First release: Dec 1, 2015
  • Latest release: Dec 2, 2015
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: vinodvaswani (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,100 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.85ms] Passed 4 tests

Analyzing server-side resources used by WC Bulk Custom Add Related Products
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0640.06 ▼1.45
Dashboard /wp-admin3.37 ▲0.0249.91 ▼11.09
Posts /wp-admin/edit.php3.42 ▲0.0651.06 ▲0.34
Add New Post /wp-admin/post-new.php5.97 ▲0.0886.15 ▼27.19
Media Library /wp-admin/upload.php3.29 ▲0.0636.24 ▲1.55
Bulk add custom related products /wp-admin/admin.php?page=bulk-add-related-products3.2633.47
Manage custom Related Products /wp-admin/admin.php?page=manage-related-products3.2630.81

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WC Bulk Custom Add Related Products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.71 ▲0.531.69 ▼0.1045.17 ▲2.45
Dashboard /wp-admin2,210 ▲305.65 ▼0.0389.27 ▼0.8237.78 ▼5.42
Posts /wp-admin/edit.php2,116 ▲162.01 ▼0.1137.49 ▲1.7935.63 ▲2.88
Add New Post /wp-admin/post-new.php1,551 ▲1418.14 ▼0.10672.50 ▲32.1764.33 ▲3.73
Media Library /wp-admin/upload.php1,415 ▲154.24 ▲0.0497.23 ▼2.6943.96 ▼4.41
Bulk add custom related products /wp-admin/admin.php?page=bulk-add-related-products9282.1928.0227.91
Manage custom Related Products /wp-admin/admin.php?page=manage-related-products8622.1924.2124.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wc-bulk-add-custom-related-products/bulk-add-custom-related-products.php:29

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Back end - Select related products by category from right side then select products by category from left side, Click on add related button. all the right side selected products will be related to foreach left side product.), #2 (Back end - Get all products related to any products, and remove them by clicking remove button.)
You can look at the official readme.txt

wc-bulk-add-custom-related-products/bulk-add-custom-related-products.php 92% from 13 tests

The primary PHP file in "WC Bulk Custom Add Related Products" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-bulk-add-custom-related-products.php" instead of "bulk-add-custom-related-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin559 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP19639351
JavaScript1689193
CSS23415

PHP code Passed 2 tests

This is a short overview 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.29
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png11.12KB5.75KB▼ 48.33%
screenshot-1.png15.45KB7.54KB▼ 51.21%
images/remove.png0.62KB0.61KB▼ 2.35%