78% click-to-top

Code Review | Click to top

WordPress plugin Click to top scored78%from 54 tests.

About plugin

  • Plugin page: click-to-top
  • Plugin version: 1.2.22
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 20, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 35
  • Update frequency: every 74.9 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

3,000+ active /69,182 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
Install script ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▲0.65ms] Passed 4 tests

An overview of server-side resources used by Click to top
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3438.39 ▼3.02
Dashboard /wp-admin3.84 ▲0.5453.59 ▲3.65
Posts /wp-admin/edit.php3.90 ▲0.5455.87 ▲3.69
Add New Post /wp-admin/post-new.php6.36 ▲0.4786.99 ▼1.71
Media Library /wp-admin/upload.php3.68 ▲0.4540.89 ▲6.76

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 48 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
click_top_basic
widget_recent-posts
click_top_style
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Click to top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,124 ▲36215.07 ▲0.368.67 ▲7.0333.02 ▼9.75
Dashboard /wp-admin2,405 ▲2256.43 ▲0.89123.81 ▲24.3355.70 ▲10.41
Posts /wp-admin/edit.php2,338 ▲2383.63 ▲1.6757.47 ▲17.4949.64 ▲10.24
Add New Post /wp-admin/post-new.php1,588 ▲6223.51 ▼0.02617.33 ▲8.4034.90 ▼21.87
Media Library /wp-admin/upload.php1,475 ▲754.37 ▲0.0891.92 ▼6.5453.49 ▲12.23
Click to top /wp-admin/click-to-top.php260.410.0913.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • click_top_style
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • click_top_basic
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(wp-content/plugins/click-to-top/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php): failed to open stream: No such file or directory in wp-content/plugins/click-to-top/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/click-to-top/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/click-to-top/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/click-to-top/admin/click_top_options.php:388
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/click-to-top/includes/click_top_options_set.php:148
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/click-to-top/admin/nt-class.php:150

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/click-to-top.php
    • > Network (severe)
    wp-admin/click-to-top.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

click-to-top/click-to-top.php 92% from 13 tests

"Click to top" version 1.2.22's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected9,162 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
CSS33531514,407
PHP207621,3463,209
SVG100655
JavaScript32793269
Markdown1820255
PO File15454127
JSON300113
XML161195
YAML16032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.43
Average class complexity36.20
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity3.01
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods167
▷ Static methods2011.98%
▷ Public methods13077.84%
▷ Protected methods63.59%
▷ Private methods3118.56%
Functions12
▷ Named functions975.00%
▷ Anonymous functions325.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
No PNG files were detected