78% skaut-google-drive-gallery

Code Review | Image and video gallery from Google Drive

WordPress plugin Image and video gallery from Google Drive scored78%from 54 tests.

About plugin

  • Plugin page: skaut-google-driv...
  • Plugin version: 2.13.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-6.3
  • WordPress version: 6.3.1
  • First release: May 16, 2018
  • Latest release: Oct 30, 2023
  • Number of updates: 90
  • Update frequency: every 22.2 days
  • Top authors: skaut (98.89%)marekdedic (2.22%)

Code review

54 tests

User reviews

36 reviews

Install metrics

4,000+ active /105,803 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.20MB] [CPU: ▼1.92ms] Passed 4 tests

A check of server-side resources used by Image and video gallery from Google Drive
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1537.88 ▲0.67
Dashboard /wp-admin3.51 ▲0.2148.12 ▲1.25
Posts /wp-admin/edit.php3.62 ▲0.2751.61 ▲2.84
Add New Post /wp-admin/post-new.php6.10 ▲0.2195.27 ▼12.42
Media Library /wp-admin/upload.php3.44 ▲0.2140.58 ▲6.20
Basic options /wp-admin/admin.php?page=sgdg_basic3.4034.28
Advanced options /wp-admin/admin.php?page=sgdg_advanced3.4034.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 832 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image and video gallery from Google Drive
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.34 ▼0.281.55 ▼0.0838.45 ▼3.32
Dashboard /wp-admin2,225 ▲545.56 ▼0.0394.79 ▲5.5682.37 ▲39.99
Posts /wp-admin/edit.php2,133 ▲332.00 ▼0.0238.53 ▼2.4934.70 ▼2.15
Add New Post /wp-admin/post-new.php6,228 ▲4,70218.94 ▼4.14975.31 ▲354.9669.92 ▲19.95
Media Library /wp-admin/upload.php1,434 ▲344.14 ▼0.0397.09 ▲0.4970.46 ▲27.54
Basic options /wp-admin/admin.php?page=sgdg_basic8762.2023.4531.23
Advanced options /wp-admin/admin.php?page=sgdg_advanced1,0081.7030.0831.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/skaut-google-drive-gallery/skaut-google-drive-gallery.php
    • > /wp-content/plugins/skaut-google-drive-gallery/uninstall.php
  • 431× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Class 'Sgdg\\Vendor\\Google\\Http\\MediaFileUpload' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/google/apiclient/src/aliases.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Sgdg\\Vendor\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp128r2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\phpseclib3\\Crypt\\EC\\Curves\\sect283k1' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk283.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\phpseclib3\\Crypt\\RSA' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\phpseclib3\\Crypt\\Common\\Formats\\Keys\\PKCS8' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php:34
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/skaut-google-drive-gallery/vendor/paragonie/constant_time_encoding/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/skaut-google-drive-gallery/vendor/paragonie/constant_time_encoding/tests/autoload.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sgdg\\Vendor\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/skaut-google-drive-gallery/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

skaut-google-drive-gallery/skaut-google-drive-gallery.php Passed 13 tests

The principal PHP file in "Image and video gallery from Google Drive" v. 2.13.8 is loaded by WordPress automatically on each request
54 characters long description:
A WordPress gallery using Google Drive as file storage

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected104,746 lines of code in 810 files:
LanguageFilesBlank linesComment linesLines of code
PHP7972,30846,230104,726
JavaScript702014
CSS6006

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.90
▷ Minimum class complexity1.00
▷ Maximum class complexity679.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces89
Interfaces40
Traits12
Classes723
▷ Abstract classes21930.29%
▷ Concrete classes50469.71%
▷ Final classes10320.44%
Methods4,276
▷ Static methods81319.01%
▷ Public methods3,35778.51%
▷ Protected methods3818.91%
▷ Private methods53812.58%
Functions301
▷ Named functions10334.22%
▷ Anonymous functions19865.78%
Constants609
▷ Global constants569.20%
▷ Class constants55390.80%
▷ Public constants553100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/icon.png0.69KB0.65KB▼ 6.06%