10% opencast

Code Review | Opencast Plugin

WordPress plugin Opencast Plugin scored10%from 54 tests.

About plugin

  • Plugin page: opencast
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7
  • WordPress version: 6.3.1
  • First release: Feb 7, 2021
  • Latest release: Mar 10, 2021
  • Number of updates: 6
  • Update frequency: every 6.5 days
  • Top authors: opencast (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /438 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/opencast/lib/Api/OCRestAPI.php+18
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.67MB] [CPU: ▼48.63ms] Passed 4 tests

A check of server-side resources used by Opencast Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.31 ▼1.157.25 ▼27.23
Dashboard /wp-admin2.33 ▼0.977.56 ▼41.64
Posts /wp-admin/edit.php2.33 ▼1.029.02 ▼37.50
Add New Post /wp-admin/post-new.php2.33 ▼3.557.10 ▼88.15
Media Library /wp-admin/upload.php2.33 ▼0.898.72 ▼23.45
General /wp-admin/admin.php?page=opencast_plugin_options2.338.92
Video Manager /wp-admin/admin.php?page=opencast_plugin_manager2.337.43

Server storage [IO: ▲5.70MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Opencast Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲13713.53 ▼0.851.93 ▲0.1040.93 ▼0.85
Dashboard /wp-admin2,253 ▲625.30 ▲0.21101.11 ▲2.8840.37 ▲2.73
Posts /wp-admin/edit.php2,136 ▲472.57 ▲0.5735.03 ▼6.2536.51 ▲1.00
Add New Post /wp-admin/post-new.php1,559 ▲3923.31 ▲0.08676.86 ▲44.4937.33 ▼20.38
Media Library /wp-admin/upload.php1,435 ▲474.57 ▲0.4097.92 ▲0.4140.19 ▼2.67
General /wp-admin/admin.php?page=opencast_plugin_options1,5972.5445.3432.38
Video Manager /wp-admin/admin.php?page=opencast_plugin_manager1,0422.2028.6428.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/opencast/lib/Api/OCRestAPI.php+18
    Undefined index: apiurl
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • opencast_plugin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

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)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=opencast_plugin_manager
    • > Notice in wp-content/plugins/opencast/lib/Api/OCRestAPI.php+18
    Undefined index: apiurl
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=opencast_plugin_manager
    • > Notice in wp-content/plugins/opencast/lib/Api/OCRestAPI.php+19
    Undefined index: apiusername
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=opencast_plugin_manager
    • > Notice in wp-content/plugins/opencast/lib/Api/OCRestAPI.php+20
    Undefined index: apipassword
    • > GET request to /wp-admin/admin.php?page=opencast_plugin_manager
    • > Notice in wp-content/plugins/opencast/lib/Base/OCVideoManagerController.php+47
    Undefined index: seriesid

SRP 0% 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 output text when accessed directly:
    • > /wp-content/plugins/opencast/opencast.php
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/opencast/src/vendors/select2/docs/plugins/breadcrumbs/breadcrumbs.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/opencast/lib/Api/OCVideoListTable.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/opencast/src/vendors/select2/docs/plugins/problems/problems.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/opencast/src/vendors/select2/docs/plugins/simplesearch/simplesearch.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/opencast/src/vendors/select2/docs/plugins/error/error.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Opencast\\Api\\OAuth\\OAuthDataStore' not found in wp-content/plugins/opencast/lib/Api/OAuth/TrivialOAuthDataStore.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Opencast\\Shortcodes\\OCShortcodeController' not found in wp-content/plugins/opencast/lib/Shortcodes/OCSingleEpisode.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/opencast/src/vendors/select2/docs/plugins/highlight/highlight.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Opencast\\Api\\OAuth\\OAuthSignatureMethod' not found in wp-content/plugins/opencast/lib/Api/OAuth/OAuthSignatureMethod_PLAINTEXT.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Opencast\\Shortcodes\\OCShortcodeController' not found in wp-content/plugins/opencast/lib/Shortcodes/OCStudio.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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
2 plugin tags: opencast, videos manager

opencast/opencast.php 92% from 13 tests

The primary PHP file in "Opencast Plugin" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
No dangerous file extensions were detected77,519 lines of code in 664 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript24313,4977,77351,329
CSS951,3626298,444
Sass1321,0115344,639
Markdown631,55504,300
PHP537819953,999
SVG7122,769
YAML28550807
Twig24560557
HTML7650344
JSON1000227
XML100102
Bourne Shell1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.25
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes44
▷ Abstract classes24.55%
▷ Concrete classes4295.45%
▷ Final classes12.38%
Methods254
▷ Static methods2710.63%
▷ Public methods18773.62%
▷ Protected methods93.54%
▷ Private methods5822.83%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
74 PNG files occupy 1.01MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/vendors/select2/docs/pages/images/flags/co.png2.53KB1.58KB▼ 37.60%
src/vendors/select2/docs/themes/site/images/apple-touch-icon-72x72.png1.59KB1.49KB▼ 6.21%
src/vendors/select2/docs/pages/images/flags/mt.png7.17KB3.38KB▼ 52.90%
src/vendors/select2/docs/themes/site/images/android-chrome-72x72.png1.50KB1.39KB▼ 6.98%
src/vendors/select2/docs/pages/images/flags/ia.png6.94KB3.21KB▼ 53.75%