88% rb-gallery

Code Review | RB Gallery

WordPress plugin RB Gallery scored 88% from 54 tests.

About plugin

  • Plugin page: rb-gallery
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Jun 19, 2014
  • Latest release: Dec 29, 2020
  • Number of updates: 34
  • Update frequency: every 70.2 days
  • Top authors: DrKnown (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,602 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by RB Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0653.19 ▲1.42
Dashboard /wp-admin3.45 ▲0.0434.25 ▲1.44
Posts /wp-admin/edit.php3.67 ▲0.0437.71 ▼0.19
Add New Post /wp-admin/post-new.php6.92 ▼0.0597.33 ▼1,191.96
Media Library /wp-admin/upload.php3.33 ▲0.0325.75 ▲0.92
Add Album /wp-admin/admin.php?page=wprb_gallery_add_album3.3522.92
How to Use /wp-admin/admin.php?page=wprb_gallery_notes3.3323.81
RB Gallery /wp-admin/admin.php?page=wprb-gallery3.3922.79

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: 2 new tables, no new options
New tables
wp_wp_rbgallery_pics
wp_wp_rbgallery_albums

Browser metrics Passed 4 tests

This is an overview of browser requirements for RB Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,970 ▲21616.87 ▲1.2216.61 ▲10.774.16 ▲1.37
Dashboard /wp-admin2,939 ▲816.32 ▲0.10115.53 ▼16.61155.91 ▼5.72
Posts /wp-admin/edit.php2,735 ▲443.24 ▼0.0062.88 ▼0.25143.53 ▼3.11
Add New Post /wp-admin/post-new.php1,748 ▼2421.25 ▲0.13438.02 ▼39.41157.15 ▼3.67
Media Library /wp-admin/upload.php1,746 ▲485.54 ▲0.05143.65 ▲8.72186.94 ▼2.16
Add Album /wp-admin/admin.php?page=wprb_gallery_add_album1,2592.8759.38104.56
How to Use /wp-admin/admin.php?page=wprb_gallery_notes1,2362.7856.63116.80
RB Gallery /wp-admin/admin.php?page=wprb-gallery1,1652.8658.3393.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rb-gallery/public/partials/rb-gallery-public-view.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/rb-gallery/admin/partials/rb-gallery-notes-view.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/rb-gallery/admin/partials/rb-gallery-admin-view.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/rb-gallery/admin/partials/rb-gallery-add-album-view.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
  • Requires at least: Version format is invalid
The official readme.txt might help

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

The main PHP script in "RB Gallery" version 2.0.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected3,081 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript55041271,626
PHP153972891,147
CSS5578308

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods52
▷ Static methods59.62%
▷ Public methods4790.38%
▷ Protected methods00.00%
▷ Private methods59.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/rbgallery_sprite@2x.png6.40KB5.76KB▼ 9.96%
public/css/rbgallery_overlay.png0.98KB0.09KB▼ 90.43%
public/css/rbgallery_sprite.png1.33KB1.42KB0.00%