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!