• Resolved rogal

    (@rogal)


    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.

    https://wordpress.org/plugins/advertising-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author switzer

    (@switzer)

    rogel: Checking into it.

    Plugin Author switzer

    (@switzer)

    rogel: Currently, all data for advertising manager is saved as a single blob into the WP options table. Obviously you have more ads + stats than your system can handle. However, I will take some of the blame here because we really should store the data in a more elegant format.

    The most efficient way to fix is to move from storing all data in the plugin_advman option to storing in the following options:

    plugin_advman – settings
    plugin_advman_ads – all of your ads
    plugin_advman_networks – all of your network settings
    plugin_advman_stats_(day) – all statistics on a given day

    Then, when dealing with data, you only pull the data you need from the DB, rather than pulling and storing the whole blob ever time.

    I will work on this change and release in the next version.

    Thread Starter rogal

    (@rogal)

    In my case, Dreamhost have increased the memory allocation in my DreamPress installation so that has taken care of it. I guess the memory load will be causing problems for others so when you improve it users of your plugin will appreciate it.

    Thanks,

    Rodger

    Plugin Author switzer

    (@switzer)

    Hi Rodger,

    v3.5.2 has split out the data into a number of DB fields, and also split out the backups into a number of fields, so that this will likely not be an issue.

    Thanks,
    Scott

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Advertising Manager 3.5.1 causes issues with server and other plugins’ is closed to new replies.