90% crudlab-scroll-to-top

Code Review | CRUDLab Scroll to Top

WordPress plugin CRUDLab Scroll to Top scored 90% from 54 tests.

About plugin

  • Plugin page: crudlab-scroll-to...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.4.1
  • WordPress version: 5.8.1
  • First release: Jan 15, 2016
  • Latest release: May 13, 2016
  • Number of updates: 7
  • Update frequency: every 17.1 days
  • Top authors: amirk27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 1,711 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼142.58ms] Passed 4 tests

An overview of server-side resources used by CRUDLab Scroll to Top
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0641.85 ▲4.28
Dashboard /wp-admin3.12 ▲0.0653.99 ▼1.83
Posts /wp-admin/edit.php3.17 ▲0.0649.90 ▲1.10
Add New Post /wp-admin/post-new.php5.47 ▲0.0496.25 ▼570.94
Media Library /wp-admin/upload.php3.06 ▲0.0637.51 ▲1.37

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 57 new files
Database: 1 new table, 1 new option
New tables
wp_wpsctotop
New WordPress options
wpfblike_db_version

Browser metrics Passed 4 tests

CRUDLab Scroll to Top: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,734 ▲13816.27 ▲0.7810.90 ▲2.9852.33 ▲1.35
Dashboard /wp-admin2,986 ▲555.90 ▼0.05145.44 ▼5.61136.84 ▲15.87
Posts /wp-admin/edit.php2,777 ▲382.70 ▲0.0169.60 ▲1.3798.50 ▼1.44
Add New Post /wp-admin/post-new.php1,516 ▼16718.77 ▲0.36395.08 ▲1.64113.76 ▲3.05
Media Library /wp-admin/upload.php1,771 ▼395.01 ▼0.02131.57 ▼21.04154.01 ▲28.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • wpfblike_db_version

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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 shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: top, goto top, back to top, go to top, scroll to top

crudlab-scroll-to-top/wpsctotop.php 92% from 13 tests

"CRUDLab Scroll to Top" version 1.0.1'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:
  • Main file name: Name the main plugin file the same as the plugin slug ("crudlab-scroll-to-top.php" instead of "wpsctotop.php")

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
There were no executable files found in this plugin37,148 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
SVG70028,312
CSS544326,262
JSON1002,106
PHP14613345
JavaScript32929123

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.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
17 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_style7.png7.10KB2.64KB▼ 62.84%
img/icon_style2.png0.97KB0.89KB▼ 8.65%
img/icon_style11.png1.99KB0.99KB▼ 50.07%
img/icon_style10.png2.60KB0.95KB▼ 63.47%
img/icon_style12.png0.85KB0.63KB▼ 25.89%