71% ungallery

Code Review | UnGallery

WordPress plugin UnGallery scored71%from 54 tests.

About plugin

  • Plugin page: ungallery
  • Plugin version: 2.2.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 11, 2009
  • Latest release: Dec 31, 2014
  • Number of updates: 150
  • Update frequency: every 13.5 days
  • Top authors: mmond (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /20,280 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.17ms] Passed 4 tests

This is a short check of server-side resources used by UnGallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.75 ▼2.22
Dashboard /wp-admin3.39 ▲0.0847.98 ▼1.29
Posts /wp-admin/edit.php3.44 ▲0.0848.94 ▼1.70
Add New Post /wp-admin/post-new.php5.97 ▲0.0886.65 ▼11.45
Media Library /wp-admin/upload.php3.31 ▲0.0838.74 ▲4.53
UnGallery /wp-admin/options-general.php?page=ungallerysettings3.2534.20

Server storage [IO: ▲2.36MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • The plugin illegally modified 1 file (0.09KB) outside of "wp-content/plugins/ungallery/" and "wp-content/uploads/"
    • (new file) wp-content/cache/.htaccess
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
version
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by UnGallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.15 ▼1.501.64 ▼0.1643.37 ▼3.89
Dashboard /wp-admin2,213 ▲224.89 ▼0.0197.79 ▼3.3139.10 ▲0.53
Posts /wp-admin/edit.php2,093 ▲41.97 ▼0.0434.72 ▼1.1732.58 ▼4.44
Add New Post /wp-admin/post-new.php1,536 ▲323.37 ▲0.18600.07 ▼98.6153.34 ▼4.87
Media Library /wp-admin/upload.php1,395 ▲74.22 ▲0.0299.73 ▼8.2242.62 ▼3.46
UnGallery /wp-admin/options-general.php?page=ungallerysettings1,0602.0222.8332.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • version
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ungallerysettings
    • > Notice in wp-content/plugins/ungallery/configuration_menu.php+114
    Undefined variable: movie_height_name
    • > GET request to /wp-admin/options-general.php?page=ungallerysettings
    • > Notice in wp-content/plugins/ungallery/configuration_menu.php+115
    Undefined variable: movie_width_name

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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ungallery/source.php
    • > /wp-content/plugins/ungallery/no_fancybox.php
    • > /wp-content/plugins/ungallery/zip.php
    • > /wp-content/plugins/ungallery/phpthumb/phpThumb.php
    • > /wp-content/plugins/ungallery/search.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      'break' not in the 'loop' or 'switch' context in wp-content/plugins/ungallery/phpthumb/phpthumb.class.php on line 3805
    • > PHP Fatal error
      'break' not in the 'loop' or 'switch' context in wp-content/plugins/ungallery/phpthumb/phpthumb.class.php on line 3805
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/ungallery/ungallery.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ungallery/configuration_menu.php:4

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (The gallery browsing view with fancyBox lightbox application featuring thumbnails, navigation buttons, zoom, and slideshow.), #2 (Thumbnails are displayed during lightbox browsing.), #3 (Navigation is available via buttons or arrow keys.), #4 (The UnGallery default view with subdirectories/subgalleries, breadcrumbs, zip, and search available.)
  • Requires at least: Invalid plugin version format
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

ungallery/ungallery.php Passed 13 tests

This is the main PHP file of "UnGallery" version 2.2.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
55 characters long description:
Publish thousands of pictures in WordPress, in minutes.

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
Success! There were no dangerous files found in this plugin8,221 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP151,4651,0418,221

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 225)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity140.25
▷ Minimum class complexity8.00
▷ Maximum class complexity945.00
Average method complexity10.34
▷ Minimum method complexity1.00
▷ Maximum method complexity225.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods179
▷ Static methods4223.46%
▷ Public methods179100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 1.78MB with 1.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png776.49KB286.17KB▼ 63.15%
screenshot-3.png407.44KB161.96KB▼ 60.25%
screenshot-2.png412.02KB150.16KB▼ 63.56%
screenshot-4.png225.84KB71.99KB▼ 68.12%