1

The plugin generated 79 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

Code As Bellow

<?php
/*
Plugin Name:Stock Notifier
Plugin URI:
Description: product out of stock.
Version: 1
*/

include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) || class_exists( 'WooCommerce' )) {


class Stock_Notifier {

} // End Class GIS_Stock_Notifier

new Stock_Notifier();

}else { ?> 
<!-- When remove else then work perfect but i need display notice message -->
<div class="update-nag notice">
    <p>First Install Woocoomerce Plugin</p>
</div>  
<?php
}

Plugin depend to woocommerce plugin. When in else part Remove Start PHP and End PHP then work but How to print message of notice.

Suggest me. Thanks.

Ravi
  • 707
  • 1
  • 8
  • 18
  • Possible duplicate of [x characters generated by WordPress plugin during activation](https://stackoverflow.com/questions/4074477/x-characters-generated-by-wordpress-plugin-during-activation) – T.Todua Dec 24 '18 at 00:02

1 Answers1

0

Your plugin shouldn't output or echo anything by itself, and should instead use hooks to manipulate content.

If you do so, and still have the error

Plugin generated X lines of unexpected output during activation

you can install this to see what was the output of the plugin.

7heo.tk
  • 1,074
  • 12
  • 23