68% mediapress

Code Review | MediaPress

WordPress plugin MediaPress scored68%from 54 tests.

About plugin

  • Plugin page: mediapress
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2016
  • Latest release: Jul 31, 2023
  • Number of updates: 69
  • Update frequency: every 39.8 days
  • Top authors: sbrajesh (98.55%)raviousprime (2.9%)

Code review

54 tests

User reviews

32 reviews

Install metrics

7,000+ active /151,695 total downloads

Benchmarks

Plugin footprint 65% 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: ▲2.49MB] [CPU: ▲13.69ms] Passed 4 tests

An overview of server-side resources used by MediaPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.75 ▲2.2961.06 ▲13.62
Dashboard /wp-admin5.86 ▲2.5567.43 ▲10.10
Posts /wp-admin/edit.php5.95 ▲2.5977.27 ▲24.93
Add New Post /wp-admin/post-new.php8.47 ▲2.59106.79 ▲8.25
Media Library /wp-admin/upload.php5.78 ▲2.5562.01 ▲22.80
All Galleries /wp-admin/edit.php?post_type=mpp-gallery5.8658.37
Settings /wp-admin/edit.php?post_type=mpp-gallery&page=mpp-settings6.0057.63
Tools /wp-admin/edit.php?post_type=mpp-gallery&page=mpp-tools6.1355.66

Server storage [IO: ▲1.42MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 298 new files
Database: 1 new table, 9 new options
New tables
wp_mpp_logs
New WordPress options
widget_mpp_gallery_list_widget
widget_theysaidso_widget
mpp-settings
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_mpp_media_list_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for MediaPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,115 ▲35414.74 ▲0.3528.69 ▲26.8941.04 ▼6.70
Dashboard /wp-admin2,264 ▲935.58 ▼0.0583.16 ▼6.1987.62 ▲42.20
Posts /wp-admin/edit.php2,170 ▲702.02 ▲0.0036.12 ▼4.2738.39 ▲3.47
Add New Post /wp-admin/post-new.php1,738 ▲19322.29 ▼0.92689.06 ▲0.0857.09 ▼6.70
Media Library /wp-admin/upload.php1,463 ▲664.17 ▼0.12115.28 ▼0.7051.73 ▲3.30
All Galleries /wp-admin/edit.php?post_type=mpp-gallery1,3573.0961.6634.42
Settings /wp-admin/edit.php?post_type=mpp-gallery&page=mpp-settings1,8933.1358.4836.33
Tools /wp-admin/edit.php?post_type=mpp-gallery&page=mpp-tools9242.9565.7336.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 failed, leaving 1 table in the database
    • wp_mpp_logs
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • mpp-settings
    • widget_theysaidso_widget
    • widget_mpp_gallery_list_widget
    • can_compress_scripts
    • widget_mpp_media_list_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mpp-gallery&page=mpp-tools
    • > Notice in wp-content/plugins/mediapress/admin/tools/debug/mpp-debug-output.php+148
    Array to string conversion

SRP 50% 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
Please take a closer look at the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_media() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/lightbox/doc.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_media() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/lightbox/video.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mediapress/core/common/mpp-cron.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_gallery() in wp-content/plugins/mediapress/templates/mediapress/default/sitewide/home.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mediapress/admin/tools/class-mpp-media-debugger.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_media() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/doc.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_media() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/lightbox/audio.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_media_permalink() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/lightbox/photo.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_media_id() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/lightbox/media-edit-form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpp_get_current_media() in wp-content/plugins/mediapress/templates/mediapress/default/gallery/media/views/oembed.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add a description for screenshot #10 in mediapress/assets to your readme.txt
You can look at the official readme.txt

mediapress/mediapress.php Passed 13 tests

The main PHP script in "MediaPress" version 1.5.7 is automatically included on every request by WordPress
123 characters long description:
MediaPress is the most powerful media plugin for BuddyPress . It allows uploading images(photos), videos, audios, documents

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 detected26,787 lines of code in 251 files:
LanguageFilesBlank linesComment linesLines of code
PHP2367,78912,93520,991
CSS43332702,244
JavaScript76415202,028
PO File15507691,467
Markdown318057

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity16.75
▷ Minimum class complexity1.00
▷ Maximum class complexity163.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes76
▷ Abstract classes45.26%
▷ Concrete classes7294.74%
▷ Final classes00.00%
Methods644
▷ Static methods365.59%
▷ Public methods50878.88%
▷ Protected methods507.76%
▷ Private methods8613.35%
Functions709
▷ Named functions70899.86%
▷ Anonymous functions10.14%
Constants57
▷ Global constants11.75%
▷ Class constants5698.25%
▷ Public constants56100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
12 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/mediapress/default/assets/images/photo-thumbnail.png6.12KB5.96KB▼ 2.62%
templates/mediapress/default/assets/images/video-thumbnail.png5.25KB5.05KB▼ 3.94%
templates/mediapress/default/assets/images/media-button-doc.png0.40KB0.40KB0.00%
assets/images/delete.png0.79KB0.97KB0.00%
templates/mediapress/default/assets/images/media-button-video.png0.35KB0.36KB0.00%