72% rocket-galleries

Code Review | Rocket Galleries

WordPress plugin Rocket Galleries scored 72% from 54 tests.

About plugin

  • Plugin page: rocket-galleries
  • Plugin version: 0.2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.0
  • WordPress version: 5.8.1
  • First release: Apr 26, 2014
  • Latest release: May 29, 2016
  • Number of updates: 149
  • Update frequency: every 5.1 days
  • Top authors: MatthewRuddy (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active / 5,154 total downloads

Benchmarks

Plugin footprint 83% 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.77MB] [CPU: ▼174.95ms] Passed 4 tests

Analyzing server-side resources used by Rocket Galleries
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.83 ▼0.0125.74 ▲3.29
Dashboard /wp-admin2.88 ▼0.1813.88 ▼24.31
Posts /wp-admin/edit.php2.88 ▼0.2313.62 ▼31.47
Add New Post /wp-admin/post-new.php2.88 ▼2.5615.07 ▼635.27
Media Library /wp-admin/upload.php2.88 ▼0.1214.68 ▼8.75
Add New /wp-admin/admin.php?page=rocketgalleries_add_gallery2.8812.91
Settings /wp-admin/admin.php?page=rocketgalleries_edit_settings2.8817.04
Extensions /wp-admin/admin.php?page=rocketgalleries_extensions2.8814.75
All Galleries /wp-admin/admin.php?page=rocketgalleries_edit_galleries2.8815.28

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 26 new files
Database: 1 new table, 3 new options
New tables
wp_rocketgalleries
New WordPress options
rocketgalleries_disable_welcome_panel
rocketgalleries_version
rocketgalleries_settings

Browser metrics Passed 4 tests

Rocket Galleries: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,771 ▲17015.31 ▲0.248.08 ▲2.4295.29 ▲12.22
Dashboard /wp-admin2,980 ▲846.14 ▼0.02119.44 ▼14.20170.05 ▼4.19
Posts /wp-admin/edit.php2,788 ▲483.24 ▲0.0264.75 ▲0.65133.33 ▼11.59
Add New Post /wp-admin/post-new.php3,771 ▼4518.17 ▼0.67502.89 ▼10.11189.60 ▲5.05
Media Library /wp-admin/upload.php1,800 ▲485.50 ▼0.04156.03 ▲12.99198.37 ▲16.37
Add New /wp-admin/admin.php?page=rocketgalleries_add_gallery1,5244.2173.42117.11
Settings /wp-admin/admin.php?page=rocketgalleries_edit_settings1,5504.2769.67131.35
Extensions /wp-admin/admin.php?page=rocketgalleries_extensions1,3804.2069.90116.84
All Galleries /wp-admin/admin.php?page=rocketgalleries_edit_galleries1,8344.2468.80126.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/rocket-galleries/rocketgalleries.php+1297
    Function create_function() is deprecated

Smoke tests 25% 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)
Almost there, just fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rocketgalleries_edit_galleries
    • > Deprecated in wp-content/plugins/rocket-galleries/rocketgalleries.php+1298
    Function create_function() is deprecated

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/rocket-galleries/backbone/gallery-thumbnail.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 3
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/rocket-galleries/admin/edit-gallery.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rocket-galleries/backbone/gallery-media-sidebar.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rocket-galleries/rocketgalleries.php:93
    • > PHP Notice
      Undefined variable: tab in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rocket-galleries/admin/edit-settings_general.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rocketgalleries_the_gallery_id() in wp-content/plugins/rocket-galleries/templates/rocketgalleries-gallery.php:10
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rocket-galleries/admin/list-galleries.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
Please take inspiration from this readme.txt

rocket-galleries/rocketgalleries.php 85% from 13 tests

"Rocket Galleries" version 0.2.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("rocket-galleries.php" instead of "rocketgalleries.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 176 characters long)

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
There were no executable files found in this plugin2,260 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP167311,0841,701
CSS42936370
JavaScript2110122189

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.31
Average class complexity28.33
▷ Minimum class complexity3.00
▷ Maximum class complexity103.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods86
▷ Static methods1213.95%
▷ Public methods8295.35%
▷ Protected methods00.00%
▷ Private methods44.65%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/delete_icon@2x.png4.48KB2.56KB▼ 42.76%
images/delete_icon.png2.57KB1.46KB▼ 43.29%