78% gallery-for-users

Code Review | Gallery for Users

WordPress plugin Gallery for Users scored78%from 54 tests.

About plugin

  • Plugin page: gallery-for-users
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Sep 1, 2016
  • Latest release: Aug 7, 2018
  • Number of updates: 24
  • Update frequency: every 29.4 days
  • Top authors: togidata (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼8.56ms] Passed 4 tests

An overview of server-side resources used by Gallery for Users
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.1642.37 ▲1.29
Dashboard /wp-admin3.53 ▲0.1451.72 ▼17.42
Posts /wp-admin/edit.php3.64 ▲0.2449.95 ▼2.35
Add New Post /wp-admin/post-new.php6.13 ▲0.2089.73 ▼15.77
Media Library /wp-admin/upload.php3.45 ▲0.1841.74 ▲8.20
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=users_gallery3.4441.22
All Gallery items /wp-admin/edit.php?post_type=users_gallery3.5041.96
Settings /wp-admin/edit.php?post_type=users_gallery&page=users_gallery_settings3.4034.18
Add New /wp-admin/post-new.php?post_type=users_gallery3.5962.11

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
gallery_types_children
users_gallery_terms_added
widget_theysaidso_widget
can_compress_scripts
db_upgraded
category_children
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gallery for Users
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲12914.42 ▼0.291.64 ▼0.2036.22 ▼7.74
Dashboard /wp-admin2,269 ▲955.94 ▲0.3386.38 ▼10.4036.88 ▼5.35
Posts /wp-admin/edit.php2,183 ▲832.30 ▲0.3038.70 ▼2.2033.98 ▼5.36
Add New Post /wp-admin/post-new.php1,580 ▲5223.38 ▲0.31658.12 ▼26.1836.31 ▼21.53
Media Library /wp-admin/upload.php1,480 ▲774.46 ▲0.2795.63 ▼4.9442.66 ▼2.75
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=users_gallery1,5342.1834.0436.18
All Gallery items /wp-admin/edit.php?post_type=users_gallery1,1902.2435.3329.93
Settings /wp-admin/edit.php?post_type=users_gallery&page=users_gallery_settings1,6052.6160.4236.52
Add New /wp-admin/post-new.php?post_type=users_gallery2,5818.03166.5368.90

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
These items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • gallery_types_children
    • widget_recent-posts
    • users_gallery_terms_added
    • category_children
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=users_gallery&page=users_gallery_settings
    • > Notice in wp-content/plugins/gallery-for-users/includes/users-gallery-admin.php+92
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-for-users/init.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 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
5 plugin tags: user gallery, gallery, images for users, user images, video gallery

gallery-for-users/init.php 85% from 13 tests

The principal PHP file in "Gallery for Users" v. 2.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gallery-for-users.php" instead of "init.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
No dangerous file extensions were detected6,709 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript92963274,212
PHP102232531,369
CSS4216523
LESS257289
PO File1115130284
JSON10032

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity18.33
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/skins/bottomshadow-110-95-4.png2.01KB2.67KB0.00%
assets/images/del-ico.png1.48KB0.84KB▼ 43.05%
assets/images/calendar-ico.png1.30KB0.70KB▼ 45.82%
assets/images/skins/arrows-32-32-0 (1).png2.38KB1.80KB▼ 24.42%
assets/images/skins/carouselarrows-32-32-0.png2.71KB2.19KB▼ 19.12%