77% simple-post-gallery

Code Review | Post Gallery

WordPress plugin Post Gallery scored77%from 54 tests.

About plugin

  • Plugin page: simple-post-gallery
  • Plugin version: 2.3.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.4
  • WordPress version: 6.3.1
  • First release: Apr 28, 2016
  • Latest release: Jun 28, 2020
  • Number of updates: 78
  • Update frequency: every 19.5 days
  • Top authors: 10quality (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active /44,338 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.59MB] [CPU: ▲1.28ms] Passed 4 tests

This is a short check of server-side resources used by Post Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5648.81 ▲7.53
Dashboard /wp-admin3.88 ▲0.5352.79 ▼12.99
Posts /wp-admin/edit.php3.99 ▲0.6455.26 ▲9.15
Add New Post /wp-admin/post-new.php6.62 ▲0.73104.90 ▲1.44
Media Library /wp-admin/upload.php3.86 ▲0.6346.06 ▲11.10
Galleries /wp-admin/options-general.php?page=post-gallery-settings3.9340.69

Server storage [IO: ▲2.39MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • There were 2 files (0.06KB) illegally modified outside of "wp-content/plugins/simple-post-gallery/" and "wp-content/uploads/"
    • (new file) wp-content/wpmvc/cache/pcom/.htaccess
    • (new file) wp-content/wpmvc/log/.empty
Filesystem: 464 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Post Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.48 ▲0.342.18 ▲0.4542.73 ▼2.18
Dashboard /wp-admin2,228 ▲285.88 ▲1.0198.00 ▼12.7939.51 ▼2.72
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0240.52 ▲3.6436.80 ▲3.71
Add New Post /wp-admin/post-new.php6,199 ▲4,65918.89 ▲0.77896.36 ▲251.4556.13 ▼0.72
Media Library /wp-admin/upload.php1,407 ▲134.23 ▼0.0698.24 ▼8.9240.45 ▼8.20
Galleries /wp-admin/options-general.php?page=post-gallery-settings2,6041.9428.3357.80

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/simple-post-gallery/assets/views/plugins/post-gallery/gallery-script.php
    • > /wp-content/plugins/simple-post-gallery/assets/views/plugins/post-gallery/gallery.php
  • 311× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Protocol\\Text\\Handler\\ResponseHandlerInterface' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Protocol/Text/Handler/BulkResponse.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Command\\CommandInterface' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/PrefixableCommandInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/TransactionMulti.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WPMVC\\MVC\\Controller' not found in wp-content/plugins/simple-post-gallery/app/Controllers/NoticeController.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/ServerSlaveOf.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/simple-post-gallery/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Connection\\AggregateConnectionInterface' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Connection/Aggregate/ReplicationInterface.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/KeyTimeToLive.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/KeyMove.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/simple-post-gallery/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/SetCardinality.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Post Gallery === )
You can take inspiration from this readme.txt

simple-post-gallery/plugin.php 85% from 13 tests

The principal PHP file in "Post Gallery" v. 2.3.12 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.4" instead of "5.6")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-post-gallery.php" instead of "plugin.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected21,874 lines of code in 431 files:
LanguageFilesBlank linesComment linesLines of code
PHP3893,54512,52316,219
SVG10883,558
Markdown1047201,189
JSON810706
JavaScript466695
XML50071
INI16624
CSS401212

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity5.90
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces39
Interfaces41
Traits13
Classes300
▷ Abstract classes237.67%
▷ Concrete classes27792.33%
▷ Final classes10.36%
Methods1,430
▷ Static methods775.38%
▷ Public methods1,17882.38%
▷ Protected methods19413.57%
▷ Private methods584.06%
Functions44
▷ Named functions1738.64%
▷ Anonymous functions2761.36%
Constants38
▷ Global constants410.53%
▷ Class constants3489.47%
▷ Public constants34100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/10quality-logo-x50.png4.13KB2.39KB▼ 42.05%
assets/img/icons.png0.71KB0.43KB▼ 39.64%