where I have to put example-theme.zip and which class is correct ?
Closed this issue · 9 comments
- my question is, where I have to put example-theme.zip ? in the packages directory?
I also like to say that when I place example-theme.zip in packages directory in wp-update-server and check this url :
(http://localhost/wp-update-server/?action=get_metadata&slug=example-theme) in the browser,
I receive this response json in browser:
{
"name": "example-theme",
"version": "1.8",
"homepage": "http://localhost/example-theme/",
"author": "the WordPress team",
"author_homepage": "http://localhost/",
"details_url": "http://localhost/my-theme-changelog/my-theme-changelog.html",
"last_updated": "2021-05-21 11:24:06",
"slug": "example-theme",
"download_url": "http://localhost/wp-update-server/?action=download&slug=example-theme",
"request_time_elapsed": "0.018"
} - which class is correct ? (Puc_v4_Factory::buildUpdateChecker or ThemeUpdateChecker) for functions.php in my example-theme
thankyou alot
- Yes, put the ZIP file in the
packages
directory. If you're getting a valid JSON response, the ZIP file is probably already in the right place. Puc_v4_Factory::buildUpdateChecker()
is the more recent version.ThemeUpdateChecker
is outdated and no longer maintained. It might still work, but I would not recommend using it in new projects.
Your screenshot isn't showing up for some reason. However, based on the JSON that you posted earlier, the version on the server is 1.8, not 2.1. Are you sure you have the latest version in the packages
directory? It might still have an older file, or the version number in the file is incorrect.
That looks OK to me, too. The version numbers are correct, and the fact that the JSON response shows the new version means that the ZIP file is in the right place.
Could it be that the code that sets up the update checker is wrong? Please make sure that it has the right URL, file name and theme slug.
I think that looks fine. And this theme is active, yes?
If it still doesn't work, try installing the Debug Bar plugin and look at he "PUC (example-theme)" panel in the debug bar. Does it show the correct information for your theme? You can also try manually triggering an update check (there should be a button for that in the panel) and see what happens.
That looks like a custom icon that was probably added by another plugin or theme. I don't know how it was done. This update checker doesn't have a feature like that. It just lets WordPress core generate the notifications.