Bug + fix – Broken plugin path throwing errors
-
The plugin has a hardcoded path which causes issues on WP installations that have a different file structure.
The message is:
Warning: fopen(/path/to/site/web/wp/wp-content/plugins/gravityforms/gravityforms.php): failed to open stream: No such file or directory
This error is caused by:
gf-form-multicolumn/includes/public/WH_GF_Multicolumn_Public_Form_Current.php
in
WH\GF\Multicolumn\Site\WH_GF_Multicolumn_Public_Form_Current::structure_form_elements
at line 120.In plugin trunk: https://plugins.trac.www.ads-software.com/browser/gf-form-multicolumn/trunk/includes/public/WH_GF_Multicolumn_Public_Form_Current.php#L119
The offending code is:
$gfInstallation = get_plugin_data( ABSPATH . 'wp-content/plugins/gravityforms/gravityforms.php' );
The solution is:
$gfInstallation = get_plugin_data( WP_CONTENT_DIR . 'plugins/gravityforms/gravityforms.php' );
tl;dr do not assume the path to the plugins directory as this can be different for some installations.
- The topic ‘Bug + fix – Broken plugin path throwing errors’ is closed to new replies.