89% wp-scroll-top

Code Review | WP Scroll Top

WordPress plugin WP Scroll Top scored89%from 54 tests.

About plugin

  • Plugin page: wp-scroll-top
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0.2
  • WordPress version: 6.3.1
  • First release: Nov 19, 2018
  • Latest release: Jan 6, 2019
  • Number of updates: 9
  • Update frequency: every 5.4 days
  • Top authors: tanvirmelon (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /476 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.09ms] Passed 4 tests

This is a short check of server-side resources used by WP Scroll Top
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.26 ▲1.19
Dashboard /wp-admin3.44 ▲0.1446.57 ▼5.05
Posts /wp-admin/edit.php3.55 ▲0.2049.58 ▲5.17
Add New Post /wp-admin/post-new.php6.04 ▲0.1593.28 ▲1.46
Media Library /wp-admin/upload.php3.36 ▲0.1333.26 ▼1.95

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Scroll Top
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲15913.65 ▼0.635.23 ▲3.5337.24 ▼6.87
Dashboard /wp-admin2,223 ▲325.86 ▲0.93107.78 ▲5.0442.37 ▼4.90
Posts /wp-admin/edit.php2,109 ▲201.98 ▼0.0441.17 ▲5.3135.59 ▼1.60
Add New Post /wp-admin/post-new.php1,531 ▲1723.26 ▲5.70676.79 ▼12.1661.58 ▼10.25
Media Library /wp-admin/upload.php1,408 ▲174.21 ▲0.1093.74 ▼14.0541.38 ▼7.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Contributors: Contributors not specified
Please take inspiration from this readme.txt

wp-scroll-top/wp-scroll-top.php 85% from 13 tests

"WP Scroll Top" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin1,524 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP11173674875
SVG200642
JavaScript23316
CSS31111

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.29
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
29 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/style10.png4.70KB2.97KB▼ 36.80%
public/img/style11.png6.45KB3.61KB▼ 43.95%
(invalid) admin/img/style9.png15.18KB0.00KB▼ 100.00%
admin/img/style14.png5.45KB2.72KB▼ 50.06%
public/img/style6.png1.14KB0.62KB▼ 45.82%