WordPress project modern structure and H5P problems

Hi, for one of our projects we are using a project structure like https://roots.io/bedrock/  and it seems that  H5p has some issues with it. So The H5p plugin doesn't respect that project structure and is not loading any resource it uses.

Basically I quess there may ways to fix but we using quick and dirty 

in file class-h5p-plugin.php  line 1105 (latest plugin version)

$rel_path = preg_replace('/^[^:]+:\/\/[^\/]+\//', '', $lib_url);

and in file class-h5p-content-admin.php

line 945 

$url = preg_replace('/^[^:]+:\/\/[^\/]+\//', '', $upload_dir) . '/';

 

but it would be nice to get a H5P wordpress plugin version for these modern project structures

 

 

├── composer.json

├── config

│   ├── application.php

│   └── environments

│       ├── development.php

│       ├── staging.php

│       └── production.php

├── vendor

└── web

    ├── app

    │   ├── mu-plugins

    │   ├── plugins

    │   ├── themes

    │   └── uploads

    ├── wp-config.php

    ├── index.php

    └── wp

icc's picture

Hi,

Have you tried the latest 1.9.2 plugin?
Also, could you share which part of the URL is wrong? Is it the 'app' folder missing? 

Hi,

yes we tried the latest 

and in console all paths to js resources look like

https://wp-content/plugins/h5p/h5p-php-library/js/jquery.js?ver=1.9.4

icc's picture

I've created an issue for getting this fixed: HFP-1593

Hi,

we think we found the problem

if we comment out the following in our config file everything works fine with the latest plugin version

define('WP_CONTENT_URL', CONTENT_DIR);

 

icc's picture

Great, thanks for sharing!

We are also running our site on bedrock and our not able to view h5p exercises on frontend or backend. Has there been any solve to this? We experience the following error code in the console. 

Is there any fix to this issue? 

Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-confirmation-dialog.css:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-core-button.css:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
cede70cbd0b27f969d8a7057f6897e709a727953.css:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
jquery.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-event-dispatcher.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-x-api-event.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-x-api.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-content-type.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-confirmation-dialog.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
h5p-action-bar.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
request-queue.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED
cede70cbd0b27f969d8a7057f6897e709a727953.js:1     Failed to load resource: net::ERR_NAME_NOT_RESOLVED