62% ar-back-to-top

Code Review | AR Back To Top

WordPress plugin AR Back To Top scored62%from 54 tests.

About plugin

  • Plugin page: ar-back-to-top
  • Plugin version: 2.10.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 31, 2019
  • Latest release: Sep 14, 2023
  • Number of updates: 44
  • Update frequency: every 38.4 days
  • Top authors: anisur8294 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /1,226 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▼5.29ms] Passed 4 tests

A check of server-side resources used by AR Back To Top
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4449.78 ▲5.73
Dashboard /wp-admin3.77 ▲0.4256.13 ▼14.85
Posts /wp-admin/edit.php3.82 ▲0.4656.14 ▲5.68
Add New Post /wp-admin/post-new.php6.29 ▲0.4088.85 ▼13.86
Media Library /wp-admin/upload.php3.63 ▲0.4042.89 ▲1.89
AR Back To Top /wp-admin/admin.php?page=arbtt3.5738.31
Settings /wp-admin/admin.php?page=arbtt-settings3.5936.07

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for AR Back To Top
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,962 ▲17613.81 ▼0.399.93 ▲8.0042.13 ▼1.67
Dashboard /wp-admin2,246 ▲725.49 ▼0.1093.10 ▼9.0538.53 ▼7.59
Posts /wp-admin/edit.php2,152 ▲522.11 ▲0.1337.02 ▼1.7536.31 ▼0.93
Add New Post /wp-admin/post-new.php1,572 ▲4623.39 ▲0.29688.39 ▲19.6270.20 ▲11.07
Media Library /wp-admin/upload.php1,451 ▲514.15 ▼0.05111.87 ▲3.8749.48 ▲0.92
AR Back To Top /wp-admin/admin.php?page=arbtt1,2862.2535.3235.22
Settings /wp-admin/admin.php?page=arbtt-settings8932.1625.3327.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/ar-back-to-top/vendor/appsero/client/src/Client.php+164
    require_once(wp-content/plugins/ar-back-to-top/vendor/appsero/client/src/License.php): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=arbtt
    • > Notice in wp-content/plugins/ar-back-to-top/ar-back-to-top.php+233
    Trying to access array offset on value of type bool

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ar-back-to-top/ar-back-to-top.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ar-back-to-top/inc/Frontend.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ar-back-to-top/inc/Settings.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ar-back-to-top/inc/assets.php:2
    • > PHP Warning
      require_once(wp-content/plugins/ar-back-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/ar-back-to-top/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ar-back-to-top/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/ar-back-to-top/vendor/appsero/client/.php-cs-fixer.dist.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 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: smooth scroll, scroll up, scroll back to top, back to top, scroll to top...

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

The main PHP script in "AR Back To Top" version 2.10.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 220 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin6,324 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP216641,3132,773
SVG1002,671
CSS33812387
Markdown1820255
JSON200108
XML161195
YAML16032
JavaScript3073

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity30.60
▷ 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%
Methods149
▷ Static methods2214.77%
▷ Public methods10872.48%
▷ Protected methods85.37%
▷ Private methods3322.15%
Functions35
▷ Named functions3394.29%
▷ Anonymous functions25.71%
Constants6
▷ Global constants6100.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
8 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/arbtt6.png3.29KB1.83KB▼ 44.21%
assets/minicolors/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
assets/images/arbtt2.png3.75KB3.35KB▼ 10.58%
assets/images/arbtt.png4.07KB1.94KB▼ 52.26%
assets/images/Back-to-Top.png10.04KB4.61KB▼ 54.10%