q2a-social-share
q2a-social-share copied to clipboard
High Resource Usage- Probably memory leak on PHP 7.0
Hi, I was using this plugin and had no issue until I moved to PHP 7.0 on Ubuntu 16.04. Since then my site was crashing and finally it worked when I uninstalled social-share plugin. Not sure what the issue is as everything is normal on Ubuntu 14.04.
Were you running on PHP 7 on Ubuntu 14.04 ?
Nopes, it was PHP 5.x. But the issue is not there on another Q2A site running on same server. So, I again tried debugging and pinned the problem to this part:
if (!empty( $image_url ) ) {
$image_data = @getimagesize( $image_url );
$imageOg = new OpenGraphProtocolImage();
$imageOg->setURL( $image_url );
$imageOg->setWidth( !empty( $image_data[0] ) ? $image_data[0] : 1200 );
$imageOg->setHeight( !empty( $image_data[0] ) ? $image_data[0] : 630 );
if ( !empty( $image_data['mime'] ) ) {
$imageOg->setType( $image_data['mime'] );
}
$ogp->addImage( $imageOg );
}
The @getimagesize function call seem to cause the issue of memory leak but is not happening on another Q2A running on same server. All other plugins are the same too. :O
Ok. I will take a look on this
Thanks..
@amiyasahu : Can I use the plugin, if the issue is fixed?