78% ns-wishlist-for-woocommerce

Code Review | NS Wishlist For Woocommerce

WordPress plugin NS Wishlist For Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-wishlist-for-w...
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Dec 12, 2016
  • Latest release: Feb 5, 2022
  • Number of updates: 46
  • Update frequency: every 40.9 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,720 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▲1.35ms] Passed 4 tests

A check of server-side resources used by NS Wishlist For Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2350.79 ▲10.11
Dashboard /wp-admin3.54 ▲0.2454.79 ▲2.52
Posts /wp-admin/edit.php3.66 ▲0.3056.48 ▲2.83
Add New Post /wp-admin/post-new.php6.14 ▲0.2697.52 ▼6.75
Media Library /wp-admin/upload.php3.47 ▲0.2443.13 ▲6.79
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.4036.20
Wishlist /wp-admin/admin.php?page=ns-wishlist-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php3.4639.82
/wp-admin/admin.php?page=plugineye2183.4345.26

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 97 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
nsww_reviews_installed_on
widget_ns_wishlist
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS Wishlist For Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,170 ▲42413.91 ▼0.3214.08 ▲12.4938.01 ▼8.14
Dashboard /wp-admin2,224 ▲364.86 ▼1.04107.50 ▼1.0369.24 ▲24.53
Posts /wp-admin/edit.php2,125 ▲332.00 ▼0.0037.77 ▼3.7034.98 ▼1.74
Add New Post /wp-admin/post-new.php1,541 ▼123.03 ▼0.21694.10 ▲63.2951.41 ▼1.31
Media Library /wp-admin/upload.php1,412 ▲214.20 ▼0.0399.51 ▼3.1677.46 ▲33.31
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6841.146.5720.90
Wishlist /wp-admin/admin.php?page=ns-wishlist-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php1,5459.06251.3854.85
/wp-admin/admin.php?page=plugineye2189032.0329.5926.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • nsww_reviews_installed_on
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_ns_wishlist
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-wishlist-for-woocommerce/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-wishlist-for-woocommerce/ns-woocommerce-wishlist-single-product.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ns-wishlist-for-woocommerce/ns-woocommerce-wishlist-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-wishlist-for-woocommerce/ns-woocommerce-wishlist-share.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-wishlist-for-woocommerce/ns-woocommerce-wishlist-loop-product.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Single product wishlist.), #2 (Shop & Widget.), #3 (Wishlist page.)
The official readme.txt is a good inspiration

ns-wishlist-for-woocommerce/ns-woocommerce-wishlist.php 92% from 13 tests

The main file in "NS Wishlist For Woocommerce" v. 2.1.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: The principal plugin file should be the same as the plugin slug ("ns-wishlist-for-woocommerce.php" instead of "ns-woocommerce-wishlist.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected15,096 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
SVG80159,715
CSS71,457193,683
PHP192384791,526
JavaScript43659172

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity23.33
▷ Minimum class complexity4.00
▷ Maximum class complexity46.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods38
▷ Static methods1539.47%
▷ Public methods2463.16%
▷ Protected methods00.00%
▷ Private methods1436.84%
Functions33
▷ Named functions2060.61%
▷ Anonymous functions1339.39%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.56MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png24.71KB6.38KB▼ 74.19%
screenshot-7.png131.00KB43.10KB▼ 67.10%
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
screenshot-6.png35.07KB10.04KB▼ 71.36%
ns-admin-options/img/nswish-bannerone.png21.82KB8.76KB▼ 59.84%