• Resolved Alfinator39

    (@alfinator39)


    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/&#8217; . 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/&#8217; . 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Andrew Misplon

    (@misplon)

    Hi, thanks for your detailed feedback; it’s most appreciated. I’ve asked Alex at SiteOrigin to reply with a solution as soon as he’s able to.

    Kind regards

    Andrew

    Plugin Contributor alexgso

    (@alexgso)

    Hi,

    Thank you for the report. I’ve run a few tests and come up with a fix to prevent this. This fix will be included in a future update.

    Kind regards,
    Alex

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue on HTTP’ is closed to new replies.