/**
 * @param $old_version
 * @param $act_version
 */
function print_changes_table_head($old_version, $act_version)
{
    $old_version_data = get_version_data($old_version);
    $act_version_data = get_version_data($act_version);
    echo '<thead>';
    echo '<tr>';
    echo '<th colspan="2" class="center">' . $old_version->version . '</th>';
    echo '<th colspan="2" class="center">' . $act_version->version . '</th>';
    echo '</tr>';
    echo '<tr>';
    print_version_deadline($old_version);
    print_version_deadline($act_version);
    echo '</tr>';
    echo '<tr>';
    print_version_progress($old_version_data[1], $old_version_data[2]);
    print_version_progress($act_version_data[1], $act_version_data[2]);
    echo '</tr>';
    echo '<tr>';
    echo '<td colspan="4">';
    echo '<hr width="100%"/>';
    echo '</td>';
    echo '</tr>';
    echo '</thead>';
}
                    $response[$slug]['url'] = $latest_package['url'];
                }
                // Info URL
            }
        }
        if (count($response) > 0) {
            print json_encode(array('new' => $response));
        } else {
            print json_encode(array('ok' => 'no updates'));
        }
        die;
        break;
    case 'plugin_information':
        if (isset($data['get'])) {
            $slug = $data['get'];
            $latest_vesion = get_latest_version($slug);
            $latest_package = get_version_data($slug, $latest_vesion);
            if (empty($latest_package)) {
                print json_encode(array('error' => 'not found', 'reason' => 'no package for ' . $slug));
            } else {
                print json_encode(array('info' => $latest_package));
            }
            die;
        }
        // let it error out 'casue the request is invalid
        break;
}
/// go away!
http_response_code(403);
print json_encode(array('error' => 'Access denied', 'reason' => 'No direct access'));
/* eof */