0

I have create a plugin in see the below code:-

/**
 * Plugin Name: gv-potfilio
 * Plugin URI: https://zeusadsolutions.com
 * Description: Potfolio sdds
 * Version: 1.2.1
 * Author: Mr. Gaurav Baliyan
 * Author URI: https://zeusadsolutions.com
 * License: GPL2dsd
*/
if ( ! defined( 'ABSPATH' ) ) {
    exit; 
}
function form_creation(){
    return '<div id="my-gallery"></div>';
    }
add_shortcode('gv-gallery', 'form_creation');

But we found one error. "The plugin generated 2 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."

Gaurav
  • 201
  • 1
  • 2
  • 9

2 Answers2

0

Do you maybe have a line break or spaces before the opening <?php in your file, or any white space after the final closing ?> (You can remove the final php end tag if only white space follows)?

janh
  • 2,885
  • 2
  • 22
  • 21
0

I have check a code there is an issue with space only nothing else.You have to check that is there any space before

<?php
/**
 * Plugin Name: gv-potfilio
 * Plugin URI: https://zeusadsolutions.com
 * Description: Potfolio sdds
 * Version: 1.2.1
 * Author: Mr. Gaurav Baliyan
 * Author URI: https://zeusadsolutions.com
 * License: GPL2dsd
*/
if ( ! defined( 'ABSPATH' ) ) {
    exit; 
}
function form_creation(){
    return '<div id="my-gallery"></div>';
    }
add_shortcode('gv-gallery', 'form_creation');
?>
Vasim Shaikh
  • 4,485
  • 2
  • 23
  • 52