89% back-to-the-top

Code Review | Back to the Top

WordPress plugin Back to the Top scored89%from 54 tests.

About plugin

  • Plugin page: back-to-the-top
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.0
  • WordPress version: 6.3.1
  • First release: May 14, 2015
  • Latest release: Apr 13, 2023
  • Number of updates: 23
  • Update frequency: every 125.7 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.15ms] Passed 4 tests

Analyzing server-side resources used by Back to the Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1247.08 ▲5.71
Dashboard /wp-admin3.42 ▲0.1147.85 ▲1.54
Posts /wp-admin/edit.php3.53 ▲0.1749.08 ▼1.89
Add New Post /wp-admin/post-new.php6.00 ▲0.1186.83 ▼5.96
Media Library /wp-admin/upload.php3.34 ▲0.1141.70 ▲9.62
Back to the Top /wp-admin/themes.php?page=backtothetop3.4533.55

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Back to the Top: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲12613.45 ▼0.9111.03 ▲8.8546.42 ▲4.69
Dashboard /wp-admin2,202 ▲255.59 ▼0.0684.58 ▼15.1839.62 ▼0.13
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0540.38 ▲1.2536.59 ▲1.31
Add New Post /wp-admin/post-new.php1,534 ▲623.17 ▲0.01705.97 ▲13.3363.62 ▲8.43
Media Library /wp-admin/upload.php1,404 ▲104.28 ▲0.12100.56 ▼5.6545.42 ▲2.85
Back to the Top /wp-admin/themes.php?page=backtothetop1,5742.3353.8234.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (options page) image missing
The official readme.txt is a good inspiration

back-to-the-top/back-to-the-top.php 85% from 13 tests

The main PHP file in "Back to the Top" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this 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
  • Description: The description should be shorter than 140 characters (currently 144 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected669 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP266128401
JavaScript33115205
PO File1254663

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity66.00
▷ Minimum class complexity66.00
▷ Maximum class complexity66.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png97.87KB28.06KB▼ 71.33%