Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Monar社交共享插件内存泄漏问题_Php_Wordpress_Memory Leaks - Fatal编程技术网

Php Monar社交共享插件内存泄漏问题

Php Monar社交共享插件内存泄漏问题,php,wordpress,memory-leaks,Php,Wordpress,Memory Leaks,在过去的两周里,我一直在为这个问题与优雅的主题和WPEngine进行斗争,但这两个方面我都毫无进展 以下是日志中的一个错误: [Wed Apr 26 20:37:29.797099 2017] [:error] [pid 9802] [client 192.104.203.89:55604] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 218817933 bytes)

在过去的两周里,我一直在为这个问题与优雅的主题和WPEngine进行斗争,但这两个方面我都毫无进展

以下是日志中的一个错误:

[Wed Apr 26 20:37:29.797099 2017] [:error] [pid 9802] [client 192.104.203.89:55604] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 218817933 bytes) in /nas/content/live/amberrein/wp-content/plugins/monarch/monarch.php on line 4279, referer: http://www.amberreinhardt.com/category/weddings/
我已经通过wp-config.php提高了内存限制:

define( 'WP_MEMORY_LIMIT', '1024M' );
define( 'WP_MAX_MEMORY_LIMIT', '1024M' );
内存泄漏是非常偶然的。有些博客帖子很好,而另一些则不行。然后,我回去参观一个工作岗位,然后因为泄漏,它没有加载,所以无论出于什么原因,它都会改变或发生什么。我不知道。内存泄漏量总是不同的,但永远不会高于我设置的限制。但是,它也似乎越高的限制,就需要更长的时间后加载,如果它确实加载,这是奇怪的

这是我认为导致错误的整个函数。第4279行以
$content
开头:

功能显示\媒体($content){ $monar\u options=$this->monar\u options

if ( $this->check_applicability( $monarch_options[ 'sharing_media_post_types' ], 'media' ) ) {
    preg_match_all( '/<img [^>]*>/s', $content, $images_array );
    foreach ( $images_array[0] as $image ) {
        if ( false !== strpos( $image, 'class="ngg_' ) ) {
            continue;
        }

        preg_match( '@src="([^"]+)"@' , $image , $image_src );

        $icons       = $this->generate_media_icons( $image_src[1] );
        $replacement = '<div class="et_social_media_wrapper">' . $image . $icons . '</div>';
        $content     = str_replace( $image, $replacement, $content );
    }
}

return $content;
if($this->检查适用性($monar\u选项['sharing\u media\u post\u types'],'media')){
preg_match_all('/generate_media_icons($image_src[1]);
$replacement='.$image.$icons';
$content=str_replace($image,$replacement,$content);
}
}
返回$content;
}


既然优雅主题和WPEngine没有帮助,我该怎么做才能解决这个问题呢?我不想在客户端想要保留插件时禁用插件。

我显然已经这样做了。我已经和开发人员来回奔波了两个多星期,但没有真正的结果。不仅如此,我们还在Conconn中使用Monar插件与Divi主题相关的问题已经由同一个开发人员开发了2年多,从未遇到过此类问题。由于他们显然无法为我提供所需的帮助,我想我会在这里联系。您还没有告诉我们您已经尝试了什么,所以您可以预期大多数建议都属于以下类别:“我已经试过了。”。你试过自己调试代码吗?你有调试经验吗?问题是我们无法重现你的问题,请在你的问题中给出代码。请参阅:最后:如果你将
/*..*/
放在你显示的代码片段的循环中,会发生什么?