84% brightcove-video-connect

Code Review | Brightcove Video Connect

WordPress plugin Brightcove Video Connect scored84%from 54 tests.

About plugin

  • Plugin page: brightcove-video-...
  • Plugin version: 2.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.4
  • WordPress version: 6.3.1
  • First release: Jun 15, 2015
  • Latest release: Nov 30, 2023
  • Number of updates: 103
  • Update frequency: every 30.2 days
  • Top authors: ChrisWiegman (21.36%)10upbot (17.48%)sudar (16.5%)oscarssanchez (12.62%)10up (11.65%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /134,450 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.82MB] [CPU: ▲1.19ms] Passed 4 tests

This is a short check of server-side resources used by Brightcove Video Connect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7740.88 ▼1.47
Dashboard /wp-admin4.16 ▲0.8156.05 ▼2.68
Posts /wp-admin/edit.php4.21 ▲0.8551.97 ▲4.66
Add New Post /wp-admin/post-new.php6.75 ▲0.8696.92 ▲4.25
Media Library /wp-admin/upload.php4.08 ▲0.8543.95 ▲12.33
Labels /wp-admin/admin.php?page=brightcove-labels4.0436.70
Edit Label /wp-admin/admin.php?page=page-brightcove-edit-label4.0438.21
Settings /wp-admin/admin.php?page=brightcove-sources4.0436.51
Add Source /wp-admin/admin.php?page=page-brightcove-edit-source4.0436.82
Playlists /wp-admin/admin.php?page=page-brightcove-playlists4.0438.72
Videos /wp-admin/admin.php?page=page-brightcove-videos4.0437.79

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 99 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Brightcove Video Connect: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15514.14 ▼0.142.07 ▲0.4138.11 ▼3.90
Dashboard /wp-admin2,267 ▲935.59 ▼0.0685.24 ▼11.0557.38 ▲12.99
Posts /wp-admin/edit.php2,184 ▲842.00 ▲0.0641.26 ▲0.6633.95 ▼3.79
Add New Post /wp-admin/post-new.php6,433 ▲4,89728.23 ▲5.15992.28 ▲380.7853.12 ▲0.03
Media Library /wp-admin/upload.php1,481 ▲784.24 ▲0.06113.63 ▲13.6948.17 ▲7.19
Labels /wp-admin/admin.php?page=brightcove-labels8551.6627.1522.77
Edit Label /wp-admin/admin.php?page=page-brightcove-edit-label8511.6624.8725.80
Settings /wp-admin/admin.php?page=brightcove-sources9582.0126.9626.31
Add Source /wp-admin/admin.php?page=page-brightcove-edit-source9942.0124.7328.90
Playlists /wp-admin/admin.php?page=page-brightcove-playlists8551.6726.8924.78
Videos /wp-admin/admin.php?page=page-brightcove-videos8551.6628.4127.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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
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
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/brightcove-video-connect/brightcove-video-connect.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'BC_API' not found in wp-content/plugins/brightcove-video-connect/includes/api/class-bc-experiences-api.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BC_API' not found in wp-content/plugins/brightcove-video-connect/includes/api/class-bc-cms-api.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/brightcove-video-connect/cli/class-brightcove-cli.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'BC_API' not found in wp-content/plugins/brightcove-video-connect/includes/api/class-bc-player-management-api2.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'BC_API' not found in wp-content/plugins/brightcove-video-connect/includes/api/class-bc-player-management-api.php:19

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: videos, 10up, video, brightcove

brightcove-video-connect/brightcove-video-connect.php 92% from 13 tests

This is the main PHP file of "Brightcove Video Connect" version 2.8.4, 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: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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,104 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript291,3007007,662
PHP351,6522,6375,897
CSS687921,274
Sass121514825
Markdown11020402
SVG20144

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity22.18
▷ Minimum class complexity1.00
▷ Maximum class complexity157.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes13.03%
▷ Concrete classes3296.97%
▷ Final classes00.00%
Methods248
▷ Static methods8132.66%
▷ Public methods23695.16%
▷ Protected methods114.44%
▷ Private methods10.40%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
images/video-background-large.png3.44KB2.48KB▼ 27.94%
assets/css/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%