83% media-category

Code Review | WordPress Media Category

WordPress plugin WordPress Media Category scored83%from 54 tests.

About plugin

  • Plugin page: media-category
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.0
  • WordPress version: 6.3.1
  • First release: Jan 10, 2017
  • Latest release: Jul 25, 2023
  • Number of updates: 7
  • Update frequency: every 340.6 days
  • Top authors: wbcomdesigns (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /2,735 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▲2.94ms] Passed 4 tests

A check of server-side resources used by WordPress Media Category
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.30 ▲4.62
Dashboard /wp-admin3.52 ▲0.2258.48 ▲7.35
Posts /wp-admin/edit.php3.58 ▲0.2360.06 ▲8.52
Add New Post /wp-admin/post-new.php6.04 ▲0.1598.04 ▼2.40
Media Library /wp-admin/upload.php3.36 ▲0.1439.03 ▲2.20
Media Category /wp-admin/edit-tags.php?taxonomy=media_category&post_type=attachment3.3942.61

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Media Category
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲19714.76 ▲0.562.03 ▲0.1544.73 ▲3.65
Dashboard /wp-admin2,349 ▲1586.44 ▲1.55135.27 ▲34.2242.99 ▲0.29
Posts /wp-admin/edit.php2,258 ▲1693.50 ▲1.4856.39 ▲16.3036.20 ▼2.37
Add New Post /wp-admin/post-new.php1,524 ▲1023.31 ▲5.78657.79 ▼41.0335.99 ▼23.69
Media Library /wp-admin/upload.php1,402 ▲144.14 ▼0.0783.75 ▼29.2744.79 ▼1.63
Media Category /wp-admin/edit-tags.php?taxonomy=media_category&post_type=attachment1,4283.0842.3628.92

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/media-category/admin/class-admin-review.php:311

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (The screenshot shows the edit media admin panel, showing the listed categories and corresponds to screenshot-1.(png|jpg|jpeg|gif).), #2 (The screenshot shows the media list with assigned category and corresponds to screenshot-2.(png|jpg|jpeg|gif).), #3 (The screenshot shows the media list with assigned category showing where the shortcode is executing and corresponds to screenshot-3.(png|jpg|jpeg|gif).)
The official readme.txt might help

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

The main PHP script in "WordPress Media Category" version 1.4.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("media-category.php" instead of "wp-media-category.php")

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
Everything looks great! No dangerous files found in this plugin11,447 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JSON2009,670
JavaScript618543908
PHP11179632620
CSS4303193
PO File2111256

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods3585.37%
▷ Protected methods00.00%
▷ Private methods614.63%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 1.60MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png682.57KB249.70KB▼ 63.42%
public/resource/transparent.png0.11KB0.09KB▼ 13.64%
screenshot-3.png166.87KB50.82KB▼ 69.55%
public/resource/opacity.png0.11KB0.09KB▼ 12.84%
public/resource/close.png0.27KB0.29KB0.00%