66% maxgalleria

Code Review | MaxGalleria

WordPress plugin MaxGalleria scored 66% from 54 tests.

About plugin

  • Plugin page: maxgalleria
  • Plugin version: 6.3.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.3
  • WordPress version: 6.3.1
  • First release: May 1, 2014
  • Latest release: Aug 1, 2023
  • Number of updates: 308
  • Update frequency: every 11.0 days
  • Top authors: AlanP57 (84.42%)arcware (9.09%)johnbhartley (7.14%)

Code review

54 tests

User reviews

61 reviews

Install metrics

3,000+ active / 181,431 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▼3.82ms] Passed 4 tests

An overview of server-side resources used by MaxGalleria
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4337.25 ▼2.08
Dashboard /wp-admin3.74 ▲0.4444.87 ▼4.73
Posts /wp-admin/edit.php3.85 ▲0.5051.12 ▲0.95
Add New Post /wp-admin/post-new.php6.34 ▲0.4689.70 ▼9.42
Media Library /wp-admin/upload.php3.66 ▲0.4439.80 ▲4.60
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=maxgallery3.6634.32
MaxGalleria /wp-admin/edit.php?post_type=maxgallery3.7642.28
Support /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-support3.7237.75
/wp-admin/admin.php?page=mg-review-notice3.6035.62
NextGEN Importer /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-nextgen-importer3.7244.64
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=maxgallery3.6641.51
/wp-admin/admin.php?page=mg-admin-notice3.6034.82
Settings /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-settings3.7541.17
/wp-admin/admin.php?page=mg-review-later3.6031.70
Upgrade to Pro /wp-admin/edit.php?post_type=maxgallery&page=mg-upgrade-to-pro3.7636.23

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

A short overview of filesystem and database impact
Please try to fix the following items
  • You have illegally modified 1 file (0.57KB) outside of "wp-content/plugins/maxgalleria/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/single-maxgallery.php
Filesystem: 372 new files
Database: no new tables, 11 new options
New WordPress options
mg_hide_presets
can_compress_scripts
db_upgraded
maxgalleria_version
widget_recent-posts
widget_theysaidso_widget
category_children
widget_maxgalleria-gallery-thumb-widget
widget_maxgalleria-gallery-widget
widget_recent-comments
...

Browser metrics 75% from 4 tests

A check of browser resources used by MaxGalleria
Please improve the following
  • Nodes: Try to keep the DOM nodes under 25,000 (currently 69,139 on /wp-admin/admin.php?page=mg-review-notice)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.25 ▼1.125.43 ▲3.4241.15 ▼2.26
Dashboard /wp-admin2,259 ▲685.84 ▲0.97108.47 ▲1.7386.18 ▲37.30
Posts /wp-admin/edit.php2,145 ▲532.01 ▲0.0237.35 ▼2.2333.13 ▼2.97
Add New Post /wp-admin/post-new.php6,726 ▲5,18923.94 ▲0.911,007.90 ▲391.9238.55 ▼21.73
Media Library /wp-admin/upload.php1,441 ▲504.19 ▼0.07103.33 ▲0.4544.57 ▲0.84
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=maxgallery1,3632.1429.1333.54
MaxGalleria /wp-admin/edit.php?post_type=maxgallery1,7685.49140.09134.38
Support /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-support1,1573.2142.3894.58
/wp-admin/admin.php?page=mg-review-notice69,13973.81623.66318.86
NextGEN Importer /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-nextgen-importer1,1453.2740.8966.20
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=maxgallery1,4932.1426.6034.20
/wp-admin/admin.php?page=mg-admin-notice69,11973.82439.62273.57
Settings /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-settings1,3313.2942.8394.51
/wp-admin/admin.php?page=mg-review-later69,11474.10428.54266.23
Upgrade to Pro /wp-admin/edit.php?post_type=maxgallery&page=mg-upgrade-to-pro1,7463.3248.41164.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_maxgalleria-gallery-widget
    • db_upgraded
    • widget_recent-posts
    • mg_hide_presets
    • can_compress_scripts
    • widget_maxgalleria-gallery-thumb-widget
    • category_children
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mg-review-later
    • > Notice in wp-content/plugins/maxgalleria/maxgalleria-admin.php+111
    Undefined index: HTTP_REFERER

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/maxgalleria/maxgalleria-media-button.php
  • 37× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/maxgalleria/admin/support.php:5
    • > PHP Notice
      Trying to get property 'settings' of non-object in wp-content/plugins/maxgalleria/admin/settings.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'MAXGALLERIA_PLUGIN_DIR/maxgallery-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/maxgalleria/addons/templates/image-tiles/image-tiles-options.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/maxgalleria/meta/meta-images.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'MaxGalleriaImageTilesOptions' not found in wp-content/plugins/maxgalleria/addons/templates/image-tiles/image-tiles-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/maxgalleria/meta/meta-options.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'MaxGalleriaVideoTilesOptions' not found in wp-content/plugins/maxgalleria/addons/templates/video-tiles/video-tiles-meta.php:3
    • > PHP Warning
      require_once(MAXGALLERIA_PLUGIN_DIR/maxgallery-options.php): failed to open stream: No such file or directory in wp-content/plugins/maxgalleria/addons/templates/video-tiles/video-tiles-options.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'MaxGalleriaYoutubeOptions' not found in wp-content/plugins/maxgalleria/addons/media-sources/youtube/youtube-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MaxGalleryOptions' not found in wp-content/plugins/maxgalleria/meta/meta-advanced.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=mg-review-notice
    • > Javascript (warning) in unknown
    /wp-admin/admin.php?page=mg-review-notice 51 Throttling navigation to prevent the browser from hanging. See https://crbug.com/1038223. Command line switch --disable-ipc-flooding-protection can be used to bypass the protection
    • > GET request to /wp-admin/admin.php?page=mg-admin-notice
    • > Javascript (warning) in unknown
    /wp-admin/admin.php?page=mg-admin-notice 51 Throttling navigation to prevent the browser from hanging. See https://crbug.com/1038223. Command line switch --disable-ipc-flooding-protection can be used to bypass the protection
    • > GET request to /wp-admin/edit.php?post_type=maxgallery&page=maxgalleria-settings
    • > Network (severe)
    wp-content/plugins/maxgalleria/images/maxgalleria-icon-32.png%20alt=MaxGalleria - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=mg-review-later
    • > Javascript (warning) in unknown
    /wp-admin/admin.php?page=mg-review-later 51 Throttling navigation to prevent the browser from hanging. See https://crbug.com/1038223. Command line switch --disable-ipc-flooding-protection can be used to bypass the protection

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #12, #13, #14, #2, #3, #4, #5, #6, #7, #8, #9 in maxgalleria/assets to your readme.txt
Please take inspiration from this readme.txt

maxgalleria/maxgalleria.php Passed 13 tests

"MaxGalleria" version 6.3.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
35 characters long description:
The gallery platform for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin52,026 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
CSS955,94147422,038
PHP432,44648413,386
Sass19551716,314
LESS18548716,244
PO File29131,7422,248
JavaScript111941281,722
JSON10074

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity59.90
▷ Minimum class complexity1.00
▷ Maximum class complexity217.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods452
▷ Static methods00.00%
▷ Public methods44297.79%
▷ Protected methods00.00%
▷ Private methods102.21%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants177
▷ Global constants177100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
147 PNG files occupy 2.56MB with 1.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/templates/slick-slider-1.png2.91KB2.30KB▼ 20.93%
images/addons/masonry-cover.png25.85KB9.30KB▼ 64.00%
images/templates/instagram-1.png3.36KB2.23KB▼ 33.83%
images/options-icons/shadow-spread-1.png19.35KB0.52KB▼ 97.33%
images/addons/get-mg-addons.png6.19KB3.48KB▼ 43.80%