Skip to content

Fixing PHP notice caused by WordPress 3.9 update / Multisite performance updates#33

Merged
headstash merged 5 commits into
mvied:masterfrom
desrosj:master
Oct 15, 2015
Merged

Fixing PHP notice caused by WordPress 3.9 update / Multisite performance updates#33
headstash merged 5 commits into
mvied:masterfrom
desrosj:master

Conversation

@desrosj
Copy link
Copy Markdown

@desrosj desrosj commented Jul 21, 2014

Since WordPress 3.9, $wpdb::prepare requires at least one placeholder. The current line of code causes the following error:

PHP Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.) in /var/www/html/wp-includes/functions.php on line 3245

This is an error that will only effect multisite installs.

This pull fixes the notice, which appears hundreds of times per page load, causing a massive debug.log. Since we are not taking any input, we don't really need to prepare the query anyways.

desrosj added 2 commits July 21, 2014 09:58
…r hosts, and caches the array of hosts after it runs the first time.

Actual code changes are at line 49, and lines 136-153.
@desrosj
Copy link
Copy Markdown
Author

desrosj commented Aug 25, 2014

After implementing my changes for multisite performance, a site that was running an average of 1500 queries @ 246ms average dropped significantly (90% drop in queries -160 average, 81% drop in speed - 90ms average).

@desrosj desrosj changed the title Fixing PHP notice caused by WordPress 3.9 update. Fixing PHP notice caused by WordPress 3.9 update / Multisite performance updates Aug 25, 2014
@desrosj
Copy link
Copy Markdown
Author

desrosj commented Oct 20, 2014

Refreshed my commit so it will merge without conflicts.

Also, it appears that other pull requests (#32) fixed the warnings that my patch fixed, so only included my performance fixes.

headstash added a commit that referenced this pull request Oct 15, 2015
Fixing PHP notice caused by WordPress 3.9 update / Multisite performance updates
@headstash headstash merged commit 99729cd into mvied:master Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants