83% wp-media-pro

Code Review | WP Media Pro

WordPress plugin WP Media Pro scored83%from 54 tests.

About plugin

  • Plugin page: wp-media-pro
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 6.3.1
  • First release: Jul 10, 2020
  • Latest release: Jan 28, 2021
  • Number of updates: 8
  • Update frequency: every 25.3 days
  • Top authors: tlovett1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /667 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 gracefully, with no errors

Server metrics [RAM: ▲0.38MB] [CPU: ▼2.04ms] Passed 4 tests

A check of server-side resources used by WP Media Pro
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3539.54 ▼0.98
Dashboard /wp-admin3.74 ▲0.4453.02 ▲6.17
Posts /wp-admin/edit.php3.80 ▲0.4552.99 ▲5.53
Add New Post /wp-admin/post-new.php6.24 ▲0.3686.53 ▼18.15
Media Library /wp-admin/upload.php3.59 ▲0.3641.05 ▲5.46
Media Tags /wp-admin/edit-tags.php?taxonomy=wpmp-media-tag&post_type=attachment3.6141.74
WP Media Pro /wp-admin/options-general.php?page=wp-media-pro3.5940.35

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

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

Browser metrics Passed 4 tests

WP Media Pro: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,095 ▲36024.46 ▲10.081.88 ▲0.0639.49 ▼7.51
Dashboard /wp-admin2,480 ▲30012.98 ▲8.03340.08 ▲231.1848.86 ▲6.51
Posts /wp-admin/edit.php2,423 ▲33412.47 ▲10.41127.60 ▲88.2238.91 ▲3.30
Add New Post /wp-admin/post-new.php1,700 ▲18623.45 ▲5.68448.30 ▼141.6626.09 ▼44.64
Media Library /wp-admin/upload.php1,584 ▲19614.27 ▲10.08153.98 ▲50.6543.15 ▼1.36
Media Tags /wp-admin/edit-tags.php?taxonomy=wpmp-media-tag&post_type=attachment1,56912.37119.3731.72
WP Media Pro /wp-admin/options-general.php?page=wp-media-pro1,21212.19107.4825.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WPMP\\Module' not found in wp-content/plugins/wp-media-pro/inc/classes/Modules/SingleView/SingleView.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WPMP\\Module' not found in wp-content/plugins/wp-media-pro/inc/classes/Modules/Credits/Credits.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WPMP\\Module' not found in wp-content/plugins/wp-media-pro/inc/classes/Modules/Taxonomies/Taxonomies.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WPMP\\Module' not found in wp-content/plugins/wp-media-pro/inc/classes/Modules/Folders/Folders.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WPMP\\Module' not found in wp-content/plugins/wp-media-pro/inc/classes/Modules/Edit/Edit.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: image folders, media organization, image tags, images, media categories...

wp-media-pro/plugin.php 77% from 13 tests

This is the main PHP file of "WP Media Pro" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-media-pro.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin17,074 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
JSON40013,966
JavaScript232791961,474
PHP103043201,255
CSS15660338
SVG80225
Markdown17011
XML1105

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity32.00
▷ Minimum class complexity3.00
▷ Maximum class complexity115.00
Average method complexity5.65
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods40
▷ Static methods12.50%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/img/img-icon.png0.91KB0.90KB0.22%
assets/img/img-icon.png2.72KB0.90KB▼ 66.74%