87% simplicity-gallery

Code Review | Simplicity - WordPress gallery plugin

WordPress plugin Simplicity - WordPress gallery plugin scored 87% from 54 tests.

About plugin

  • Plugin page: simplicity-gallery
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7.1
  • WordPress version: 5.8.1
  • First release: Nov 21, 2013
  • Latest release: Aug 5, 2014
  • Number of updates: 13
  • Update frequency: every 19.8 days
  • Top authors: saiman_thefreeart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,605 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 gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼150.77ms] Passed 4 tests

This is a short check of server-side resources used by Simplicity - WordPress gallery plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2233.39 ▲8.91
Dashboard /wp-admin3.45 ▲0.3945.64 ▼1.94
Posts /wp-admin/edit.php3.50 ▲0.3946.56 ▲0.96
Add New Post /wp-admin/post-new.php4.97 ▼0.4657.46 ▼603.04
Media Library /wp-admin/upload.php3.33 ▲0.3333.12 ▲0.96

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 144 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Simplicity - WordPress gallery plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.97 ▲0.3110.67 ▲1.2547.11 ▼3.13
Dashboard /wp-admin2,992 ▲586.08 ▲0.12136.90 ▼6.32109.95 ▼8.05
Posts /wp-admin/edit.php2,739 ▼02.84 ▲0.1370.21 ▲3.5590.83 ▲2.22
Add New Post /wp-admin/post-new.php1,750 ▲25018.53 ▼0.02360.98 ▼12.90108.78 ▲1.14
Media Library /wp-admin/upload.php1,804 ▼35.02 ▼0.03151.65 ▲4.31121.17 ▼0.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simplicity-gallery/UberGallery/resources/templates/colorboxScripts.php
    • > /wp-content/plugins/simplicity-gallery/UberGallery/index.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined index: cache_dir in wp-content/plugins/simplicity-gallery/UberGallery/resources/UberGallery.php on line 148
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-naked/index.php on line 9
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-orange/index.php on line 9
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-blue/index.php on line 9
    • > PHP Notice
      Undefined index: cache_dir in wp-content/plugins/simplicity-gallery/UberGallery/resources/UberGallery.php on line 149
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-orange/index.php on line 8
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-responsive/index.php on line 7
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-responsive/index.php on line 9
    • > PHP Warning
      Use of undefined constant THEMEPATH - assumed 'THEMEPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplicity-gallery/UberGallery/resources/themes/uber-naked/index.php on line 6
    • > PHP Notice
      Undefined index: cache_dir in wp-content/plugins/simplicity-gallery/UberGallery/resources/UberGallery.php on line 140

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === simplicity-gallery === )
The official readme.txt is a good inspiration

simplicity-gallery/simplicity.php 85% from 13 tests

The entry point to "Simplicity - WordPress gallery plugin" version 1.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("simplicity-gallery.php" instead of "simplicity.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)

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
No dangerous file extensions were detected4,660 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP317051,2632,447
CSS251952291,168
PO File6142186460
JavaScript1561125432
Markdown1580127
INI2281626

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.43
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods106
▷ Static methods6460.38%
▷ Public methods9286.79%
▷ Protected methods00.00%
▷ Private methods1413.21%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1292.31%
▷ Class constants17.69%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
47 compressed PNG files occupy 0.83MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
meta-boxes/img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
meta-boxes/img/jqueryui/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
UberGallery/resources/colorbox/1/images/ie6/borderTopRight.png0.21KB0.20KB▼ 2.34%
meta-boxes/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
UberGallery/resources/colorbox/5/images/controls.png1.99KB2.04KB0.00%