73% foogallery

Code Review | Best WordPress Gallery Plugin – FooGallery

WordPress plugin Best WordPress Gallery Plugin – FooGallery scored 73% from 54 tests.

About plugin

  • Plugin page: foogallery
  • Plugin version: 2.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Sep 6, 2023
  • Number of updates: 202
  • Update frequency: every 16.6 days
  • Top authors: bradvin (100%)

Code review

54 tests

User reviews

852 reviews

Install metrics

100,000+ active / 4,480,864 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲6.42MB] [CPU: ▲39.25ms] 50% from 4 tests

An overview of server-side resources used by Best WordPress Gallery Plugin – FooGallery
Please take the time to fix the following items
  • RAM: The total memory usage must be kept under 10MB (currently 10.10MB on /wp-admin/admin.php?page=freemius)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.42MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.11 ▲5.6595.61 ▲52.82
Dashboard /wp-admin10.01 ▲6.7190.40 ▲33.58
Posts /wp-admin/edit.php10.06 ▲6.70102.71 ▲56.40
Add New Post /wp-admin/post-new.php12.55 ▲6.66138.50 ▲14.95
Media Library /wp-admin/upload.php9.88 ▲6.6588.02 ▲55.66
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius10.1074.46

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 404 new files
Database: no new tables, 11 new options
New WordPress options
fs_debug_mode
widget_recent-comments
theysaidso_admin_options
foogallery_extensions_auto_activated
db_upgraded
fs_active_plugins
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
fs_accounts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Best WordPress Gallery Plugin – FooGallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.16 ▼1.571.74 ▲0.0333.84 ▼8.90
Dashboard /wp-admin2,241 ▲675.99 ▲1.10116.92 ▲7.7446.02 ▼0.22
Posts /wp-admin/edit.php2,124 ▲352.03 ▲0.0439.19 ▲2.6838.65 ▲4.71
Add New Post /wp-admin/post-new.php1,504 ▼1918.98 ▼4.18704.50 ▲57.2841.70 ▼10.01
Media Library /wp-admin/upload.php1,423 ▲354.20 ▲0.04115.27 ▲8.2946.21 ▲2.71
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0981.7125.9328.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/foogallery/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 11 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • fs_accounts
    • db_upgraded
    • widget_recent-posts
    • foogallery_extensions_auto_activated
    • widget_theysaidso_widget
    • fs_debug_mode
    • theysaidso_admin_options
    • fs_active_plugins
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 60× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function foogallery_get_setting() in wp-content/plugins/foogallery/extensions/default-templates/image-viewer/gallery-image-viewer.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'FOOGALLERY_PATHgutenberg/class-foogallery-blocks.php' (include_path='.:/usr/share/php') in wp-content/plugins/foogallery/gutenberg/class-foogallery-gutenberg.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/foogallery/includes/foopluginbase\\classes\\class-foo-friendly-dates.php' (include_path='.:/usr/share/php') in wp-content/plugins/foogallery/includes/foopluginbase/tests/class-foo-friendly-dates-tests.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Sitemaps_Provider' not found in wp-content/plugins/foogallery/includes/class-foogallery-sitemaps.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function foogallery_get_all_galleries() in wp-content/plugins/foogallery/extensions/import-export/view-import-export.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/foogallery/extensions/default-templates/justified/class-justified-gallery-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/foogallery/extensions/default-templates/default/class-default-gallery-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function foogallery_gallery_template_setting_lightbox() in wp-content/plugins/foogallery/extensions/default-templates/thumbnail/gallery-thumbnail.php:7
    • > PHP Warning
      require_once(FOOGALLERY_PATHincludes/constants.php): failed to open stream: No such file or directory in wp-content/plugins/foogallery/includes/includes.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'FooGallery_Thumb_Engine' not found in wp-content/plugins/foogallery/includes/thumbs/shortpixel/class-foogallery-thumb-engine-shortpixel.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: responsive gallery, wordpress gallery plugin, photo gallery, image gallery, albums...

foogallery/foogallery.php Passed 13 tests

"Best WordPress Gallery Plugin – FooGallery" version 2.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
98 characters long description:
FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin74,834 lines of code in 330 files:
LanguageFilesBlank linesComment linesLines of code
PHP26611,90423,34952,412
JavaScript292,0776,06113,538
CSS317032278,681
SVG11314157
XML23043
Markdown1103

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity39.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes162
▷ Abstract classes42.47%
▷ Concrete classes15897.53%
▷ Final classes00.00%
Methods2,092
▷ Static methods22210.61%
▷ Public methods1,64478.59%
▷ Protected methods221.05%
▷ Private methods42620.36%
Functions253
▷ Named functions253100.00%
▷ Anonymous functions00.00%
Constants226
▷ Global constants16271.68%
▷ Class constants6428.32%
▷ Public constants64100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.21MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/logo.png25.62KB27.92KB0.00%
includes/thumbs/default/tests/test2.png21.66KB5.35KB▼ 75.29%
includes/thumbs/default/tests/test1.png21.08KB5.90KB▼ 72.02%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%