77% media-library-assistant

Code Review | Media Library Assistant

WordPress plugin Media Library Assistant scored77%from 54 tests.

About plugin

  • Plugin page: media-library-ass...
  • Plugin version: 3.13
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 13, 2012
  • Latest release: Nov 13, 2023
  • Number of updates: 723
  • Update frequency: every 5.7 days
  • Top authors: dglingren (100%)

Code review

54 tests

User reviews

189 reviews

Install metrics

70,000+ active /1,814,215 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.64MB] [CPU: ▲30.01ms] Passed 4 tests

Analyzing server-side resources used by Media Library Assistant
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.57 ▲1.1047.01 ▲4.93
Dashboard /wp-admin7.71 ▲4.3681.96 ▲16.89
Posts /wp-admin/edit.php7.76 ▲4.4091.53 ▲47.74
Add New Post /wp-admin/post-new.php10.79 ▲4.89147.18 ▲50.75
Media Library /wp-admin/upload.php7.93 ▲4.7080.47 ▲50.47
Media Library Assistant /wp-admin/options-general.php?page=mla-settings-menu-general7.8079.86
Assistant /wp-admin/upload.php?page=mla-menu8.2786.68
Att. Tag /wp-admin/edit-tags.php?taxonomy=attachment_tag&post_type=attachment7.6365.91
Att. Category /wp-admin/edit-tags.php?taxonomy=attachment_category&post_type=attachment7.6377.01

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 451 new files
Database: no new tables, 12 new options
New WordPress options
mla_post_mime_types
widget_recent-comments
mla_upload_mimes
db_upgraded
can_compress_scripts
widget_recent-posts
mla_iptc_exif_mapping
mla_current_version
mla_custom_field_mapping
widget_mla-text-widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Media Library Assistant
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲5914.23 ▲0.301.77 ▲0.0540.54 ▼3.44
Dashboard /wp-admin2,211 ▲375.62 ▼0.0292.42 ▼5.6736.32 ▼6.41
Posts /wp-admin/edit.php2,116 ▲131.94 ▼0.0039.08 ▼0.2737.13 ▼0.09
Add New Post /wp-admin/post-new.php1,686 ▲16023.24 ▲0.33681.05 ▲35.0540.23 ▼16.11
Media Library /wp-admin/upload.php1,937 ▲5404.49 ▲0.35108.09 ▲7.0957.55 ▲11.79
Media Library Assistant /wp-admin/options-general.php?page=mla-settings-menu-general2,6001.6629.4452.16
Assistant /wp-admin/upload.php?page=mla-menu3,7962.0149.0732.21
Att. Tag /wp-admin/edit-tags.php?taxonomy=attachment_tag&post_type=attachment1,2642.1229.3930.87
Att. Category /wp-admin/edit-tags.php?taxonomy=attachment_category&post_type=attachment1,2922.1226.0428.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_mla-text-widget
    • mla_post_mime_types
    • mla_upload_mimes
    • mla_current_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • mla_custom_field_mapping
    • mla_iptc_exif_mapping
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/media-library-assistant/includes/mla-stream-image.php
    • > /wp-content/plugins/media-library-assistant/examples/plugins/smart-media-categories/public/views/public.php
    • > /wp-content/plugins/media-library-assistant/examples/plugins/smart-media-categories/admin/views/smc-sync-tag-block.php
    • > /wp-content/plugins/media-library-assistant/examples/plugins/smart-media-categories/admin/views/smc-sync-tag-fieldset.php
    • > /wp-content/plugins/media-library-assistant/examples/plugins/smart-media-categories/admin/views/smc-sync-category-fieldset.php
  • 158× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/meta-boxes.php' (include_path='.:/usr/share/php') in wp-content/plugins/media-library-assistant/includes/class-mla-main.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/woofixit.php:3772
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/mla-hierarchical-mapping-example.php:257
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/mla-subscriber-media-access-example.php:189
    • > PHP Fatal error
      Uncaught Error: Class 'MLACore' not found in wp-content/plugins/media-library-assistant/includes/class-mla-ajax.php:566
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/mla-current-user-example.php:188
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-library-assistant/includes/class-mla-main.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/media-library-assistant/examples/plugins/smart-media-categories/admin/views/smc-sync-category-block.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/mla-custom-nolink-example.php:109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-assistant/examples/plugins/mla-bulk-edit-remap-example.php:148

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: categories, gallery, images, tags, media...

media-library-assistant/index.php 85% from 13 tests

The main PHP file in "Media Library Assistant" ver. 3.13 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("media-library-assistant.php" instead of "index.php")

Code Analysis 97% from 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 detected86,531 lines of code in 236 files:
LanguageFilesBlank linesComment linesLines of code
PHP17114,56840,98363,694
PO File43,8391,98810,599
JavaScript321,1248714,604
Smarty2176,1824,469
CSS266704333,119
XML10046

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 289)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity46.70
▷ Minimum class complexity1.00
▷ Maximum class complexity926.00
Average method complexity6.31
▷ Minimum method complexity1.00
▷ Maximum method complexity289.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes286
▷ Abstract classes00.00%
▷ Concrete classes286100.00%
▷ Final classes00.00%
Methods2,460
▷ Static methods1,63066.26%
▷ Public methods1,92178.09%
▷ Protected methods301.22%
▷ Private methods50920.69%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants257
▷ Global constants103.89%
▷ Class constants24796.11%
▷ Public constants247100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
112 PNG files occupy 0.64MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/crystal/image.png7.06KB2.52KB▼ 64.34%
images/crystal/mime_cdr.png5.57KB2.27KB▼ 59.27%
images/crystal/postscript.png6.20KB2.58KB▼ 58.39%
images/crystal/knotes.png5.88KB3.02KB▼ 48.57%
images/crystal/metafont.png6.36KB2.55KB▼ 59.93%