Put Up a New Version of a Download with Download Manager and AI
Swap a Download Manager file for its new version, with the version number updated and every link still working.
Prerequisites
A site connected to WPVibe running Download Manager 3.3.80 or newer (tested on 3.3.80, free) on WordPress 6.9 or newer, with an administrator account, and the Packages and Files groups turned on in Downloads, Settings, AI Abilities.
My WordPress site uses Download Manager. Put up version [the new version number] of [which download]. The new file is [a public link to the file, or its name in my Media Library]. 1. Run discover_abilities with category wpdm-packages, then wpdm-files. If the abilities this needs are not there, stop and tell me to install or update the free Download Manager plugin (3.3.80 or newer, on WordPress 6.9 or newer) and tick the Packages and Files groups in Downloads, Settings, AI Abilities, then save. 2. Run wpdm/list-packages with search set to a word from the download. If several match, show me their titles and ask which one. If none match, tell me and stop. 3. Run wpdm/get-package and tell me its status, its version, its files (ID, name, title) and its download count. If it has more than one file, list them, tell me the free plugin serves only the first, and that the new file goes on the end of the list, so the only way to serve it is to take every old file off. Ask whether to do that, and stop if I say no. If it has none, attach the new file as in step 4 and skip to step 6. 4. Attach the file with wpdm/attach-file: a public link goes in source url (it must be the file itself, not a page about it); a file in my Media Library goes in source media_id (find its ID with rest_api GET /wp/v2/media?search=FILE_TITLE, using its title or name). If the link doesn't end in the file's name, pass source filename too, with the right extension. If the file is only on my computer, tell me to upload it in Media, Add New, and tell you its name, then wait. If wpdm/attach-file refuses the file, tell me its message as it is and stop. If the message says the extension does not match the contents, the link is probably a page about the file rather than the file itself: ask me for a direct link. If it says the type is not allowed, tell me the allowed types are set in Downloads, Settings, Basic, Allowed file types to upload. Don't guess which types the site allows. If the file came from my Media Library and the download is limited to some roles, tell me the Media Library copy stays public at its own address, so I should delete it in Media once the download works. Pass version set to the new version number. If the new file comes from a link and has the same name as the old one, pass source filename with the version in it (for example price-list-v2.pdf): otherwise the site adds -1 to the name. If the download had one file and its title is not just its file name, pass the same title. Don't remove anything yet. 5. Tell me which files you will take off the download next (each ID and name), that they stay on the server, and that the download will give the new file from then on. Wait for my yes, then run wpdm/detach-file with each old file_id, one at a time. If I say no, take the new file off again with wpdm/detach-file, leave the version as it was, and stop. 6. Run wpdm/update-package with version set to the new version number. Don't change anything else. 7. Run wpdm/get-package and check it has exactly one file, the new one, and the new version. Tell me the download page (permalink), and that buttons and links to this download now give the new file.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Put Up a New Version of a Download with Download Manager and AI” recipe from the WPVibe cookbook on my connected site.
Your price list changed, your template got a fix, your template pack has a new release. The download page, the buttons on your posts and the links you already sent should all give the new file, without a second download or a broken link.
The AI finds the download, attaches the new file next to the old one, and takes the old file off only after your yes, so there is never a moment with nothing to download. It sets the new version number and checks that the download now has exactly one file, the new one.
The old file is taken off the download but stays on your server. The free plugin serves only the first file of a download, which is why the AI removes the old one rather than keeping both; a download with several files ends up with the new file alone, after your yes. Links and buttons to the download keep working and give the new file. Paste the prompt with the version number and a direct link to the new file.
Outcome
The download gives the new file under the new version number, and the old file is off the download but still on the server.