88% s-gallery

Code Review | S gallery

WordPress plugin S gallery scored 88% from 53 tests.

About plugin

  • Plugin page: s-gallery
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 5.8.1
  • First release: Nov 10, 2014
  • Latest release: Nov 10, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: Robiulawal40 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,029 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼259.22ms] Passed 4 tests

Server-side resources used by S gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1734.75 ▲14.22
Dashboard /wp-admin3.13 ▲0.0745.08 ▲8.90
Posts /wp-admin/edit.php3.18 ▲0.0739.97 ▼6.85
Add New Post /wp-admin/post-new.php5.49 ▲0.0694.48 ▼1,033.90
Media Library /wp-admin/upload.php3.07 ▲0.0633.69 ▼5.04
Gallery settings /wp-admin/edit.php?post_type=simple_gallery&page=my-custom-submenu-page3.0127.74
Add New Image /wp-admin/post-new.php?post_type=simple_gallery3.1947.19
Simple Gallery /wp-admin/edit.php?post_type=simple_gallery3.1135.24

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for S gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲23316.64 ▲1.1412.95 ▲4.9345.45 ▼3.19
Dashboard /wp-admin3,004 ▲1516.02 ▲0.20143.06 ▲10.6199.98 ▼8.11
Posts /wp-admin/edit.php2,748 ▲452.70 ▲0.0163.83 ▼8.5588.19 ▼3.09
Add New Post /wp-admin/post-new.php2,064 ▲2819.01 ▲0.01360.40 ▲5.32105.77 ▼6.37
Media Library /wp-admin/upload.php1,814 ▲425.03 ▲0.01146.17 ▼11.58113.52 ▼12.44
Gallery settings /wp-admin/edit.php?post_type=simple_gallery&page=my-custom-submenu-page1,1502.0955.9683.96
Add New Image /wp-admin/post-new.php?post_type=simple_gallery3,1479.06206.13126.27
Simple Gallery /wp-admin/edit.php?post_type=simple_gallery1,4312.6162.0560.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

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/edit.php?post_type=simple_gallery&page=my-custom-submenu-page
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=simple_gallery&page=my-custom-submenu-page
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=simple_gallery&page=my-custom-submenu-page
    • > Notice in wp-content/plugins/s-gallery/r-options.php+76
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/s-gallery/r-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/s-gallery/index.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/s-gallery/shortcode.php:67

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

s-gallery/index.php 92% from 13 tests

The primary PHP file in "S gallery" version 1.1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("s-gallery.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected514 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP48262303
CSS260156
JavaScript1181055

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods360.00%
▷ Protected methods00.00%
▷ Private methods240.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/close.png0.24KB0.25KB0.00%
css/arrow-right.png0.21KB0.32KB0.00%
css/arrow-left.png0.23KB0.32KB0.00%