78% inpost-gallery

Code Review | InPost Gallery

WordPress plugin InPost Gallery scored78%from 54 tests.

About plugin

  • Plugin page: inpost-gallery
  • Plugin version: 2.1.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 24, 2012
  • Latest release: Aug 23, 2023
  • Number of updates: 419
  • Update frequency: every 9.9 days
  • Top authors: RealMag777 (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /62,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼2.88ms] Passed 4 tests

Server-side resources used by InPost Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1741.84 ▲2.30
Dashboard /wp-admin3.47 ▲0.1746.28 ▼3.47
Posts /wp-admin/edit.php3.59 ▲0.2349.23 ▲4.25
Add New Post /wp-admin/post-new.php6.07 ▲0.1984.89 ▼12.88
Media Library /wp-admin/upload.php3.40 ▲0.1736.49 ▲2.52
InPost Gallery /wp-admin/options-general.php?page=inpost-gallery-settings3.3731.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 209 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

InPost Gallery: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲21913.79 ▼0.595.41 ▲3.5643.80 ▼3.09
Dashboard /wp-admin2,261 ▲735.20 ▼0.70111.86 ▲10.6139.04 ▼0.31
Posts /wp-admin/edit.php2,169 ▲802.29 ▲0.2844.54 ▲5.1236.02 ▲2.86
Add New Post /wp-admin/post-new.php6,278 ▲4,74519.43 ▼3.78947.35 ▲333.5648.25 ▼10.86
Media Library /wp-admin/upload.php1,453 ▲684.64 ▲0.38110.15 ▲14.4742.92 ▲1.06
InPost Gallery /wp-admin/options-general.php?page=inpost-gallery-settings1,0232.3030.1728.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: custom_css
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: customize_changeset
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: oembed_cache
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: user_request
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: wp_block
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: wp_template
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: wp_template_part
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: wp_global_styles
    • > GET request to /wp-admin/options-general.php?page=inpost-gallery-settings
    • > Notice in wp-content/plugins/inpost-gallery/views/admin/settings.php+20
    Undefined index: wp_navigation

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 17× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/inpost-gallery/views/admin/meta_slide_item.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/popups/inpost_pixedelic_camera.php
    • > /wp-content/plugins/inpost-gallery/index.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/popups/inpost_nivo.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/popups/inpost_gallery.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/popups/inpost_galleria.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/inpost_fancy.php
    • > /wp-content/plugins/inpost-gallery/views/admin/settings.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/popups/inpost_fancy.php
    • > /wp-content/plugins/inpost-gallery/views/shortcodes/inpost_pixedelic_camera.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

inpost-gallery/index.php 92% from 13 tests

The main PHP file in "InPost Gallery" ver. 2.1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("inpost-gallery.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin22,290 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript662,6661,54613,868
CSS163382623,895
PHP187781653,395
SVG111910
HTML2153222

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity67.00
▷ Minimum class complexity35.00
▷ Maximum class complexity99.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods3386.84%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
81 PNG files occupy 0.31MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/update.png1.54KB1.38KB▼ 10.34%
images/edit.png0.92KB1.14KB0.00%
js/sliders/nivo/themes/dark/bullets.png3.07KB0.42KB▼ 86.27%
js/sliders/fancybox/fancy_shadow_nw.png0.32KB0.47KB0.00%
js/sliders/galleria/themes/fullscreen/west-mini.png0.61KB0.34KB▼ 43.79%