78% gallery-box

Code Review | Gallery Box

WordPress plugin Gallery Box scored 78% from 54 tests.

About plugin

  • Plugin page: gallery-box
  • Plugin version: 1.7.23
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.8.1
  • WordPress version: 5.8.1
  • First release: Jul 2, 2016
  • Latest release: Oct 4, 2021
  • Number of updates: 128
  • Update frequency: every 15.0 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

3,000+ active / 89,829 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.50MB] [CPU: ▼137.07ms] Passed 4 tests

Analyzing server-side resources used by Gallery Box
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2035.52 ▲13.46
Dashboard /wp-admin3.72 ▲0.6753.92 ▲8.99
Posts /wp-admin/edit.php3.77 ▲0.6661.02 ▲4.22
Add New Post /wp-admin/post-new.php5.99 ▲0.5696.57 ▼566.79
Media Library /wp-admin/upload.php3.58 ▲0.5843.39 ▲5.31
All gallery /wp-admin/edit.php?post_type=gallery_box3.6546.50
Add New gallery /wp-admin/post-new.php?post_type=gallery_box4.6369.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 484 new files
Database: no new tables, 5 new options
New WordPress options
iframe_style
img_style
Lightbox_settings
vimeo_style
youtube_style

Browser metrics Passed 4 tests

An overview of browser requirements for Gallery Box
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,181 ▲54418.46 ▲2.8814.80 ▲6.1749.81 ▼4.06
Dashboard /wp-admin3,304 ▲3708.34 ▲2.32180.22 ▲22.17119.90 ▼10.91
Posts /wp-admin/edit.php3,117 ▲3784.56 ▲1.8791.05 ▲18.7796.47 ▲6.95
Add New Post /wp-admin/post-new.php1,739 ▲5621.37 ▲2.99267.07 ▼128.00111.56 ▼1.35
Media Library /wp-admin/upload.php1,883 ▲764.97 ▼0.06135.68 ▼11.96129.80 ▲7.44
All gallery /wp-admin/edit.php?post_type=gallery_box1,8164.3190.3580.01
Gallery Box settings /wp-admin/gallery-box-options.php260.900.2112.93
Add New gallery /wp-admin/post-new.php?post_type=gallery_box9,0109.19277.86195.27

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • vimeo_style
    • iframe_style
    • img_style
    • Lightbox_settings
    • youtube_style

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 82× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'GALLERY_BOX_PATH/includes/all-gallery/vimeo-gallery/vimeo-script.php' (include_path='.:/usr/share/php') in wp-content/plugins/gallery-box/includes/all-gallery/vimeo-gallery/vimeo-gallery.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/gallery-box/admin/src/CMB2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/gallery-box/includes/elementor-addon.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'GALLERY_BOX_PATH/includes/all-gallery/advance-image/advance-image-script.php' (include_path='.:/usr/share/php') in wp-content/plugins/gallery-box/includes/all-gallery/advance-image/image-gallery.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-box/admin/src/cmb2-tabs/example-functions.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-box/includes/all-gallery/simple-image/simple-gallery-script.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-box/admin/src/CMB2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/gallery-box/admin/src/CMB2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-box/includes/all-gallery/youtube-gallery/youtube-script.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Select' not found in wp-content/plugins/gallery-box/admin/src/CMB2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/gallery-box-options.php
    • > Network (severe)
    wp-admin/gallery-box-options.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #4, #5 in gallery-box/assets to your readme.txt
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt might help

gallery-box/gallery-box.php 92% from 13 tests

"Gallery Box" version 1.7.23's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin64,527 lines of code in 300 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP1033,6408,08313,945
CSS266171,3468,204
JSON5004,343
JavaScript224556741,865
SVG3101,500
Sass17306291,411
Markdown43100936

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.67
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes83
▷ Abstract classes910.84%
▷ Concrete classes7489.16%
▷ Final classes00.00%
Methods723
▷ Static methods9713.42%
▷ Public methods59382.02%
▷ Protected methods9813.55%
▷ Private methods324.43%
Functions86
▷ Named functions8598.84%
▷ Anonymous functions11.16%
Constants15
▷ Global constants533.33%
▷ Class constants1066.67%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/src/CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
admin/src/CMB2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
admin/src/CMB2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
images/gbox-pro.png46.80KB15.55KB▼ 66.77%
images/simple-img.png1.36KB0.93KB▼ 31.49%