This plugin generated 3 characters of unexpected output during activation

0

I'm creating a Zero plugin for Wordpress. All I want is to create shortcodes to print forms in php.

But just put:

<?php
 /*
 Plugin Name: BluePotion Form
 Plugin URI: http://bluepotion.com.br/
 Description: Plugin teste
 Author: Kauê Nicoletti Alves
 Author URI: http://bluepotion.com.br/
 Text Domain: BluePotion Form
 Domain Path: /
 Version: 1.0 
 */

You already receive the error:

  

This plugin generated 3 characters of unexpected output during activation.

And this is preventing me from updating pages or even activating other plugins before you deactivate mine.

I want to make this plugin work so that I can update pages and posts without problem.

Here is the code so far:

        <?php 
    /*
    Plugin Name: Blue Potion Form
    Plugin URI:  local
    Description: Formularios de envio de email.
    Version:     1.0
    Author:      Kauê Nicoletti Alves
    Author URI:  www.bluepotion.com.br
    License:     ----
    License URI: ----
    Text Domain: wporg
    Domain Path: /languages

    Blue Potion Form  is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    any later version.

    Blue Potion Form is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Blue Potion Form. If not, see .
    */

    defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

    global $bpform_db_version;
    $bpform_db_version = '1.0';

    function bpform_install() {
        global $wpdb;
        global $bpform_db_version;

        $table_name = $wpdb->prefix . 'bpform_aluno';   
        $table_name1 = $wpdb->prefix . 'bpform_chef';
        $charset_collate = $wpdb->get_charset_collate();

    // Cria tabela clientes
        $sql = "CREATE TABLE $table_name (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        cpf mediumint(11) ,
        cnpj mediumint(14) ,
        nome varchar(50)  NOT NULL,
        email varchar(70)  NOT NULL,
        endereço varchar(255) DEFAULT '',
        telefone varchar(20),
        cursos varchar(500),
        PRIMARY KEY  (id),
        UNIQUE  (cpf),
        UNIQUE  (cnpj)
        ) $charset_collate;
        CREATE TABLE $table_name1 (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        cpf mediumint(11) ,
        cnpj mediumint(14) ,
        nome varchar(50)  NOT NULL,
        email varchar(70)  NOT NULL,
        endereço varchar(255) DEFAULT '',
        telefone varchar(20),
        cursos varchar(500),
        PRIMARY KEY  (id),
        UNIQUE  (cpf),
        UNIQUE  (cnpj)
        ) $charset_collate;
        ";
        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
        dbDelta( $sql );
        add_option( 'bpform_db_version', $bpform_db_version );
    }

    register_activation_hook( __FILE__, 'bpform_install' );

    /** Step 2 (from text above). */
    add_action( 'admin_menu', 'bpform_menu' );

    /** Step 1. */
    function bpform_menu() {
        add_plugins_page( 'BPFORM' , 'BPFORM', 'manage_options', 'bluepotion-form', 'bpform_options');
    }

    /** Step 3. */
    function bpform_options() {

    }

    add_shortcode( 'bpform', 'addForm' );
    function addForm(){
        $form =  plugin_dir_path( __FILE__ ).'formAluno.php';
        if($form){
            require ($form);
            echo"teste";
        }   
    }
    add_shortcode( 'bpformChef', 'addFormChef' );
    function addFormChef(){
        if($form){
            require ($form);
            echo"teste";
        }   
    }
    
asked by anonymous 12.10.2017 / 23:30

1 answer

0

I usually use SublimeText, and by playing the code and saving in another text editor the problem has been solved.

    
17.10.2017 / 17:59