84% show-media-widget-pdf-support

Code Review | Show Media Widget

WordPress plugin Show Media Widget scored84%from 54 tests.

About plugin

  • Plugin page: show-media-widget...
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Mar 15, 2018
  • Latest release: Dec 23, 2021
  • Number of updates: 12
  • Update frequency: every 114.9 days
  • Top authors: ole1986 (100%)Otto42 (16.67%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.20ms] Passed 4 tests

An overview of server-side resources used by Show Media Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.54 ▼4.16
Dashboard /wp-admin3.32 ▲0.0243.35 ▼4.26
Posts /wp-admin/edit.php3.37 ▲0.0244.85 ▼2.84
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.85 ▼5.55
Media Library /wp-admin/upload.php3.24 ▲0.0235.88 ▼2.00

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_mediawidget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Show Media Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.52 ▼0.712.06 ▲0.3439.86 ▼2.08
Dashboard /wp-admin2,206 ▲214.86 ▼0.22110.00 ▼1.6442.31 ▼1.23
Posts /wp-admin/edit.php2,089 ▲32.00 ▼0.0540.95 ▲4.0037.28 ▲2.84
Add New Post /wp-admin/post-new.php1,547 ▲2818.31 ▼4.88606.42 ▼88.2467.92 ▲4.56
Media Library /wp-admin/upload.php1,388 ▼04.28 ▲0.06100.80 ▼3.6741.06 ▲0.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_mediawidget
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

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 | 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/show-media-widget-pdf-support/ShowMediaWidget.php

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: preview, widget, pdf support, show, media files...

show-media-widget-pdf-support/ShowMediaWidget.php 85% from 13 tests

The main file in "Show Media Widget" v. 1.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("show-media-widget-pdf-support.php" instead of "ShowMediaWidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin288 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP15176219
PO File18031
XML11120
JavaScript14218

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods321.43%
▷ Public methods1071.43%
▷ Protected methods17.14%
▷ Private methods321.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin