57% unite-gallery-lite

Code Review | Unite Gallery Lite

WordPress plugin Unite Gallery Lite scored57%from 54 tests.

About plugin

  • Plugin page: unite-gallery-lite
  • Plugin version: 1.7.62
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 15, 2015
  • Latest release: Jul 27, 2023
  • Number of updates: 95
  • Update frequency: every 31.9 days
  • Top authors: valiano (100%)

Code review

54 tests

User reviews

53 reviews

Install metrics

10,000+ active /297,271 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲6.40MB] [CPU: ▲43.63ms] 75% from 4 tests

This is a short check of server-side resources used by Unite Gallery Lite
Please take the time to fix the following items
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.40MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.79 ▲6.3281.87 ▲40.86
Dashboard /wp-admin9.73 ▲6.4388.47 ▲40.03
Posts /wp-admin/edit.php9.85 ▲6.4988.57 ▲41.67
Add New Post /wp-admin/post-new.php12.32 ▲6.43143.18 ▲51.94
Media Library /wp-admin/upload.php9.66 ▲6.4390.12 ▲57.08
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.9073.89

Server storage [IO: ▲7.36MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 717 new files
Database: 3 new tables, 10 new options
New tables
wp_unitegallery_items
wp_unitegallery_categories
wp_unitegallery_galleries
New WordPress options
fs_debug_mode
widget_theysaidso_widget
widget_unitegallery-widget
fs_active_plugins
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
fs_accounts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Unite Gallery Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.58 ▲0.171.63 ▲0.0131.77 ▼10.04
Dashboard /wp-admin2,228 ▲575.52 ▼0.1382.77 ▼8.3240.23 ▲1.06
Posts /wp-admin/edit.php2,134 ▲341.99 ▼0.0436.79 ▼2.3835.83 ▲1.77
Add New Post /wp-admin/post-new.php1,557 ▲2924.43 ▲1.23711.77 ▲74.5960.45 ▲3.14
Media Library /wp-admin/upload.php1,436 ▲394.19 ▼0.02100.08 ▼0.1944.12 ▲2.53
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0881.6724.0627.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/unite-gallery-lite/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_unitegallery_galleries
    • wp_unitegallery_categories
    • wp_unitegallery_items
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_active_plugins
    • widget_unitegallery-widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • fs_accounts
    • widget_recent-posts

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 0% 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
  • 151× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/unite-gallery-lite/galleries/ugcore_tilescolumns/client_output.php
    • > /wp-content/plugins/unite-gallery-lite/unitegallery_admin.php
    • > /wp-content/plugins/unite-gallery-lite/inc_php/unitegallery_gallery_type.class.php
    • > /wp-content/plugins/unite-gallery-lite/views/preview.php
    • > /wp-content/plugins/unite-gallery-lite/galleries/ugcore_compact/client_output.php
    • > /wp-content/plugins/unite-gallery-lite/galleries/ugcore_tilesgrid/views/preview.php
    • > /wp-content/plugins/unite-gallery-lite/helpers/settings/slider_textpanel.php
    • > /wp-content/plugins/unite-gallery-lite/views/system/video_dialog.php
    • > /wp-content/plugins/unite-gallery-lite/galleries/ugcore_tilesgrid/settings/gallery_settings.php
    • > /wp-content/plugins/unite-gallery-lite/galleries/ugcore_grid/scripts.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'UniteGalleryManager' not found in wp-content/plugins/unite-gallery-lite/inc_php/unitegallery_manager_main.class.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'UniteGalleryManager' not found in wp-content/plugins/unite-gallery-lite/inc_php/unitegallery_manager_inline.class.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GlobalsUGGallery' not found in wp-content/plugins/unite-gallery-lite/views/items.php:3
    • > PHP Notice
      Undefined variable: currentFolder in wp-content/plugins/unite-gallery-lite/inc_php/framework/provider/provider_main_file.php on line 3
    • > PHP Warning
      require_once(/inc_php/framework/provider/unitegallery_widget.class.php): failed to open stream: No such file or directory in wp-content/plugins/unite-gallery-lite/inc_php/framework/provider/provider_main_file.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'UniteGallerySettingsUG' not found in wp-content/plugins/unite-gallery-lite/helpers/settings/position.php:2
    • > PHP Fatal error
      require_once(): Failed opening required '/inc_php/framework/provider/unitegallery_widget.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/unite-gallery-lite/inc_php/framework/provider/provider_main_file.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/unite-gallery-lite/galleries/ugcore_video/views/settings_before_draw.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'UniteGallerySettingsUG' not found in wp-content/plugins/unite-gallery-lite/helpers/settings/position_tiles.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/unite-gallery-lite/inc_php/framework/provider/unitegallery_widget.class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 118 tag instead of maximum 10
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === unite-gallery-lite === )
You can take inspiration from this readme.txt

unite-gallery-lite/unitegallery.php 92% from 13 tests

The principal PHP file in "Unite Gallery Lite" v. 1.7.62 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("unite-gallery-lite.php" instead of "unitegallery.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected92,551 lines of code in 423 files:
LanguageFilesBlank linesComment linesLines of code
PHP27215,92721,67148,965
JavaScript5814,6597,81334,650
CSS371,1332455,187
XML43864173,266
SVG1000263
Markdown1680214
INI2226

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity62.94
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity96.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes107
▷ Abstract classes21.87%
▷ Concrete classes10598.13%
▷ Final classes00.00%
Methods2,306
▷ Static methods49421.42%
▷ Public methods1,52466.09%
▷ Protected methods23110.02%
▷ Private methods55123.89%
Functions105
▷ Named functions105100.00%
▷ Anonymous functions00.00%
Constants380
▷ Global constants10026.32%
▷ Class constants28073.68%
▷ Public constants280100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
137 PNG files occupy 0.24MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
unitegallery-plugin/themes/default/images/arrows_strip_right.png0.19KB0.12KB▼ 37.19%
unitegallery-plugin/skins/default/arrow_grid_down.png0.45KB0.24KB▼ 46.77%
unitegallery-plugin/images/cover-grid.png0.91KB0.10KB▼ 89.28%
unitegallery-plugin/images/icon-play32.png0.67KB0.63KB▼ 6.83%
unitegallery-plugin/skins/default/tile_button_right.png0.61KB0.48KB▼ 20.97%