84% gp-back-to-top

Code Review | GP Back To Top

WordPress plugin GP Back To Top scored 84% from 54 tests.

About plugin

  • Plugin page: gp-back-to-top
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.9.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2015
  • Latest release: Dec 23, 2017
  • Number of updates: 22
  • Update frequency: every 35.4 days
  • Top authors: giangmd93 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 15,416 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
Install script ran successfully

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

This is a short check of server-side resources used by GP Back To Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.11 ▼0.36
Dashboard /wp-admin3.32 ▲0.0144.18 ▼1.94
Posts /wp-admin/edit.php3.37 ▲0.0148.53 ▲0.89
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.05 ▼0.59
Media Library /wp-admin/upload.php3.24 ▲0.0136.92 ▼3.05
GP Back To Top /wp-admin/options-general.php?page=gp-back-to-top3.2133.47

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for GP Back To Top
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲16113.98 ▼0.319.26 ▲7.4644.28 ▲6.51
Dashboard /wp-admin2,214 ▲424.89 ▼0.03111.57 ▼14.2041.98 ▼3.27
Posts /wp-admin/edit.php2,097 ▲82.05 ▲0.0239.62 ▲1.8834.43 ▼0.61
Add New Post /wp-admin/post-new.php1,525 ▼823.55 ▲0.25612.65 ▼49.8955.30 ▼0.49
Media Library /wp-admin/upload.php1,399 ▲114.21 ▲0.0398.80 ▼7.4743.16 ▼1.15
GP Back To Top /wp-admin/options-general.php?page=gp-back-to-top8901.7425.6430.84

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/gp-back-to-top/gp-back-to-top.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/gp-back-to-top/inc/uninstall.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: simple plugin back to top, create back to top button, back to top, back to top plugin

gp-back-to-top/gp-back-to-top.php Passed 13 tests

The main PHP script in "GP Back To Top" version 3.0 is automatically included on every request by WordPress
33 characters long description:
Create Back To Top Button Custom.

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
Good job! No executable or dangerous file extensions detected682 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
SVG100288
PHP22721203
CSS31244125
JavaScript2141666

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.22
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin