10% os-media

Code Review | OS media - HTML5 Featured Video

WordPress plugin OS media - HTML5 Featured Video scored10%from 54 tests.

About plugin

  • Plugin page: os-media
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 4, 2013
  • Latest release: Oct 16, 2016
  • Number of updates: 77
  • Update frequency: every 14.0 days
  • Top authors: molven (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /9,196 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure had errors
    • > User notice in wp-includes/functions.php+5905
    Function add_shortcode was called incorrectly. Invalid shortcode name: Empty name given. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.)

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

A check of server-side resources used by OS media - HTML5 Featured Video
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1839.61 ▼1.91
Dashboard /wp-admin3.49 ▲0.1948.83 ▼0.73
Posts /wp-admin/edit.php3.55 ▲0.1951.77 ▲0.99
Add New Post /wp-admin/post-new.php6.03 ▲0.15100.28 ▲4.93
Media Library /wp-admin/upload.php3.35 ▲0.1240.48 ▲3.49
Add New /wp-admin/post-new.php?post_type=osmedia_cpt3.5959.46
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=osmedia_cpt3.3537.60
OSmedia videos /wp-admin/edit.php?post_type=osmedia_cpt3.5252.88
OSmedia Taxonomy /wp-admin/edit-tags.php?taxonomy=osmedia_tax&post_type=osmedia_cpt3.3536.39

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 58 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
OSmedia_settings
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for OS media - HTML5 Featured Video
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲14114.21 ▼0.0137.19 ▲35.6341.69 ▲0.27
Dashboard /wp-admin2,264 ▲875.89 ▲0.2890.31 ▲2.3742.19 ▲6.82
Posts /wp-admin/edit.php2,153 ▲532.32 ▲0.3134.54 ▲0.0531.66 ▼7.32
Add New Post /wp-admin/post-new.php6,622 ▲5,08721.01 ▲2.84931.32 ▲294.0559.33 ▼8.55
Media Library /wp-admin/upload.php1,476 ▲764.30 ▲0.0893.42 ▼9.6543.60 ▼1.67
Add New /wp-admin/post-new.php?post_type=osmedia_cpt3,1688.30194.4174.08
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=osmedia_cpt1,3962.0834.5732.93
OSmedia videos /wp-admin/edit.php?post_type=osmedia_cpt1,8942.3135.7932.13
OSmedia Taxonomy /wp-admin/edit-tags.php?taxonomy=osmedia_tax&post_type=osmedia_cpt1,3482.0731.5632.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • OSmedia_settings
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/os-media/views/frontend/youtube.php
    • > /wp-content/plugins/os-media/views/frontend/style_videoplayer.php
    • > /wp-content/plugins/os-media/views/frontend/mobile.php
    • > /wp-content/plugins/os-media/views/OSmedia-settings/page-settings-fields.php
    • > /wp-content/plugins/os-media/views/frontend/standard.php
    • > /wp-content/plugins/os-media/includes/admin-notice-helper/admin-notice-helper.php
    • > /wp-content/plugins/os-media/views/frontend/vimeo.php
  • 147× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: color2 in wp-content/plugins/os-media/views/frontend/style_videoplayer.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/os-media/views/OSmedia-settings/page-settings-fields.php on line 127
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/os-media/views/frontend/style_videoplayer.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'OSmedia_Module' not found in wp-content/plugins/os-media/classes/OSmedia-post-admin.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/os-media/views/OSmedia-settings/page-settings-section-headers.php on line 5
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/os-media/views/OSmedia-settings/page-settings-fields.php on line 104
    • > PHP Notice
      Undefined variable: controls_atts in wp-content/plugins/os-media/views/frontend/mobile.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/os-media/views/OSmedia-settings/page-settings-fields.php on line 104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/os-media/layout/osmedia_cpt-twentythirteen.php:10
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/os-media/views/OSmedia-settings/page-settings-fields.php on line 80

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 35 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (General Options: Admin area for HTML5 Player), #2 (Metabox area for single post/page), #3 (Frontpage Twenty Fifteen Wordpress theme)
You can look at the official readme.txt

os-media/bootstrap.php 77% from 13 tests

This is the main PHP file of "OS media - HTML5 Featured Video" version 2.3, 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:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("os-media.php" instead of "bootstrap.php")
  • Domain Path: The domain path folder was not found ("/languages")

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
No dangerous file extensions were detected16,149 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43,9897,06710,929
PHP369162,2513,858
CSS52301381,362

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity48.67
▷ Minimum class complexity1.00
▷ Maximum class complexity268.00
Average method complexity4.91
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes17.69%
Methods196
▷ Static methods10855.10%
▷ Public methods15679.59%
▷ Protected methods2512.76%
▷ Private methods157.65%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants33
▷ Global constants1236.36%
▷ Class constants2163.64%
▷ Public constants21100.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
images/icon_cpt.png1.31KB2.05KB0.00%
images/blank.png0.27KB0.10KB▼ 61.68%