84% meow-gallery

Code Review | Gallery Block (Meow Gallery)

WordPress plugin Gallery Block (Meow Gallery) scored84%from 54 tests.

About plugin

  • Plugin page: meow-gallery
  • Plugin version: 5.0.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 21, 2016
  • Latest release: Nov 26, 2023
  • Number of updates: 237
  • Update frequency: every 10.9 days
  • Top authors: TigrouMeow (100%)

Code review

54 tests

User reviews

152 reviews

Install metrics

9,000+ active /260,401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.25MB] [CPU: ▼3.83ms] Passed 4 tests

This is a short check of server-side resources used by Gallery Block (Meow Gallery)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1543.81 ▲0.69
Dashboard /wp-admin3.64 ▲0.2951.56 ▼8.75
Posts /wp-admin/edit.php3.70 ▲0.3451.08 ▲3.83
Add New Post /wp-admin/post-new.php6.16 ▲0.2888.82 ▼11.10
Media Library /wp-admin/upload.php3.50 ▲0.2738.66 ▲5.94
Gallery /wp-admin/admin.php?page=mgl_settings3.4736.38
Dashboard /wp-admin/admin.php?page=meowapps-main-menu3.6754.47

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 69 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
mgl_options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Gallery Block (Meow Gallery)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20421.23 ▲6.961.71 ▲0.1139.21 ▼1.81
Dashboard /wp-admin2,359 ▲18211.39 ▲5.74271.14 ▲172.2242.97 ▼0.54
Posts /wp-admin/edit.php2,275 ▲17510.26 ▲8.3197.81 ▲57.3937.50 ▲1.33
Add New Post /wp-admin/post-new.php6,255 ▲4,72919.66 ▼3.39853.77 ▲248.4040.37 ▼13.41
Media Library /wp-admin/upload.php1,576 ▲17913.02 ▲8.79144.42 ▲47.3342.00 ▲0.99
Gallery /wp-admin/admin.php?page=mgl_settings1,30811.47164.8542.92
Dashboard /wp-admin/admin.php?page=meowapps-main-menu5,77212.14139.0274.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • mgl_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/meow-gallery/classes/builders/tiles.css.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Meow_MGL_Builders_Core' not found in wp-content/plugins/meow-gallery/classes/builders/tiles.php:3
    • > PHP Notice
      Undefined variable: isPreview in wp-content/plugins/meow-gallery/classes/builders/tiles-php.css.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/meow-gallery/classes/builders/tiles-php.css.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/meow-gallery/classes/builders/masonry.css.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/meow-gallery/classes/builders/cascade.css.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Meow_MGL_Builders_Core' not found in wp-content/plugins/meow-gallery/classes/builders/raw.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/meow-gallery/classes/builders/horizontal.css.php:3
    • > PHP Notice
      Undefined variable: columns in wp-content/plugins/meow-gallery/classes/builders/square.css.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/meow-gallery/classes/builders/cell.tpl.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4 in meow-gallery/assets to your readme.txt
Please take inspiration from this readme.txt

meow-gallery/meow-gallery.php Passed 13 tests

"Gallery Block (Meow Gallery)" version 5.0.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
57 characters long description:
Gallery system built for photographers, by photographers.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin4,193 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP314411942,584
JavaScript181831291,580
Bourne Shell113821
SVG1006
CSS2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity16.60
▷ Minimum class complexity3.00
▷ Maximum class complexity110.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes15.00%
▷ Concrete classes1995.00%
▷ Final classes00.00%
Methods133
▷ Static methods1813.53%
▷ Public methods12593.98%
▷ Protected methods00.00%
▷ Private methods86.02%
Functions22
▷ Named functions836.36%
▷ Anonymous functions1463.64%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/img/1x1.png0.07KB0.09KB0.00%
app/img/layout-carousel.png1.13KB0.48KB▼ 57.71%
app/img/layout-cascade.png0.65KB0.15KB▼ 76.28%
app/img/layout-square.png0.68KB0.16KB▼ 76.55%
app/img/layout-map.png1.96KB0.91KB▼ 53.90%