72% media-modal

Code Review | Media Modal

WordPress plugin Media Modal scored72%from 54 tests.

About plugin

  • Plugin page: media-modal
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 12, 2015
  • Latest release: Feb 2, 2015
  • Number of updates: 13
  • Update frequency: every 1.8 days
  • Top authors: cmabugay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,159 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.64ms] Passed 4 tests

An overview of server-side resources used by Media Modal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0641.09 ▼4.12
Dashboard /wp-admin3.37 ▲0.0751.15 ▼3.41
Posts /wp-admin/edit.php3.42 ▲0.0749.88 ▼6.46
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.78 ▼12.56
Media Library /wp-admin/upload.php3.29 ▲0.0637.90 ▲2.30
Media Modal /wp-admin/options-general.php?page=mediamodal-options3.2433.77

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Media Modal
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14613.46 ▼0.899.43 ▲7.7340.07 ▼3.54
Dashboard /wp-admin2,200 ▲205.65 ▲0.0289.77 ▼1.0740.99 ▼4.20
Posts /wp-admin/edit.php2,108 ▲111.99 ▼0.0436.51 ▼2.4736.04 ▲0.20
Add New Post /wp-admin/post-new.php1,533 ▲523.67 ▲0.51665.14 ▼12.3452.56 ▼13.61
Media Library /wp-admin/upload.php1,408 ▲84.18 ▼0.0297.41 ▼21.1641.56 ▼7.35
Media Modal /wp-admin/options-general.php?page=mediamodal-options1,1371.9925.2837.89

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
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mediamodal-options
    • > Notice in wp-content/plugins/media-modal/lib/mm-admin-page.php+50
    Trying to access array offset on value of type bool

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-modal/lib/mm-ajax.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-modal/lib/mm-admin-page.php:163
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-modal/lib/mm-scripts.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/media-modal/media-modal.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/media-modal/lib/mm-functions.php:64

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=mediamodal-options
    • > Network (severe)
    wp-content/plugins/media-modal/lib/js/mm_admin_scripts.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Modal buttons.), #2 (Modal in white for video), #3 (Modal with no padding and custom background and text color for video), #4 (Embed Audio file and modal buttons), #5 (Modal in white for audio), #6 (Modal with no padding and custom background and text color for audio), #7 (Global Settings)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

media-modal/media-modal.php Passed 13 tests

This is the main PHP file of "Media Modal" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
79 characters long description:
Provides multiple options for different media that you want to show on a modal.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected822 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP513246419
CSS2303286
JavaScript1312117

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 1.26MB with 0.88MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png289.34KB86.99KB▼ 69.94%
screenshot-1.png119.76KB32.85KB▼ 72.57%
lib/img/Jumpstart-Logo.png13.49KB5.25KB▼ 61.08%
screenshot-6.png126.18KB34.88KB▼ 72.36%
screenshot-7.png198.64KB52.42KB▼ 73.61%