83% sr-scroll-to-top-wp

Code Review | sr-scroll-to-top-wp

WordPress plugin sr-scroll-to-top-wp scored 83% from 54 tests.

About plugin

  • Plugin page: sr-scroll-to-top-wp
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 5.8.1
  • First release: Oct 30, 2014
  • Latest release: Oct 30, 2014
  • Number of updates: 27
  • Update frequency: N/A
  • Top authors: sohel razzaque (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 2,150 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
Installer ran successfully

Server metrics [RAM: ▼0.89MB] [CPU: ▼173.02ms] Passed 4 tests

Analyzing server-side resources used by sr-scroll-to-top-wp
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.0627.04 ▼14.88
Dashboard /wp-admin2.76 ▼0.3024.08 ▼25.57
Posts /wp-admin/edit.php2.76 ▼0.3524.46 ▼21.89
Add New Post /wp-admin/post-new.php2.76 ▼2.6722.63 ▼629.74
Media Library /wp-admin/upload.php2.76 ▼0.2524.98 ▼14.80
scroll to top menu /wp-admin/options-general.php?page=scroll-option-page2.7723.03

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by sr-scroll-to-top-wp
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲21016.24 ▲0.7214.78 ▲5.2455.83 ▲4.04
Dashboard /wp-admin2,964 ▲335.88 ▼0.11159.34 ▲9.06115.24 ▲1.07
Posts /wp-admin/edit.php2,744 ▲82.69 ▼0.0170.21 ▲3.9192.14 ▼5.67
Add New Post /wp-admin/post-new.php1,675 ▲6919.20 ▲0.35397.63 ▼35.38110.66 ▼15.85
Media Library /wp-admin/upload.php1,812 ▲55.03 ▲0.00157.91 ▲8.08122.31 ▼9.97
scroll to top menu /wp-admin/options-general.php?page=scroll-option-page1,1882.0959.1581.40

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=scroll-option-page
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

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

The main PHP file in "sr-scroll-to-top-wp" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 494 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sr-scroll-to-top-wp.php" instead of "sr-scroll to top-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,040 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
SVG200643
JavaScript22888246
PHP111630140
CSS21311

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png82.35KB27.82KB▼ 66.22%
screenshot-3.png28.34KB9.01KB▼ 68.21%
screenshot-2.png62.42KB19.03KB▼ 69.51%