83% bh-custom-preloader

Code Review | BH Custom Preloader

WordPress plugin BH Custom Preloader scored83%from 54 tests.

About plugin

  • Plugin page: bh-custom-preloader
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2015
  • Latest release: Apr 13, 2023
  • Number of updates: 71
  • Update frequency: every 40.0 days
  • Top authors: masumbd (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active /21,840 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.72ms] Passed 4 tests

Server-side resources used by BH Custom Preloader
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1841.15 ▲3.62
Dashboard /wp-admin3.47 ▲0.1748.18 ▲2.88
Posts /wp-admin/edit.php3.59 ▲0.2347.37 ▲0.43
Add New Post /wp-admin/post-new.php6.06 ▲0.1780.95 ▼9.81
Media Library /wp-admin/upload.php3.40 ▲0.1740.75 ▲9.72
Codestar Framework /wp-admin/tools.php?page=csf-welcome3.4536.56

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 187 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
bh_preloader

Browser metrics Passed 4 tests

Checking browser requirements for BH Custom Preloader
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,009 ▲24813.53 ▼0.7913.28 ▲11.2747.12 ▲8.86
Dashboard /wp-admin2,253 ▲765.62 ▼0.0686.88 ▲0.2741.02 ▲0.10
Posts /wp-admin/edit.php2,155 ▲552.01 ▲0.0535.11 ▼2.0630.91 ▼6.50
Add New Post /wp-admin/post-new.php1,568 ▲4023.35 ▲0.32624.85 ▼34.3651.24 ▼14.43
Media Library /wp-admin/upload.php1,452 ▲554.28 ▲0.1695.92 ▼4.8142.71 ▲0.35
Preloader /wp-admin/admin.php?page=bh-preloader#tab=preloader1,6304.2476.2795.89
CSS3 Preloader Options /wp-admin/admin.php?page=bh-preloader#tab=css3-preloader-options1,3483.7550.0899.26
Image Preloader Options /wp-admin/admin.php?page=bh-preloader#tab=image-preloader-options1,3483.7550.61114.46
Codestar Framework /wp-admin/tools.php?page=csf-welcome1,4763.4641.8049.24

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
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • bh_preloader
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bh-custom-preloader/functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/bh-custom-preloader/functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bh-custom-preloader/preloader.php:70

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

bh-custom-preloader/plugin_main.php 92% from 13 tests

"BH Custom Preloader" version 1.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("bh-custom-preloader.php" instead of "plugin_main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin16,877 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
PHP722,2351,0069,908
PO File203,1983,5916,500
Markdown2850379
CSS36768
JavaScript41720
SVG2002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity20.65
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity6.80
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods183
▷ Static methods3116.94%
▷ Public methods183100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
33 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/preview/21.png2.25KB1.47KB▼ 34.43%
img/preview/13.png1.34KB0.50KB▼ 62.57%
img/preview/6.png2.02KB1.05KB▼ 47.72%
img/preview/19.png1.72KB0.82KB▼ 52.24%
screenshot-2.png18.10KB2.89KB▼ 84.01%