10% reflex-gallery

Code Review | ReFlex Gallery » WordPress Photo Gallery

WordPress plugin ReFlex Gallery » WordPress Photo Gallery scored 10% from 54 tests.

About plugin

  • Plugin page: reflex-gallery
  • Plugin version: 3.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Sep 25, 2012
  • Latest release: Mar 10, 2021
  • Number of updates: 102
  • Update frequency: every 30.3 days
  • Top authors: hahncgdev (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 64,920 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/reflex-gallery/lib/install-db.php+40
    Uncaught Error: Using $this when not in object context in wp-content/plugins/reflex-gallery/lib/install-db.php:40
    Stack trace:
    #0 wp-content/plugins/reflex-gallery/reflex-gallery.php(67): install_db()
    #1 wp-includes/class-wp-hook.php(310): ReFlex_Gallery->create_db_tables()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.08ms] Passed 4 tests

This is a short check of server-side resources used by ReFlex Gallery » WordPress Photo Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.42 ▼7.09
Dashboard /wp-admin3.31 ▲0.0045.51 ▼1.60
Posts /wp-admin/edit.php3.36 ▲0.0048.52 ▲3.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.30 ▲1.79
Media Library /wp-admin/upload.php3.23 ▲0.0034.08 ▼1.42

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 108 new files
Database: 2 new tables, 7 new options
New tables
wp_reflex_gallery
wp_reflex_gallery_images
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
reflex_gallery_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for ReFlex Gallery » WordPress Photo Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.20 ▼1.184.39 ▲2.2039.63 ▼12.36
Dashboard /wp-admin2,209 ▲245.92 ▲0.02105.52 ▼0.8640.58 ▼0.41
Posts /wp-admin/edit.php2,092 ▲31.97 ▼0.0442.34 ▲0.5036.97 ▲2.10
Add New Post /wp-admin/post-new.php1,544 ▲2418.29 ▼5.04641.98 ▼46.5247.38 ▼8.17
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.0498.39 ▼5.3743.74 ▼2.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_reflex_gallery
    • wp_reflex_gallery_images
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • reflex_gallery_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
Please fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/reflex-gallery/admin/add-images.php
    • > /wp-content/plugins/reflex-gallery/admin/overview.php
    • > /wp-content/plugins/reflex-gallery/admin/add-gallery.php
    • > /wp-content/plugins/reflex-gallery/admin/edit-gallery.php
    • > /wp-content/plugins/reflex-gallery/admin/ws.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/reflex-gallery/reflex-gallery.php:19
    • > WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for query SELECT Id, name FROM

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 24 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (Represent an entire gallery as a thumbnail - grouped like albums), #2 (PrettyPhoto style pop-up for image gallery), #3 (Dynamically switch to slider for mobile devices (480 pixels or less)), #4 (Gallery Overview admin panel - easily maintain multiple galleries), #5 (Add galleries to group images into), #6 (Add images by first selecting which gallery to add image into), #7 (Add images (multiple image upload is a pro feature))
The official readme.txt is a good inspiration

reflex-gallery/reflex-gallery.php Passed 13 tests

The main PHP file in "ReFlex Gallery » WordPress Photo Gallery" ver. 3.1.7 adds more information about the plugin and also serves as the entry point for this plugin
79 characters long description:
Wordpress Plugin for creating responsive image galleries. By: HahnCreativeGroup

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,342 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript124743352,239
PHP9100311,054
CSS611845572
PO File3211358458
SVG10019

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.33
▷ Minimum class complexity3.00
▷ Maximum class complexity17.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods39
▷ Static methods12.56%
▷ Public methods3897.44%
▷ Protected methods00.00%
▷ Private methods12.56%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
34 PNG files occupy 0.25MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
scripts/images/prettyPhoto/facebook/contentPatternLeft.png0.13KB0.10KB▼ 24.82%
scripts/images/prettyPhoto/dark_rounded/sprite.png3.98KB2.56KB▼ 35.79%
scripts/images/prettyPhoto/facebook/btnPrevious.png0.81KB0.58KB▼ 27.90%
scripts/images/prettyPhoto/facebook/btnNext.png0.83KB0.57KB▼ 30.77%
scripts/images/prettyPhoto/facebook/contentPatternBottom.png0.14KB0.11KB▼ 21.13%