78% su-gallery

Code Review | Su-Gallery

WordPress plugin Su-Gallery scored78%from 54 tests.

About plugin

  • Plugin page: su-gallery
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.2
  • WordPress version: 6.3.1
  • First release: Jan 1, 2018
  • Latest release: Jun 19, 2021
  • Number of updates: 16
  • Update frequency: every 79.1 days
  • Top authors: suryaveersingh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /775 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.45ms] Passed 4 tests

Server-side resources used by Su-Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.63 ▼1.79
Dashboard /wp-admin3.37 ▲0.0645.00 ▼8.62
Posts /wp-admin/edit.php3.42 ▲0.0653.34 ▲5.97
Add New Post /wp-admin/post-new.php5.95 ▲0.0782.81 ▼17.22
Media Library /wp-admin/upload.php3.29 ▲0.0635.58 ▲1.85
All Gallery /wp-admin/edit.php?post_type=su_gallery3.3337.61
Add New /wp-admin/post-new.php?post_type=su_gallery3.3540.09

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Su-Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲20814.90 ▲0.357.02 ▲5.0940.74 ▼2.39
Dashboard /wp-admin2,243 ▲556.01 ▲0.13108.39 ▼7.9237.87 ▼7.81
Posts /wp-admin/edit.php2,132 ▲432.62 ▲0.5851.04 ▲12.3634.15 ▲1.50
Add New Post /wp-admin/post-new.php1,552 ▲2418.59 ▲0.31645.28 ▲45.9434.60 ▼18.05
Media Library /wp-admin/upload.php1,419 ▲285.26 ▲1.06100.69 ▼4.6741.79 ▼4.24
All Gallery /wp-admin/edit.php?post_type=su_gallery1,1152.6641.3327.76
Add New /wp-admin/post-new.php?post_type=su_gallery1,5523.5654.9533.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 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 take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/su-gallery/main.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/su-gallery/shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/su-gallery/meta.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=su_gallery
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=su_gallery 409:2 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: photo gallery, wordpress gallery plugin, gallery

su-gallery/main.php 92% from 13 tests

"Su-Gallery" version 1.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("su-gallery.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected13,851 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33,0792,08613,606
PHP35119225
CSS32720

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin