62% ams-page-scroll-back-to-top

Code Review | AMS Page Scroll Back To Top

WordPress plugin AMS Page Scroll Back To Top scored 62% from 54 tests.

About plugin

  • Plugin page: ams-page-scroll-b...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.9
  • WordPress version: 6.3.1
  • First release: Oct 14, 2016
  • Latest release: Jan 23, 2022
  • Number of updates: 20
  • Update frequency: every 96.4 days
  • Top authors: manojsv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,141 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.72MB] [CPU: ▼35.64ms] Passed 4 tests

A check of server-side resources used by AMS Page Scroll Back To Top
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2741.16 ▼1.29
Dashboard /wp-admin3.23 ▼0.0823.04 ▼24.87
Posts /wp-admin/edit.php3.23 ▼0.1324.79 ▼29.18
Add New Post /wp-admin/post-new.php3.23 ▼2.6626.52 ▼79.43
Media Library /wp-admin/upload.php3.23 ▼0.0023.70 ▼9.08
AMS Page Scroll Back /wp-admin/options-general.php?page=msv-amspsbtt-page-scroll-back-to-top-settings3.2332.25

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 105 new files
Database: no new tables, 10 new options
New WordPress options
msv_amspsbtt_page_scroll_back_to_top_layout
db_upgraded
can_compress_scripts
msv_amspsbtt_page_scroll_back_to_top_advanced
msv_amspsbtt_page_scroll_back_to_top_icon
widget_recent-comments
theysaidso_admin_options
msv_amspsbtt_page_scroll_back_to_top_style
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for AMS Page Scroll Back To Top
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,003 ▲26815.01 ▲0.422.23 ▲0.0440.37 ▼2.41
Dashboard /wp-admin2,370 ▲1886.63 ▲0.79132.93 ▲29.5350.46 ▲8.33
Posts /wp-admin/edit.php2,277 ▲1883.53 ▲1.4855.00 ▲14.0638.22 ▲3.47
Add New Post /wp-admin/post-new.php1,544 ▲1118.42 ▼5.08583.01 ▼25.8042.14 ▼14.75
Media Library /wp-admin/upload.php1,418 ▲304.32 ▲0.2079.26 ▼19.2652.46 ▲6.43
AMS Page Scroll Back /wp-admin/options-general.php?page=msv-amspsbtt-page-scroll-back-to-top-settings3,6424.61125.75201.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=msv-amspsbtt-page-scroll-back-to-top-settings
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ams-page-scroll-back-to-top/help/overview.php
    • > /wp-content/plugins/ams-page-scroll-back-to-top/help/choose-img-preset.php
    • > /wp-content/plugins/ams-page-scroll-back-to-top/help/choose-icon.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/ams-page-scroll-back-to-top/includes/class.ams-page-scroll-back-help.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/ams-page-scroll-back-to-top/includes/ams-page-scroll-back-inline-style.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: scroller, scroll back to top, scroll top, link to top, scroll up...

ams-page-scroll-back-to-top/ams-page-scroll-back-to-top.php 92% from 13 tests

The main file in "AMS Page Scroll Back To Top" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin2,806 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP102711751,393
JavaScript514359706
SVG100685
CSS30422

PHP code Passed 2 tests

A brief analysis 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.34
Average class complexity27.75
▷ Minimum class complexity2.00
▷ Maximum class complexity96.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods53
▷ Static methods11.89%
▷ Public methods5298.11%
▷ Protected methods00.00%
▷ Private methods11.89%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
80 PNG files occupy 2.59MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/arrow32.png16.20KB9.61KB▼ 40.68%
assets/icons/arrow3.png10.71KB6.12KB▼ 42.83%
assets/icons/arrow68.png0.37KB0.26KB▼ 28.99%
assets/icons/arrow52.png8.86KB5.19KB▼ 41.41%
assets/icons/arrow6.png3.44KB2.32KB▼ 32.55%