84% 2j-photo-gallery

Code Review | Photo Gallery by 2J

WordPress plugin Photo Gallery by 2J scored84%from 54 tests.

About plugin

  • Plugin page: 2j-photo-gallery
  • Plugin version: 1.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Apr 21, 2017
  • Latest release: Mar 7, 2018
  • Number of updates: 38
  • Update frequency: every 9.3 days
  • Top authors: 2jgallery (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /2,317 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.31ms] Passed 4 tests

Server-side resources used by Photo Gallery by 2J
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.12 ▼1.47
Dashboard /wp-admin3.35 ▲0.0449.24 ▼5.63
Posts /wp-admin/edit.php3.40 ▲0.0458.85 ▲5.92
Add New Post /wp-admin/post-new.php5.93 ▲0.04100.22 ▲0.84
Media Library /wp-admin/upload.php3.27 ▲0.0438.52 ▲1.03
2J Photo Gallery /wp-admin/options-general.php?page=photo_gallery_2j_settings3.2333.47

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 8 new options
New WordPress options
widget_photo_gallery_2j_widget
db_upgraded
widget_theysaidso_widget
can_compress_scripts
twoj_photo_gallery_BeforeActivator
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Photo Gallery by 2J
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▼0.131.85 ▼0.0843.32 ▼2.45
Dashboard /wp-admin2,199 ▲195.62 ▼0.0590.25 ▼6.8344.00 ▲1.47
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0739.49 ▲0.9435.51 ▼1.32
Add New Post /wp-admin/post-new.php1,537 ▲1118.22 ▼4.81606.37 ▼24.9967.71 ▲9.54
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.07103.50 ▲2.0943.42 ▼5.74
2J Photo Gallery /wp-admin/options-general.php?page=photo_gallery_2j_settings8102.0425.3526.25

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 does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_photo_gallery_2j_widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=photo_gallery_2j_settings
    • > Notice in wp-content/plugins/2j-photo-gallery/includes/options.php+41
    Undefined index: active

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Photo gallery 2J - An example of plugin in action - [Grid Gallery Type]), #2 (Photo gallery - An example of plugin in action - [Grid Gallery Type]), #3 (An example of plugin in action - (LightBox Gallery Version)), #4 (An example of plugin in action - (LightBox Gallery Version)), #5 (An example of plugin in action - (Thumbnails Video Version)), #10 (An example of plugin in action - (Thumbnails Video Version))
You can take inspiration from this readme.txt

2j-photo-gallery/2j-photo-gallery.php Passed 13 tests

The main PHP file in "Photo Gallery by 2J" ver. 1.0.12 adds more information about the plugin and also serves as the entry point for this plugin
128 characters long description:
Photo gallery with light style design. Simple config and interface settings of the photo gallery. Classic and grid photo layout.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin13,516 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
CSS71,2051910,197
JavaScript59294613,141
PHP44835177
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods233.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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 2.07MB with 1.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png7.08KB4.33KB▼ 38.83%
screenshot-4.png31.39KB9.15KB▼ 70.86%
screenshot-1.png6.21KB4.10KB▼ 33.93%
screenshot-5.png1,063.18KB246.50KB▼ 76.82%
screenshot-6.png1,004.99KB231.62KB▼ 76.95%