66% media-category-library

Code Review | Media Category Library

WordPress plugin Media Category Library scored66%from 54 tests.

About plugin

  • Plugin page: media-category-li...
  • Plugin version: 2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2012
  • Latest release: May 22, 2020
  • Number of updates: 47
  • Update frequency: every 59.4 days
  • Top authors: timmcdaniels (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

800+ active /24,942 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼7.08ms] Passed 4 tests

Analyzing server-side resources used by Media Category Library
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1839.58 ▲2.42
Dashboard /wp-admin3.49 ▲0.1448.29 ▼10.29
Posts /wp-admin/edit.php3.61 ▲0.2549.36 ▲1.52
Add New Post /wp-admin/post-new.php6.09 ▲0.2087.82 ▼21.96
Media Library /wp-admin/upload.php3.41 ▲0.1837.88 ▲4.22
Media Category Library /wp-admin/options-general.php?page=mediacatlib-settings3.3832.32
Media Categories /wp-admin/edit-tags.php?taxonomy=media-category&post_type=attachment3.4039.06
Media Category Library /wp-admin/upload.php?page=mediacatlib-library3.3634.39

Server storage [IO: ▲0.68MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Media Category Library
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲5213.09 ▼1.161.81 ▲0.1140.48 ▼0.61
Dashboard /wp-admin2,222 ▲425.66 ▲0.1483.04 ▼5.1034.64 ▼2.08
Posts /wp-admin/edit.php2,127 ▲242.05 ▲0.0834.93 ▼3.7735.18 ▼1.42
Add New Post /wp-admin/post-new.php1,548 ▲2022.77 ▼0.22588.78 ▼14.1553.69 ▼2.07
Media Library /wp-admin/upload.php1,427 ▲334.26 ▲0.1099.84 ▲1.8844.15 ▲1.55
Media Category Library /wp-admin/options-general.php?page=mediacatlib-settings9232.0324.6525.87
Media Categories /wp-admin/edit-tags.php?taxonomy=media-category&post_type=attachment1,3232.1732.0334.08
Media Category Library /wp-admin/upload.php?page=mediacatlib-library8652.0927.2827.09

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

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

Smoke tests 0% 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/options-general.php?page=mediacatlib-settings
    • > Notice in wp-content/plugins/media-category-library/classes/media-category-library.php+943
    Undefined index: include_css
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Notice in wp-content/plugins/media-category-library/classes/media-category-library.php+626
    Undefined variable: total_pages
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Notice in wp-content/plugins/media-category-library/classes/media-category-library.php+626
    Undefined variable: results
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Notice in wp-content/plugins/media-category-library/classes/media-category-library.php+626
    Undefined variable: row
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Notice in wp-content/plugins/media-category-library/classes/media-category-library.php+626
    Trying to access array offset on value of type null

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/media-category-library/views/shortcode.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/media-category-library/views/search.php:1
    • > PHP Notice
      Undefined variable: frontend in wp-content/plugins/media-category-library/views/list.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/media-category-library/views/admin_settings_form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/media-category-library/views/list.php:11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/media-category-library/views/shortcode.php on line 11
    • > PHP Notice
      Undefined index: mediacat_document_id in wp-content/plugins/media-category-library/views/list.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/media-category-library/views/shortcode.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/media-category-library/js/media-category-library.js?ver=2.7:2:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/upload.php?page=mediacatlib-library
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (This is a screenshot of the Media Category settings page.), #2 (This is a screenshot of the Edit Media page with a Media Category checkboxes.), #3 (This is a screenshot of the backend Media Category Library page.), #4 (This is a screenshot of the Media Category Taxonomy page.), #5 (This is a screenshot of the frontend search form.)
Please take inspiration from this readme.txt

media-category-library/media-category-library.php 92% from 13 tests

The main PHP file in "Media Category Library" ver. 2.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.0.0")

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
There were no executable files found in this plugin1,313 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP6162400887
PO File281179198
CSS200136
JavaScript40092

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity128.00
▷ Minimum class complexity128.00
▷ Maximum class complexity128.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods54100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.61MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png65.14KB18.88KB▼ 71.02%
screenshot-4.png206.75KB69.90KB▼ 66.19%
screenshot-3.png96.62KB36.09KB▼ 62.65%
screenshot-2.png234.96KB78.85KB▼ 66.44%
screenshot-1.png19.11KB9.02KB▼ 52.81%