72% scroll-back-to-top-button

Code Review | Scroll Back To Top Button

WordPress plugin Scroll Back To Top Button scored 72% from 54 tests.

About plugin

  • Plugin page: scroll-back-to-to...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.9.8
  • WordPress version: 5.8.1
  • First release: Aug 14, 2018
  • Latest release: Sep 21, 2018
  • Number of updates: 24
  • Update frequency: every 1.6 days
  • Top authors: webkochi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 337 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼144.17ms] Passed 4 tests

Analyzing server-side resources used by Scroll Back To Top Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1530.79 ▲7.05
Dashboard /wp-admin3.11 ▲0.0648.44 ▼10.91
Posts /wp-admin/edit.php3.22 ▲0.1247.77 ▲1.22
Add New Post /wp-admin/post-new.php5.45 ▲0.0187.68 ▼566.17
Media Library /wp-admin/upload.php3.03 ▲0.0330.71 ▼0.82
Scroll Back To Top /wp-admin/options-general.php?page=scroll_back_to_top_button3.0530.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
_scroll_page_to_top_settings

Browser metrics Passed 4 tests

Checking browser requirements for Scroll Back To Top Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,050 ▲44518.01 ▲2.4015.90 ▲5.6746.42 ▼30.34
Dashboard /wp-admin3,215 ▲2848.33 ▲2.11174.74 ▼1.27107.56 ▼18.62
Posts /wp-admin/edit.php2,988 ▲2494.40 ▲1.6886.92 ▲22.6285.85 ▼1.47
Add New Post /wp-admin/post-new.php1,518 ▼8618.61 ▲0.11379.07 ▼56.73105.77 ▼7.87
Media Library /wp-admin/upload.php1,840 ▲334.89 ▼0.13124.62 ▼29.77118.38 ▲4.34
Scroll Back To Top /wp-admin/options-general.php?page=scroll_back_to_top_button1,6364.0177.2382.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • _scroll_page_to_top_settings

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=scroll_back_to_top_button
    • > Notice in wp-content/plugins/scroll-back-to-top-button/inc/settings.temp.php+4
    Undefined index: frm-action
    • > GET request to /wp-admin/options-general.php?page=scroll_back_to_top_button
    • > Notice in wp-content/plugins/scroll-back-to-top-button/inc/settings.temp.php+11
    Undefined variable: response

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-back-to-top-button/scroll-back-to-top-button.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-back-to-top-button/inc/settings.class.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/scroll-back-to-top-button/inc/settings.temp.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=scroll_back_to_top_button
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31592 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=scroll_back_to_top_button:266:13)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=scroll_back_to_top_button
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31702 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 96% from 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: scroll top wordpress plugin, scroll back to top button, go to top, best scroll plugin wordpress, wordpress scroll to top button...

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

"Scroll Back To Top Button" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 149 characters long)

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
There were no executable files found in this plugin309 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32028308
JavaScript1061

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 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
(invalid) img/top-icn.png0.72KB0.00KB▼ 100.00%