77% ns-smooth-scroll-back-to-top

Code Review | NS Smooth scroll back to top

WordPress plugin NS Smooth scroll back to top scored77%from 54 tests.

About plugin

  • Plugin page: ns-smooth-scroll-...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1
  • WordPress version: 6.3.1
  • First release: Sep 2, 2016
  • Latest release: Mar 24, 2023
  • Number of updates: 61
  • Update frequency: every 39.3 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,426 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.64ms] Passed 4 tests

A check of server-side resources used by NS Smooth scroll back to top
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.27 ▲1.46
Dashboard /wp-admin3.35 ▲0.0546.54 ▼3.52
Posts /wp-admin/edit.php3.47 ▲0.1144.23 ▼2.03
Add New Post /wp-admin/post-new.php5.95 ▲0.0783.28 ▼14.46
Media Library /wp-admin/upload.php3.28 ▲0.0537.78 ▲2.74
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2133.42
Back To Top /wp-admin/admin.php?page=ns-btta-options-page3.3035.60
/wp-admin/admin.php?page=plugineye1663.2443.91

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 53 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
btta_reviews_installed_on
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by NS Smooth scroll back to top
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲21013.81 ▼0.825.48 ▲3.8038.58 ▼9.26
Dashboard /wp-admin2,245 ▲575.02 ▼0.87101.95 ▼12.9285.36 ▲38.10
Posts /wp-admin/edit.php2,148 ▲592.33 ▲0.3234.87 ▼1.4833.80 ▼1.67
Add New Post /wp-admin/post-new.php1,719 ▲19122.64 ▲4.28782.90 ▲133.5234.89 ▼33.27
Media Library /wp-admin/upload.php1,442 ▲574.37 ▲0.16107.35 ▲8.5243.03 ▲0.58
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6891.167.3218.52
Back To Top /wp-admin/admin.php?page=ns-btta-options-page1,76010.94300.8757.71
/wp-admin/admin.php?page=plugineye1669352.0228.0426.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • btta_reviews_installed_on
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-smooth-scroll-back-to-top/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add images for these screenshots: #1 (View NS Smooth scroll back to top in site.), #2 (View NS Smooth scroll back to top in mobile.), #3 (Settings NS Smooth scroll back to top.)
The official readme.txt is a good inspiration

ns-smooth-scroll-back-to-top/ns-back-to-top-arrow.php 92% from 13 tests

"NS Smooth scroll back to top" version 1.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ns-smooth-scroll-back-to-top.php" instead of "ns-back-to-top-arrow.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
Good job! No executable or dangerous file extensions detected2,916 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP191873431,139
SVG200943
CSS66814643
JavaScript4266100
PO File1344291

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity33.00
▷ Minimum class complexity20.00
▷ Maximum class complexity46.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1544.12%
▷ Public methods2058.82%
▷ Protected methods00.00%
▷ Private methods1441.18%
Functions24
▷ Named functions1458.33%
▷ Anonymous functions1041.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.55MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png295.07KB129.43KB▼ 56.14%
screenshot-3.png56.33KB16.64KB▼ 70.47%
ns-admin-options/img/placeholder.png2.75KB2.92KB0.00%
ns-admin-options/img/ns-theme-promo.png29.37KB8.96KB▼ 69.50%
screenshot-1.png155.72KB51.85KB▼ 66.70%