84% scroll-to-top-or-bottom

Code Review | Scroll To Top or Bottom

WordPress plugin Scroll To Top or Bottom scored 84% from 54 tests.

About plugin

  • Plugin page: scroll-to-top-or-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.0.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2014
  • Latest release: Nov 24, 2014
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: ifte.hsn2013 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,803 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.31ms] Passed 4 tests

Analyzing server-side resources used by Scroll To Top or Bottom
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.88 ▼2.73
Dashboard /wp-admin3.31 ▲0.0145.14 ▼4.38
Posts /wp-admin/edit.php3.36 ▲0.0145.61 ▼3.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.59 ▼6.22
Media Library /wp-admin/upload.php3.23 ▲0.0132.56 ▼2.98

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Scroll To Top or Bottom
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲24513.73 ▼0.6512.56 ▲10.4340.75 ▼6.81
Dashboard /wp-admin2,206 ▲215.83 ▲0.9798.03 ▼10.5640.94 ▼4.37
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0435.97 ▼4.1634.23 ▼3.24
Add New Post /wp-admin/post-new.php1,537 ▲423.36 ▼0.03628.53 ▼15.7259.84 ▲3.65
Media Library /wp-admin/upload.php1,391 ▼04.31 ▲0.1395.77 ▼1.1042.49 ▲1.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-to-top-or-bottom/Totop.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
6 plugin tags: smooth scroll, scroll to top, scroll to bottom, scrolltop, go-to-top...

scroll-to-top-or-bottom/Totop.php 85% from 13 tests

This is the main PHP file of "Scroll To Top or Bottom" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("scroll-to-top-or-bottom.php" instead of "Totop.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin184 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2120130
CSS10040
PHP1142614

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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

All PNG images should be compressed to minimize bandwidth usage for end users
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
css/totopicons.png2.24KB1.31KB▼ 41.55%