84% wp-scroll-2

Code Review | Scroll to top button

WordPress plugin Scroll to top button scored84%from 54 tests.

About plugin

  • Plugin page: wp-scroll-2
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8.1
  • WordPress version: 6.3.1
  • First release: May 8, 2017
  • Latest release: Sep 10, 2021
  • Number of updates: 25
  • Update frequency: every 63.5 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,245 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.02MB] [CPU: ▼10.45ms] Passed 4 tests

A check of server-side resources used by Scroll to top button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.39 ▼3.25
Dashboard /wp-admin3.34 ▼0.0153.42 ▼11.94
Posts /wp-admin/edit.php3.39 ▲0.0352.00 ▼5.42
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.60 ▼21.17
Media Library /wp-admin/upload.php3.26 ▲0.0342.01 ▲3.59

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Scroll to top button: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲12513.41 ▼0.8810.13 ▲7.8439.76 ▼2.16
Dashboard /wp-admin2,211 ▲315.62 ▼0.0386.36 ▼4.8038.76 ▼6.33
Posts /wp-admin/edit.php2,113 ▲101.98 ▼0.0435.61 ▼4.6634.15 ▼5.95
Add New Post /wp-admin/post-new.php1,539 ▲1323.10 ▼0.60624.38 ▼8.1850.48 ▼4.33
Media Library /wp-admin/upload.php1,419 ▲194.35 ▲0.1399.56 ▼9.6242.84 ▼1.40

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-scroll-2/scroll_to_top.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: scroll up, scroll to top, scroll, scroll top, back to top

wp-scroll-2/scroll_to_top.php 92% from 13 tests

Analyzing the main PHP file in "Scroll to top button" version 1.0.5
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-scroll-2.php" instead of "scroll_to_top.php")

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
No dangerous file extensions were detected196 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12819148
JavaScript15042
CSS1006

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image/scroll-top-icon.png2.51KB2.42KB▼ 3.35%