78% ns-custom-message-cart

Code Review | NS Custom Cart Message for WooCoomerce

WordPress plugin NS Custom Cart Message for WooCoomerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-custom-message...
  • Plugin version: 1.2.4
  • 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: 44
  • Update frequency: every 42.8 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,733 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.09MB] [CPU: ▲0.77ms] Passed 4 tests

A check of server-side resources used by NS Custom Cart Message for WooCoomerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0843.78 ▲1.94
Dashboard /wp-admin3.39 ▲0.0949.09 ▲2.47
Posts /wp-admin/edit.php3.50 ▲0.1548.77 ▼1.79
Add New Post /wp-admin/post-new.php5.99 ▲0.1099.44 ▲0.45
Media Library /wp-admin/upload.php3.31 ▲0.0840.41 ▲5.06
NS Custom Cart Message /wp-admin/admin.php?page=ns-custom-message-cart/ns-admin-options/ns_admin_option_dashboard.php3.2934.21
/wp-admin/admin.php?page=plugineye2493.2841.87
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2531.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for NS Custom Cart Message for WooCoomerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7514.46 ▲0.181.72 ▼0.6243.77 ▼5.26
Dashboard /wp-admin2,224 ▲365.87 ▲0.99110.00 ▲8.0370.24 ▲20.95
Posts /wp-admin/edit.php2,125 ▲332.01 ▼0.0138.15 ▼2.6334.34 ▼0.06
Add New Post /wp-admin/post-new.php1,555 ▲2223.43 ▼0.05693.33 ▲26.8055.65 ▼4.73
Media Library /wp-admin/upload.php1,418 ▲274.18 ▼0.01112.87 ▲15.1643.76 ▼3.26
NS Custom Cart Message /wp-admin/admin.php?page=ns-custom-message-cart/ns-admin-options/ns_admin_option_dashboard.php1,4939.38289.9757.59
/wp-admin/admin.php?page=plugineye2499061.8426.6923.82
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6841.557.7314.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
    • > 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just 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-custom-message-cart/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 require images: #1 (Settings Custom Message.), #2 (View cart message example.)
The official readme.txt might help

ns-custom-message-cart/ns-custom-message-cart.php Passed 13 tests

"NS Custom Cart Message for WooCoomerce" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
52 characters long description:
This plugin allow to add custom message to cart page

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,180 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP1169178616
CSS54716513
JavaScript310251

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions16
▷ Named functions531.25%
▷ Anonymous functions1168.75%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.14MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
screenshot-1.png41.02KB11.90KB▼ 70.98%
ns-admin-options/img/ns-theme-promo.png29.37KB8.96KB▼ 69.50%
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
screenshot-2.png50.75KB16.03KB▼ 68.41%