88% social-gallery-lite

Code Review | Social Gallery Lite

WordPress plugin Social Gallery Lite scored 88% from 54 tests.

About plugin

  • Plugin page: social-gallery-lite
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 5.9.2
  • First release: Jan 14, 2013
  • Latest release: Aug 3, 2017
  • Number of updates: 85
  • Update frequency: every 19.5 days
  • Top authors: mikemayhem3030 (74.12%)woodyhayday (27.06%)

Code review

54 tests

User reviews

28 reviews

Install metrics

100+ active / 64,119 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼215.84ms] Passed 4 tests

An overview of server-side resources used by Social Gallery Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0263.24 ▲1.04
Dashboard /wp-admin3.43 ▲0.02150.59 ▲116.25
Posts /wp-admin/edit.php3.65 ▲0.01147.84 ▲110.45
Add New Post /wp-admin/post-new.php6.90 ▼0.07212.18 ▼1,091.09
Media Library /wp-admin/upload.php3.30 ▲0.01163.52 ▲138.58
Social Gallery /wp-admin/admin.php?page=sgp-plugin-config3.28135.77
Settings /wp-admin/admin.php?page=sgp-plugin-settings3.28134.49

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 194 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Social Gallery Lite
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,026 ▲28219.45 ▲3.6313.85 ▲6.872.46 ▼0.03
Dashboard /wp-admin3,001 ▲1478.42 ▲2.20200.31 ▲41.08247.32 ▲76.87
Posts /wp-admin/edit.php2,800 ▲1065.76 ▲2.52113.98 ▲51.09212.27 ▲61.61
Add New Post /wp-admin/post-new.php2,061 ▲36324.08 ▲6.87539.18 ▲131.18299.53 ▲135.86
Media Library /wp-admin/upload.php1,806 ▲1117.20 ▲1.70174.67 ▲11.99214.07 ▲13.88
Social Gallery /wp-admin/admin.php?page=sgp-plugin-config1,2276.16128.33163.66
Settings /wp-admin/admin.php?page=sgp-plugin-settings1,2586.24125.44157.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/social-gallery-lite/freemius/templates/ajax-loader.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/social-gallery-lite/lite/loader.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/social-gallery-lite/lite/loader.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (62 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

social-gallery-lite/SocialGalleryLite.php 92% from 13 tests

The entry point to "Social Gallery Lite" version 3.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-gallery-lite.php" instead of "SocialGalleryLite.php")

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 detected24,931 lines of code in 123 files:
LanguageFilesBlank linesComment linesLines of code
PHP814,0479,22417,218
PO File52,0952,1184,740
Sass18299761,875
JavaScript55475839
Markdown1610192
JSON10040
CSS1221427

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,111)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity48.78
▷ Minimum class complexity1.00
▷ Maximum class complexity1,111.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes00.00%
Methods704
▷ Static methods11416.19%
▷ Public methods52774.86%
▷ Protected methods131.85%
▷ Private methods16423.30%
Functions114
▷ Named functions114100.00%
▷ Anonymous functions00.00%
Constants102
▷ Global constants8583.33%
▷ Class constants1716.67%
▷ Public constants17100.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
32 PNG files occupy 0.23MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/social-gallery.png6.90KB3.20KB▼ 53.59%
lite/i/icon-32.png2.04KB1.68KB▼ 17.52%
lite/i/l.png0.22KB0.16KB▼ 27.31%
lite/i/social-gallery.png9.36KB5.05KB▼ 46.06%
themes/classic/r.png0.24KB0.16KB▼ 34.68%