78% simple-back-to-top

Code Review | Simple Back To Top

WordPress plugin Simple Back To Top scored78%from 54 tests.

About plugin

  • Plugin page: simple-back-to-top
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2015
  • Latest release: Jan 3, 2023
  • Number of updates: 19
  • Update frequency: every 137.1 days
  • Top authors: praveencrony (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /21,706 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

An overview of server-side resources used by Simple Back To Top
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.81 ▼5.13
Dashboard /wp-admin3.32 ▲0.0151.44 ▼1.56
Posts /wp-admin/edit.php3.37 ▲0.0148.72 ▼4.60
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.54 ▼13.68
Media Library /wp-admin/upload.php3.24 ▲0.0137.36 ▼3.30
Back To Top - SBTT /wp-admin/options-general.php?page=sbtt-option3.2432.40

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
sbtt_options
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Simple Back To Top
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15213.48 ▼0.789.47 ▲7.6238.98 ▼13.46
Dashboard /wp-admin2,204 ▲245.55 ▼0.1086.43 ▼7.9738.40 ▼0.73
Posts /wp-admin/edit.php2,109 ▲92.01 ▲0.0341.20 ▲2.9734.46 ▼1.99
Add New Post /wp-admin/post-new.php1,531 ▲323.10 ▼0.16700.42 ▲28.2853.70 ▼1.37
Media Library /wp-admin/upload.php1,406 ▲94.21 ▲0.04117.38 ▲0.7345.71 ▼1.42
Back To Top - SBTT /wp-admin/options-general.php?page=sbtt-option8272.1123.5632.35

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 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

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 errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=sbtt-option
    • > 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/options-general.php?page=sbtt-option
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=sbtt-option
    • > Notice in wp-content/plugins/simple-back-to-top/options.php+48
    Undefined variable: msg

SRP 50% from 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 following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-back-to-top/options.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/simple-back-to-top/backtotop.php:13

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: simple back to top, scroll top, back to top, simple scroll to top, scroll...

simple-back-to-top/backtotop.php 92% from 13 tests

This is the main PHP file of "Simple Back To Top" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-back-to-top.php" instead of "backtotop.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
Success! There were no dangerous files found in this plugin167 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP22615107
CSS212739
JavaScript11121

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/backtotop.png1.35KB1.00KB▼ 26.03%