78% b-gallery

Code Review | B Gallery - lightbox gallery plugin for WordPress

WordPress plugin B Gallery - lightbox gallery plugin for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: b-gallery
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: Nov 9, 2021
  • Latest release: Mar 5, 2023
  • Number of updates: 9
  • Update frequency: every 53.4 days
  • Top authors: abuhayat (77.78%)srabonr (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /551 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.69MB] [CPU: ▲2.72ms] Passed 4 tests

An overview of server-side resources used by B Gallery - lightbox gallery plugin for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7651.86 ▲5.84
Dashboard /wp-admin4.00 ▲0.6954.42 ▲2.53
Posts /wp-admin/edit.php4.05 ▲0.6976.99 ▲23.82
Add New Post /wp-admin/post-new.php6.58 ▲0.69100.51 ▼9.05
Media Library /wp-admin/upload.php3.92 ▲0.6951.46 ▲11.57
All Galleries /wp-admin/edit.php?post_type=bgallery4.1053.52
Add New /wp-admin/post-new.php?post_type=bgallery4.0957.91

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for B Gallery - lightbox gallery plugin for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15213.44 ▼0.949.63 ▲7.7441.81 ▲2.26
Dashboard /wp-admin2,224 ▲475.60 ▼0.0393.83 ▲0.7341.39 ▼3.75
Posts /wp-admin/edit.php2,129 ▲262.05 ▲0.0241.59 ▼0.8936.38 ▲0.09
Add New Post /wp-admin/post-new.php1,551 ▲423.43 ▲0.28668.19 ▲48.5554.01 ▲2.59
Media Library /wp-admin/upload.php1,426 ▲234.27 ▲0.0698.80 ▼12.1845.51 ▼3.11
All Galleries /wp-admin/edit.php?post_type=bgallery1,3023.6257.7030.26
Add New /wp-admin/post-new.php?post_type=bgallery2,9235.82140.4876.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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 following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/b-gallery/templates/gallery-video.php
    • > /wp-content/plugins/b-gallery/templates/gallery-image.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/b-gallery/templates/gallery-image.php on line 4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/b-gallery/templates/gallery-video.php on line 3
    • > PHP Notice
      Undefined variable: bgallery_images in wp-content/plugins/b-gallery/templates/gallery-image.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/b-gallery/inc/additional-customize.php:18
    • > PHP Notice
      Undefined variable: bgallery_videos in wp-content/plugins/b-gallery/templates/gallery-video.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Sidebar menu), #2 (UI), #3 (Gallery configuration), #4 (Shortcode Generator)
You can look at the official readme.txt

b-gallery/b-gallery.php 85% from 13 tests

This is the main PHP file of "B Gallery - lightbox gallery plugin for WordPress" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected31,108 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
CSS82905038,486
PHP782,3829637,316
PO File203,1973,5946,490
Sass1595234,803
JavaScript71,2553594,011
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity24.27
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity6.77
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes00.00%
Methods238
▷ Static methods4016.81%
▷ Public methods238100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
inc/codestar/assets/images/checkerboard.png2.29KB2.54KB0.00%