83% backtotop

Code Review | Back To Top

WordPress plugin Back To Top scored83%from 54 tests.

About plugin

  • Plugin page: backtotop
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.1-4.2
  • WordPress version: 6.3.1
  • First release: Jul 22, 2013
  • Latest release: Apr 21, 2015
  • Number of updates: 26
  • Update frequency: every 24.6 days
  • Top authors: arkapravamajumder (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

800+ active /17,461 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.37ms] Passed 4 tests

This is a short check of server-side resources used by Back To Top
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0243.50 ▲0.59
Dashboard /wp-admin3.37 ▲0.0248.47 ▼7.00
Posts /wp-admin/edit.php3.48 ▲0.0852.35 ▼0.46
Add New Post /wp-admin/post-new.php5.95 ▲0.0293.41 ▼6.20
Media Library /wp-admin/upload.php3.29 ▲0.0239.54 ▲0.18
Settings /wp-admin/admin.php?page=backtop-settings3.2630.95
Back To Top /wp-admin/admin.php?page=backtotop3.3134.06

Server storage [IO: ▲0.82MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/backtotop/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/backtotop/banner-772\303\227250.png"
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Back To Top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13613.44 ▼0.918.92 ▲7.1343.43 ▲0.61
Dashboard /wp-admin2,224 ▲505.56 ▲0.0286.82 ▼1.6472.46 ▲31.17
Posts /wp-admin/edit.php2,132 ▲322.01 ▲0.0038.33 ▼0.6234.00 ▼2.20
Add New Post /wp-admin/post-new.php1,548 ▲2223.47 ▼0.07684.00 ▲8.8751.31 ▼2.50
Media Library /wp-admin/upload.php1,423 ▲234.20 ▼0.02100.74 ▼16.3974.07 ▲27.08
Settings /wp-admin/admin.php?page=backtop-settings8412.0127.9025.10
Back To Top /wp-admin/admin.php?page=backtotop8602.0324.3026.82

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/backtotop/inc/btt_backend.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/backtotop/inc/btt_settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_menu_page() in wp-content/plugins/backtotop/inc/btt_backend_functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/backtotop/backtotop.php:15

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: backtotop, scrolltotop, smooth scroll to top, top

backtotop/backtotop.php Passed 13 tests

"Back To Top" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
119 characters long description:
This plugin will create a "back to top" or "scroll to top button" for your website with smooth scrolling and 25 images.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin305 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP47315302
JavaScript3003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
27 PNG files occupy 0.55MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) img/8.png7.47KB0.00KB▼ 100.00%
img/19.png10.98KB10.60KB▼ 3.47%
img/20.png25.91KB8.22KB▼ 68.27%
img/6.png1.36KB0.41KB▼ 70.04%
img/1.png2.00KB0.57KB▼ 71.31%