84% vistrom-media-library-categories

Code Review | Viström Media Library Categories

WordPress plugin Viström Media Library Categories scored84%from 54 tests.

About plugin

  • Plugin page: vistrom-media-lib...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.0
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: Oct 28, 2022
  • Number of updates: 8
  • Update frequency: every 10.0 days
  • Top authors: vistromdigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /393 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.86ms] Passed 4 tests

This is a short check of server-side resources used by Viström Media Library Categories
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.65 ▼1.24
Dashboard /wp-admin3.34 ▼0.0046.38 ▼14.29
Posts /wp-admin/edit.php3.40 ▲0.0449.98 ▲4.26
Add New Post /wp-admin/post-new.php5.94 ▲0.0684.02 ▼8.18
Media Library /wp-admin/upload.php3.27 ▲0.0438.79 ▲6.21
Categories /wp-admin/edit-tags.php?taxonomy=vistrom_media_category&post_type=attachment3.2835.64

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
vistrom_media_category_children
theysaidso_admin_options
default_term_vistrom_media_category
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Viström Media Library Categories
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲8214.71 ▲0.331.84 ▼0.2343.04 ▼0.18
Dashboard /wp-admin2,256 ▲686.35 ▲1.47125.60 ▲8.7639.69 ▼4.47
Posts /wp-admin/edit.php2,165 ▲763.31 ▲1.2551.69 ▲18.4036.45 ▼0.29
Add New Post /wp-admin/post-new.php1,537 ▲1723.12 ▼0.38626.61 ▼81.4137.22 ▼27.80
Media Library /wp-admin/upload.php1,421 ▲364.20 ▲0.0280.01 ▼28.8043.73 ▼4.13
Categories /wp-admin/edit-tags.php?taxonomy=vistrom_media_category&post_type=attachment1,4393.1640.3331.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • vistrom_media_category_children
    • default_term_vistrom_media_category

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/vistrom-media-library-categories/vistrom-media-library-categories.php:140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vistrom-media-library-categories/includes/VistromMediaAjaxController.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/vistrom-media-library-categories/views/admin/media/bulk-edit-grid.php:4

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 96% from 29 tests

readme.txt Passed 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
5 plugin tags: categories, bulk-edit, library, category, media

vistrom-media-library-categories/vistrom-media-library-categories.php 92% from 13 tests

The principal PHP file in "Viström Media Library Categories" v. 1.1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected32,296 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JSON40031,336
PHP9110168527
JavaScript36916288
PO File1303886
Sass29058
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.00
▷ Minimum class complexity5.00
▷ Maximum class complexity22.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods16
▷ Static methods1168.75%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin