84% smooth-back-to-top-button

Code Review | Smooth Back To Top Button

WordPress plugin Smooth Back To Top Button scored 84% from 54 tests.

About plugin

  • Plugin page: smooth-back-to-to...
  • Plugin version: 1.1.12
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 8, 2019
  • Latest release: Sep 16, 2023
  • Number of updates: 22
  • Update frequency: every 64.0 days
  • Top authors: tanvirul (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

20,000+ active / 106,698 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.10ms] Passed 4 tests

Server-side resources used by Smooth Back To Top Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.96 ▼4.17
Dashboard /wp-admin3.46 ▲0.1648.04 ▲5.32
Posts /wp-admin/edit.php3.51 ▲0.1651.75 ▲5.13
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.85 ▼10.69
Media Library /wp-admin/upload.php3.30 ▲0.0736.15 ▲5.42
Back To Top Button /wp-admin/options-general.php?page=smooth-back-to-top3.3035.82

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Smooth Back To Top Button
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,060 ▲32515.36 ▲0.806.36 ▲4.6241.89 ▲3.10
Dashboard /wp-admin2,369 ▲1836.66 ▲1.67132.63 ▲11.9443.76 ▲2.08
Posts /wp-admin/edit.php2,270 ▲1783.51 ▲1.4755.41 ▲15.4731.43 ▼1.80
Add New Post /wp-admin/post-new.php1,540 ▲118.67 ▼4.56588.27 ▼93.7133.17 ▼18.84
Media Library /wp-admin/upload.php1,405 ▲204.35 ▲0.0685.77 ▼23.5744.34 ▼2.70
Back To Top Button /wp-admin/options-general.php?page=smooth-back-to-top1,8284.1085.4436.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'SBTTB_Settings_API' not found in wp-content/plugins/smooth-back-to-top-button/admin/class-sbttb_settings.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

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:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

smooth-back-to-top-button/smooth-back-to-top-button.php Passed 13 tests

The main PHP script in "Smooth Back To Top Button" version 1.1.12 is automatically included on every request by WordPress
83 characters long description:
The best WordPress smooth back to top button plugin with scroll progress indicator.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,252 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP62323431,119
CSS27279
SVG20034
JavaScript18020

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity29.75
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods62
▷ Static methods23.23%
▷ Public methods5893.55%
▷ Protected methods00.00%
▷ Private methods46.45%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants6
▷ Global constants6100.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
There are no PNG files in this plugin