73% wp-media-category-management

Code Review | WP Media Category Management

WordPress plugin WP Media Category Management scored73%from 54 tests.

About plugin

  • Plugin page: wp-media-category...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2014
  • Latest release: Nov 16, 2023
  • Number of updates: 104
  • Update frequency: every 31.9 days
  • Top authors: DeBAAT (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

9,000+ active /188,567 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲5.56MB] [CPU: ▲27.98ms] 75% from 4 tests

This is a short check of server-side resources used by WP Media Category Management
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.56MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7963.34 ▲22.65
Dashboard /wp-admin9.27 ▲5.9680.18 ▲33.54
Posts /wp-admin/edit.php9.27 ▲5.9187.39 ▲44.37
Add New Post /wp-admin/post-new.php10.46 ▲4.57112.64 ▲15.14
Media Library /wp-admin/upload.php9.27 ▲6.0472.79 ▲40.59
WP MCM /wp-admin/options-general.php?page=wp-mcm9.2768.36
MCM Categories /wp-admin/edit-tags.php?taxonomy=category_media&post_type=attachment9.2764.91
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius9.2767.34

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 268 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
widget_recent-posts
fs_debug_mode
fs_active_plugins
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
fs_accounts
widget_recent-comments
wp-media-category-management-options

Browser metrics Passed 4 tests

A check of browser resources used by WP Media Category Management
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11014.55 ▼0.191.72 ▼0.0530.11 ▼17.18
Dashboard /wp-admin2,275 ▲1016.10 ▲0.56120.41 ▲18.4448.42 ▲1.78
Posts /wp-admin/edit.php2,202 ▲993.17 ▲1.1650.05 ▲14.8240.99 ▲2.63
Add New Post /wp-admin/post-new.php1,558 ▲3222.94 ▼0.39699.63 ▲73.8339.03 ▼12.67
Media Library /wp-admin/upload.php1,460 ▲604.19 ▼0.0096.77 ▼18.5148.06 ▲3.67
WP MCM /wp-admin/options-general.php?page=wp-mcm1,0702.9241.27103.28
MCM Categories /wp-admin/edit-tags.php?taxonomy=category_media&post_type=attachment1,3833.1339.4635.11
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,1702.8839.1626.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wp-media-category-management/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • wp-media-category-management-options
    • widget_theysaidso_widget
    • fs_debug_mode
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • fs_accounts
    • theysaidso_admin_options
    • fs_active_plugins
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_mcm_maybe_define_constant() in wp-content/plugins/wp-media-category-management/include/class-WP_MCM_Plugin.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'DebugMyPluginPanel' not found in wp-content/plugins/wp-media-category-management/include/class.dmppanels.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-media-category-management/include/media/wp-mcm-content-media.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-media-category-management === )
  • Tags: Please delete some tags, you are using 26 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-media-category-management/wp-media-category-management.php Passed 13 tests

"WP Media Category Management" version 2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
88 characters long description:
A plugin to provide bulk category management functionality for media in WordPress sites.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin39,327 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1408,65619,21836,831
PO File67101,4911,747
CSS155332369
JavaScript96284349
XML13016
SVG10015

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity74.79
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes67
▷ Abstract classes22.99%
▷ Concrete classes6597.01%
▷ Final classes00.00%
Methods1,444
▷ Static methods19913.78%
▷ Public methods1,05372.92%
▷ Protected methods181.25%
▷ Private methods37325.83%
Functions115
▷ Named functions115100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 1.70MB with 0.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-9.png35.49KB17.81KB▼ 49.82%
screenshot-3.png78.22KB33.34KB▼ 57.37%
screenshot-5.png76.90KB31.23KB▼ 59.39%
assets/icon-wp-mcm-18.png0.51KB0.48KB▼ 6.08%
freemius/assets/img/wp-media-category-management.png16.35KB6.75KB▼ 58.69%