83% gb-gallery-slideshow

Code Review | GB Gallery Slideshow

WordPress plugin GB Gallery Slideshow scored83%from 54 tests.

About plugin

  • Plugin page: gb-gallery-slideshow
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5+
  • WordPress version: 6.3.1
  • First release: Nov 18, 2013
  • Latest release: Sep 7, 2014
  • Number of updates: 37
  • Update frequency: every 8.0 days
  • Top authors: gb-plugins (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /23,027 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 gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▼3.93ms] Passed 4 tests

Analyzing server-side resources used by GB Gallery Slideshow
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2041.89 ▼0.68
Dashboard /wp-admin3.51 ▲0.2047.45 ▲1.14
Posts /wp-admin/edit.php3.62 ▲0.2649.94 ▲2.16
Add New Post /wp-admin/post-new.php6.11 ▲0.2285.23 ▼17.54
Media Library /wp-admin/upload.php3.43 ▲0.2035.87 ▲1.38
ShortCode Generator /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_shortcode.php3.4234.15
GBGallery admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery-admin.php3.3933.35
Add Image /wp-admin/post-new.php?post_type=gb_gallery_post3.5554.33
Group Admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_group-admin.php3.4132.99
Special Effect Admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_effect-admin.php3.4133.84
GB Gallery /wp-admin/edit.php?post_type=gb_gallery_post3.4734.96

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: 1 new table, 8 new options
New tables
wp_gb_gallery_group_post
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
gb_gallery_help
widget_recent-posts
widget_gb_gallery_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for GB Gallery Slideshow
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,037 ▲28013.78 ▼0.604.94 ▲2.6638.15 ▼15.12
Dashboard /wp-admin2,326 ▲1385.89 ▲1.03101.81 ▼5.6577.15 ▲33.01
Posts /wp-admin/edit.php2,207 ▲1212.05 ▲0.0637.60 ▲3.7233.66 ▼0.11
Add New Post /wp-admin/post-new.php1,590 ▲5723.10 ▼0.15766.96 ▲125.8939.04 ▼22.54
Media Library /wp-admin/upload.php1,542 ▲1514.21 ▲0.0299.31 ▲1.6678.62 ▲36.00
ShortCode Generator /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_shortcode.php1,3332.3535.9238.11
GBGallery admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery-admin.php1,0051.7626.6228.28
Add Image /wp-admin/post-new.php?post_type=gb_gallery_post2,4417.84167.00151.26
Group Admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_group-admin.php1,0431.8626.2332.94
Special Effect Admin /wp-admin/admin.php?page=gb-gallery-slideshow/admin/GBgallery_effect-admin.php1,1992.1625.4728.92
GB Gallery /wp-admin/edit.php?post_type=gb_gallery_post1,1872.0037.3428.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_gb_gallery_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/gb-gallery-slideshow/admin/GBgallery_effect-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/gb-gallery-slideshow/admin/GBgallery-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/gb-gallery-slideshow/gbgallery/the_gallery.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gb-gallery-slideshow/GBgallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gb-gallery-slideshow/GBgallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/gb-gallery-slideshow/admin/GBgallery_shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/gb-gallery-slideshow/admin/GBgallery_group-admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
These attributes 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
  • Tested up to: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

gb-gallery-slideshow/GBgallery.php 92% from 13 tests

The main PHP script in "GB Gallery Slideshow" version 1.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gb-gallery-slideshow.php" instead of "GBgallery.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
Success! There were no dangerous files found in this plugin3,945 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP7105571,652
JavaScript51311291,224
CSS233291,069

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity9.25
▷ Minimum method complexity1.00
▷ Maximum method complexity25.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%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/PP.png2.36KB1.21KB▼ 48.47%
images/admin-icon.png2.55KB1.43KB▼ 43.86%
images/Q.png1.56KB0.52KB▼ 66.83%
images/GB_Gallery_icon.png2.31KB1.36KB▼ 41.22%