83% scroll-top-advanced

Code Review | Scroll Top Advanced - Scroll to ID or Class

WordPress plugin Scroll Top Advanced - Scroll to ID or Class scored83%from 54 tests.

About plugin

  • Plugin page: scroll-top-advanced
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9.3
  • WordPress version: 6.3.1
  • First release: Oct 22, 2015
  • Latest release: May 23, 2022
  • Number of updates: 27
  • Update frequency: every 89.1 days
  • Top authors: nasir179125 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /4,469 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.04MB] [CPU: ▼15.04ms] Passed 4 tests

Analyzing server-side resources used by Scroll Top Advanced - Scroll to ID or Class
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0126.21 ▼15.83
Dashboard /wp-admin3.38 ▲0.0344.56 ▼14.71
Posts /wp-admin/edit.php3.43 ▲0.0746.73 ▼4.09
Add New Post /wp-admin/post-new.php5.96 ▲0.0779.51 ▼25.53
Media Library /wp-admin/upload.php3.30 ▲0.0733.81 ▲1.74

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 112 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Scroll Top Advanced - Scroll to ID or Class
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲16013.63 ▼0.755.72 ▲3.9437.81 ▼6.08
Dashboard /wp-admin2,219 ▲345.81 ▼0.2495.40 ▼5.9238.59 ▼1.21
Posts /wp-admin/edit.php2,105 ▲162.02 ▼0.0132.71 ▼8.6537.82 ▲0.30
Add New Post /wp-admin/post-new.php1,555 ▲3618.42 ▼4.76599.81 ▼4.0949.25 ▲0.38
Media Library /wp-admin/upload.php1,404 ▲164.33 ▲0.0994.58 ▼4.4642.20 ▼0.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× 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/scroll-top-advanced/main.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scroll-top-advanced/main.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can take inspiration from this readme.txt

scroll-top-advanced/index.php 69% from 13 tests

The main PHP script in "Scroll Top Advanced - Scroll to ID or Class" version 2.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("scroll-top-advanced.php" instead of "index.php")
  • Domain Path: The domain path should use only dashes and lowercase characters ("Domain Path")
  • Domain Path: Prefix the domain path with a forward slash character ("/Domain Path")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,911 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS4331121,810
SVG100640
PHP21617354
JavaScript2136107

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
94 PNG files occupy 0.36MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/icons/22.png7.24KB3.44KB▼ 52.45%
image/icons/74.png0.22KB0.14KB▼ 36.61%
image/icons/82.png1.12KB1.04KB▼ 6.64%
image/icons/10.png2.66KB2.29KB▼ 13.83%
image/icons/51.png3.90KB2.79KB▼ 28.52%