10% social-photo-gallery

Code Review | Social Photo Gallery

WordPress plugin Social Photo Gallery scored10%from 54 tests.

About plugin

  • Plugin page: social-photo-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2015
  • Latest release: Dec 7, 2016
  • Number of updates: 9
  • Update frequency: every 115.1 days
  • Top authors: iwcontribution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,474 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+708
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.70MB] [CPU: ▼53.54ms] Passed 4 tests

Server-side resources used by Social Photo Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.33 ▼1.187.70 ▼31.01
Dashboard /wp-admin2.35 ▼1.007.47 ▼43.89
Posts /wp-admin/edit.php2.35 ▼1.0510.12 ▼47.35
Add New Post /wp-admin/post-new.php2.35 ▼3.587.80 ▼91.92
Media Library /wp-admin/upload.php2.35 ▼0.928.71 ▼26.19
Gallery Settings /wp-admin/admin.php?page=gallery-settings2.359.06
Add Album /wp-admin/admin.php?page=add-album2.359.07
Add Images /wp-admin/admin.php?page=add-imgae2.357.25
Show Album /wp-admin/admin.php?page=social-photo-gallery2.357.96

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

Filesystem and database footprint
These are issues you should consider
  • There were 1 file (1.51KB) illegally modified outside of "wp-content/plugins/social-photo-gallery/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/single-gallery.php
Filesystem: 82 new files
Database: 2 new tables, 8 new options
New tables
spg_album
spg_albumimages
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
album_path
widget_recent-comments
root_album_name
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Social Photo Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,055 ▲29414.47 ▼0.1726.54 ▲24.4950.25 ▲5.97
Dashboard /wp-admin2,244 ▲645.73 ▲0.0890.96 ▲2.9545.19 ▼0.55
Posts /wp-admin/edit.php2,146 ▲462.23 ▲0.2638.08 ▼1.5339.67 ▲2.96
Add New Post /wp-admin/post-new.php1,564 ▲2923.02 ▲4.96644.37 ▲25.2058.66 ▼18.04
Media Library /wp-admin/upload.php1,449 ▲494.29 ▲0.1297.73 ▼10.9743.75 ▼7.55
Gallery Settings /wp-admin/admin.php?page=gallery-settings9781.8123.4027.02
Add Album /wp-admin/admin.php?page=add-album9021.9126.2532.52
Add Images /wp-admin/admin.php?page=add-imgae9061.9325.0527.80
Show Album /wp-admin/admin.php?page=social-photo-gallery8471.8824.6925.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+708
    Trying to access array offset on value of type bool
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • spg_albumimages
    • spg_album
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-photo-gallery
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+708
    Trying to access array offset on value of type bool
  • 40 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-photo-gallery
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-album
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+425
    Undefined variable: album
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+645
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=add-album
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+424
    Trying to get property 'album_title' of non-object
    • > GET request to /wp-admin/admin.php?page=add-album
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+425
    Trying to get property 'album_description' of non-object
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+447
    Undefined index: album_id
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+690
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+690
    Trying to get property 'folder_name' of non-object
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+602
    Undefined index: upload
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+645
    Undefined variable: image
    • > GET request to /wp-admin/admin.php?page=add-imgae
    • > Notice in wp-content/plugins/social-photo-gallery/socialphotogallery.php+645
    Trying to get property 'image_caption' of non-object

SRP 50% 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× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/social-photo-gallery/single-gallery.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/social-photo-gallery/socialphotogallery.php:14

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: album, woocommerce, gallery, plugin, photo gallery...

social-photo-gallery/socialphotogallery.php 92% from 13 tests

The primary PHP file in "Social Photo Gallery" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-photo-gallery.php" instead of "socialphotogallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin3,002 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP37329881
JavaScript47637760
CSS59893633
HTML11210488
SVG100240

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
30 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/dark_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
images/prettyPhoto/default/sprite_next.png1.33KB0.39KB▼ 70.69%
images/prettyPhoto/facebook/btnPrevious.png0.81KB0.58KB▼ 27.90%
images/prettyPhoto/light_rounded/sprite.png4.00KB2.56KB▼ 36.16%
images/prettyPhoto/dark_square/btnNext.png1.38KB1.14KB▼ 17.29%