78% ns-popup-cart-for-woocommerce

Code Review | NS Popup Cart for WooCommerce

WordPress plugin NS Popup Cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-popup-cart-for...
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Nov 21, 2016
  • Latest release: Feb 11, 2022
  • Number of updates: 37
  • Update frequency: every 51.5 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,237 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.66ms] Passed 4 tests

Server-side resources used by NS Popup Cart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.45 ▼6.48
Dashboard /wp-admin3.33 ▲0.0347.20 ▲0.54
Posts /wp-admin/edit.php3.44 ▲0.0948.64 ▼5.59
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.91 ▼9.56
Media Library /wp-admin/upload.php3.25 ▲0.0234.49 ▼5.01
/wp-admin/admin.php?page=plugineye2463.2229.75
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.1931.42
NS Popup Cart /wp-admin/admin.php?page=ns-popup-cart-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php3.2530.77

Server storage [IO: ▲0.25MB] [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: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for NS Popup Cart for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲21313.53 ▼0.879.14 ▲7.5339.57 ▼2.96
Dashboard /wp-admin2,224 ▲365.88 ▲1.0298.90 ▼5.4577.25 ▲34.44
Posts /wp-admin/edit.php2,125 ▲332.04 ▼0.0246.52 ▲6.3342.55 ▲3.03
Add New Post /wp-admin/post-new.php1,542 ▲923.00 ▼0.09741.31 ▲70.3463.12 ▲4.00
Media Library /wp-admin/upload.php1,421 ▲334.21 ▲0.0096.19 ▼18.4080.92 ▲32.66
/wp-admin/admin.php?page=plugineye2469031.7325.8223.77
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6841.557.1718.60
NS Popup Cart /wp-admin/admin.php?page=ns-popup-cart-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php1,4499.25267.2758.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-popup-cart-for-woocommerce/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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 need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Graphics example.), #2 (Settings Custom Popup Cart.)
The official readme.txt might help

ns-popup-cart-for-woocommerce/ns-popup-view-cart.php 92% from 13 tests

The main PHP file in "NS Popup Cart for WooCommerce" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ns-popup-cart-for-woocommerce.php" instead of "ns-popup-view-cart.php")

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
Everything looks great! No dangerous files found in this plugin1,167 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172176624
CSS44716492
JavaScript39251

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions17
▷ Named functions741.18%
▷ Anonymous functions1058.82%
Constants2
▷ Global constants2100.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
5 PNG files occupy 0.20MB with 0.11MB 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-1.png92.91KB33.94KB▼ 63.47%
screenshot-2.png55.88KB15.60KB▼ 72.08%
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
ns-admin-options/img/ns-theme-promo.png29.37KB8.96KB▼ 69.50%