62% rocket-galleries

Code Review | Rocket Galleries

WordPress plugin Rocket Galleries scored62%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: 6.3.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

20+ active /5,465 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.95MB] [CPU: ▼39.67ms] Passed 4 tests

Analyzing server-side resources used by Rocket Galleries
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.01 ▼0.4516.91 ▼28.31
Dashboard /wp-admin3.06 ▼0.2418.92 ▼26.54
Posts /wp-admin/edit.php3.06 ▼0.2921.54 ▼28.39
Add New Post /wp-admin/post-new.php3.06 ▼2.8318.37 ▼75.44
Media Library /wp-admin/upload.php3.06 ▼0.1717.62 ▼20.07
All Galleries /wp-admin/admin.php?page=rocketgalleries_edit_galleries3.0618.65
Add New /wp-admin/admin.php?page=rocketgalleries_add_gallery3.0617.83
Settings /wp-admin/admin.php?page=rocketgalleries_edit_settings3.0619.73
Extensions /wp-admin/admin.php?page=rocketgalleries_extensions3.0615.80

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, 9 new options
New tables
wp_rocketgalleries
New WordPress options
rocketgalleries_settings
rocketgalleries_disable_welcome_panel
rocketgalleries_version
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Rocket Galleries: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲7213.68 ▼0.511.88 ▼0.0946.76 ▲9.10
Dashboard /wp-admin2,247 ▲565.91 ▲0.8295.93 ▼6.7340.00 ▼2.93
Posts /wp-admin/edit.php2,130 ▲412.02 ▼0.0040.53 ▼2.3036.00 ▼1.62
Add New Post /wp-admin/post-new.php1,586 ▲5317.63 ▼5.66672.34 ▼6.4953.20 ▼3.45
Media Library /wp-admin/upload.php1,429 ▲414.19 ▼0.0292.05 ▼6.0041.49 ▼2.65
All Galleries /wp-admin/admin.php?page=rocketgalleries_edit_galleries1,3233.0544.9128.98
Add New /wp-admin/admin.php?page=rocketgalleries_add_gallery1,1383.1241.7527.15
Settings /wp-admin/admin.php?page=rocketgalleries_edit_settings1,1343.1739.0228.52
Extensions /wp-admin/admin.php?page=rocketgalleries_extensions1,0233.0437.6624.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/rocket-galleries/rocketgalleries.php+1297
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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_extensions
    • > Deprecated in wp-content/plugins/rocket-galleries/rocketgalleries.php+1298
    Function create_function() is deprecated

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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/rocket-galleries/backbone/gallery-thumbnail.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > 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 rocketgalleries_the_gallery_id() in wp-content/plugins/rocket-galleries/templates/rocketgalleries-gallery.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rocket-galleries/admin/list-galleries.php:10
    • > 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 esc_attr() in wp-content/plugins/rocket-galleries/admin/edit-gallery.php:2
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rocket-galleries/admin/list-extensions.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/rocket-galleries/admin/edit-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/rocket-galleries/admin/edit-settings.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rocket-galleries/admin/welcome-panel.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
Please take inspiration from this readme.txt

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

This is the main PHP file of "Rocket Galleries" version 0.2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("rocket-galleries.php" instead of "rocketgalleries.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected2,260 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP167311,0841,701
CSS42936370
JavaScript2110122189

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
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.png2.57KB1.46KB▼ 43.29%
images/delete_icon@2x.png4.48KB2.56KB▼ 42.76%