84% scroll-top

Code Review | Scroll To Top

WordPress plugin Scroll To Top scored84%from 54 tests.

About plugin

  • Plugin page: scroll-top
  • Plugin version: 1.5.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 22, 2014
  • Latest release: Nov 21, 2023
  • Number of updates: 61
  • Update frequency: every 58.3 days
  • Top authors: satrya (85.25%)idenovasi (9.84%)6hourcreative (8.2%)

Code review

54 tests

User reviews

12 reviews

Install metrics

20,000+ active /154,472 total downloads

Benchmarks

Plugin footprint 83% 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.59MB] [CPU: ▼0.66ms] Passed 4 tests

An overview of server-side resources used by Scroll To Top
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5742.60 ▲0.60
Dashboard /wp-admin3.92 ▲0.5751.18 ▼14.44
Posts /wp-admin/edit.php3.97 ▲0.6151.91 ▲2.37
Add New Post /wp-admin/post-new.php6.51 ▲0.6196.51 ▲9.76
Media Library /wp-admin/upload.php3.85 ▲0.6140.85 ▲8.84
Scroll To Top /wp-admin/options-general.php?page=scroll_top_settings_page3.8234.44

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 126 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Scroll To Top
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14013.75 ▼0.988.39 ▲6.7835.42 ▼9.60
Dashboard /wp-admin2,202 ▲255.59 ▼0.0296.36 ▲6.7739.26 ▼3.52
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0740.18 ▲3.5435.69 ▲3.66
Add New Post /wp-admin/post-new.php1,529 ▼1123.47 ▲0.35586.60 ▼11.5555.16 ▲9.50
Media Library /wp-admin/upload.php1,404 ▲104.19 ▼0.0097.69 ▼2.4541.14 ▼1.15
Scroll To Top /wp-admin/options-general.php?page=scroll_top_settings_page1,3832.3152.6927.75

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\Plugin\\UpdateChecker' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Vcs/PluginUpdateChecker.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\InstalledPackage' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Plugin/Package.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\InstalledPackage' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Theme/Package.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-top/admin/admin.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\Update' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Plugin/Update.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-top/inc/functions.php:64
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\Vcs\\Api' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Vcs/GitLabApi.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\UpdateChecker' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Theme/UpdateChecker.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\Vcs\\Api' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/Vcs/GitHubApi.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p2\\DebugBar\\Panel' not found in wp-content/plugins/scroll-top/plugin-update-checker/Puc/v5p2/DebugBar/PluginPanel.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: back to top, scroll to top, jquery, to top, customization...

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

The primary PHP file in "Scroll To Top" version 1.5.3 is used by WordPress to initiate all plugin functionality
78 characters long description:
Adds a flexible Back to Top button to any post/page of your WordPress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,956 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,4382,5295,612
PO File24143146833
Markdown1890283
CSS321192
JSON38072
JavaScript391551
XML14413

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity20.58
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces6
Interfaces1
Traits3
Classes34
▷ Abstract classes514.71%
▷ Concrete classes2985.29%
▷ Final classes00.00%
Methods380
▷ Static methods266.84%
▷ Public methods22860.00%
▷ Protected methods13936.58%
▷ Private methods133.42%
Functions32
▷ Named functions2784.38%
▷ Anonymous functions515.62%
Constants15
▷ Global constants426.67%
▷ Class constants1173.33%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected