78% ns-remove-related-products-for-woocommerce

Code Review | NS Remove Related Products for WooCommerce

WordPress plugin NS Remove Related Products for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-remove-related...
  • Plugin version: 2.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1
  • WordPress version: 6.3.1
  • First release: Sep 10, 2016
  • Latest release: Mar 24, 2023
  • Number of updates: 75
  • Update frequency: every 31.8 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

5,000+ active /46,956 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼3.35ms] Passed 4 tests

An overview of server-side resources used by NS Remove Related Products for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1335.52 ▼1.85
Dashboard /wp-admin3.45 ▲0.1547.82 ▲3.87
Posts /wp-admin/edit.php3.57 ▲0.2152.51 ▲3.83
Add New Post /wp-admin/post-new.php6.05 ▲0.1684.68 ▼15.49
Media Library /wp-admin/upload.php3.38 ▲0.1438.92 ▲0.10
Remove Related /wp-admin/admin.php?page=ns-remove-related-products-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php3.3533.96
/wp-admin/admin.php?page=plugineye2083.3443.36
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.1624.52

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
rrpw_reviews_installed_on
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by NS Remove Related Products for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9313.26 ▼1.121.58 ▲0.0143.87 ▲2.06
Dashboard /wp-admin2,231 ▲434.92 ▲0.0197.17 ▼13.5275.94 ▲33.03
Posts /wp-admin/edit.php2,132 ▲462.06 ▲0.0138.32 ▲2.8134.65 ▼3.33
Add New Post /wp-admin/post-new.php1,548 ▲1523.01 ▼0.19749.84 ▲63.5739.25 ▼14.37
Media Library /wp-admin/upload.php1,416 ▲284.23 ▲0.07101.58 ▼9.2177.32 ▲29.04
Remove Related /wp-admin/admin.php?page=ns-remove-related-products-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php1,4199.19282.2752.36
/wp-admin/admin.php?page=plugineye2089101.7624.7426.30
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3,19114.95463.83193.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • rrpw_reviews_installed_on
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ns-remove-related-products-for-woocommerce/ns-admin-options/inc.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-remove-related-products-for-woocommerce/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Deprecation (warning) in unknown
    https://www.nsthemes.com/wp-content/themes/flatsome/assets/js/flatsome.js?ver=295a0d1d1e8168b25a51f884bffa7b33 0 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

ns-remove-related-products-for-woocommerce/ns-remove-related-product-woocommerce.php 92% from 13 tests

The main file in "NS Remove Related Products for WooCommerce" v. 2.3.10 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ns-remove-related-products-for-woocommerce.php" instead of "ns-remove-related-product-woocommerce.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
Success! There were no dangerous files found in this plugin1,860 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP11159307934
CSS512911821
PO File1192054
JavaScript36051

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity33.00
▷ Minimum class complexity20.00
▷ Maximum class complexity46.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1544.12%
▷ Public methods2058.82%
▷ Protected methods00.00%
▷ Private methods1441.18%
Functions20
▷ Named functions1050.00%
▷ Anonymous functions1050.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
ns-admin-options/img/ns-theme-promo.png36.29KB11.62KB▼ 67.99%