77% responsive-photo-gallery-lightbox

Code Review | Responsive Photo Gallery & Lightbox

WordPress plugin Responsive Photo Gallery & Lightbox scored 77% from 54 tests.

About plugin

  • Plugin page: responsive-photo-...
  • Plugin version: 0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 2, 2021
  • Latest release: Jul 5, 2021
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: wpmwa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 443 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: ▼3.54ms] Passed 4 tests

Server-side resources used by Responsive Photo Gallery & Lightbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.81 ▼0.25
Dashboard /wp-admin3.34 ▲0.0445.65 ▲0.43
Posts /wp-admin/edit.php3.46 ▲0.1046.74 ▼0.21
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.78 ▼14.10
Media Library /wp-admin/upload.php3.27 ▲0.0433.94 ▲0.40
Add New Gallery /wp-admin/post-new.php?post_type=mwarglplug3.4849.60
All Galleries /wp-admin/admin.php?page=mwa_rgl_plug3.2331.01

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 90 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Responsive Photo Gallery & Lightbox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲13114.07 ▼0.774.82 ▲3.1841.66 ▲0.22
Dashboard /wp-admin2,250 ▲475.86 ▲0.0399.23 ▲4.2262.98 ▲21.14
Posts /wp-admin/edit.php2,130 ▲382.03 ▼0.0234.74 ▼4.3432.54 ▼2.44
Add New Post /wp-admin/post-new.php1,552 ▲3223.19 ▼0.18711.07 ▲53.8453.57 ▲1.80
Media Library /wp-admin/upload.php1,432 ▲474.12 ▼0.1196.00 ▼8.2077.24 ▲29.75
Add New Gallery /wp-admin/post-new.php?post_type=mwarglplug3,5106.16165.66164.71
All Galleries /wp-admin/admin.php?page=mwa_rgl_plug1,7672.7636.3334.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Good news, no errors were detected

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/responsive-photo-gallery-lightbox/responsive-gallery-lightbox.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/responsive-photo-gallery-lightbox/admin/inc/rgl_preview_gallery_html.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 80% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

responsive-photo-gallery-lightbox/responsive-gallery-lightbox.php 62% from 13 tests

The principal PHP file in "Responsive Photo Gallery & Lightbox" v. 0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.2" instead of "7.2")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.9" instead of "5.2")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: The principal plugin file should be the same as the plugin slug ("responsive-photo-gallery-lightbox.php" instead of "responsive-gallery-lightbox.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 145 characters long)

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 detected38,720 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
CSS171,57910914,770
SVG7631511,355
JavaScript132,5621,97510,899
PHP17170951,433
PO File1115117263

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity3.91
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods37
▷ Static methods2670.27%
▷ Public methods3594.59%
▷ Protected methods00.00%
▷ Private methods25.41%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 1.88MB with 0.77MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/g2.png1,425.71KB362.36KB▼ 74.58%
assets/css/nav-icon.png1.48KB1.35KB▼ 8.59%
assets/images/g1.PNG196.72KB41.21KB▼ 79.05%
assets/images/Close-icon-new.png13.20KB9.46KB▼ 28.33%
assets/images/respgallogo.png1.09KB0.94KB▼ 13.92%