78% snvk-media-gallery

Code Review | Snvk Gallery Metabox

WordPress plugin Snvk Gallery Metabox scored78%from 54 tests.

About plugin

  • Plugin page: snvk-media-gallery
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.8+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8
  • WordPress version: 6.3.1
  • First release: Aug 24, 2021
  • Latest release: Aug 24, 2021
  • Number of updates: 22
  • Update frequency: N/A
  • Top authors: sushilsankwal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /335 total downloads

Benchmarks

Plugin footprint 83% from 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.66MB] [CPU: ▼19.48ms] Passed 4 tests

Analyzing server-side resources used by Snvk Gallery Metabox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0237.69 ▼3.37
Dashboard /wp-admin3.38 ▲0.0349.79 ▼3.01
Posts /wp-admin/edit.php3.43 ▲0.0350.91 ▼2.36
Add New Post /wp-admin/post-new.php3.22 ▼2.7036.12 ▼69.19
Media Library /wp-admin/upload.php3.30 ▲0.0336.60 ▼1.00
Snvk Media Gallery /wp-admin/admin.php?page=snv-media-gallery3.2632.89
Setting /wp-admin/admin.php?page=snv-media-setting3.2433.96

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Snvk Gallery Metabox
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5214.34 ▼0.191.68 ▼0.2341.61 ▼3.97
Dashboard /wp-admin2,207 ▲305.56 ▼0.0486.11 ▼9.4177.61 ▲33.34
Posts /wp-admin/edit.php2,124 ▲212.00 ▲0.0433.66 ▼10.3631.78 ▼5.36
Add New Post /wp-admin/post-new.php6,256 ▲4,73026.05 ▲2.531,011.98 ▲368.4158.06 ▲8.54
Media Library /wp-admin/upload.php1,424 ▲274.08 ▼0.32100.15 ▼7.1478.28 ▲31.10
Snvk Media Gallery /wp-admin/admin.php?page=snv-media-gallery8672.2925.5027.76
Setting /wp-admin/admin.php?page=snv-media-setting1,0142.0022.0928.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=snv-media-setting
    • > Notice in wp-content/plugins/snvk-media-gallery/snvk-media-gallery.php+68
    Undefined variable: return

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
Please fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_stylesheet_directory_uri() in wp-content/plugins/snvk-media-gallery/config.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_stylesheet_directory_uri() in wp-content/plugins/snvk-media-gallery/config.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/snvk-media-gallery/snvk-media-meta.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/snvk-media-gallery/snvk-media-setting.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: Please take inspiration from this readme.txt

snvk-media-gallery/snvk-media-gallery.php Passed 13 tests

The main file in "Snvk Gallery Metabox" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
84 characters long description:
Media Video gallery metabox for pages , custom post type with drag and drop feature.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin279 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP48326173
CSS111070
JavaScript114536

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/snvk-gallery.png1.08KB0.94KB▼ 12.41%