78% ns-custom-alert-popup-box

Code Review | NS WordPress Custom Alert Popup Box

WordPress plugin NS WordPress Custom Alert Popup Box scored78%from 54 tests.

About plugin

  • Plugin page: ns-custom-alert-p...
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: Feb 9, 2022
  • Number of updates: 54
  • Update frequency: every 36.9 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,890 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.96ms] Passed 4 tests

Server-side resources used by NS WordPress Custom Alert Popup Box
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.43 ▼1.32
Dashboard /wp-admin3.43 ▲0.1246.49 ▼1.09
Posts /wp-admin/edit.php3.54 ▲0.1846.75 ▼1.03
Add New Post /wp-admin/post-new.php6.03 ▲0.1489.66 ▼12.40
Media Library /wp-admin/upload.php3.35 ▲0.1239.50 ▲4.78
Popup Box /wp-admin/admin.php?page=ns-custom-alert-popup-box/ns-admin-options/ns_admin_option_dashboard.php3.3944.12
/wp-admin/admin.php?page=plugineye2393.3233.39
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.1425.04

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 16 new options
New WordPress options
wt_wcapb_opacity_layer
wt_wcapb_padding
widget_recent-comments
ns_wcapb_delay
wt_wcapb_border_size
wt_wcapb_color_layer
ns_wcapb_text
theysaidso_admin_options
ns_wcapb_test_mode_premium
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS WordPress Custom Alert Popup Box
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,077 ▲34213.99 ▼0.5714.73 ▲13.0543.74 ▼3.04
Dashboard /wp-admin2,242 ▲575.14 ▼0.71102.14 ▲2.6888.76 ▲41.27
Posts /wp-admin/edit.php2,142 ▲532.31 ▲0.3136.74 ▼6.4129.44 ▼6.24
Add New Post /wp-admin/post-new.php1,561 ▲2723.20 ▲0.08661.42 ▲60.94122.59 ▲62.37
Media Library /wp-admin/upload.php1,440 ▲584.56 ▲0.35100.94 ▲2.8170.88 ▲28.95
Popup Box /wp-admin/admin.php?page=ns-custom-alert-popup-box/ns-admin-options/ns_admin_option_dashboard.php2,1837.79161.83120.12
/wp-admin/admin.php?page=plugineye2399292.0227.9023.98
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3,01814.04456.88186.30

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
  • This plugin did not uninstall successfully, leaving 16 options in the database
    • ns_wcapb_delay
    • ns_wcapb_test_mode_premium
    • wt_wcapb_border_color
    • wt_wcapb_opacity_layer
    • wt_wcapb_color_layer
    • db_upgraded
    • widget_recent-comments
    • wt_wcapb_padding
    • wt_wcapb_color_content
    • 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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-custom-alert-popup-box/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ns-custom-alert-popup-box/ns-admin-options/inc.php:21

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)
There are user-side issues 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 90% from 29 tests

readme.txt 88% 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 require attention:
  • Screenshots: Add images for these screenshots: #1 (View NS WordPress Custom Alert Popup Box in site.), #2 (Settings NS WordPress Custom Alert Popup Box.)
  • Tags: Please delete some tags, you are using 26 tag instead of maximum 10
You can look at the official readme.txt

ns-custom-alert-popup-box/ns-wordpress-custom-alert-popup-box.php 92% from 13 tests

The main PHP script in "NS WordPress Custom Alert Popup Box" version 1.7.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ns-custom-alert-popup-box.php" instead of "ns-wordpress-custom-alert-popup-box.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,089 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS5164201,099
PHP1199201837
JavaScript414077
PO File1181876

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions24
▷ Named functions1458.33%
▷ Anonymous functions1041.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.25MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png35.53KB13.74KB▼ 61.32%
ns-admin-options/img/rac-shopping-cart.png11.87KB9.31KB▼ 21.62%
ns-admin-options/img/rac-loss-chart.png7.77KB5.42KB▼ 30.26%
ns-admin-options/img/rac-recovery.png6.76KB5.72KB▼ 15.42%
img/ns_banner_membership-500.png24.95KB26.27KB0.00%