78% picture-gallery

Code Review | Picture Gallery - Frontend Image Uploads, AJAX Photo List

WordPress plugin Picture Gallery - Frontend Image Uploads, AJAX Photo List scored78%from 54 tests.

About plugin

  • Plugin page: picture-gallery
  • Plugin version: 1.5.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3
  • WordPress version: 6.3.1
  • First release: Sep 30, 2016
  • Latest release: Sep 17, 2023
  • Number of updates: 59
  • Update frequency: every 43.2 days
  • Top authors: videowhisper (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /18,103 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.66MB] [CPU: ▼4.95ms] Passed 4 tests

Server-side resources used by Picture Gallery - Frontend Image Uploads, AJAX Photo List
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6848.07 ▲1.85
Dashboard /wp-admin3.97 ▲0.6253.71 ▼10.70
Posts /wp-admin/edit.php4.09 ▲0.7359.75 ▲4.78
Add New Post /wp-admin/post-new.php6.55 ▲0.66103.19 ▼10.35
Media Library /wp-admin/upload.php3.89 ▲0.6639.49 ▼0.61
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=picture3.8944.31
Documentation /wp-admin/admin.php?page=picture-gallery-docs3.8436.55
Upload /wp-admin/admin.php?page=picture-gallery-upload3.8435.73
New Picture /wp-admin/post-new.php?post_type=picture4.1163.63
Galleries /wp-admin/edit-tags.php?taxonomy=gallery&post_type=picture3.8945.67
All Pictures /wp-admin/edit.php?post_type=picture3.9545.24
Manage /wp-admin/admin.php?page=picture-gallery-manage3.8437.23
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=picture3.8943.06
Options /wp-admin/admin.php?page=picture-gallery4.00153.94
Import /wp-admin/admin.php?page=picture-gallery-import3.8534.00

Server storage [IO: ▲4.04MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
VWpictureGalleryOptions
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
category_children
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Picture Gallery - Frontend Image Uploads, AJAX Photo List
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,060 ▲29913.84 ▼0.5710.15 ▲8.2246.46 ▲2.87
Dashboard /wp-admin2,331 ▲1515.63 ▲0.0185.14 ▼5.6949.41 ▲5.58
Posts /wp-admin/edit.php2,233 ▲1301.97 ▼0.0241.05 ▲3.7342.84 ▲7.24
Add New Post /wp-admin/post-new.php1,639 ▲11323.09 ▼0.27607.93 ▼50.1556.20 ▼9.83
Media Library /wp-admin/upload.php1,530 ▲1274.25 ▲0.06102.69 ▼0.2246.97 ▼0.15
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=picture1,5882.1432.4547.33
Documentation /wp-admin/admin.php?page=picture-gallery-docs1,0252.1325.7836.58
Upload /wp-admin/admin.php?page=picture-gallery-upload1,3522.5333.37117.94
New Picture /wp-admin/post-new.php?post_type=picture3,0237.86182.6880.24
Galleries /wp-admin/edit-tags.php?taxonomy=gallery&post_type=picture1,4042.2627.8635.08
All Pictures /wp-admin/edit.php?post_type=picture1,3101.9331.2234.90
Manage /wp-admin/admin.php?page=picture-gallery-manage8992.0126.5730.66
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=picture1,4492.1329.2633.80
Options /wp-admin/admin.php?page=picture-gallery1,0782.0023.1833.84
Import /wp-admin/admin.php?page=picture-gallery-import9752.1722.7929.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • VWpictureGalleryOptions
    • widget_theysaidso_widget
    • category_children

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=category&post_type=picture
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=picture-gallery-import
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=picture-gallery-import
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=picture-gallery-upload
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/picture-gallery/template-picture.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/picture-gallery/taxonomy-gallery.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (AJAX picture listings (updates live as pictures are added)), #2 (Rate Star Review - picture reviews integration)
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

picture-gallery/picture-gallery.php 92% from 13 tests

"Picture Gallery - Frontend Image Uploads, AJAX Photo List" version 1.5.11's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 631 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin4,555 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
SVG30122,880
PHP59512,1711,244
PO File1120123347
JavaScript2181283
CSS10101

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity171.67
▷ Minimum class complexity64.00
▷ Maximum class complexity350.00
Average method complexity9.53
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces1
Interfaces0
Traits2
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods60
▷ Static methods5896.67%
▷ Public methods60100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.47MB with 0.22MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png363.25KB108.22KB▼ 70.21%
scripts/semantic/themes/default/assets/images/flags.png27.46KB29.21KB0.00%
screenshot-2.png83.56KB27.18KB▼ 67.47%
no_video.png7.30KB3.58KB▼ 50.92%