78% ns-gdpr

Code Review | NS GDPR Helper

WordPress plugin NS GDPR Helper scored78%from 54 tests.

About plugin

  • Plugin page: ns-gdpr
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.3.29+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Apr 16, 2018
  • Latest release: Feb 7, 2022
  • Number of updates: 37
  • Update frequency: every 37.7 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,506 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼1.29ms] Passed 4 tests

A check of server-side resources used by NS GDPR Helper
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1041.51 ▼0.82
Dashboard /wp-admin3.42 ▲0.1151.53 ▼1.54
Posts /wp-admin/edit.php3.53 ▲0.1750.47 ▲2.74
Add New Post /wp-admin/post-new.php6.00 ▲0.1189.20 ▼5.53
Media Library /wp-admin/upload.php3.34 ▲0.1139.77 ▲5.07
NS GDPR /wp-admin/admin.php?page=ns-gdpr/ns-admin-options/ns_admin_option_dashboard.php3.3335.96
/wp-admin/admin.php?page=plugineye2073.3133.74
Join the NS CLUB /wp-admin/admin.php?page=join-the-club3.1324.23

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS GDPR Helper
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16213.72 ▼0.908.61 ▲6.8942.40 ▼1.86
Dashboard /wp-admin2,220 ▲435.66 ▲0.0979.13 ▼18.0777.15 ▲33.09
Posts /wp-admin/edit.php2,128 ▲282.01 ▼0.0137.14 ▼3.0234.27 ▼0.30
Add New Post /wp-admin/post-new.php1,705 ▲16722.45 ▼0.92716.66 ▲27.3451.92 ▼6.68
Media Library /wp-admin/upload.php1,431 ▲344.17 ▼0.0395.79 ▼10.0273.53 ▲21.39
NS GDPR /wp-admin/admin.php?page=ns-gdpr/ns-admin-options/ns_admin_option_dashboard.php9682.0022.5636.64
/wp-admin/admin.php?page=plugineye2079162.0023.6523.80
Join the NS CLUB /wp-admin/admin.php?page=join-the-club3,37511.25388.23169.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× 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/ns-gdpr/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-gdpr/comments/ns-gdpr-comments.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-gdpr/contact-form-7/ns-gdpr-contact-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-gdpr/woocommerce/ns-wc-gdpr-checkout.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=join-the-club
    • > 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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Settings NS GDPR for WordPress and WooCommerce.), #2 (View GDPR checkbox.)
The official readme.txt might help

ns-gdpr/ns-gdpr.php Passed 13 tests

This is the main PHP file of "NS GDPR Helper" version 1.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
91 characters long description:
This plugin helps you to comply with the European General Data Protection Regulation (GDPR)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,669 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS312229794
PHP15141209783
PO File1192354
JavaScript26038

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods526.32%
▷ Protected methods00.00%
▷ Private methods1473.68%
Functions23
▷ Named functions1252.17%
▷ Anonymous functions1147.83%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
screenshot-1.png87.51KB23.52KB▼ 73.12%
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%