84% on-click-to-top

Code Review | On Click to Top

WordPress plugin On Click to Top scored84%from 54 tests.

About plugin

  • Plugin page: on-click-to-top
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Mar 16, 2022
  • Latest release: Mar 16, 2022
  • Number of updates: 2
  • Update frequency: every 11.0 days
  • Top authors: devrahim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /222 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.69ms] Passed 4 tests

An overview of server-side resources used by On Click to Top
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.19 ▼1.57
Dashboard /wp-admin3.31 ▲0.0049.94 ▼5.56
Posts /wp-admin/edit.php3.36 ▲0.0053.85 ▼0.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.16 ▼18.74
Media Library /wp-admin/upload.php3.23 ▲0.0035.61 ▲0.07

Server storage [IO: ▲0.00MB] [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: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for On Click to Top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲9413.36 ▼1.008.26 ▲6.2341.56 ▼0.55
Dashboard /wp-admin2,192 ▲155.57 ▼0.0789.35 ▼6.9137.82 ▼3.23
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.0935.61 ▼8.1632.74 ▼7.74
Add New Post /wp-admin/post-new.php1,526 ▼222.98 ▼0.19701.52 ▲85.5355.71 ▲3.30
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0399.72 ▼8.4148.88 ▲3.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/on-click-to-top/scroll.php:15

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 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: on click to top, scroll to top, click to top button, scroll to top button, simple scroll to top button

on-click-to-top/scroll.php 85% from 13 tests

The principal PHP file in "On Click to Top" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 277 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("on-click-to-top.php" instead of "scroll.php")

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
Everything looks great! No dangerous files found in this plugin61 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS13331
JavaScript12516
PHP161214

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/up-arrow.png0.37KB0.36KB▼ 3.13%