83% click-to-top-button

Code Review | Click To Top Button

WordPress plugin Click To Top Button scored83%from 54 tests.

About plugin

  • Plugin page: click-to-top-button
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2023
  • Latest release: Mar 7, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: tamzidsakib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /99 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.77ms] Passed 4 tests

Server-side resources used by Click To Top Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0144.20 ▲2.28
Dashboard /wp-admin3.36 ▲0.0149.98 ▼4.91
Posts /wp-admin/edit.php3.41 ▲0.0149.36 ▼4.12
Add New Post /wp-admin/post-new.php5.94 ▲0.0187.54 ▼16.12
Media Library /wp-admin/upload.php3.28 ▲0.0137.21 ▲2.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Click To Top Button
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14613.47 ▼0.8911.51 ▲9.5644.49 ▲4.84
Dashboard /wp-admin2,198 ▲185.59 ▼0.0493.41 ▲5.4241.22 ▼6.26
Posts /wp-admin/edit.php2,100 ▲31.98 ▼0.0434.64 ▼5.0532.71 ▼6.25
Add New Post /wp-admin/post-new.php1,526 ▼523.23 ▲0.22643.34 ▼25.8746.94 ▼13.89
Media Library /wp-admin/upload.php1,403 ▲94.20 ▲0.0396.21 ▼1.6542.86 ▼0.30

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/click-to-top-button/click+to+top+button.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: You can look at the official readme.txt

click-to-top-button/click+to+top+button.php 85% from 13 tests

This is the main PHP file of "Click To Top Button" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important 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
  • Main file name: Name the main plugin file the same as the plugin slug ("click-to-top-button.php" instead of "click+to+top+button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin63 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111953
CSS1019
JavaScript1061

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/top.png0.39KB0.42KB0.00%