64% custom-scrollbar

Code Review | Custom Scrollbar

WordPress plugin Custom Scrollbar scored64%from 54 tests.

About plugin

  • Plugin page: custom-scrollbar
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2015
  • Latest release: Jul 9, 2021
  • Number of updates: 79
  • Update frequency: every 27.8 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /44,117 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.68MB] [CPU: ▼3.49ms] Passed 4 tests

An overview of server-side resources used by Custom Scrollbar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.49 ▲1.0349.49 ▼8.66
Dashboard /wp-admin5.20 ▲1.9060.57 ▲4.33
Posts /wp-admin/edit.php5.26 ▲1.9058.29 ▲9.68
Add New Post /wp-admin/post-new.php7.79 ▲1.9098.15 ▼19.32
Media Library /wp-admin/upload.php5.13 ▲1.9057.24 ▲22.00
Scrollbars /wp-admin/themes.php?page=csb_settings9.7981.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Scrollbar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲12013.73 ▼0.6511.88 ▲9.7937.53 ▼5.03
Dashboard /wp-admin2,199 ▲225.62 ▼0.0688.98 ▼7.6239.59 ▼3.99
Posts /wp-admin/edit.php2,101 ▼21.99 ▼0.0133.03 ▼7.4836.22 ▼1.70
Add New Post /wp-admin/post-new.php1,541 ▲623.33 ▲5.22700.71 ▲66.4455.99 ▲0.88
Media Library /wp-admin/upload.php1,398 ▲14.20 ▲0.01100.71 ▼5.7946.66 ▲2.20
Scrollbars /wp-admin/themes.php?page=csb_settings2,3843.9094.6148.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Compile error in wp-content/plugins/custom-scrollbar/custom-scrollbar.php+16
    Cannot declare class CustomScrollbar_Registry_Base, because the name is already in use
  • Uninstaller has failed for this plugin, leaving 230 files (1.57MB) in the plugin directory
    • (new file) asset/css/csb_settings.min.css
    • (new file) asset/log/1.3.4.rm
    • (new file) asset/image/scrollbar_parts_names.pdn
    • (new file) asset/js/custom-scrollbar-enabler.js
    • (new file) asset/log/1.3.5.rm
    • (new file) asset/image/scrollbar_parts_names.png
    • (new file) asset/js/custom-scrollbar-enabler.min.js
    • (new file) asset/css/csb_settings.css
    • (new file) asset/css/admin.css
    • (new file) asset/css/admin.min.css
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • recovery_mode_email_last_sent

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
Even though no errors were found, this is by no means 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 items
  • 176× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/_abstract/_model/AdminPageFramework_Format_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Form_View___Attribute_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/form/_view/attribute/AdminPageFramework_Form_View___Attribute_SectionTable.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Resource_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/admin_page/_controller/AdminPageFramework_Resource_admin_page.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Form_View___Generate_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/form/_view/generator/section/AdminPageFramework_Form_View___Generate_SectionName.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/_abstract/_view/AdminPageFramework_PageLoadInfo_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Factory___Script_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/form/_view/script/AdminPageFramework_Form_View___Script_AttributeUpdator.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Input_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/form/input/AdminPageFramework_Input_radio.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_PluginUtility' not found in wp-content/plugins/custom-scrollbar/include/main/resource/CustomScrollbar_ResourceLoader__Script.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework_Form_Base' not found in wp-content/plugins/custom-scrollbar/include/library/apf/factory/_common/form/_model/AdminPageFramework_Form_Model___DefaultValues.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CustomScrollbar_AdminPageFramework' not found in wp-content/plugins/custom-scrollbar/include/main/admin/CustomScrollbar_AdminPage.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

custom-scrollbar/custom-scrollbar.php Passed 13 tests

The main PHP file in "Custom Scrollbar" ver. 1.3.8 adds more information about the plugin and also serves as the entry point for this plugin
51 characters long description:
Adds a custom scrollbar to specified HTML elements.

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 plugin20,185 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PHP1941,1383,11215,259
JavaScript88471,0243,306
CSS103591561,057
PO File1222251512
Markdown123051

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.67
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes275
▷ Abstract classes6122.18%
▷ Concrete classes21477.82%
▷ Final classes41.87%
Methods1,571
▷ Static methods26917.12%
▷ Public methods80150.99%
▷ Protected methods28718.27%
▷ Private methods48330.74%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants13.57%
▷ Class constants2796.43%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/malihu-custom-scrollbar-plugin/mCSB_buttons.png2.93KB0.99KB▼ 66.18%
asset/image/scrollbar_parts_names.png20.91KB5.34KB▼ 74.48%