78% rio-photo-gallery

Code Review | Rio Photo Gallery

WordPress plugin Rio Photo Gallery scored 78% from 54 tests.

About plugin

  • Plugin page: rio-photo-gallery
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Oct 16, 2018
  • Latest release: Oct 1, 2019
  • Number of updates: 6
  • Update frequency: every 58.5 days
  • Top authors: sabareesha (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 487 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼175.49ms] Passed 4 tests

A check of server-side resources used by Rio Photo Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0332.00 ▼0.59
Dashboard /wp-admin3.10 ▲0.0441.12 ▲0.04
Posts /wp-admin/edit.php3.15 ▲0.0443.44 ▲0.34
Add New Post /wp-admin/post-new.php5.45 ▲0.0276.63 ▼701.15
Media Library /wp-admin/upload.php3.04 ▲0.0432.46 ▼0.27
Image Settings /wp-admin/admin.php?page=manage-images2.9925.40
Manage Albums /wp-admin/admin.php?page=manage-albums2.9928.43
/wp-admin/admin.php?page=individual-albums2.9927.59
Add Albums /wp-admin/admin.php?page=add-albums2.9922.71
/wp-admin/admin.php?page=edit-album2.9923.58
Add Gallery /wp-admin/admin.php?page=add-gallery2.9927.72
Rio Photo Gallery /wp-admin/admin.php?page=rio-photo-gallery3.0226.78
/wp-admin/admin.php?page=individual-create-albums3.0025.39
Gallery Settings /wp-admin/admin.php?page=manage-options2.9926.22

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 37 new files
Database: 4 new tables, 2 new options
New tables
wp_rio_gallery
wp_rio_image
wp_rio_album
wp_rio_settings
New WordPress options
recovery_mode_email_last_sent
jal_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Rio Photo Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲21016.46 ▲0.9811.18 ▲0.8446.90 ▲0.48
Dashboard /wp-admin3,059 ▲1257.11 ▲1.18140.10 ▲1.20105.99 ▼2.50
Posts /wp-admin/edit.php2,828 ▲893.04 ▲0.3572.26 ▲11.1194.74 ▲11.63
Add New Post /wp-admin/post-new.php1,577 ▼10614.42 ▼4.36266.21 ▼115.27116.81 ▲13.67
Media Library /wp-admin/upload.php1,822 ▲125.87 ▲0.83127.37 ▼16.77119.43 ▲1.94
Image Settings /wp-admin/admin.php?page=manage-images9292.0446.2353.49
Manage Albums /wp-admin/admin.php?page=manage-albums1,3252.9577.0553.53
/wp-admin/admin.php?page=individual-albums1,3143.0475.3452.06
Add Albums /wp-admin/admin.php?page=add-albums1,2822.7369.5647.46
/wp-admin/admin.php?page=edit-album1,4632.9873.3454.49
Add Gallery /wp-admin/admin.php?page=add-gallery1,4903.0079.3747.78
Rio Photo Gallery /wp-admin/admin.php?page=rio-photo-gallery1,1602.7165.8146.24
/wp-admin/admin.php?page=individual-create-albums1,2762.7465.5847.92
Gallery Settings /wp-admin/admin.php?page=manage-options1,5792.7863.7644.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

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
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=manage-images
    • > Error in wp-content/plugins/rio-photo-gallery/rio-photo-gallery.php+925
    Uncaught ArgumentCountError: Too few arguments to function rio_rpgs_manage_images(), 1 passed in wp-includes/class-wp-hook.php on line 303 and exactly 3 expected in wp-content/plugins/rio-photo-gallery/rio-photo-gallery.php:925
    Stack trace:
    #0 wp-includes/class-wp-hook.php(303): rio_rpgs_manage_images()
    #1 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(470): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=individual-create-albums
    • > Warning in wp-content/plugins/rio-photo-gallery/rio-album.php+853
    Use of undefined constant RID - assumed 'RID' (this will throw an Error in a future version of PHP)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=individual-create-albums
    • > Notice in wp-content/plugins/rio-photo-gallery/rio-album.php+885
    Undefined index: id
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manage-options
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=individual-albums
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-album
    • > Notice in wp-content/plugins/rio-photo-gallery/rio-album.php+445
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=edit-album
    • > Notice in wp-content/plugins/rio-photo-gallery/rio-album.php+415
    Trying to get property 'album_name' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-album
    • > Notice in wp-content/plugins/rio-photo-gallery/rio-album.php+445
    Trying to get property 'album_thumb' of non-object

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manage-options
    • > Javascript (severe) in unknown
    /wp-content/plugins/rio-photo-gallery/js/dataTables.bootstrap.min.js?ver=5.8.1 4:363 Uncaught TypeError: Cannot read properties of undefined (reading 'defaults')
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-gallery
    • > Network (severe)
    wp-content/plugins/rio-photo-gallery/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-gallery
    • > Network (severe)
    wp-content/plugins/rio-photo-gallery/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=edit-album
    • > Network (severe)
    wp-content/rio_uploads/ - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: rio gallery, photo gallery, wordpress gallery plugin, wordpress photo gallery plugin, rio photo gallery

rio-photo-gallery/rio-photo-gallery.php 92% from 13 tests

The main file in "Rio Photo Gallery" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected6,986 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,959
PHP41201032,367
CSS1021591,169
JavaScript62731491

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.18MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png45.19KB18.43KB▼ 59.20%
assets/screenshot-3.png88.32KB36.04KB▼ 59.19%
assets/screenshot-2.png46.70KB18.13KB▼ 61.17%