72% scroll-page-to-top

Code Review | Scroll Page To Top

WordPress plugin Scroll Page To Top scored72%from 54 tests.

About plugin

  • Plugin page: scroll-page-to-top
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Aug 15, 2018
  • Latest release: Jun 18, 2021
  • Number of updates: 8
  • Update frequency: every 129.8 days
  • Top authors: pradeepsinghweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.44ms] Passed 4 tests

Analyzing server-side resources used by Scroll Page To Top
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.31 ▲1.35
Dashboard /wp-admin3.38 ▲0.0347.91 ▼12.77
Posts /wp-admin/edit.php3.49 ▲0.1353.12 ▲8.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0580.95 ▼24.35
Media Library /wp-admin/upload.php3.28 ▲0.0538.15 ▲6.03
Scroll Page To Top /wp-admin/options-general.php?page=scroll_page_to_top3.3132.18

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
_rps_scroll_page_to_top_settings
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Scroll Page To Top
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,063 ▲27715.28 ▲0.738.08 ▲6.4143.58 ▲3.41
Dashboard /wp-admin2,353 ▲1726.35 ▲0.64114.36 ▲10.7837.63 ▼1.91
Posts /wp-admin/edit.php2,288 ▲1883.51 ▲1.5752.01 ▲15.8131.93 ▼4.36
Add New Post /wp-admin/post-new.php1,541 ▲323.44 ▲4.90669.36 ▼16.6037.35 ▼36.56
Media Library /wp-admin/upload.php1,421 ▲214.33 ▲0.1496.64 ▲1.2050.43 ▲4.40
Scroll Page To Top /wp-admin/options-general.php?page=scroll_page_to_top1,3683.2242.9729.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • _rps_scroll_page_to_top_settings
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=scroll_page_to_top
    • > Notice in wp-content/plugins/scroll-page-to-top/lib/settings.tpl.php+4
    Undefined index: frm-action
    • > GET request to /wp-admin/options-general.php?page=scroll_page_to_top
    • > Notice in wp-content/plugins/scroll-page-to-top/lib/settings.tpl.php+11
    Undefined variable: response

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/scroll-page-to-top/scroll-page-to-top.php:107
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/scroll-page-to-top/lib/settings.tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-page-to-top/lib/settings.class.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=scroll_page_to_top
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=scroll_page_to_top:331:13)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=scroll_page_to_top
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: scroll page to top, scroll to top, scroll page, bottom to top, back to top

scroll-page-to-top/scroll-page-to-top.php 92% from 13 tests

The principal PHP file in "Scroll Page To Top" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 142 characters long)

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
Good job! No executable or dangerous file extensions detected418 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32128417
JavaScript1061

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity9.00
▷ Minimum class complexity7.00
▷ Maximum class complexity11.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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 images were found in this plugin