79% dynamic-to-top

Code Review | Dynamic "To Top" Plugin

WordPress plugin Dynamic "To Top" Plugin scored 79% from 54 tests.

About plugin

  • Plugin page: dynamic-to-top
  • Plugin version: 3.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 5, 2010
  • Latest release: Feb 8, 2020
  • Number of updates: 94
  • Update frequency: every 38.6 days
  • Top authors: sksmatt (93.62%)tberneman (7.45%)

Code review

54 tests

User reviews

58 reviews

Install metrics

10,000+ active / 329,271 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼11.33ms] Passed 4 tests

Server-side resources used by Dynamic "To Top" Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.35 ▼0.117.68 ▼34.84
Dashboard /wp-admin3.41 ▲0.1148.13 ▲1.82
Posts /wp-admin/edit.php3.52 ▲0.1746.84 ▼2.31
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.41 ▼9.97
Media Library /wp-admin/upload.php3.33 ▲0.1039.37 ▲3.99
To Top /wp-admin/themes.php?page=dynamic-to-top/inc/dynamic-to-top-options.php3.2830.30

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

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

Browser metrics Passed 4 tests

Dynamic "To Top" Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲19013.76 ▼1.057.10 ▲5.5238.72 ▼3.58
Dashboard /wp-admin2,213 ▲255.90 ▲1.02102.37 ▼6.6436.71 ▼5.29
Posts /wp-admin/edit.php2,093 ▲42.04 ▼0.0533.79 ▼2.9633.76 ▲3.30
Add New Post /wp-admin/post-new.php1,522 ▲223.30 ▲0.10615.87 ▼4.3656.68 ▲0.59
Media Library /wp-admin/upload.php1,386 ▼54.26 ▲0.0594.72 ▼5.6142.46 ▼3.16
To Top /wp-admin/themes.php?page=dynamic-to-top/inc/dynamic-to-top-options.php1,2332.2447.8845.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=dynamic-to-top/inc/dynamic-to-top-options.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/themes.php?page=dynamic-to-top/inc/dynamic-to-top-options.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-to-top/inc/dynamic-to-top-options.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-to-top/dynamic-to-top.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-to-top/inc/dynamic-to-top-class.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: enhance, jquery, automatic, ux, button...

dynamic-to-top/dynamic-to-top.php Passed 13 tests

This is the main PHP file of "Dynamic "To Top" Plugin" version 3.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
83 characters long description:
Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin5,549 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP53722,7673,388
JavaScript81921401,159
PO File6365345837
CSS22432165

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity8.39
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes69
▷ Abstract classes1014.49%
▷ Concrete classes5985.51%
▷ Final classes00.00%
Methods161
▷ Static methods127.45%
▷ Public methods15696.89%
▷ Protected methods00.00%
▷ Private methods53.11%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
css/images/up.png2.87KB0.24KB▼ 91.70%
css/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%