79% h5p

Code Review | Interactive Content – H5P

WordPress plugin Interactive Content – H5P scored79%from 54 tests.

About plugin

  • Plugin page: h5p
  • Plugin version: 1.15.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-6.2.2
  • WordPress version: 6.3.1
  • First release: May 15, 2014
  • Latest release: Jun 14, 2023
  • Number of updates: 113
  • Update frequency: every 29.4 days
  • Top authors: icc0rz (85.84%)thomasmars (11.5%)fnoks (4.42%)

Code review

54 tests

User reviews

57 reviews

Install metrics

40,000+ active /519,213 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.57MB] [CPU: ▲7.96ms] Passed 4 tests

Analyzing server-side resources used by Interactive Content – H5P
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.77 ▲1.69
Dashboard /wp-admin5.43 ▲2.1360.34 ▲9.46
Posts /wp-admin/edit.php5.50 ▲2.1462.56 ▲8.34
Add New Post /wp-admin/post-new.php7.67 ▲1.78113.08 ▲12.33
Media Library /wp-admin/upload.php5.43 ▲2.2051.17 ▲15.43
My Results /wp-admin/admin.php?page=h5p_results5.4044.74
Add New /wp-admin/admin.php?page=h5p_new5.4050.11
All H5P Content /wp-admin/admin.php?page=h5p5.4043.27
H5P /wp-admin/options-general.php?page=h5p_settings5.4044.61
Libraries /wp-admin/admin.php?page=h5p_libraries5.4050.08

Server storage [IO: ▲6.84MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 567 new files
Database: 14 new tables, 24 new options
New tables
wp_h5p_events
wp_h5p_libraries_hub_cache
wp_h5p_tmpfiles
wp_h5p_contents_libraries
wp_h5p_contents_tags
wp_h5p_libraries_languages
wp_h5p_libraries_libraries
wp_h5p_contents
wp_h5p_counters
wp_h5p_results
...
New WordPress options
h5p_export
h5p_save_content_frequency
h5p_send_usage_statistics
can_compress_scripts
widget_theysaidso_widget
h5p_track_user
h5p_check_h5p_requirements
theysaidso_admin_options
h5p_multisite_capabilities
h5p_save_content_state
...

Browser metrics Passed 4 tests

An overview of browser requirements for Interactive Content – H5P
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲10213.25 ▼1.171.64 ▼0.4748.40 ▲1.04
Dashboard /wp-admin2,267 ▲645.85 ▲0.96107.44 ▲3.4339.21 ▼6.72
Posts /wp-admin/edit.php2,146 ▲462.06 ▲0.0840.46 ▼2.1737.72 ▼0.23
Add New Post /wp-admin/post-new.php1,564 ▲1923.42 ▲0.37600.79 ▲0.7051.96 ▲6.87
Media Library /wp-admin/upload.php1,449 ▲494.24 ▲0.11101.37 ▼22.2342.54 ▼3.78
My Results /wp-admin/admin.php?page=h5p_results9472.2935.4926.99
Add New /wp-admin/admin.php?page=h5p_new8392.0728.0825.37
All H5P Content /wp-admin/admin.php?page=h5p9462.4137.0526.18
H5P /wp-admin/options-general.php?page=h5p_settings1,3082.4035.7733.99
Libraries /wp-admin/admin.php?page=h5p_libraries9922.1829.2837.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/h5p/h5p-php-library/embed.php
  • 30× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: lang in wp-content/plugins/h5p/h5p-php-library/embed.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/h5p/admin/views/select-content.php:31
    • > PHP Notice
      Undefined variable: library in wp-content/plugins/h5p/admin/views/library-content-upgrade.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/h5p/admin/views/show-content.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'H5PFileStorage' not found in wp-content/plugins/h5p/h5p-php-library/h5p-default-storage.class.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'H5P_Plugin_Admin' not found in wp-content/plugins/h5p/admin/views/settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/h5p/admin/views/user-consent.php:15
    • > PHP Notice
      Undefined variable: scripts in wp-content/plugins/h5p/h5p-php-library/embed.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'H5PEventBase' not found in wp-content/plugins/h5p/public/class-h5p-event.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/h5p/admin/views/libraries.php:14

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 Passed 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
5 plugin tags: video, slider, quiz, editor, education

h5p/h5p.php Passed 13 tests

The main PHP file in "Interactive Content – H5P" ver. 1.15.6 adds more information about the plugin and also serves as the entry point for this plugin
92 characters long description:
Allows you to upload, create, share and use rich interactive content on your WordPress site.

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
There were no executable files found in this plugin54,956 lines of code in 496 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2982,2015,79718,313
PO File164,5815,83912,026
PHP371,7794,8579,648
CSS836883375,624
Sass40812325,094
Markdown111,10603,714
HTML23511249
SVG501196
JSON30085
Ruby15127

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity47.70
▷ Minimum class complexity1.00
▷ Maximum class complexity172.00
Average method complexity4.41
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes26
▷ Abstract classes623.08%
▷ Concrete classes2076.92%
▷ Final classes00.00%
Methods501
▷ Static methods6312.57%
▷ Public methods40480.64%
▷ Protected methods81.60%
▷ Private methods8917.76%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants42
▷ Global constants00.00%
▷ Class constants42100.00%
▷ Public constants42100.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
32 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
h5p-editor-php-library/images/binary-file.png5.87KB3.72KB▼ 36.66%
h5p-editor-php-library/ckeditor/skins/bootstrapck/images/hidpi/lock-open.png0.56KB0.34KB▼ 39.62%
h5p-editor-php-library/ckeditor/skins/bootstrapck/images/hidpi/close.png0.49KB0.27KB▼ 44.58%
h5p-editor-php-library/images/order.png0.45KB0.43KB▼ 4.31%
h5p-editor-php-library/images/expand.png0.20KB0.13KB▼ 34.33%