78% scrolltotop

Code Review | scrollToTop

WordPress plugin scrollToTop scored78%from 54 tests.

About plugin

  • Plugin page: scrolltotop
  • Plugin version: 1.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Jun 12, 2020
  • Number of updates: 43
  • Update frequency: every 24.6 days
  • Top authors: rom4i (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /3,596 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.28MB] [CPU: ▲1.00ms] Passed 4 tests

This is a short check of server-side resources used by scrollToTop
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1245.09 ▲4.52
Dashboard /wp-admin3.64 ▲0.3347.88 ▲2.78
Posts /wp-admin/edit.php3.75 ▲0.3948.09 ▲0.24
Add New Post /wp-admin/post-new.php6.22 ▲0.3384.02 ▼1.97
Media Library /wp-admin/upload.php3.56 ▲0.3336.47 ▲2.94
scrollToTop /wp-admin/options-general.php?page=scrolltotop_settings_page3.5434.58

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for scrollToTop
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲15413.75 ▼0.667.49 ▲5.7156.35 ▲10.26
Dashboard /wp-admin2,207 ▲225.88 ▲0.0992.56 ▼6.6136.09 ▼6.59
Posts /wp-admin/edit.php2,093 ▲42.03 ▼0.0334.25 ▼2.0133.07 ▼2.84
Add New Post /wp-admin/post-new.php1,517 ▼1617.62 ▼5.66641.34 ▼51.8252.90 ▼4.40
Media Library /wp-admin/upload.php1,389 ▲14.24 ▼0.0693.89 ▼17.6942.52 ▼3.48
scrollToTop /wp-admin/options-general.php?page=scrolltotop_settings_page3,0468.70150.0656.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scrolltotop/includes/scrolltotop-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/scrolltotop/scrolltotop.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/scrolltotop/includes/scrolltotop-admin-sidebar.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=scrolltotop_settings_page
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=scrolltotop_settings_page
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=scrolltotop_settings_page
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultString is deprecated since version 5.5.0! Use wp.i18n instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=scrolltotop_settings_page
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: scroll up, to top, scroll, back to top, button...

scrolltotop/scrolltotop.php 92% from 13 tests

Analyzing the main PHP file in "scrollToTop" version 1.16
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 209 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin3,025 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP6285641,612
JavaScript72062661,006
CSS47510381
SVG114026

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin