78% polaroid-gallery

Code Review | Polaroid Gallery

WordPress plugin Polaroid Gallery scored 78% from 54 tests.

About plugin

  • Plugin page: polaroid-gallery
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.7
  • WordPress version: 6.3.1
  • First release: Mar 22, 2010
  • Latest release: Jan 26, 2017
  • Number of updates: 57
  • Update frequency: every 43.9 days
  • Top authors: janisto (78.95%)tashemi (22.81%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 81,020 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲1.87ms] Passed 4 tests

This is a short check of server-side resources used by Polaroid Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2848.83 ▲10.98
Dashboard /wp-admin3.41 ▲0.1146.60 ▼4.96
Posts /wp-admin/edit.php3.46 ▲0.1048.46 ▲0.09
Add New Post /wp-admin/post-new.php5.99 ▲0.1096.42 ▲7.67
Media Library /wp-admin/upload.php3.33 ▲0.1037.16 ▲4.68
Polaroid Gallery /wp-admin/options-general.php?page=polaroid_gallery_options3.2732.28

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Polaroid Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17613.65 ▼0.7312.24 ▲10.0842.22 ▲0.23
Dashboard /wp-admin2,207 ▲195.83 ▼0.0593.99 ▼9.6842.20 ▼1.17
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0139.22 ▲4.0933.90 ▲1.65
Add New Post /wp-admin/post-new.php1,538 ▲523.23 ▼0.05651.09 ▲13.6855.12 ▲5.67
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.0294.75 ▼4.1643.59 ▲0.15
Polaroid Gallery /wp-admin/options-general.php?page=polaroid_gallery_options1,0891.7026.1929.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=polaroid_gallery_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=polaroid_gallery_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/polaroid-gallery/polaroid_gallery.php:50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots do not have images: #1 (Choose between Medium, Large or Full size images for fullscreen overlay and configure rest of the options as desired.), #2 (Change your thumbnail size and optionally use Regenerate Thumbnails plugin to regenerate all thumbnails.), #3 (Click "Add an Image" in post or page and upload your pictures.), #4 (Edit title and caption for the images and then click "Save all changes".), #5 (Choose your order and Gallery columns and then click "Insert gallery".), #6 (Edit page.), #7 (Post page.), #8 (Fullscreen image.)
You can take inspiration from this readme.txt

polaroid-gallery/polaroid_gallery.php 92% from 13 tests

"Polaroid Gallery" version 2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("polaroid-gallery.php" instead of "polaroid_gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,281 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP3205686986
SVG100526
CSS75033485
JavaScript519104200
PO File1365084

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity122.00
▷ Minimum class complexity122.00
▷ Maximum class complexity122.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods33
▷ Static methods927.27%
▷ Public methods3193.94%
▷ Protected methods26.06%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
26 compressed PNG files occupy 0.31MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png19.55KB19.72KB0.00%
screenshot-6.png26.25KB26.54KB0.00%
images/fancybox/fancy_shadow_w.png0.10KB0.18KB0.00%
images/fancybox/fancy_nav_right.png1.42KB1.66KB0.00%
images/fancybox/fancy_shadow_ne.png0.34KB0.48KB0.00%