72% drm-protected-video-streaming

Code Review | S3Player - WooCommerce & Elementor Integration

WordPress plugin S3Player - WooCommerce & Elementor Integration scored72%from 54 tests.

About plugin

  • Plugin page: drm-protected-vid...
  • Plugin version: 4.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9.3
  • WordPress version: 6.3.1
  • First release: May 3, 2019
  • Latest release: Apr 15, 2022
  • Number of updates: 154
  • Update frequency: every 7.0 days
  • Top authors: s3bubble (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /9,698 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼3.46ms] Passed 4 tests

An overview of server-side resources used by S3Player - WooCommerce & Elementor Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3345.86 ▲4.33
Dashboard /wp-admin3.61 ▲0.2657.89 ▼9.50
Posts /wp-admin/edit.php3.72 ▲0.3762.25 ▲12.58
Add New Post /wp-admin/post-new.php6.21 ▲0.3289.21 ▼9.94
Media Library /wp-admin/upload.php3.53 ▲0.3040.13 ▲1.29

Server storage [IO: ▲2.36MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/drm-protected-video-streaming/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/drm-protected-video-streaming/languages/drm-protected-video-streaming\342\200\216.pot"
Filesystem: 38 new files
Database: 1 new table, 9 new options
New tables
wp_drm_blocked_ips
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
s3bubble_drm_db_version
theysaidso_admin_options
can_compress_scripts
s3bubble_drm_plugin_options
s3bubble_drm_activation_date
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by S3Player - WooCommerce & Elementor Integration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲22218.62 ▲4.06190.62 ▲189.0348.11 ▲8.14
Dashboard /wp-admin2,217 ▲405.69 ▲0.0984.24 ▼4.4037.41 ▼6.35
Posts /wp-admin/edit.php2,122 ▲221.99 ▼0.0034.43 ▼0.8231.57 ▼5.34
Add New Post /wp-admin/post-new.php6,212 ▲4,68418.83 ▼4.30876.95 ▲201.5049.93 ▼6.33
Media Library /wp-admin/upload.php1,422 ▲224.28 ▲0.0499.85 ▼11.9242.57 ▼6.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_drm_blocked_ips
  • Zombie WordPress options detected upon uninstall: 9 options
    • s3bubble_drm_plugin_options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • s3bubble_drm_db_version
    • s3bubble_drm_activation_date
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/drm-protected-video-streaming/includes/watermarks.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/drm-protected-video-streaming/includes/db.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ElementorS3BubbleDrm\\add_action() in wp-content/plugins/drm-protected-video-streaming/includes/elementor-plugin.php:84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/drm-protected-video-streaming/includes/admin-notices.php:15

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 80% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 45 tag instead of maximum 10
You can take inspiration from this readme.txt

drm-protected-video-streaming/drm-protected-video-streaming.php 62% from 13 tests

"S3Player - WooCommerce & Elementor Integration" version 4.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 148 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.5" instead of "3.8")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,996 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP156725701,959
SVG10031
CSS3003
JavaScript3333

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity9.00
▷ Minimum class complexity2.00
▷ Maximum class complexity14.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods24
▷ Static methods14.17%
▷ Public methods1770.83%
▷ Protected methods625.00%
▷ Private methods14.17%
Functions50
▷ Named functions4998.00%
▷ Anonymous functions12.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/ic_cast_grey_24dp.png0.86KB0.58KB▼ 31.62%
dist/images/ic_cast_connected_white_24dp.png0.96KB0.72KB▼ 24.97%
dist/images/ic_cast_connected_black_24dp.png0.87KB0.72KB▼ 17.49%
dist/images/ic_cast_black_24dp.png0.72KB0.60KB▼ 15.90%
dist/images/ic_cast_connected_grey_24dp.png0.99KB0.69KB▼ 30.03%