84% image-gallery

Code Review | ImagePress - Image Gallery

WordPress plugin ImagePress - Image Gallery scored84%from 54 tests.

About plugin

  • Plugin page: image-gallery
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 11, 2011
  • Latest release: Oct 26, 2023
  • Number of updates: 35
  • Update frequency: every 133.5 days
  • Top authors: butterflymedia (65.71%)Jbudone (37.14%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /18,302 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.42MB] [CPU: ▼0.47ms] Passed 4 tests

An overview of server-side resources used by ImagePress - Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4240.10 ▲1.78
Dashboard /wp-admin3.70 ▲0.3947.37 ▼1.71
Posts /wp-admin/edit.php3.82 ▲0.4650.28 ▲2.32
Add New Post /wp-admin/post-new.php6.39 ▲0.5084.07 ▼4.29
Media Library /wp-admin/upload.php3.63 ▲0.3939.24 ▲2.57
Image Categories /wp-admin/edit-tags.php?taxonomy=imagepress_image_category&post_type=image3.6236.20
ImagePress Settings /wp-admin/edit.php?post_type=image&page=imagepress_admin_page3.5932.02
All images /wp-admin/edit.php?post_type=image3.6738.24
Add new /wp-admin/post-new.php?post_type=image6.3879.45

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

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

Browser metrics Passed 4 tests

ImagePress - Image Gallery: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲20715.37 ▲0.8015.37 ▲13.1539.53 ▼6.97
Dashboard /wp-admin2,234 ▲545.56 ▼0.1087.49 ▼6.6240.80 ▼3.11
Posts /wp-admin/edit.php2,142 ▲391.99 ▲0.0135.82 ▼1.9535.85 ▼0.86
Add New Post /wp-admin/post-new.php1,561 ▲3523.04 ▼0.09670.20 ▲26.0153.14 ▼0.18
Media Library /wp-admin/upload.php1,436 ▲364.20 ▼0.0994.35 ▼6.8442.55 ▲0.44
Image Categories /wp-admin/edit-tags.php?taxonomy=imagepress_image_category&post_type=image1,3132.1229.4728.73
ImagePress Settings /wp-admin/edit.php?post_type=image&page=imagepress_admin_page9902.0023.8052.76
All images /wp-admin/edit.php?post_type=image1,1731.9729.2927.88
Add new /wp-admin/post-new.php?post_type=image6,24322.83904.2333.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • imagepress
    • widget_img_gallery

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/image-gallery/includes/imagepress-install.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-gallery/includes/functions.php:203
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/image-gallery/includes/alpha-functions.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (A view of the Image Gallery in action), #2 (A view of the Image Gallery in action)
Please take inspiration from this readme.txt

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

The main PHP script in "ImagePress - Image Gallery" version 1.0.8 is automatically included on every request by WordPress
64 characters long description:
A simple WordPress image gallery plugin with a crossfade effect.

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
There were no executable files found in this plugin5,609 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript49071062,392
PHP74182771,665
CSS6215451,121
Sass2275260
LESS1135150
SVG11013
Ruby1208

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png18.48KB8.01KB▼ 56.67%
screenshot-1.png22.84KB9.37KB▼ 58.95%