77% top-scroller

Code Review | Top Scroller

WordPress plugin Top Scroller scored 77% from 53 tests.

About plugin

  • Plugin page: top-scroller
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 5.8.1
  • First release: Apr 19, 2021
  • Latest release: Sep 6, 2021
  • Number of updates: 16
  • Update frequency: every 8.8 days
  • Top authors: hamzaakram25 (100%)

Code review

53 tests

User reviews

5 reviews

Install metrics

60+ active / 232 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
Install script ran successfully

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

Server-side resources used by Top Scroller
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1533.57 ▲15.18
Dashboard /wp-admin3.10 ▲0.0437.29 ▼5.85
Posts /wp-admin/edit.php3.15 ▲0.0448.00 ▲8.24
Add New Post /wp-admin/post-new.php5.46 ▲0.0391.48 ▼1,075.13
Media Library /wp-admin/upload.php3.04 ▲0.0335.25 ▼2.59
Top Scroller /wp-admin/options-general.php?page=top-scroller3.0629.36

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
scroll_to_top_btn_color
scroll_to_top_speed
scroll_to_top_hvr_color
scroll_to_top_hvr_icon_color
scroll_to_top_icon
scroll_to_top_icon_color
scroll_to_top_font_size

Browser metrics Passed 4 tests

This is an overview of browser requirements for Top Scroller
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,825 ▲24416.77 ▲1.2012.89 ▲5.3856.73 ▲9.17
Dashboard /wp-admin2,963 ▲1106.55 ▲0.63135.63 ▼19.6690.75 ▼15.51
Posts /wp-admin/edit.php2,742 ▲363.00 ▲0.3169.32 ▲2.6392.74 ▲1.66
Add New Post /wp-admin/post-new.php1,682 ▼35418.32 ▲0.57366.27 ▲16.01101.08 ▼7.85
Media Library /wp-admin/upload.php1,805 ▲335.39 ▲0.40127.51 ▼21.39103.49 ▼7.44
Top Scroller /wp-admin/options-general.php?page=top-scroller2,0103.3088.0264.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, function 'uninstallHook' not found or invalid function name

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=top-scroller
    • > Notice in wp-content/plugins/top-scroller/manage/admin.php+22
    Undefined index: Totop_save

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/top-scroller/js/to_top_btn.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/top-scroller/css/to_top_style.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-1) image not found
You can take inspiration from this readme.txt

top-scroller/scroll_to_top_btn.php 77% from 13 tests

The primary PHP file in "Top Scroller" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("top-scroller.php" instead of "scroll_to_top_btn.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.1" instead of "5.2")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin9,893 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
SVG3009,552
PHP426688335
JavaScript1615
CSS1041

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png45.41KB17.04KB▼ 62.48%