84% back-top

Code Review | Back Top

WordPress plugin Back Top scored84%from 54 tests.

About plugin

  • Plugin page: back-top
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 18, 2018
  • Latest release: Jun 18, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: w3helps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /594 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.55MB] [CPU: ▼5.75ms] Passed 4 tests

Server-side resources used by Back Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6944.15 ▼0.12
Dashboard /wp-admin4.00 ▲0.7054.86 ▲0.07
Posts /wp-admin/edit.php4.04 ▲0.6958.53 ▲5.67
Add New Post /wp-admin/post-new.php6.05 ▲0.1673.55 ▼28.62
Media Library /wp-admin/upload.php3.89 ▲0.6743.82 ▲5.70

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Back Top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,144 ▲39815.40 ▲1.112.26 ▲0.5240.18 ▼4.80
Dashboard /wp-admin2,512 ▲3217.00 ▲1.12137.19 ▲32.4040.51 ▼0.27
Posts /wp-admin/edit.php2,418 ▲3293.91 ▲1.8554.68 ▲15.1730.92 ▲0.36
Add New Post /wp-admin/post-new.php6,424 ▲4,90026.63 ▲3.49911.03 ▲330.8447.52 ▼7.37
Media Library /wp-admin/upload.php1,551 ▲1634.71 ▲0.53127.21 ▲24.9651.02 ▲6.44

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • _cs_options
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/back-top/includes/back-top-settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/back-top/includes/back-top-scripts.php:10

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (frontend.png), #2 (backend.png)
The official readme.txt is a good inspiration

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

The main PHP file in "Back Top" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
95 characters long description:
Back to top option for your website. You can customize color, icon, text etc from setting page.

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 detected34,740 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
JSON20017,050
JavaScript91,0837944,597
CSS8166764,358
PHP501,0991,0443,099
SVG1002,671
Sass634102,083
PO File7306334705
Markdown2240177

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity13.91
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes00.00%
Methods99
▷ Static methods55.05%
▷ Public methods99100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions47
▷ Named functions47100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
setting-page/assets/images/chosen-sprite.png0.53KB0.88KB0.00%
setting-page/assets/images/checkerboard.png2.29KB2.54KB0.00%
setting-page/assets/images/chosen-sprite@2x.png0.72KB0.83KB0.00%