84% scroll-to-top-button

Code Review | Scroll to Top Button

WordPress plugin Scroll to Top Button scored 84% from 54 tests.

About plugin

  • Plugin page: scroll-to-top-button
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 6.3.1
  • First release: Dec 19, 2013
  • Latest release: Jan 31, 2021
  • Number of updates: 17
  • Update frequency: every 152.9 days
  • Top authors: Rene Puchinger (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 26,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.22ms] Passed 4 tests

Analyzing server-side resources used by Scroll to Top Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.34 ▲1.12
Dashboard /wp-admin3.32 ▲0.0248.34 ▲1.75
Posts /wp-admin/edit.php3.37 ▲0.0144.66 ▲0.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.42 ▼3.37
Media Library /wp-admin/upload.php3.24 ▲0.0132.10 ▼2.87
Scroll to Top Button /wp-admin/themes.php?page=scroll_to_top_button_admin3.1828.26

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Scroll to Top Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲21413.62 ▼1.067.15 ▲5.4241.58 ▼2.63
Dashboard /wp-admin2,207 ▲165.84 ▼0.03100.42 ▲4.9939.19 ▲1.03
Posts /wp-admin/edit.php2,072 ▼172.06 ▲0.0534.15 ▼1.9531.25 ▼4.52
Add New Post /wp-admin/post-new.php1,545 ▲2623.30 ▲0.17668.41 ▼28.1951.21 ▼4.65
Media Library /wp-admin/upload.php1,386 ▼24.17 ▲0.0597.36 ▼5.7242.25 ▲0.36
Scroll to Top Button /wp-admin/themes.php?page=scroll_to_top_button_admin8122.0623.7127.46

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
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% 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
    • > GET request to /wp-admin/themes.php?page=scroll_to_top_button_admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/themes.php?page=scroll_to_top_button_admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were 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: Please add images for these screenshots: #1 (Settings in the admin area.), #2 (Scroll to Top Button in action)
The official readme.txt is a good inspiration

scroll-to-top-button/scroll-to-top-button.php Passed 13 tests

The main file in "Scroll to Top Button" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
77 characters long description:
A simple plugin for displaying a scroll to top button in bottom right corner.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected168 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15340101
CSS16045
JavaScript16022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png33.82KB15.88KB▼ 53.04%
screenshot-1.png9.21KB4.46KB▼ 51.55%