Just installed wordpress plugin, unable to load libraries or create content

I just installed the h5p plugin for the very first time and I'm unable to create any h5p content. It seems the libraries are unable to load?

  • If I navigate to “All h5p content” i get an error message “Failed to load data.”
  • If I navigate to “Add new” I get an error “unable to load libraries”

Deprecated: Creation of dynamic property H5PWordPress::$plugin_slug is deprecated in /var/www/wptbox/wp-content/plugins/h5p/public/class-h5p-wordpress.php on line 74

 

There are also some sanitize_string error messages at the top of the screen.

_SANITIZE_STRING is deprecated in /var/www/wptbox/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php on line 553

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/wptbox/wp-content/plugins/h5p/admin/class-h5p-content-admin.php on line 67
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/wptbox/wp-content/plugins/h5p/admin/class-h5p-content-admin.php on line 179

 

Let me know if any additional info would be helpful.

 EDIT: I tried deactivating and deleting the plugin, then installing it again. This time when I navigated to "Add New" I clicked the button asking for consent to connect to the hub, then it said Loading, please wait.. and then again the same "Error, unable to load libraries"

Error, unable to load libraries.
Deprecated: Creation of dynamic property H5PWordPress::$plugin_slug is deprecated in /var/www/wptbox/wp-content/plugins/h5p/public/class-h5p-wordpress.php on line 74

Content types: 

My hosting tech support said the problem is related to the error: R_SANITIZE_STRING is deprecated in /var/www/wptbox/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php on line 553

They also said

"all the settings from this article [  https://h5p.org/installation/configure-php ] are already implemented. You can check with the developers of this plugin is anything else specific can be implemented on the server, but we did not see anything in the logs.

We suspect something is wrong with the plugin files itself."

 

otacke's picture

I am pretty sure it's some issue with the plugin on your setup, but the cause definitely not one of the messages that you shared.

These messages that are issued by PHP and are merely deprecation warnings. They tell you that the code uses PHP features that will be removed in a future version of PHP, but the features still work. It's a message intended for developers, so they know that they should update their code.

So, good idea to mention these messages, but they do not help to pin down the issue, unfortunately. You'd probably want to share more information about the server environment to help reproduce the issue.

And a note: Deprecation warnings do only show up if PHP's error reporting is set accordingly. A server in production should normally not show them on screen (but still log them on the server), as they may reveal sensitive system information that could help breach security - and it feels like causing a bad user experience. You might want to ask your service provider why error reporting is set that way.

Great to hear and many thanks for your quick reply, otacke! 

what information can I provide about our server environment that would be helpful for resolving this issue?

otacke's picture

"Everything" that could help. PHP version, type of database and version, single-site or multisite of WordPress, caching mechanisms (e. g. by other plugins), potential file access restrictions or content security policies, ... but first and foremost someone should check the PHP error log for real errors.

OK our hosting provider replied with the requested info -

  • PHP version 8.3.14
  • SQL server MariaDB client 10.11.10
  • single-site
  • three levels of advanced caching -Varnish, Opcache and Redis object cache.
They are also sharing our php logs, will post here 

uploading logs here - let me know if any additional info would be helpful

otacke's picture

Those are access logs, not PHP error logs.

oh man. OK I explained to the hosting tech support they sent the access log and told them what we need is the "php error log." they sent this file. does this include the info we need?

otacke's picture

Nope. That's also an access log. It lists all HTTP requests that the server received to a file that it serves including timestamps, browser information and the error code (e.g. 200 for OK, 404 for file not found, etc.). It does not list, however, PHP errors (such as the deprecation warning that you see on screen).
The location of the PHP error log file is set in the PHP configuration (php.ini file) in the value of the variable `error_log`.

Error can either happen in your browser and/or on the server. So let's try this. Check if you see any error message (in red) in your browser's development console. Please refer to https://snordian.de/2024/02/17/how-can-i-craft-an-effective-bug-report-for-h5p-components/ how to obtain that information. That will reveal errors in the browser and there's a chance that you see an error message caused by a problem on the server, too. That's not as good information as entries from the PHP error log, but let's work with that.

Apart from that, back to the deprecation messages. They are not problematic themselves, but displaying them on screen might (as they alter the response that the browser may expect). So, if possible, ask your web provider to change their PHP configuration (php.ini) so the respective variables hold these values:

display_errors = Off
display_startup_errors = Off
log_errors = On

That is a typical setting for production sites that does not display errors on screen but still logs them. Additionally, they may want to check whether the variable `error_reporting` holds what they actually want to log.

If they don't want to change the setting for the whole server, they (or maybe you if you feel confident) can modify the `.htaccess` file that's in your web space's root folder (or you can add one). If you add `ini_set('display_errors', '0');` as the last line, the deprecation warnings should not be shown on your site anymore - and that might make a difference for H5P. But also ensure that there's no plugin like `WP Debug` running that might override your settings ...

Many thanks for all your help @otacke!

 

I think we have now solved the problem after seeing this previous comment on the wordpress plugin support forum 

https://i.imgur.com/5XPcOuq.png

Steps to Fix:

  • Opened WP Debugging plugin settings (without deactivating the plugin)
  • Unchecked the checkbox “Set WP_DEBUG to be true”

now it works and the h5p content loads when I navigate to H5P Content -> Add New 

So it seems there may be a conflict with the h5p plugin and the WP Debugging plugin (when it’s actively debugging)

 

EDIT: note this issue returns unless we completely deactivate the WP Debugging plugin

 

otacke's picture

Glad I could help.

H5P Group might still want to look into this though. It's possible that client is waiting for a response from the server that is response is supposed to be JSON content, but displaying the deprecation messages taints the response and thus leads to a crash. Should not happen. Nothing that could not be solved by output buffering and clearing, but would need investigation. @BV: Could you please relay this to the right people at H5P Group?

BV52's picture

Hi Oliver,

Will do and thank you for the help.

-BV