90% mdc-scroll-to-top

Code Review | Scroll to Top

WordPress plugin Scroll to Top scored90%from 54 tests.

About plugin

  • Plugin page: mdc-scroll-to-top
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.5.3
  • WordPress version: 6.3.1
  • First release: Nov 24, 2014
  • Latest release: Aug 14, 2016
  • Number of updates: 8
  • Update frequency: every 78.6 days
  • Top authors: mukto90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,676 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼5.38ms] Passed 4 tests

This is a short check of server-side resources used by Scroll to Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1139.91 ▼9.10
Dashboard /wp-admin3.55 ▲0.2457.08 ▲6.34
Posts /wp-admin/edit.php3.60 ▲0.2458.04 ▼1.87
Add New Post /wp-admin/post-new.php6.05 ▲0.1691.17 ▼15.44
Media Library /wp-admin/upload.php3.39 ▲0.1639.51 ▲4.88

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Scroll to Top
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲23514.81 ▲0.622.61 ▲0.4445.01 ▼1.61
Dashboard /wp-admin2,373 ▲1826.60 ▲0.72152.03 ▲31.6547.03 ▼0.11
Posts /wp-admin/edit.php2,285 ▲1963.49 ▲1.4754.03 ▲13.6532.58 ▼5.20
Add New Post /wp-admin/post-new.php1,539 ▲2520.93 ▲3.21644.70 ▼114.1969.78 ▲15.26
Media Library /wp-admin/upload.php1,421 ▲334.33 ▲0.1387.11 ▼22.4243.50 ▼2.22

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • mdc_scroll_to_top_icon
    • widget_recent-posts
    • db_upgraded
    • mdc_scroll_to_top_style
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: top scroll, page scrolling, scroll to top, go to top of page, page top...

mdc-scroll-to-top/mdc-scroll-to-top.php Passed 13 tests

The main file in "Scroll to Top" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
44 characters long description:
Adds a 'Scroll to Top' feature to your site.

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
Success! There were no dangerous files found in this plugin593 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3146195547
JavaScript20124
CSS20022

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.37
Average class complexity23.33
▷ Minimum class complexity2.00
▷ Maximum class complexity64.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
80 PNG files occupy 0.21MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/arrow5.png0.76KB0.73KB▼ 3.34%
assets/icons/arrow52.png5.11KB2.88KB▼ 43.59%
assets/icons/arrow54.png1.64KB2.02KB0.00%
assets/icons/arrow42.png1.33KB1.34KB0.00%
assets/icons/arrow28.png3.48KB1.97KB▼ 43.39%