Comments (14)
Try downloading the update manually and see what error message (if any) you get.
While the download URL can be truncated in the plugin update log, you can get it another way:
- Install Debug Bar.
- Click the "Debug" link in the admin bar and open the "PUC (your-plugin-slug)" panel.
- You should see a bunch of debugging information about the update checker. Just scroll down to the "Download Url" field.
from wp-update-server.
Hi,
Thanks for the reply. When I download the update manually, the file does download without error.
I am installing the debug components and will let you know those results as soon as I have them. Thanks!
Mark
from wp-update-server.
The "Download URL" in the debug information only shows up as:
http://plugins.mydomain.com/updates/?
(My domain redacted.)
Note: I am using WordPress 3.6 in case it's relevant.
from wp-update-server.
That URL is definitely wrong. There should be at least two parameters after the question mark.
Some ideas:
- Find the "download_url" key in the update JSON. Does it contain the same incorrect URL, or something else?
- The download URL is generated by the
Wpup_UpdateServer::generateDownloadUrl()
method inwp-update-server/includes/Wpup/UpdateServer.php
. Try adding some diagnostic output to see where it goes wrong, or step through it with a debugger. - Check your PHP error log for messages relating to this library.
from wp-update-server.
Thanks.
The "download_url" key in the JSON is the same incorrect URL:
"download_url":"http://plugins.mydomain.com/updates/?"
There are no PHP error logs at all.
I'll take a look at the code you mentioned which generates the download URL, and add anything else I find.
Thanks!
Mark
from wp-update-server.
Strange, I can't find any reason that the entire URL isn't generated. However I probably don't know a fraction of what you do about how to diagnose and debug it, sorry. :-(
from wp-update-server.
Sorry, I'm not sure what else to do in terms of diagnosing and debugging. Could this be an issue caused by something new in WP 3.6?
from wp-update-server.
Probably not 3.6-related, no. I have a commercial plugin that relies on this library, and it runs fine on my WP 3.6 site.
Did you try adding some debug output to the function I mentioned? Even something as simple as this could help:
protected function generateDownloadUrl(Wpup_Package $package) {
$query = array(
'action' => 'download',
'slug' => $package->slug,
);
$result = self::addQueryArg($query, $this->serverUrl);
var_dump($query, $this->serverUrl, $result);
return $result;
}
This modified version will dump the values of the three main variables involved in download URL generation into the JSON output. You can then view the metadata URL in the browser and see if the values make sense. If it turns out that, for example, the $query
array has the correct values for your plugin but addQueryArg()
fails to properly append them to $this->serverUrl
, the bug probably lies somewhere in addQueryArg()
and that's the function we should investigate next.
from wp-update-server.
Hi,
Okay, I've found something relevant. We're running PHP 5.4 on this server. Just to see if it was an issue with that version, I reverted to PHP 5.3. And the problem went away. (Well, I didn't test completely but the JSON data shows the proper URL in PHP 5.3.
So I'd assume that all your code is fine but there is some function or other element that is incompatible with PHP 5.4. I'm wondering what would be necessary to make it work in 5.4, as we'll need to keep current on PHP versions.
I hope this helps!
Thanks,
Mark
from wp-update-server.
I also tested in PHP 5.5, and it seems to work there. So, to recap:
- 5.3 works
- 5.4 does not work
- 5.5 works
In each case the PHP configurations are identical in terms of modules (except for any that aren't supported in the particular version).
Again, hope this helps.
from wp-update-server.
Interesting. Which minor version of PHP 5.4 are you using? I just tested it in PHP 5.4.3 and it output the correct download URL. This was when running the update server as a stand-alone script, not a WP plugin. The only issue I noticed was a bunch of unrelated E_STRICT warnings.
There doesn't seem to be any code that would be obviously incompatible with PHP 5.4, but it's possible that one of the functions or syntax features that it uses has a subtly different behaviour in your PHP version and that is what trips it up. I would still recommend adding some debugging code to the relevant method(s). Also, in case the problem is somehow related to closures, try commenting out these lines in UpdateServer.php
:
//Remove null/false arguments.
$query = array_filter($query, function($value) {
return ($value !== null) && ($value !== false);
});
from wp-update-server.
It is 5.4.19.
We can use PHP 5.5 as a workaround, however I'll follow your debugging suggestions and continue working on this in case we can help someone else using 5.4. I'll post any relevant results ASAP.
from wp-update-server.
The problem seems to be solved by commenting out the lines you suggested:
//Remove null/false arguments.
$query = array_filter($query, function($value) {
return ($value !== null) && ($value !== false);
});
from wp-update-server.
Hmm, are you completely sure it is PHP 5.4.19 and not something older? The only reason I can think of that would cause those lines to fail is if the PHP version used did not support closures. Closures were introduced in PHP 5.3.
By the way, I just tested it with PHP 5.4.19 (on Windows) and still could not reproduce the problem.
from wp-update-server.
Related Issues (20)
- Issue with the latest wp-update-server version HOT 5
- Critical Error Upon Setup HOT 4
- PHP8 deprecation notices HOT 4
- Sudenly I get: Update failed: You have the latest version of the plugin. HOT 10
- Handling alpha and beta plugin versions HOT 2
- Problem connecting server with checker library HOT 1
- Is it possible to add a list of domains to update? HOT 5
- How about implementing WordPress Code Standards? HOT 4
- Server maintenance questions. HOT 4
- PHP 8.2.7 Deprecated warnings on Server returning metadata (WP_DEBUG true) HOT 3
- Extension for packages list HOT 4
- Need a little help with extends Wpup_UpdateServer HOT 5
- What's going on here? HOT 3
- Can you change it to a remote zip URL? HOT 2
- guidance HOT 1
- Forbidden HOT 13
- Update Packagist HOT 2
- where I have to put example-theme.zip and which class is correct ? HOT 9
- unexpected error HOT 1
- Secure download link error message HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-update-server.