Issue on HTTP
-
Hello we have a big issue when we work offline or on HTTP
The main problem is that your plugin always checks the last version of siteorigin-installer (which is not great)
and the request always offline or HTTP returns error
And because is an error the value instead of ARRAY is FALSE. But your code expects an array. The solution is straightforward
In siteorign-panels and so-widgets-bundle in file github-plugin-updater.php
in this code
public function check_for_update( $transient ) {
$all_headers = $this->get_plugin_headers();
$plugin_path = $this->get_plugin_path();if ( version_compare( SITEORIGIN_INSTALLER_VERSION, $all_headers[‘Version’], ‘<‘ ) ) {
// There is a newer version available on Github
$update = new stdClass();
$update->slug = $plugin_path;
$update->new_version = $all_headers[‘Version’];
$update->url = $all_headers[‘PluginURI’];
$update->package = ‘https://github.com/siteorigin/siteorigin-installer/archive/’ . self::UPDATES_BRANCH . ‘.zip’;$transient->response[ $plugin_path ] = $update;
}return $transient;
}add verification that $all_headers are not false
public function check_for_update( $transient ) {
$all_headers = $this->get_plugin_headers();
$plugin_path = $this->get_plugin_path();if ( $all_headers && version_compare( SITEORIGIN_INSTALLER_VERSION, $all_headers[‘Version’], ‘<‘ ) ) {
// There is a newer version available on Github
$update = new stdClass();
$update->slug = $plugin_path;
$update->new_version = $all_headers[‘Version’];
$update->url = $all_headers[‘PluginURI’];
$update->package = ‘https://github.com/siteorigin/siteorigin-installer/archive/’ . self::UPDATES_BRANCH . ‘.zip’;$transient->response[ $plugin_path ] = $update;
}return $transient;
}OR verify that $all_headers[‘Version’] is set because if is not set there is an error notice.
Thank you
- The topic ‘Issue on HTTP’ is closed to new replies.