10% good-old-gallery

Code Review | Good Old Gallery

WordPress plugin Good Old Gallery scored10%from 54 tests.

About plugin

  • Plugin page: good-old-gallery
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Jan 20, 2011
  • Latest release: Dec 17, 2012
  • Number of updates: 30
  • Update frequency: every 23.2 days
  • Top authors: linuslundahl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /37,696 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/good-old-gallery/good-old-gallery.php+42
    Accessing static property GoodOldGallery::$is_loaded as non static

Server metrics [RAM: ▼1.95MB] [CPU: ▼50.60ms] Passed 4 tests

An overview of server-side resources used by Good Old Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.426.22 ▼31.84
Dashboard /wp-admin2.06 ▼1.248.02 ▼39.27
Posts /wp-admin/edit.php2.06 ▼1.306.22 ▼37.89
Add New Post /wp-admin/post-new.php2.06 ▼3.835.87 ▼93.41
Media Library /wp-admin/upload.php2.06 ▼1.175.69 ▼31.40
Add New /wp-admin/post-new.php?post_type=goodoldgallery2.065.28
Settings /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings2.065.33
Galleries /wp-admin/edit.php?post_type=goodoldgallery2.065.27
Themes /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes2.065.24

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
gog_plugin
gog_settings
theysaidso_admin_options
widget_goodoldgallerywidget
db_upgraded
gog_themes
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Good Old Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.64 ▼0.731.70 ▼0.1344.18 ▲1.78
Dashboard /wp-admin2,243 ▲524.95 ▲0.0498.71 ▼1.4978.55 ▲36.04
Posts /wp-admin/edit.php2,123 ▲342.02 ▼0.1236.18 ▲1.2532.86 ▼3.24
Add New Post /wp-admin/post-new.php1,568 ▲4923.04 ▼0.04774.69 ▲182.2357.88 ▲6.96
Media Library /wp-admin/upload.php1,422 ▲314.18 ▼0.11100.34 ▲3.4069.15 ▲25.67
Add New /wp-admin/post-new.php?post_type=goodoldgallery1,4602.5449.1864.79
Settings /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings1,2182.0135.8457.86
Galleries /wp-admin/edit.php?post_type=goodoldgallery1,0871.9532.0426.93
Themes /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes9231.8330.9238.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/good-old-gallery/good-old-gallery.php+42
    Accessing static property GoodOldGallery::$is_loaded as non static
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_goodoldgallerywidget
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes
    • > Notice in wp-content/plugins/good-old-gallery/good-old-gallery.php+42
    Accessing static property GoodOldGallery::$is_loaded as non static
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes
    • > Deprecated in wp-content/plugins/good-old-gallery/includes/PageThemes.class.php+84
    Non-static method GOG_FormBuilder::parseForm() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=goodoldgallery
    • > User deprecated in wp-includes/functions.php+5453
    Function wp_get_single_post is deprecated since version 3.5.0! Use get_post() instead.
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method GOG_FormBuilder::select() should not be called statically
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method GOG_FormBuilder::checkbox() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Deprecated in wp-content/plugins/good-old-gallery/includes/PageSettings.class.php+180
    Non-static method GOG_Helpers::orderFields() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method GOG_FormBuilder::markup() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Deprecated in wp-admin/includes/template.php+1771
    Non-static method GOG_PageSettings::settingsHeader() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method GOG_FormBuilder::text() should not be called statically

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/good-old-gallery/includes/delete.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/good-old-gallery/includes/Widget.class.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/good-old-gallery/good-old-gallery.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Network (severe)
    wp-content/plugins/good-old-gallery/assets/css/assets/fonts/fontawesome-webfont.woff - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_settings
    • > Network (severe)
    wp-content/plugins/good-old-gallery/assets/css/assets/fonts/fontawesome-webfont.ttf - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=goodoldgallery&page=gog_themes
    • > Network (severe)
    https://button.flattr.com/loader.js?mode=auto - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 87% 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:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Screenshots: Please add images for these screenshots: #1 (Galleries listing page), #2 (Edit gallery page), #3 (Default settings page), #4 (Gallery shortcode generator), #5 (Widget settings)
You can take inspiration from this readme.txt

good-old-gallery/good-old-gallery.php 85% from 13 tests

"Good Old Gallery" version 2.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 256 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin4,692 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52402632,152
PHP133163791,797
CSS44653457
SVG100255
Markdown115031

PHP code Passed 2 tests

Analyzing 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.46
Average class complexity27.33
▷ Minimum class complexity13.00
▷ Maximum class complexity52.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
9 PNG files occupy 0.27MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png59.29KB58.25KB▼ 1.76%
screenshot-3.png65.80KB65.97KB0.00%
screenshot-1.png25.66KB25.26KB▼ 1.55%
screenshot-4.png51.22KB50.63KB▼ 1.15%
themes/good-old-gallery-dots/good-old-gallery-dots.png22.70KB3.65KB▼ 83.93%