56% grand-media

Code Review | Gmedia Photo Gallery

WordPress plugin Gmedia Photo Gallery scored56%from 54 tests.

About plugin

  • Plugin page: grand-media
  • Plugin version: 1.22.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 13, 2013
  • Latest release: Apr 7, 2023
  • Number of updates: 532
  • Update frequency: every 6.9 days
  • Top authors: pasyuk (100%)

Code review

54 tests

User reviews

276 reviews

Install metrics

10,000+ active /985,203 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.17MB] [CPU: ▲17.38ms] 75% from 4 tests

This is a short check of server-side resources used by Gmedia Photo Gallery
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 2,976.76ms on /wp-admin/admin.php?page=GrandMedia_Modules)
PageMemory (MB)CPU Time (ms)
Home /5.37 ▲1.8757.96 ▲15.17
Dashboard /wp-admin5.62 ▲2.2869.25 ▲15.80
Posts /wp-admin/edit.php5.75 ▲2.3571.31 ▲19.43
Add New Post /wp-admin/post-new.php8.23 ▲2.30125.15 ▲36.11
Media Library /wp-admin/upload.php5.52 ▲2.2558.27 ▲19.11
Galleries /wp-admin/admin.php?page=GrandMedia_Galleries5.6357.84
Gmedia Library /wp-admin/admin.php?page=GrandMedia5.9658.61
Albums /wp-admin/admin.php?page=GrandMedia_Albums5.8861.90
Modules /wp-admin/admin.php?page=GrandMedia_Modules5.732,976.76
Gmedia Logs /wp-admin/admin.php?page=GrandMedia_Logs5.6052.87
Categories /wp-admin/admin.php?page=GrandMedia_Categories5.8759.19
Tags /wp-admin/admin.php?page=GrandMedia_Tags5.6454.67
Settings /wp-admin/admin.php?page=GrandMedia_Settings5.6553.71
Add/Import Files /wp-admin/admin.php?page=GrandMedia_AddMedia5.5454.77
WP Media Library /wp-admin/admin.php?page=GrandMedia_WordpressLibrary5.6164.04

Server storage [IO: ▲9.48MB] [DB: ▲0.02MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • The plugin illegally modified 7 files (0.00KB) outside of "wp-content/plugins/grand-media/" and "wp-content/uploads/"
    • (new file) wp-content/grand-media/text/.empty
    • (new file) wp-content/grand-media/image/thumb/.empty
    • (new file) wp-content/grand-media/module/.empty
    • (new file) wp-content/grand-media/audio/.empty
    • (new file) wp-content/grand-media/image/original/.empty
    • (new file) wp-content/grand-media/video/.empty
    • (new file) wp-content/grand-media/application/.empty
Filesystem: 374 new files
Database: 6 new tables, 12 new options
New tables
wp_gmedia
wp_gmedia_term_meta
wp_gmedia_term
wp_gmedia_term_relationships
wp_gmedia_meta
wp_gmedia_log
New WordPress options
gmediaVersion
theysaidso_admin_options
gmediaDbVersion
gmediaOptions
db_upgraded
GmediaHashID_salt
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_gmedia_album_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gmedia Photo Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲25213.39 ▼0.9610.13 ▲8.4541.36 ▼3.71
Dashboard /wp-admin2,308 ▲1345.56 ▼0.11101.25 ▲8.7038.21 ▼1.57
Posts /wp-admin/edit.php2,219 ▲1192.12 ▲0.1651.59 ▲6.8435.48 ▼6.11
Add New Post /wp-admin/post-new.php1,670 ▲14420.35 ▼3.34654.94 ▼48.5055.60 ▼1.08
Media Library /wp-admin/upload.php1,512 ▲1094.31 ▲0.08105.32 ▲1.1543.51 ▼2.75
Galleries /wp-admin/admin.php?page=GrandMedia_Galleries1,8573.80114.42104.70
Gmedia Library /wp-admin/admin.php?page=GrandMedia2,0764.16104.9545.79
Albums /wp-admin/admin.php?page=GrandMedia_Albums2,0244.3490.4765.54
Modules /wp-admin/admin.php?page=GrandMedia_Modules2,9003.7579.1765.41
Gmedia Logs /wp-admin/admin.php?page=GrandMedia_Logs1,5993.7984.4439.75
Categories /wp-admin/admin.php?page=GrandMedia_Categories1,9714.3389.6651.68
Tags /wp-admin/admin.php?page=GrandMedia_Tags1,6843.8383.7744.64
Settings /wp-admin/admin.php?page=GrandMedia_Settings3,0193.7884.9244.97
Add/Import Files /wp-admin/admin.php?page=GrandMedia_AddMedia1,8404.42108.3156.52
WP Media Library /wp-admin/admin.php?page=GrandMedia_WordpressLibrary1,7093.8189.4241.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall successfully, leaving 6 tables in the database
    • wp_gmedia_term_meta
    • wp_gmedia
    • wp_gmedia_meta
    • wp_gmedia_term
    • wp_gmedia_term_relationships
    • wp_gmedia_log
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_gmedia_album_widget
    • widget_gmedia_gallery_widget
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=GrandMedia_Modules
    • > Notice in wp-content/plugins/grand-media/admin/pages/modules/functions.php+52
    Undefined index: status

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 70× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/grand-media/inc/core.php
    • > /wp-content/plugins/grand-media/admin/pages/terms/tpl/album-list-item.php
    • > /wp-content/plugins/grand-media/admin/pages/galleries/tpl/gallery-edit-item.php
    • > /wp-content/plugins/grand-media/admin/pages/library/tpl/grid-item.php
    • > /wp-content/plugins/grand-media/admin/pages/modules/tpl/modal-modulezip.php
    • > /wp-content/plugins/grand-media/config/setup.php
    • > /wp-content/plugins/grand-media/admin/pages/galleries/galleries.php
    • > /wp-content/plugins/grand-media/admin/pages/settings/tpl/roles.php
    • > /wp-content/plugins/grand-media/admin/pages/modules/edit-preset.php
    • > /wp-content/plugins/grand-media/admin/pages/terms/tpl/album-create-item.php
  • 65× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/grand-media/module/wp-videoplayer/init.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_gmedia_header() in wp-content/plugins/grand-media/template/single.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/grand-media/module/amron/init.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GmediaProcessor' not found in wp-content/plugins/grand-media/admin/processor/class.processor.modules.php:6
    • > PHP Warning
      Use of undefined constant GMEDIA_ABSPATH - assumed 'GMEDIA_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/grand-media/admin/class.processor.php on line 120
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryNumber' not found in wp-content/plugins/grand-media/inc/pel/PelEntryByte.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryAscii' not found in wp-content/plugins/grand-media/inc/pel/PelEntryTime.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/grand-media/module/jq-mplayer/init.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GmediaProcessor' not found in wp-content/plugins/grand-media/admin/processor/class.processor.addmedia.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/grand-media/admin/pages/terms/functions.php:118

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=GrandMedia_WordpressLibrary
    • > Console-api (severe) in unknown
    https://platform.twitter.com/widgets.js 0:11500 "Error: This Timeline type is no longer supported (Likes, Collections, & Moments). \n\t" "* Twitter still supports Profile and List Timelines \n\t" "* You can learn more about this change in our announcement: \n\t" "https://twittercommunity.com/t/removing-support-for-embedded-like-collection-and-moment-timelines/150313 \n\t" "* In order to create a new Embedded Timeline, visit: https://publish.twitter.com"

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: best gallery plugin, image gallery, wordpress gallery plugin, gallery, photo gallery

grand-media/grand-media.php Passed 13 tests

The principal PHP file in "Gmedia Photo Gallery" v. 1.22.0 is loaded by WordPress automatically on each request
99 characters long description:
Gmedia Gallery - powerful media library plugin for creating beautiful galleries and managing files.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected82,771 lines of code in 223 files:
LanguageFilesBlank linesComment linesLines of code
PHP1594,41111,14232,236
JavaScript405,7733,98430,865
CSS244,83024919,670

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
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 185)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity43.55
▷ Minimum class complexity1.00
▷ Maximum class complexity723.00
Average method complexity6.48
▷ Minimum method complexity1.00
▷ Maximum method complexity185.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes64
▷ Abstract classes34.69%
▷ Concrete classes6195.31%
▷ Final classes00.00%
Methods495
▷ Static methods6212.53%
▷ Public methods45792.32%
▷ Protected methods173.43%
▷ Private methods214.24%
Functions159
▷ Named functions14993.71%
▷ Anonymous functions106.29%
Constants382
▷ Global constants82.09%
▷ Class constants37497.91%
▷ Public constants36998.66%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
103 PNG files occupy 0.58MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/application.png5.83KB3.53KB▼ 39.45%
assets/photoswipe/images/icons@2x.png8.00KB5.50KB▼ 31.25%
assets/image-editor/img/ui-slider.png0.41KB0.29KB▼ 28.19%
module/jq-mplayer/img/player-pause.png0.16KB0.17KB0.00%
module/wp-videoplayer/screenshot.png87.92KB36.74KB▼ 58.21%