Title: Scriptrunner (Doug Sparling)'s Replies - page 10 | WordPress.org

---

# Scriptrunner (Doug Sparling)

  [  ](https://wordpress.org/support/users/scriptrunner/)

 *   [Profile](https://wordpress.org/support/users/scriptrunner/)
 *   [Topics Started](https://wordpress.org/support/users/scriptrunner/topics/)
 *   [Replies Created](https://wordpress.org/support/users/scriptrunner/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/scriptrunner/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/scriptrunner/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/scriptrunner/engagements/)
 *   [Favorites](https://wordpress.org/support/users/scriptrunner/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 136 through 150 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/9/?output_format=md)
[1](https://wordpress.org/support/users/scriptrunner/replies/?output_format=md) 
[2](https://wordpress.org/support/users/scriptrunner/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/scriptrunner/replies/page/3/?output_format=md)…
[9](https://wordpress.org/support/users/scriptrunner/replies/page/9/?output_format=md)
10 [11](https://wordpress.org/support/users/scriptrunner/replies/page/11/?output_format=md)…
[33](https://wordpress.org/support/users/scriptrunner/replies/page/33/?output_format=md)
[34](https://wordpress.org/support/users/scriptrunner/replies/page/34/?output_format=md)
[35](https://wordpress.org/support/users/scriptrunner/replies/page/35/?output_format=md)
[→](https://wordpress.org/support/users/scriptrunner/replies/page/11/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Having issue with a Warning: division by zero](https://wordpress.org/support/topic/having-issue-with-a-warning-division-by-zero/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/having-issue-with-a-warning-division-by-zero/#post-4230762)
 * The 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Very High CPU/Memory Usage After Theme Change](https://wordpress.org/support/topic/very-high-cpumemory-usage-after-theme-change/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/very-high-cpumemory-usage-after-theme-change/#post-4228131)
 * No, I don’t believe SAVEQUERIES needs WP_DEBUG on. Two separate things.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [I accidentally deleted code and now this line is way off…](https://wordpress.org/support/topic/i-accidentally-deleted-code-and-now-this-line-is-way-off/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/i-accidentally-deleted-code-and-now-this-line-is-way-off/#post-4230058)
 * 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [500 Server Error, TEMPLATEPATH not defined and a VERY weird fix](https://wordpress.org/support/topic/500-server-error-templatepath-not-defined-and-a-very-weird-fix/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/500-server-error-templatepath-not-defined-and-a-very-weird-fix/#post-4227127)
 * Happens 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [A way to lock a user account from being edited?](https://wordpress.org/support/topic/a-way-to-lock-a-user-account-from-being-edited/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/a-way-to-lock-a-user-account-from-being-edited/#post-4228341)
 * I’m the author of WP Admin No Show (so thanks [@leejosepho](https://wordpress.org/support/users/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](https://wordpress.org/support/users/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](http://www.wpbeginner.com/wp-tutorials/how-to-remove-the-password-reset-change-option-from-wordpress/)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [500 Server Error, TEMPLATEPATH not defined and a VERY weird fix](https://wordpress.org/support/topic/500-server-error-templatepath-not-defined-and-a-very-weird-fix/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/500-server-error-templatepath-not-defined-and-a-very-weird-fix/#post-4227105)
 * First, `wp-settings.php` is 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…
 * `foreach` doesn’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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Activation Email](https://wordpress.org/support/topic/activation-email-1/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/activation-email-1/#post-4218946)
 * You might try the WordPress[ Check Email](http://wordpress.org/plugins/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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Very High CPU/Memory Usage After Theme Change](https://wordpress.org/support/topic/very-high-cpumemory-usage-after-theme-change/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/very-high-cpumemory-usage-after-theme-change/#post-4228064)
 * I 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](http://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis)
   in the Codex page [Editing wp-config.php](http://codex.wordpress.org/Editing_wp-config.php).
 * or
 * 2) Used the [Debug Queries](http://wordpress.org/plugins/debug-queries/) plugin.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to Integrate an External Database into WP](https://wordpress.org/support/topic/how-to-integrate-an-external-database-into-wp/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-integrate-an-external-database-into-wp/#post-4223026)
 * Normally 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Subscriber notification emails not going out after 3.6.1 update](https://wordpress.org/support/topic/subscriber-notification-emails-not-going-out-after-361-update/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/subscriber-notification-emails-not-going-out-after-361-update/#post-4221137)
 * Oh, 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Not able to search for new themes](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/#post-4217609)
 * At 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 `$request` in `wp-admin/includes/theme.php` and 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Not able to search for new themes](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/#post-4217607)
 * cURL 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Not able to search for new themes](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/not-able-to-search-for-new-themes/#post-4217603)
 * Interesting, 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-Encoding
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Internal server error](https://wordpress.org/support/topic/internal-server-error-urgent/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/internal-server-error-urgent/#post-4222029)
 * Actually, 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](http://wordpress.org/plugins/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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Internal server error](https://wordpress.org/support/topic/internal-server-error-urgent/)
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/internal-server-error-urgent/#post-4222006)
 * If 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.

Viewing 15 replies - 136 through 150 (of 520 total)

[←](https://wordpress.org/support/users/scriptrunner/replies/page/9/?output_format=md)
[1](https://wordpress.org/support/users/scriptrunner/replies/?output_format=md) 
[2](https://wordpress.org/support/users/scriptrunner/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/scriptrunner/replies/page/3/?output_format=md)…
[9](https://wordpress.org/support/users/scriptrunner/replies/page/9/?output_format=md)
10 [11](https://wordpress.org/support/users/scriptrunner/replies/page/11/?output_format=md)…
[33](https://wordpress.org/support/users/scriptrunner/replies/page/33/?output_format=md)
[34](https://wordpress.org/support/users/scriptrunner/replies/page/34/?output_format=md)
[35](https://wordpress.org/support/users/scriptrunner/replies/page/35/?output_format=md)
[→](https://wordpress.org/support/users/scriptrunner/replies/page/11/?output_format=md)