Scriptrunner (Doug Sparling)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Having issue with a Warning: division by zeroThe error message says it’s in your theme:
Warning: Division by zero in /home3/charis/public_html/wp-content/themes/Pricerr/functions.php on line 1711
The code on line 1711 in the Pricerr functions.php file:
$sdd = ceil($sum/$nr_ratings);is the culprit. The the author does not check if $nr_ratings is 0 or not before doing the division and apparently $nr_ratings is 0 in your case and causing the error.
The Pricerr theme appears to be a premium theme and you should contact the theme author.
Forum: Fixing WordPress
In reply to: Very High CPU/Memory Usage After Theme ChangeNo, I don’t believe SAVEQUERIES needs WP_DEBUG on. Two separate things.
Forum: Fixing WordPress
In reply to: I accidentally deleted code and now this line is way off…It’s this bit of html that’s creating the line:
<div id="comments"> β¦ </div>and the css tied to the “comments” selector. Maybe your original theme style.css is cached.
Forum: Fixing WordPress
In reply to: 500 Server Error, TEMPLATEPATH not defined and a VERY weird fixHappens to the best of us. Mistakes are are a great way to learn π
I guess I didn’t completely answer your question, though I assume you may have deduced it. Since you were only loading that last active plugin in the foreach loop, all the others were not, so basically all the other plugins were essentially disabled, and that must have included the one that was causing the original error.
Good luck and happy coding!
Forum: Fixing WordPress
In reply to: A way to lock a user account from being edited?I’m the author of WP Admin No Show (so thanks @leejosepho for the recommendation). Removing the reset password functionality was something I’d never thought of, though I may consider it as an option (it’s never been requested before, so not sure if there’s much demand).
However, @kytro360, you might check out this article if you need to prevent password resets from the login form:
How to Remove the Password Reset / Change option from WordPress
Forum: Fixing WordPress
In reply to: 500 Server Error, TEMPLATEPATH not defined and a VERY weird fixFirst,
wp-settings.phpis not your problem, that’s a WordPress core file, and not one you should change.To answer your question…
foreach ( wp_get_active_and_valid_plugins() as $plugin ) print($plugin); include_once( $plugin ); unset( $plugin );does not do what you think it does…
foreachdoesn’t require a curly bracket if there is only one statement, but does if there are multiple statements.So your update above, is the same as if you had written it this way:
foreach ( wp_get_active_and_valid_plugins() as $plugin ) { print($plugin); } include_once( $plugin ); unset( $plugin );So it printed every plugin, but only included the last one. (assuming there were more than one active plugins)
Your second bit of modified code:
foreach ( wp_get_active_and_valid_plugins() as $plugin ) (function(){}); include_once( $plugin ); unset( $plugin );basically did the same thing, but without printing anything. (it just included the last active plugin)
Forum: Fixing WordPress
In reply to: Activation EmailYou might try the WordPress Check Email plugin to see if you can send (and receive) email outside of any form or other plugin. If it doesn’t work, probably wouldn’t hurt to try with all other plugins deactivated.
Forum: Fixing WordPress
In reply to: Very High CPU/Memory Usage After Theme ChangeI once bought a premium theme that just killed my server. I went ahead and debugged it myself as I didn’t have time to wait and found that they had used the wrong hook and every page hit was running the theme initialization code, which included a ton of database queries and update. May not apply to your situation, but worth a look.
I can’t recall, but I either:
1) Added SAVEQUERIES to wp-config.php. See Save queries for analysis in the Codex page Editing wp-config.php.
or
2) Used the Debug Queries plugin.
Forum: Fixing WordPress
In reply to: How to Integrate an External Database into WPNormally you would get a e-commerce theme or plugin and then import your data into WordPress. You’ll probably have to export your existing data as a CSV file and import that or just do it manually.
Forum: Fixing WordPress
In reply to: Subscriber notification emails not going out after 3.6.1 updateOh, man, yeah, the obvious! π I should have thought of that. Sometimes I don’t see the forest for the trees…glad you got if solved.
Forum: Fixing WordPress
In reply to: Not able to search for new themesAt this point, if it were me, I’d have to debug from within WordPress core to see what’s coming back from the request in WordPress itself. For instance, if I var_dump
$requestinwp-admin/includes/theme.phpand turn of wifi (I’m on my laptop), I get:/common-controller.php on line 315 object(WP_Error)#258 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(87) "Could not resolve host: api.wordpress.org; nodename nor servname provided, or not known" } } ["error_data"]=> array(0) { } }That said, you shouldn’t have to do this, (and you probably shouldn’t), I’d say it has to be a server issue.
There are a lot of reasons the request could fail, but to see the error message:
An unexpected error occurred. Something may be wrong with WordPress.org or this serverβs configuration. If you continue to have problems, please try the support forums.
I think that only happens if the request failed or the data that came back was bad (or empty).
Forum: Fixing WordPress
In reply to: Not able to search for new themescURL isn’t the only transport used (curl, streams, and fsockopen), but WordPress will look for curl first.
So, one more cURL attempt. Actually query the API instead of just calling the HEAD:
Themes – search for ‘blue’
curl --data 'action=query_themes&request=O:8:"stdClass":4:{s:4:"page";i:1;s:8:"per_page";i:36;s:6:"fields";N;s:6:"search";s:4:"blue";}' http://api.wordpress.org/themes/info/1.0/Plugins – search for ‘cache’
curl --data 'action=query_plugins&request=O:8:"stdClass":3:{s:4:"page";i:1;s:8:"per_page";i:30;s:6:"search";s:5:"cache";}' http://api.wordpress.org/plugins/info/1.0/In both cases you should get a load of serialized data back.
Forum: Fixing WordPress
In reply to: Not able to search for new themesInteresting, you’re the second person I’ve seen post that they can search plugins but not themes via WordPress admin. In the other poster’s case, he just contacted his host (I think they had to whitelist a URL).
What happens when you do this:
curl -I http://api.wordpress.org/plugins/info/1.0/and
curl -I http://api.wordpress.org/themes/info/1.0/That will at least tell you if you have cURL installed and if you can make the connection to the repspecitve APIs (though you’ve already said you can search plugins). If you can, you should see output something like this:
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 15 Oct 2013 14:06:36 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Vary: Accept-EncodingForum: Fixing WordPress
In reply to: Internal server errorActually, I’m getting 404 errors on your page links. Try setting your permalinks back to the default (in Admin, go to Settings->Permalinks, select “Default” snd “Save Changes” button).
Then reload your home page (do a full refresh) and try the links. if that works, try setting your permalinks back to whatever you had the set at before.
Of course, if that doesn’t work, you need to try deactivating plugins and try a default theme (or use the Safe Mode plugin, which lets you do that just by passing a query string param, so it won’t effect the site for regular visitors).
Forum: Fixing WordPress
In reply to: Internal server errorIf you’re getting internal server errors then the first thing you need to do is look at your server error logs. Sometimes you can access them from a control panel. Depends on your host.
On another note, if your host doesn’t respond in a timely manner, you might want to look for another host, especially if this is where you’re hosting a site for an important client.