78% video-stream-embed

Code Review | Stream Defence

WordPress plugin Stream Defence scored 78% from 54 tests.

About plugin

  • Plugin page: video-stream-embed
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 6.3.1
  • First release: Aug 27, 2021
  • Latest release: Feb 1, 2022
  • Number of updates: 4
  • Update frequency: every 40.3 days
  • Top authors: danyeltobi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 337 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.97ms] Passed 4 tests

Server-side resources used by Stream Defence
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.22 ▼4.71
Dashboard /wp-admin3.31 ▲0.0156.08 ▲2.62
Posts /wp-admin/edit.php3.36 ▲0.0153.64 ▼3.44
Add New Post /wp-admin/post-new.php5.90 ▲0.01101.64 ▼28.08
Media Library /wp-admin/upload.php3.23 ▲0.0140.09 ▼7.65
StreamDefence settings /wp-admin/options-general.php?page=plgsdapi_settings_page3.1732.85

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 3 new files
Database: 1 new table, 6 new options
New tables
wp_plgsdapi_config
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Stream Defence
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.25 ▼1.141.61 ▼0.8438.14 ▼23.37
Dashboard /wp-admin2,207 ▲195.80 ▲0.93124.20 ▲12.3253.00 ▲4.68
Posts /wp-admin/edit.php2,096 ▲42.05 ▲0.0340.16 ▼10.4138.89 ▼22.14
Add New Post /wp-admin/post-new.php1,539 ▲14123.34 ▲5.16674.73 ▼29.0160.86 ▼9.83
Media Library /wp-admin/upload.php1,389 ▲44.24 ▲0.05107.25 ▼17.6149.44 ▼2.64
StreamDefence settings /wp-admin/options-general.php?page=plgsdapi_settings_page1,1131.8231.6542.72

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+446
    Undefined index: replace_method
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+539
    Undefined index: extra_template
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+437
    Undefined index: apikey
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+469
    Undefined index: enable_captcha
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+476
    Undefined index: disable_ads_block
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+490
    Undefined index: protect_by_domain
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+497
    Undefined index: domain_url
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+504
    Undefined index: video_password
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+511
    Undefined index: iframe_w
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+511
    Undefined index: iframe_h
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+519
    Undefined index: extra_js_code
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+548
    Undefined index: meta_code
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+563
    Undefined index: mixdrop_email
    • > GET request to /wp-admin/options-general.php?page=plgsdapi_settings_page
    • > Notice in wp-content/plugins/video-stream-embed/streamdefence.php+563
    Undefined index: mixdrop_token

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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/video-stream-embed/streamdefence.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: streamdefence changes iframes to encrypted with streamdefencecom api

video-stream-embed/streamdefence.php 92% from 13 tests

"Stream Defence" version 1.8.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("video-stream-embed.php" instead of "streamdefence.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,296 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25263362,296

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity193.50
▷ Minimum class complexity138.00
▷ Maximum class complexity249.00
Average method complexity5.28
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods90
▷ Static methods11.11%
▷ Public methods7583.33%
▷ Protected methods1516.67%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants22100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin