83% fancy-gallery

Code Review | Gallery Manager

WordPress plugin Gallery Manager scored83%from 54 tests.

About plugin

  • Plugin page: fancy-gallery
  • Plugin version: 1.6.58
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Dec 5, 2009
  • Latest release: Aug 9, 2023
  • Number of updates: 316
  • Update frequency: every 15.8 days
  • Top authors: dhoppe (100%)

Code review

54 tests

User reviews

53 reviews

Install metrics

5,000+ active /398,431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▲3.07ms] Passed 4 tests

This is a short check of server-side resources used by Gallery Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6447.61 ▲5.06
Dashboard /wp-admin3.92 ▲0.6253.96 ▼2.90
Posts /wp-admin/edit.php3.98 ▲0.6255.09 ▲9.94
Add New Post /wp-admin/post-new.php6.57 ▲0.6887.95 ▲1.62
Media Library /wp-admin/upload.php3.84 ▲0.6240.47 ▲8.50
Add Gallery /wp-admin/post-new.php?post_type=gallery3.9452.59
Galleries /wp-admin/options-general.php?page=gallery-options3.8136.88
All Galleries /wp-admin/edit.php?post_type=gallery3.8937.33

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 96 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_gallery-taxonomy-cloud
theysaidso_admin_options
widget_theysaidso_widget
widget_random-gallery-images
widget_gallery-taxonomies
widget_galleries

Browser metrics Passed 4 tests

Checking browser requirements for Gallery Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,009 ▲27413.65 ▼0.987.60 ▲5.6743.65 ▲0.10
Dashboard /wp-admin2,241 ▲534.84 ▼0.04100.45 ▼14.6138.03 ▼8.57
Posts /wp-admin/edit.php2,124 ▲352.04 ▲0.0134.85 ▼3.4536.09 ▲2.52
Add New Post /wp-admin/post-new.php1,571 ▲4618.35 ▼4.83592.93 ▼72.2859.55 ▼9.92
Media Library /wp-admin/upload.php1,426 ▲384.15 ▼0.0797.35 ▲2.3743.39 ▲0.99
Add Gallery /wp-admin/post-new.php?post_type=gallery1,9903.8169.5639.89
Galleries /wp-admin/options-general.php?page=gallery-options1,6731.9130.9032.57
All Galleries /wp-admin/edit.php?post_type=gallery1,1102.0132.0329.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_galleries
    • widget_gallery-taxonomy-cloud
    • widget_random-gallery-images
    • widget_gallery-taxonomies
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 46× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/fancy-gallery/templates/gallery-taxonomies-cloud-widget.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/fancy-gallery/widgets/galleries.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WordPress\\Plugin\\GalleryManager\\I18n' not found in wp-content/plugins/fancy-gallery/options-page/previews.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WordPress\\Plugin\\GalleryManager\\Options' not found in wp-content/plugins/fancy-gallery/options-page/options-page.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WordPress\\Plugin\\GalleryManager\\add_Filter() in wp-content/plugins/fancy-gallery/includes/tiny-mce-editor.php:9
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/fancy-gallery/templates/galleries-widget.php on line 11
    • > PHP Notice
      Trying to get property 'before_widget' of non-object in wp-content/plugins/fancy-gallery/templates/gallery-taxonomies-widget.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WordPress\\Plugin\\GalleryManager\\add_Filter() in wp-content/plugins/fancy-gallery/includes/wpml.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/fancy-gallery/widgets/taxonomies.php:7
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/fancy-gallery/templates/galleries-widget.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 28 tag instead of maximum 10
The official readme.txt is a good inspiration

fancy-gallery/plugin.php 85% from 13 tests

Analyzing the main PHP file in "Gallery Manager" version 1.6.58
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 195 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("fancy-gallery.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin4,270 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP424961872,258
PO File23964641,029
Sass6610456
JavaScript56330298
CSS143225168
JSON10040
SVG24021

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.65
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes26
▷ Abstract classes2180.77%
▷ Concrete classes519.23%
▷ Final classes00.00%
Methods136
▷ Static methods10677.94%
▷ Public methods136100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.03MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/error.png2.16KB1.62KB▼ 25.05%
assets/img/plugin-logo-1544x500.png25.25KB25.59KB0.00%