67% lz-scroll-bar

Code Review | LZ Scroll Bar

WordPress plugin LZ Scroll Bar scored67%from 54 tests.

About plugin

  • Plugin page: lz-scroll-bar
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: May 16, 2021
  • Latest release: May 16, 2021
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: nazmul_0ham (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /311 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.91MB] [CPU: ▼53.79ms] Passed 4 tests

This is a short check of server-side resources used by LZ Scroll Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.02 ▼38.52
Dashboard /wp-admin2.10 ▼1.2011.10 ▼37.11
Posts /wp-admin/edit.php2.11 ▼1.265.33 ▼47.03
Add New Post /wp-admin/post-new.php2.10 ▼3.796.01 ▼92.48
Media Library /wp-admin/upload.php2.10 ▼1.134.73 ▼31.86
Lz Scrollbar Options /wp-admin/options-general.php?page=lzscrollbar-settings2.115.26

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for LZ Scroll Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,016 ▲25513.87 ▼0.6916.93 ▲14.8040.49 ▼4.99
Dashboard /wp-admin2,222 ▲455.79 ▲0.1187.49 ▼11.4642.23 ▼6.99
Posts /wp-admin/edit.php2,132 ▲322.31 ▲0.2837.67 ▲0.8435.80 ▲2.28
Add New Post /wp-admin/post-new.php1,547 ▲1923.23 ▲0.18701.19 ▲13.2041.28 ▼20.21
Media Library /wp-admin/upload.php1,430 ▲394.54 ▲0.32112.69 ▲10.4345.67 ▲0.68
Lz Scrollbar Options /wp-admin/options-general.php?page=lzscrollbar-settings1,0662.5138.4326.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the lz-scrollbar-main handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=lzscrollbar-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the lz-scrollbar-main handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=lzscrollbar-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the lz-scrollbar-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lz-scroll-bar/plugin-main.php:16

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

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Contributors: The plugin contributors field is missing
The official readme.txt is a good inspiration

lz-scroll-bar/plugin-main.php 85% from 13 tests

The primary PHP file in "LZ Scroll Bar" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 141 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lz-scroll-bar.php" instead of "plugin-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin257 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15920136
JavaScript200121

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin