83% sn-scroll-to-up

Code Review | SN Scroll To Up

WordPress plugin SN Scroll To Up scored83%from 54 tests.

About plugin

  • Plugin page: sn-scroll-to-up
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Mar 15, 2015
  • Latest release: Mar 15, 2015
  • Number of updates: 4
  • Update frequency: every 3.0 days
  • Top authors: syednuman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,117 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 gracefully, with no errors

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

This is a short check of server-side resources used by SN Scroll To Up
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.89 ▼0.79
Dashboard /wp-admin3.35 ▲0.0551.75 ▼0.84
Posts /wp-admin/edit.php3.41 ▲0.0548.11 ▼0.17
Add New Post /wp-admin/post-new.php5.95 ▲0.0788.05 ▼6.31
Media Library /wp-admin/upload.php3.28 ▲0.0542.83 ▲4.07

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for SN Scroll To Up
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,998 ▲23713.63 ▼0.7413.16 ▲11.2243.66 ▼3.46
Dashboard /wp-admin2,229 ▲525.72 ▲0.1488.85 ▼12.4488.38 ▲45.20
Posts /wp-admin/edit.php2,136 ▲362.32 ▲0.3336.20 ▼3.0239.18 ▲3.02
Add New Post /wp-admin/post-new.php1,712 ▲16422.72 ▼0.35759.51 ▲58.0635.83 ▼18.31
Media Library /wp-admin/upload.php1,431 ▲344.41 ▲0.14104.37 ▼16.5073.67 ▲24.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× 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/sn-scroll-to-up/plugin-main.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Add images for these screenshots: #1 (Scroll to top arrow on bottom right), #2 (Admin panel screenshot)
The official readme.txt is a good inspiration

sn-scroll-to-up/plugin-main.php 92% from 13 tests

"SN Scroll To Up" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sn-scroll-to-up.php" instead of "plugin-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,155 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS23101,334
SVG100414
PHP18226269
JavaScript3577138

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon.png0.44KB0.18KB▼ 59.73%
screenshot-1.png10.13KB5.72KB▼ 43.54%
screenshot-2.png56.74KB35.61KB▼ 37.24%
img/top.png0.68KB0.69KB0.00%