68% categorized-gallery

Code Review | Categorized Gallery Plugin

WordPress plugin Categorized Gallery Plugin scored68%from 54 tests.

About plugin

  • Plugin page: categorized-gallery
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 6.3.1
  • First release: Jul 7, 2017
  • Latest release: Nov 20, 2019
  • Number of updates: 8
  • Update frequency: every 112.6 days
  • Top authors: wamasoftware (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /2,415 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼7.76ms] Passed 4 tests

A check of server-side resources used by Categorized Gallery Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2136.96 ▼4.44
Dashboard /wp-admin3.57 ▲0.2646.39 ▼3.43
Posts /wp-admin/edit.php3.66 ▲0.3148.08 ▼0.52
Add New Post /wp-admin/post-new.php6.28 ▲0.3978.27 ▼22.63
Media Library /wp-admin/upload.php3.51 ▲0.2835.14 ▲0.10
user album publish /wp-admin/admin.php?page=update_publish_gallery_album3.4031.44
Gallery /wp-admin/admin.php?page=gallery_list3.4336.73
delete multiple images /wp-admin/admin.php?page=delete_multiple_image3.4032.47
delete gallery title /wp-admin/admin.php?page=delete_gallery_title3.4031.75
list gallery album /wp-admin/admin.php?page=add_gallary_images3.4028.87
Add New Gallery /wp-admin/admin.php?page=add_new_gallery_images3.4434.52
user gallery publish /wp-admin/admin.php?page=update_publish_gallery_image3.4028.65
user image crop /wp-admin/admin.php?page=image_resize_crop13.4029.03
user image reset /wp-admin/admin.php?page=reset_image3.4029.19
delete gallery album /wp-admin/admin.php?page=delete_gallery_album3.4032.82

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 58 new files
Database: 2 new tables, 6 new options
New tables
wp_galcategory
wp_galimage
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Categorized Gallery Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲17813.49 ▼0.7812.09 ▲10.4744.15 ▼3.72
Dashboard /wp-admin2,219 ▲425.63 ▲0.0292.35 ▲3.3175.49 ▲35.89
Posts /wp-admin/edit.php2,139 ▲392.06 ▲0.0537.14 ▲0.7533.38 ▼3.16
Add New Post /wp-admin/post-new.php1,577 ▲4724.45 ▲1.30655.55 ▲42.4835.99 ▼7.65
Media Library /wp-admin/upload.php1,433 ▲304.12 ▼0.09104.14 ▼0.6969.98 ▲23.62
user album publish /wp-admin/admin.php?page=update_publish_gallery_album6981.378.4317.09
Gallery /wp-admin/admin.php?page=gallery_list8651.6827.0226.73
delete multiple images /wp-admin/admin.php?page=delete_multiple_image8091.6525.7024.01
delete gallery title /wp-admin/admin.php?page=delete_gallery_title6981.378.1318.59
list gallery album /wp-admin/admin.php?page=add_gallary_images6981.557.8113.41
Add New Gallery /wp-admin/admin.php?page=add_new_gallery_images8861.6924.7129.08
user gallery publish /wp-admin/admin.php?page=update_publish_gallery_image6981.377.8511.95
user image crop /wp-admin/admin.php?page=image_resize_crop16981.558.0714.43
user image reset /wp-admin/admin.php?page=reset_image6981.558.0713.26
delete gallery album /wp-admin/admin.php?page=delete_gallery_album6981.557.6118.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/categorized-gallery/init.php+115
    rmdir(wp-content/uploads/categoryimg): Directory not empty
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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 errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=delete_multiple_image
    • > Notice in wp-content/plugins/categorized-gallery/delete_gallery_album.php+54
    Undefined index: catid

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
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/categorized-gallery/html/add_update_gallery.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/categorized-gallery/html/display_gallary_image.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/categorized-gallery/html/add_gallary_images_header.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/categorized-gallery/html/image_crop.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/categorized-gallery/html/display_title_image.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4, #5, #6 in categorized-gallery/assets to your readme.txt
  • Plugin Name: You should set the name of your plugin on the first line ( === categorized-gallery === )
You can take inspiration from this readme.txt

categorized-gallery/init.php 92% from 13 tests

The entry point to "Categorized Gallery Plugin" version 1.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("categorized-gallery.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,497 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP1384108864
CSS55738483
JavaScript379150

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.50
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
33 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/fancybox.png14.93KB8.47KB▼ 43.29%
icons/fancy_shadow_se.png0.34KB0.48KB0.00%
icons/addimg.png2.68KB2.46KB▼ 8.26%
icons/crop.png7.70KB4.47KB▼ 41.92%
icons/close.png0.27KB0.29KB0.00%