78% simple-responsive-image-gallery

Code Review | Simple Image Gallery

WordPress plugin Simple Image Gallery scored 78% from 54 tests.

About plugin

  • Plugin page: simple-responsive...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 5.8.1
  • First release: Feb 18, 2015
  • Latest release: May 2, 2015
  • Number of updates: 10
  • Update frequency: every 7.7 days
  • Top authors: duogeek (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 6,137 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼152.96ms] Passed 4 tests

Server-side resources used by Simple Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.1921.09 ▼14.81
Dashboard /wp-admin3.22 ▲0.1629.24 ▼10.89
Posts /wp-admin/edit.php3.28 ▲0.1733.34 ▼7.79
Add New Post /wp-admin/post-new.php5.35 ▼0.0976.72 ▼576.34
Media Library /wp-admin/upload.php3.25 ▲0.2425.11 ▼9.80
Gallery Settings /wp-admin/admin.php?page=duogallery-settings3.2124.87
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses3.2127.06
Add New Gallery /wp-admin/post-new.php?post_type=gallery3.3339.74
Help /wp-admin/admin.php?page=duogeek-panel-help3.2132.67
DuoGeek /wp-admin/admin.php?page=duogeek-panel3.2128.53
All Galleries /wp-admin/edit.php?post_type=gallery3.2630.18

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 173 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for Simple Image Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,129 ▲53318.29 ▲2.6615.75 ▲5.3248.39 ▲0.19
Dashboard /wp-admin3,280 ▲3498.38 ▲2.45163.38 ▲21.22111.25 ▲0.75
Posts /wp-admin/edit.php3,081 ▲3424.46 ▲1.7686.14 ▲16.9886.98 ▼9.42
Add New Post /wp-admin/post-new.php2,347 ▲73224.99 ▲3.12355.40 ▲80.42101.63 ▼0.83
Media Library /wp-admin/upload.php1,923 ▲1134.97 ▼0.07116.37 ▼35.15115.44 ▼6.93
Gallery Settings /wp-admin/admin.php?page=duogallery-settings2,2298.82167.55130.05
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses1,3563.8174.1059.04
Add New Gallery /wp-admin/post-new.php?post_type=gallery2,3664.84106.3594.51
Help /wp-admin/admin.php?page=duogeek-panel-help1,4814.0575.7485.57
DuoGeek /wp-admin/admin.php?page=duogeek-panel1,0562.2735.4071.19
All Galleries /wp-admin/edit.php?post_type=gallery1,7724.3585.7576.18

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 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gallery
    • > Notice in wp-content/plugins/simple-responsive-image-gallery/duogeek/duogeek-panel.php+147
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Error in wp-content/plugins/simple-responsive-image-gallery/duogeek/duogeek-panel.php+413
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/simple-responsive-image-gallery/duogeek/duogeek-panel.php:413
    Stack trace:
    #0 wp-includes/class-wp-hook.php(303): DuoGeekPlugins->duogeek_panel_cb()
    #1 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(470): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% 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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/simple-responsive-image-gallery/duogeek/helper.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/simple-responsive-image-gallery/duogeek/duogeek-panel.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/simple-responsive-image-gallery/simple-image-gallery.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/simple-responsive-image-gallery/duogeek/class.customPostType.php:3

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: photo, awesome, easy, beautiful, wordpress...

simple-responsive-image-gallery/simple-image-gallery.php 92% from 13 tests

"Simple Image Gallery" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-responsive-image-gallery.php" instead of "simple-image-gallery.php")

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
No dangerous file extensions were detected17,721 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
CSS588623039,849
JavaScript97311,0353,379
Sass1326241,352
LESS1326331,343
PHP4270621,232
SVG200566

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity40.00
▷ Minimum class complexity3.00
▷ Maximum class complexity59.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods3788.10%
▷ Protected methods511.90%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
67 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
duogeek/inc/icheck/skins/flat/flat.png1.48KB1.66KB0.00%
duogeek/inc/icheck/skins/futurico/futurico.png1.69KB1.61KB▼ 5.07%
duogeek/inc/icheck/skins/minimal/green@2x.png1.38KB2.66KB0.00%
duogeek/inc/icheck/skins/square/orange.png2.13KB1.83KB▼ 14.26%
duogeek/inc/icheck/skins/line/line.png0.57KB0.79KB0.00%