Support » Plugins » OptimizePress incorrect warning about WP_MEMORY_LIMIT in some cases

  • Here’s a minor bug report about the OptimizePress plugin.

    When using OptimizePress, this message appears, even if PHP’s memory_limit is set to a number higher than 64 MB:

    Your WP memory limit (40MB) is lower than recommended (64MB)

    To “fix” this, it suggests adding something like this to wp-config.php:

    define( ‘WP_MEMORY_LIMIT’, ’64M’ );

    This is incorrect, though. The OptimizePress code is using WP_MEMORY_LIMIT the wrong way. That constant is not the amount of memory currently available to WordPress PHP scripts. Instead, it is used in “/wp-includes/default-constants.php” to try to raise the memory to that limit if (and only if) the current php systemwide “memory_limit” setting is lower than WP_MEMORY_LIMIT.

    So if the current PHP memory_limit is, say, 200 MB, the WordPress “WP_MEMORY_LIMIT” value is irrelevant and unused. Setting it to 64M in wp-config.php is pointless and does nothing except suppress the incorrect OptimizePress warning.

    OptimizePress could check “ini_get( ‘memory_limit’ )”, and only show this warning if both that and WP_MEMORY_LIMIT are both lower than 64 MB.

  • The topic ‘OptimizePress incorrect warning about WP_MEMORY_LIMIT in some cases’ is closed to new replies.