78% cloudflare-stream

Code Review | Cloudflare Stream Video

WordPress plugin Cloudflare Stream Video scored 78% from 54 tests.

About plugin

  • Plugin page: cloudflare-stream
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: May 14, 2019
  • Latest release: Feb 7, 2022
  • Number of updates: 21
  • Update frequency: every 47.6 days
  • Top authors: cloudflare (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active / 9,244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▲1.45ms] Passed 4 tests

Server-side resources used by Cloudflare Stream Video
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1240.68 ▼0.24
Dashboard /wp-admin3.43 ▲0.1346.42 ▼0.06
Posts /wp-admin/edit.php3.54 ▲0.1944.73 ▼0.27
Add New Post /wp-admin/post-new.php6.01 ▲0.1393.82 ▲7.75
Media Library /wp-admin/upload.php3.35 ▲0.1238.05 ▲6.35
Cloudflare Stream /wp-admin/options-general.php?page=cloudflare-stream3.3232.51

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Cloudflare Stream Video
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.23 ▼1.144.47 ▲2.5543.34 ▼5.87
Dashboard /wp-admin2,207 ▲255.84 ▼0.02100.24 ▼6.9537.89 ▼9.83
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0136.79 ▲2.0933.66 ▼1.84
Add New Post /wp-admin/post-new.php1,536 ▲323.12 ▼0.03606.28 ▼49.4052.28 ▼0.23
Media Library /wp-admin/upload.php1,392 ▲74.24 ▲0.03100.62 ▼2.9042.59 ▼1.48
Cloudflare Stream /wp-admin/options-general.php?page=cloudflare-stream8422.1129.6027.11

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cloudflare-stream/src/inc/class-cloudflare-stream-shortcode.php:57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cloudflare-stream/src/inc/class-cloudflare-stream-settings.php:59

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=cloudflare-stream
    • > Console-api (severe) in wp-content/plugins/cloudflare-stream/src/heap.js?ver=1562695936+15:10
    Event: Stream WP Plugin - Settings Page Visit

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: videos, block, block-enabled, stream, movies...

cloudflare-stream/cloudflare-stream.php 92% from 13 tests

The main PHP file in "Cloudflare Stream Video" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 340 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,536 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript101741,944912
PHP5108411548
Sass310274
CSS2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity9.00
▷ Minimum class complexity2.00
▷ Maximum class complexity16.00
Average method complexity1.63
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods38
▷ Static methods410.53%
▷ Public methods3181.58%
▷ Protected methods00.00%
▷ Private methods718.42%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.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 files were detected