62% wp-brightcove-portal

Code Review | WP Brightcove Portal

WordPress plugin WP Brightcove Portal scored62%from 54 tests.

About plugin

  • Plugin page: wp-brightcove-portal
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5
  • WordPress version: 6.3.1
  • First release: Jul 14, 2013
  • Latest release: Jan 7, 2014
  • Number of updates: 3
  • Update frequency: every 59.0 days
  • Top authors: moyo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /988 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.24ms] Passed 4 tests

This is a short check of server-side resources used by WP Brightcove Portal
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.93 ▼6.85
Dashboard /wp-admin3.34 ▲0.0346.71 ▼2.33
Posts /wp-admin/edit.php3.39 ▲0.0345.51 ▼2.85
Add New Post /wp-admin/post-new.php5.93 ▲0.0382.71 ▼20.92
Media Library /wp-admin/upload.php3.27 ▲0.0336.21 ▲1.22
Brightcove Portal /wp-admin/admin.php?page=wp-brightcove-portal3.6031.86
Brightcove Players /wp-admin/admin.php?page=wp-brightcove-portal-players3.2829.85
Brightcove Settings /wp-admin/admin.php?page=wp-brightcove-portal-settings3.2829.74

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 24 new files
Database: 3 new tables, 7 new options
New tables
wp_brightcoveVideos
wp_brightcoveSettings
wp_brightcovePlayers
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
bcPortal_db_version
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Brightcove Portal
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲13713.82 ▼0.557.29 ▲5.5738.47 ▼3.34
Dashboard /wp-admin2,210 ▲335.56 ▼0.0685.74 ▼1.8974.92 ▲33.09
Posts /wp-admin/edit.php2,127 ▲241.99 ▼0.0334.83 ▼1.7235.02 ▼0.13
Add New Post /wp-admin/post-new.php6,277 ▲4,74923.99 ▲0.83927.95 ▲317.3358.96 ▲4.02
Media Library /wp-admin/upload.php1,433 ▲334.18 ▼0.0797.27 ▼13.9373.49 ▲25.51
Brightcove Portal /wp-admin/admin.php?page=wp-brightcove-portal8661.8525.0053.11
Brightcove Players /wp-admin/admin.php?page=wp-brightcove-portal-players8511.9428.5129.17
Brightcove Settings /wp-admin/admin.php?page=wp-brightcove-portal-settings9331.8926.6833.76

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
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_brightcoveSettings
    • wp_brightcovePlayers
    • wp_brightcoveVideos
  • This plugin does not fully uninstall, leaving 7 options in the database
    • bcPortal_db_version
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% 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)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-brightcove-portal-settings
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-brightcove-portal/pages/footer.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-brightcove-portal/pages/videos.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-brightcove-portal/wp-brightcove-portal.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-brightcove-portal/pages/players.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-brightcove-portal/pages/header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-brightcove-portal/pages/settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (first screenshot), #2 (second screenshot), #3 (third screenshot)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-brightcove-portal === )
You can take inspiration from this readme.txt

wp-brightcove-portal/wp-brightcove-portal.php 92% from 13 tests

"WP Brightcove Portal" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 183 characters long)

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
No dangerous file extensions were detected17,128 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,0246,3887,820
CSS477607,276
PHP87833742,032

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.36
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2779.41%
▷ Protected methods00.00%
▷ Private methods720.59%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants16.67%
▷ Class constants1493.33%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.18MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png83.61KB28.47KB▼ 65.94%
screenshot-2.png36.60KB10.96KB▼ 70.06%
screenshot-3.png42.22KB12.82KB▼ 69.63%
img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
img/menuIcon.png3.34KB0.94KB▼ 71.78%