H5P Mods and compatibility with PHP 8
Submitted by 1791 Delegates on Thu, 01/11/2024 - 14:30
Forums:
Dear H5P Colleagues,
Our new server requires that we use PHP version 8.1.21. I'm writing to see if the two sets of plugin issues may be related to the H5P Mods plugin not being compatible with PHP 8.
ISSUE 1. UPDATE AVAILABLE NOT WORKING
We're unable to update the H5P Content Types, as shown here:
http://assets.1791delegates.org/v/S2qWaqroAN6Tmv2PreI7
ISSUE 2. FATAL ERROR
Fatal error: Uncaught Error: implode(): Argument #2 ($array) must be of type ?array, string givenin /var/www/webroot/ROOT/wp-content/plugins/h5pmods-wordpress-plugin-master/h5pmods.php on line 231Call stack:
implode()
wp-content/plugins/h5pmods-wordpress-plugin-master/h5pmods.php:231find_semantics_path()
wp-content/plugins/h5pmods-wordpress-plugin-master/h5pmods.php:220find_semantics_path()
wp-content/plugins/h5pmods-wordpress-plugin-master/h5pmods.php:52h5pmods_alter_semantics()
wp-includes/class-wp-hook.php:324WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:348WP_Hook::do_action()
wp-includes/plugin.php:565do_action_ref_array()
wp-content/plugins/h5p/public/class-h5p-wordpress.php:680H5PWordPress::alterLibrarySemantics()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:2509H5PCore::loadLibrarySemantics()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4123H5PContentValidator::validateLibrary()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4028H5PContentValidator::validateGroup()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:3871H5PContentValidator::validateList()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4028H5PContentValidator::validateGroup()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4028H5PContentValidator::validateGroup()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4028H5PContentValidator::validateGroup()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:4134H5PContentValidator::validateLibrary()
wp-content/plugins/h5p/h5p-php-library/h5p.classes.php:2188H5PCore::filterParameters()
wp-content/plugins/h5p/public/class-h5p-plugin.php:939H5P_Plugin::get_content_settings()
wp-content/plugins/h5p/public/class-h5p-plugin.php:1033H5P_Plugin::add_assets()
wp-content/plugins/h5p/public/class-h5p-plugin.php:925H5P_Plugin::shortcode()
wp-includes/shortcodes.php:433do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273do_shortcode()
wp-content/plugins/elementor/includes/widgets/shortcode.php:130Elementor\Widget_Shortcode::render()
wp-content/plugins/elementor/includes/base/controls-stack.php:2297Elementor\Controls_Stack::render_by_mode()
wp-content/plugins/elementor/includes/base/widget-base.php:614Elementor\Widget_Base::render_content()
wp-content/plugins/elementor/includes/base/widget-base.php:755Elementor\Widget_Base::print_content()
wp-content/plugins/elementor/includes/base/element-base.php:464Elementor\Element_Base::print_element()
wp-content/plugins/elementor/includes/base/element-base.php:1375Elementor\Element_Base::print_content()
wp-content/plugins/elementor/includes/base/element-base.php:464Elementor\Element_Base::print_element()
wp-content/plugins/elementor/includes/base/element-base.php:1375Elementor\Element_Base::print_content()
wp-content/plugins/elementor/includes/base/element-base.php:464Elementor\Element_Base::print_element()
wp-content/plugins/elementor/includes/base/element-base.php:1375Elementor\Element_Base::print_content()
wp-content/plugins/elementor/includes/base/element-base.php:464Elementor\Element_Base::print_element()
wp-content/plugins/elementor/includes/base/element-base.php:1375Elementor\Element_Base::print_content()
wp-content/plugins/elementor/includes/base/element-base.php:464Elementor\Element_Base::print_element()
wp-content/plugins/elementor/core/base/document.php:1749Elementor\C\B\Document::print_elements()
wp-content/plugins/elementor/core/base/document.php:1144Elementor\C\B\Document::print_elements_with_wrapper()
wp-content/plugins/elementor/includes/frontend.php:1179Elementor\Frontend::get_builder_content()
wp-content/plugins/elementor/includes/frontend.php:1074Elementor\Frontend::apply_builder_in_content()
wp-includes/class-wp-hook.php:324WP_Hook::apply_filters()
wp-includes/plugin.php:205apply_filters()
wp-includes/post-template.php:256the_content()
wp-content/themes/buddyboss-theme/template-parts/content-sfwd.php:15require()
wp-includes/template.php:792load_template()
wp-includes/template.php:725locate_template()
wp-includes/general-template.php:206get_template_part()
wp-content/themes/buddyboss-theme/single-sfwd-lessons.php:27include()
wp-includes/template-loader.php:106require_once()
wp-blog-header.php:19require()
index.php:17
Thank you for your assistance with these two issues.
Thanks,
Nate
otacke
Thu, 01/11/2024 - 17:14
Permalink
Have you updated the plugin
Have you updated the plugin code since you installed it? Yes, I know it's not available in the WordPress plugin repository and that staying up-to-date requires an extra effort.
I think that the relevant code was changed in May 2022.
1791 Delegates
Thu, 01/11/2024 - 18:02
Permalink
Where can I find the updated plugin
Hi Otacke,
Thanks for confirming the code was changed in May 2022. Where can I go to find the updated plugin? When I go here https://github.com/h5p/h5pmods-wordpress-plugin/ I'm still only able to access version 0.0.1
Thanks,
Nate
otacke
Thu, 01/11/2024 - 18:09
Permalink
That is the updated version,
That is the updated version, but obviously the version number was never changed. You can simply change it to 0.0.2 or similar after downloading yourself.
BUT: WHEN INSTALLING THAT, YOU'D OVERWRITE ALL YOUR CHANGES, SO IT'S BETTER TO CHANGE THE CODE ON YOUR WORDPRESS INSTANCE DIRECTLY!
1791 Delegates
Thu, 01/11/2024 - 18:14
Permalink
Limited expertise
Hi Otacke,
Thanks for confirming that it's the updated version, but the version number never changed. That would explain why when I try uploading the updated version, I’m now seeing two plugins with the same version as seen here: number:
See: http://assets.1791delegates.org/v/hhpEerStmapr36UrLg7g
Forgive me, but I don’t have the expertise to change the code directly or to change plugin version names.
I welcome your expertise.
Thanks,
Nate
otacke
Mon, 01/15/2024 - 14:44
Permalink
Hi Nate!You should not see
Hi Nate!
You should not see the plugin twice - unless whoever customized it before renamed it (wisely). Could you reach out to that person?
Either way: All you should be required to do is to edit the h5pmods.php file inside the zip archive of the latest dowlonad. Line 17 holds the version number.
Best,
Oliver