Advertising Manager 3.5.1 causes issues with server and other plugins
-
Hi Scott
Since upgrading to Advertising Manager 3.5.1, I’ve had problems with partial page loads for some pages on raglan23.co.nz
At first I thought it was Jetpack so disabled that. Then I thought it was Business Directory as the issue stopped when that was deactivated.
The developer for Business Directory investigated the issue and found that it was a line of code in Advertising Manager that was causing a high demand on server memory. See the full report below.
So basically either Advertising Manger has to be made to run with less memory or the provider has to allow more memory and that often isn’t an option on a shared server.
Regards,
Rodger
Business Directory Report and Advice
This was a memory limit, just as I thought. That it disappeared when either BD or Advertising Manager were disabled just supports that. The same thing would’ve happened if other plugins were disabled.
Instead of commenting out the problematic line like I did before, I now followed the execution of that function to see where it was failing exactly.
After passing through several classes and functions the incrementStats() function above ends up calling update_option inside advertising-manager/lib/Advman/Dal.php (line 92). This is the exact spot where the script execution stopped.I checked the memory usage before the update_option() call: it was 113 MB and the configured memory limit for PHP is 128 MB. Since update_option()does several things internally, some of which include retrieving the previous value (which in this case is a huge array), it’s completely normal for this function to exceed the limit.
In some severs, you can increase the memory limit via a PHP function (ini_set()). That was the case here so I increased the limit to 256M by adding some code to advertising-manager/advertising-manager.php (line 17):
@ini_set( ‘memory_limit’, ‘256M’ );
That makes everything work with no line commented out, proving the memory limit was the problem all along. That being said, this is hack. If the customer has a way to increase the memory limit via some admin panel or by contacting the hosting provider, that’s what he should do.
After that, he should remove the line above.
- The topic ‘Advertising Manager 3.5.1 causes issues with server and other plugins’ is closed to new replies.