78% photo-galleria

Code Review | Photo Galleria

WordPress plugin Photo Galleria scored78%from 54 tests.

About plugin

  • Plugin page: photo-galleria
  • Plugin version: 0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.2.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2008
  • Latest release: Nov 1, 2012
  • Number of updates: 58
  • Update frequency: every 27.7 days
  • Top authors: endortrails (94.83%)philiparthurmoore (6.9%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /142,840 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.90ms] Passed 4 tests

A check of server-side resources used by Photo Galleria
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.03 ▲5.67
Dashboard /wp-admin3.31 ▲0.0144.84 ▼3.45
Posts /wp-admin/edit.php3.36 ▲0.0147.24 ▲0.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.15 ▼18.24
Media Library /wp-admin/upload.php3.24 ▲0.0135.07 ▲1.92
Photo Galleria /wp-admin/options-general.php?page=photo_galleria_options3.1829.52

Server storage [IO: ▲0.27MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Photo Galleria
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.63 ▼0.021.80 ▼0.4140.72 ▼9.98
Dashboard /wp-admin2,213 ▲285.09 ▼0.73110.88 ▼4.9336.91 ▼7.10
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0238.24 ▲3.8636.00 ▼0.16
Add New Post /wp-admin/post-new.php1,536 ▲323.47 ▲0.33685.18 ▲3.5154.40 ▼0.60
Media Library /wp-admin/upload.php1,389 ▼24.25 ▲0.10110.70 ▲10.6746.39 ▼0.54
Photo Galleria /wp-admin/options-general.php?page=photo_galleria_options9702.0525.3936.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=photo_galleria_options
    • > Notice in wp-content/plugins/photo-galleria/photo-galleria.php+201
    Trying to access array offset on value of type bool

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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/photo-galleria/photo-galleria.php:18
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/photo-galleria/photo-galleria.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Design options)
  • Plugin Name: Please specify the plugin name on the first line ( === photo-galleria === )
You can take inspiration from this readme.txt

photo-galleria/photo-galleria.php Passed 13 tests

The main file in "Photo Galleria" v. 0.5.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
63 characters long description:
Creates beautiful slideshows from embedded WordPress galleries.

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
Good job! No executable or dangerous file extensions detected646 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP19377289
CSS131213
HTML114381
JavaScript3183163

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.16MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/themes/classic/classic-map.png1.80KB0.67KB▼ 62.77%
screenshot-1.png161.37KB159.66KB▼ 1.06%