83% media-categories-2

Code Review | Media Categories

WordPress plugin Media Categories scored83%from 54 tests.

About plugin

  • Plugin page: media-categories-2
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5
  • WordPress version: 6.3.1
  • First release: Jan 16, 2012
  • Latest release: Dec 19, 2012
  • Number of updates: 22
  • Update frequency: every 15.3 days
  • Top authors: eddiemoya (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active /28,889 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.22MB] [CPU: ▼15.42ms] Passed 4 tests

An overview of server-side resources used by Media Categories
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.86 ▼0.77
Dashboard /wp-admin3.36 ▲0.0645.68 ▼3.78
Posts /wp-admin/edit.php3.42 ▲0.0643.88 ▼6.70
Add New Post /wp-admin/post-new.php4.89 ▼1.0056.51 ▼44.74
Media Library /wp-admin/upload.php3.20 ▼0.0327.21 ▼6.47
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=attachment3.2838.68

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Media Categories
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7214.45 ▼0.171.98 ▼0.0842.61 ▼6.69
Dashboard /wp-admin2,207 ▲225.81 ▲0.92105.88 ▲3.1043.12 ▲1.00
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0135.30 ▼4.9931.84 ▼3.39
Add New Post /wp-admin/post-new.php1,524 ▲723.62 ▲5.91632.11 ▲27.0952.26 ▲8.28
Media Library /wp-admin/upload.php1,399 ▲114.30 ▲0.1199.14 ▼6.2743.28 ▼2.81
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=attachment1,4472.1428.5732.99

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 does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • category_children
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/media-categories-2/attachment-walker-category-checklist-class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-categories-2/media-categories.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (This plugin will include clean, simple to use, searchable categories to your Media Editor page.), #2 (Use categories in much the same way you use them on your posts and pages.), #3 (Filter categories as you type, very useful if you have a lot of categories to look through (thanks to Jason Corradino's "Searchable Categories" plugin))
  • Tags: You are using too many tags: 23 tag instead of maximum 10
The official readme.txt might help

media-categories-2/media-categories.php 85% from 13 tests

"Media Categories" version 1.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("media-categories-2.php" instead of "media-categories.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 149 characters long)

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 detected468 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP29187294
JavaScript24242110
CSS29464

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity23.50
▷ Minimum class complexity4.00
▷ Maximum class complexity43.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png33.41KB9.41KB▼ 71.83%
screenshot-1.png112.80KB37.65KB▼ 66.62%
screenshot-2.png18.61KB6.27KB▼ 66.30%