72% ns-woocommerce-catalog

Code Review | NS WooCommerce Catalog

WordPress plugin NS WooCommerce Catalog scored72%from 54 tests.

About plugin

  • Plugin page: ns-woocommerce-ca...
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2016
  • Latest release: Mar 24, 2023
  • Number of updates: 86
  • Update frequency: every 28.0 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /6,959 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by NS WooCommerce Catalog
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.21 ▼1.58
Dashboard /wp-admin3.35 ▲0.0550.39 ▼7.19
Posts /wp-admin/edit.php3.47 ▲0.1155.54 ▼4.02
Add New Post /wp-admin/post-new.php5.95 ▲0.0788.35 ▼20.92
Media Library /wp-admin/upload.php3.28 ▲0.0538.69 ▲3.16
/wp-admin/admin.php?page=plugineye2103.2435.29
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.0625.84
Catalog /wp-admin/admin.php?page=ns-woocommerce-catalog/ns-admin-options/ns_admin_option_dashboard.php3.3046.88

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
wcf_hide_cart_button_single_product
widget_theysaidso_widget
wcf_hide_cart_button_all_product
widget_recent-posts
widget_recent-comments
wcf_enabled_plugin
wcatalog_reviews_installed_on
...

Browser metrics Passed 4 tests

A check of browser resources used by NS WooCommerce Catalog
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8114.73 ▲0.451.73 ▼0.3043.58 ▲1.93
Dashboard /wp-admin2,232 ▲584.85 ▼0.7294.57 ▲3.3588.84 ▲48.25
Posts /wp-admin/edit.php2,154 ▲512.29 ▲0.2739.33 ▼1.9535.39 ▼2.38
Add New Post /wp-admin/post-new.php1,729 ▲20122.39 ▼0.75626.40 ▲1.9528.84 ▼23.04
Media Library /wp-admin/upload.php1,447 ▲534.46 ▲0.3092.18 ▼9.1978.18 ▲32.98
/wp-admin/admin.php?page=plugineye2109391.8726.4127.90
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3,01513.15461.27197.65
Catalog /wp-admin/admin.php?page=ns-woocommerce-catalog/ns-admin-options/ns_admin_option_dashboard.php1,55610.17275.5954.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • wcatalog_reviews_installed_on
    • db_upgraded
    • wcf_enabled_plugin
    • wcf_hide_cart_checkout_page
    • widget_theysaidso_widget
    • wcf_hide_cart_button_single_product
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ns-woocommerce-catalog/ns-admin-options/inc.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-woocommerce-catalog/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-woocommerce-catalog/ns-woocommerce-catalog-info.php:65

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors 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 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (View Caltalog mode on single product.), #2 (Settings NS WooCommerce Catalog.)
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
Please take inspiration from this readme.txt

ns-woocommerce-catalog/ns-woocommerce-catalog.php Passed 13 tests

The main file in "NS WooCommerce Catalog" v. 2.4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
47 characters long description:
Switch their WooCommerce site in online catalog

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
Everything looks great! No dangerous files found in this plugin10,999 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
SVG50148,698
PHP132023171,138
CSS8146191,014
JavaScript4260113
PO File1101036

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions27
▷ Named functions1555.56%
▷ Anonymous functions1244.44%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.24MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
screenshot-2.png15.23KB5.79KB▼ 62.00%
ns-admin-options/img/ns-theme-promo.png36.29KB11.62KB▼ 67.99%
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%