'note for self', '222' => 'like the URL of the user' ); // Strip away comments $allowed_clients = array_keys($allowed_clients); $versions['check'] = array( array( 'version' => '0.5', 'package' => 'http://api.example.com/plugin-0.5.zip' ) ); // Check if the request is valid if (!isset($_POST['name']) || $disable_update || !is_array($versions[$_POST['name']])) return; // Check if client can receive updates if (!in_array($_POST['api-key'], $allowed_clients)) return; $latest_version = array_shift($versions[$_POST['name']]); if (version_compare($_POST['version'], $latest_version['version'], '<')) print serialize($latest_version); if ($disable_update && !isset($_POST)) print_r($versions); ?>