Plugin Directory

Changeset 1869189


Ignore:
Timestamp:
05/05/2018 03:00:21 PM (8 years ago)
Author:
cosme12
Message:

Several changes v1.1.0

Location:
copito-comments/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • copito-comments/trunk/README.txt

    r1867716 r1869189  
    22Contributors: cosme12
    33Donate link: http://copitosystem.com
    4 Tags: comments, tool, migrate, facebook, fanpage
     4Tags: comments, tool, migrate, facebook, fanpage, social media, copy
    55Requires at least: 4.0
    66Tested up to: 4.9.5
     
    8989== Changelog ==
    9090
     91= 1.1.0 =
     92*Release Date - xx May 2018*
     93
     94Added:
     95* Adds optional email input.
     96* Adds version tag in footer.
     97* Adds alert messages to form.
     98* Adds minor text help under inputs.
     99
     100
    91101= 1.0.1 =
    92102*Release Date - 2 May 2018*
     
    95105* Fixes a bug where the number of post was capped at 5. The limit has been increase to 50.
    96106* Fixes translation bugs.
    97 
    98107
    99108
  • copito-comments/trunk/admin/class-copito-comments-admin.php

    r1867804 r1869189  
    115115                $data = array(
    116116                'name' => $this->sanitizeTextField($_POST['name']),
     117                'email' => $this->sanitizeEmail($_POST['email']),
    117118                'comment' => $this->sanitizeTextAreaField($_POST['comment']),
    118119                'post-id' => $this->sanitizeNumber($_POST['post-id']),
     
    122123                'comment_post_ID' => $data['post-id'], // to which post the comment will show up
    123124                'comment_author' => $data['name'],
    124                 'comment_author_email' => '',
     125                'comment_author_email' => $data['email'],
    125126                'comment_author_url' => '',
    126127                'comment_content' => $data['comment'],
     
    130131                );
    131132               
    132                 //Insert new comment and get the comment ID
    133                 //$comment_id = wp_new_comment( $commentdata );
    134                 if (wp_new_comment( $commentdata )) {
    135                     //$this->settings_errors(1);
    136                 }else{
    137                     //$this->settings_errors(0);
     133                /*Insert new comment and get the comment ID
     134                Usuful to add a reply DO NOT DELETE
     135                $comment_id = wp_new_comment( $commentdata );
     136                */
     137                if ($commentdata['comment_content'] != '' && $commentdata['comment_post_ID']  && wp_new_comment( $commentdata )) {
     138                    update_option( 'copito-error-msg', 3);
     139                } elseif ($commentdata['comment_content'] == '') {
     140                    update_option( 'copito-error-msg', 2);
     141                } else {
     142                    update_option( 'copito-error-msg', 1);
    138143                }
    139144            }
     
    160165            return 1;
    161166        }
    162        
     167    }
     168
     169    public function sanitizeEmail($input) {
     170        if (is_email($input)) {
     171            return sanitize_email($input);
     172        } else {
     173            return '';
     174        }
    163175    }
    164176
    165177    /**
    166178     * Displays success or error messages.
    167      * NOT IMPLEMENTED
    168      *
    169      * @since    1.0.0
    170      */
    171     public function settings_errors($value) {
    172         if ($value == 0) {
    173             echo '<div class="notice notice-error is-dismissible"><p>'. __('Unknown error.', 'copito-comments') .'</p></div>';
    174         }elseif ($value == 1) {
    175             echo '<div class="notice notice-success is-dismissible"><p>'. __('Comment added successfully.', 'copito-comments') .'</p></div>';
    176         }
     179     *
     180     * @since    1.0.0
     181     */
     182    public function settings_errors() {
     183        $value = get_option('copito-error-msg');
     184        switch ($value) {
     185            case 1:
     186                echo '<div class="notice notice-error is-dismissible"><p>'. __('Unknown error.', 'copito-comments') .'</p></div>';
     187                delete_option( 'copito-error-msg');
     188                break;
     189            case 2:
     190                echo '<div class="notice notice-error is-dismissible"><p>'. __('Failed: empty comment.', 'copito-comments') .'</p></div>';
     191                delete_option( 'copito-error-msg');
     192                break;
     193            case 3:
     194                echo '<div class="notice notice-success is-dismissible"><p>'. __('Comment added successfully.', 'copito-comments') .'</p></div>';
     195                delete_option( 'copito-error-msg');
     196                break;
     197        }
     198    }
     199   
     200
     201    public function set_settings() {
     202        register_setting( 'copito-comments-settings', 'copito-error-msg');     
     203    }
     204
     205    /**
     206     * Displays plugin version
     207     *
     208     * @since    1.1.0
     209     */
     210    public function display_version() {
     211        echo __('Thank you for using Copito Comments. <b>Version: ').COPITO_COMMENTS_VERSION .'</b>';
    177212    }
    178213
  • copito-comments/trunk/admin/partials/copito-comments-admin-display.php

    r1867701 r1869189  
    4141        <td><input type="text" name="name" value="" /></td>
    4242        </tr>
     43
     44        <tr valign="top">
     45        <th scope="row" style="width: 10%;"><?php _e("Email", 'copito-comments'); ?></th>
     46        <td><input type="email" name="email" value="" />
     47            <br><?php _e("Optional", 'copito-comments'); ?>
     48        </td>
     49        </tr>
    4350         
    4451        <tr valign="top">
     
    6875                }
    6976                ?>
    70             </select>
     77            </select>
     78            <br><?php _e("Only last 50 being displayed", 'copito-comments'); ?>
    7179        </td>
    7280        </tr>
  • copito-comments/trunk/copito-comments.php

    r1867804 r1869189  
    1111 * Plugin URI:       
    1212 * Description:       Allows you to add comments manually. Useful to migrate comments from a Facebook Fan Page to your website.
    13  * Version:           1.0.1
     13 * Version:           1.1.0
    1414 * Author:            Cosme12
    1515 * Author URI:        http://copitosystem.com/about-us/
     
    3030 * Rename this for your plugin and update it as you release new versions.
    3131 */
    32 define( 'COPITO_COMMENTS_VERSION', '1.0.1' );
     32define( 'COPITO_COMMENTS_VERSION', '1.1.0' );
    3333
    3434/**
  • copito-comments/trunk/includes/class-copito-comments.php

    r1867249 r1869189  
    148148        $plugin_admin = new Copito_Comments_Admin( $this->get_plugin_name(), $this->get_version() );
    149149
    150         // Prevent loading unnecesary stuff
     150        // Prevent loading unnecesary stuff if not inside plugin page
    151151        if (isset($_GET['page']) && $_GET['page'] == 'copito-comments-settings') {
    152152            $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
     
    154154            //EDITED
    155155            $this->loader->add_action( 'admin_init', $plugin_admin, 'copitoAddCommentsForm');
     156            $this->loader->add_action( 'admin_init', $plugin_admin, 'set_settings');
     157            $this->loader->add_action( 'admin_notices', $plugin_admin, 'settings_errors');
     158            $this->loader->add_filter('admin_footer_text', $plugin_admin, 'display_version');
    156159        }
    157160        $this->loader->add_action( 'admin_menu', $plugin_admin, 'copito_comments_menu');
  • copito-comments/trunk/languages/copito-comments-es.po

    r1867701 r1869189  
    22msgstr ""
    33"Project-Id-Version: Copito Comments\n"
    4 "POT-Creation-Date: 2018-05-02 14:32-0300\n"
    5 "PO-Revision-Date: 2018-05-02 14:34-0300\n"
     4"POT-Creation-Date: 2018-05-04 19:15-0300\n"
     5"PO-Revision-Date: 2018-05-04 19:16-0300\n"
    66"Last-Translator: \n"
    77"Language-Team: CopitoSystem\n"
     
    1616"X-Poedit-SearchPath-0: .\n"
    1717
    18 #: admin/class-copito-comments-admin.php:162
     18#: admin/class-copito-comments-admin.php:186
    1919msgid "Unknown error."
    2020msgstr "Error desconocido."
    2121
    22 #: admin/class-copito-comments-admin.php:164
     22#: admin/class-copito-comments-admin.php:190
     23msgid "Failed: empty comment."
     24msgstr "Falló: sin comentario."
     25
     26#: admin/class-copito-comments-admin.php:194
    2327msgid "Comment added successfully."
    2428msgstr "Comentario agregado de forma exitosa."
     29
     30#: admin/class-copito-comments-admin.php:211
     31msgid "Thank you for using Copito Comments. <b>Version: "
     32msgstr "Gracias por utilizar Copito Comments. <b>Versión: "
    2533
    2634#: admin/partials/copito-comments-admin-display.php:20
     
    5563
    5664#: admin/partials/copito-comments-admin-display.php:45
     65msgid "Email"
     66msgstr "Correo electrónico"
     67
     68#: admin/partials/copito-comments-admin-display.php:47
     69msgid "Optional"
     70msgstr "Opcional"
     71
     72#: admin/partials/copito-comments-admin-display.php:52
    5773msgid "Comment"
    5874msgstr "Comentario"
    5975
    60 #: admin/partials/copito-comments-admin-display.php:46
     76#: admin/partials/copito-comments-admin-display.php:53
    6177msgid "Insert your content here..."
    6278msgstr "Inserte su contenido aquí..."
    6379
    64 #: admin/partials/copito-comments-admin-display.php:50
     80#: admin/partials/copito-comments-admin-display.php:57
    6581msgid "Post"
    6682msgstr "Entrada"
    6783
    68 #: admin/partials/copito-comments-admin-display.php:75
     84#: admin/partials/copito-comments-admin-display.php:78
     85msgid "Only last 50 being displayed"
     86msgstr "Solo se muestran los últimos 50"
     87
     88#: admin/partials/copito-comments-admin-display.php:83
    6989msgid "Add comment"
    7090msgstr "Agregar comentario..."
    7191
    72 #: admin/partials/copito-comments-admin-display.php:81
     92#: admin/partials/copito-comments-admin-display.php:89
    7393msgid "About the plugin"
    7494msgstr "Acerca del plugin"
    7595
    76 #: admin/partials/copito-comments-admin-display.php:82
     96#: admin/partials/copito-comments-admin-display.php:90
    7797msgid ""
    7898"Be able to copy your social media comments or private messages to your "
     
    82102"a su sitio web."
    83103
    84 #: admin/partials/copito-comments-admin-display.php:83
     104#: admin/partials/copito-comments-admin-display.php:91
    85105msgid ""
    86106"This plugin allows you to convert each message to comments by hand and "
     
    91111"en su sitio web."
    92112
    93 #: admin/partials/copito-comments-admin-display.php:84
     113#: admin/partials/copito-comments-admin-display.php:92
    94114msgid ""
    95115"If you have any problem or need a detailed explanation of how to use this "
     
    100120"pronto."
    101121
    102 #: admin/partials/copito-comments-admin-display.php:85
     122#: admin/partials/copito-comments-admin-display.php:93
    103123msgid "Made by"
    104124msgstr "Hecho por"
    105125
    106 #: admin/partials/copito-comments-admin-display.php:87
     126#: admin/partials/copito-comments-admin-display.php:95
    107127msgid "Learn More"
    108128msgstr "Obtener más información"
    109129
    110 #: admin/partials/copito-comments-admin-display.php:88
     130#: admin/partials/copito-comments-admin-display.php:96
    111131msgid "Comming soon!"
    112132msgstr "Próximamente!"
    113133
    114 #: admin/partials/copito-comments-admin-display.php:88
     134#: admin/partials/copito-comments-admin-display.php:96
    115135msgid "Go Premium"
    116136msgstr "Volverse Premium"
    117137
    118 #: admin/partials/copito-comments-admin-display.php:92
     138#: admin/partials/copito-comments-admin-display.php:100
    119139msgid "Give us your feedback or make a donation"
    120140msgstr "Envienos su comentario o haga una donación"
    121141
    122 #: admin/partials/copito-comments-admin-display.php:93
     142#: admin/partials/copito-comments-admin-display.php:101
    123143msgid ""
    124144"We focus on creating a great product, and the best way we can achieve that "
     
    128148"recibiendo la opinión de nuestros usuarios."
    129149
    130 #: admin/partials/copito-comments-admin-display.php:94
     150#: admin/partials/copito-comments-admin-display.php:102
    131151msgid ""
    132152"If you really liked this plugin, feel free to send me a little donation (I "
     
    136156"(necesito una nueva pc :)"
    137157
    138 #: admin/partials/copito-comments-admin-display.php:97
     158#: admin/partials/copito-comments-admin-display.php:105
    139159msgid "Give Your Feedback"
    140160msgstr "Dar su opinión"
    141161
    142 #: admin/partials/copito-comments-admin-display.php:110
     162#: admin/partials/copito-comments-admin-display.php:118
    143163msgid "Copito System news"
    144164msgstr "Noticias de Copito System"
    145165
    146 #: admin/partials/copito-comments-admin-display.php:111
     166#: admin/partials/copito-comments-admin-display.php:119
    147167msgid "Find the best coding tutorials"
    148168msgstr "Encuentre los mejores tutoriales de programación"
    149169
    150 #: admin/partials/copito-comments-admin-display.php:113
     170#: admin/partials/copito-comments-admin-display.php:121
    151171msgid "Services"
    152172msgstr "Servicios"
    153173
    154 #: admin/partials/copito-comments-admin-display.php:114
     174#: admin/partials/copito-comments-admin-display.php:122
    155175msgid "Would you like to learn how to code?"
    156176msgstr "¿Le gustaría aprender a programar?"
    157177
    158 #: admin/partials/copito-comments-admin-display.php:114
     178#: admin/partials/copito-comments-admin-display.php:122
    159179msgid "Let's us teach you in a simple and easy way!"
    160180msgstr "¡Dejenos enseñarle de una forma simple y rápida!"
  • copito-comments/trunk/languages/copito-comments-es_AR.po

    r1867701 r1869189  
    22msgstr ""
    33"Project-Id-Version: Copito Comments\n"
    4 "POT-Creation-Date: 2018-05-02 14:30-0300\n"
    5 "PO-Revision-Date: 2018-05-02 14:32-0300\n"
     4"POT-Creation-Date: 2018-05-04 19:13-0300\n"
     5"PO-Revision-Date: 2018-05-04 19:15-0300\n"
    66"Last-Translator: \n"
    77"Language-Team: CopitoSystem\n"
     
    1717"X-Poedit-SearchPathExcluded-0: *.js\n"
    1818
    19 #: admin/class-copito-comments-admin.php:162
     19#: admin/class-copito-comments-admin.php:186
    2020msgid "Unknown error."
    2121msgstr "Error desconocido."
    2222
    23 #: admin/class-copito-comments-admin.php:164
     23#: admin/class-copito-comments-admin.php:190
     24msgid "Failed: empty comment."
     25msgstr "Falló: sin comentario."
     26
     27#: admin/class-copito-comments-admin.php:194
    2428msgid "Comment added successfully."
    2529msgstr "Comentario agregado de forma exitosa."
     30
     31#: admin/class-copito-comments-admin.php:211
     32msgid "Thank you for using Copito Comments. <b>Version: "
     33msgstr "Gracias por utilizar Copito Comments. <b>Versión: "
    2634
    2735#: admin/partials/copito-comments-admin-display.php:20
     
    5664
    5765#: admin/partials/copito-comments-admin-display.php:45
     66msgid "Email"
     67msgstr "Correo electrónico"
     68
     69#: admin/partials/copito-comments-admin-display.php:47
     70msgid "Optional"
     71msgstr "Opcional"
     72
     73#: admin/partials/copito-comments-admin-display.php:52
    5874msgid "Comment"
    5975msgstr "Comentario"
    6076
    61 #: admin/partials/copito-comments-admin-display.php:46
     77#: admin/partials/copito-comments-admin-display.php:53
    6278msgid "Insert your content here..."
    6379msgstr "Insertá tu contenido aquí..."
    6480
    65 #: admin/partials/copito-comments-admin-display.php:50
     81#: admin/partials/copito-comments-admin-display.php:57
    6682msgid "Post"
    6783msgstr "Entrada"
    6884
    69 #: admin/partials/copito-comments-admin-display.php:75
     85#: admin/partials/copito-comments-admin-display.php:78
     86msgid "Only last 50 being displayed"
     87msgstr "Solo se muestran los últimos 50"
     88
     89#: admin/partials/copito-comments-admin-display.php:83
    7090msgid "Add comment"
    7191msgstr "Agrear comentario..."
    7292
    73 #: admin/partials/copito-comments-admin-display.php:81
     93#: admin/partials/copito-comments-admin-display.php:89
    7494msgid "About the plugin"
    7595msgstr "Acerca del plugin"
    7696
    77 #: admin/partials/copito-comments-admin-display.php:82
     97#: admin/partials/copito-comments-admin-display.php:90
    7898msgid ""
    7999"Be able to copy your social media comments or private messages to your "
     
    83103"a tu sitio web."
    84104
    85 #: admin/partials/copito-comments-admin-display.php:83
     105#: admin/partials/copito-comments-admin-display.php:91
    86106msgid ""
    87107"This plugin allows you to convert each message to comments by hand and "
     
    92112"en tu sitio web."
    93113
    94 #: admin/partials/copito-comments-admin-display.php:84
     114#: admin/partials/copito-comments-admin-display.php:92
    95115msgid ""
    96116"If you have any problem or need a detailed explanation of how to use this "
     
    101121"contacto pronto."
    102122
    103 #: admin/partials/copito-comments-admin-display.php:85
     123#: admin/partials/copito-comments-admin-display.php:93
    104124msgid "Made by"
    105125msgstr "Hecho por"
    106126
    107 #: admin/partials/copito-comments-admin-display.php:87
     127#: admin/partials/copito-comments-admin-display.php:95
    108128msgid "Learn More"
    109129msgstr "Obtener más información"
    110130
    111 #: admin/partials/copito-comments-admin-display.php:88
     131#: admin/partials/copito-comments-admin-display.php:96
    112132msgid "Comming soon!"
    113133msgstr "¡Próximamente!"
    114134
    115 #: admin/partials/copito-comments-admin-display.php:88
     135#: admin/partials/copito-comments-admin-display.php:96
    116136msgid "Go Premium"
    117137msgstr "Hacerse Premium"
    118138
    119 #: admin/partials/copito-comments-admin-display.php:92
     139#: admin/partials/copito-comments-admin-display.php:100
    120140msgid "Give us your feedback or make a donation"
    121141msgstr "Envianos tu comentario o hacé una donación"
    122142
    123 #: admin/partials/copito-comments-admin-display.php:93
     143#: admin/partials/copito-comments-admin-display.php:101
    124144msgid ""
    125145"We focus on creating a great product, and the best way we can achieve that "
     
    129149"recibiendo la opinión de nuestros usuarios."
    130150
    131 #: admin/partials/copito-comments-admin-display.php:94
     151#: admin/partials/copito-comments-admin-display.php:102
    132152msgid ""
    133153"If you really liked this plugin, feel free to send me a little donation (I "
     
    137157"(necesito una nueva pc :)"
    138158
    139 #: admin/partials/copito-comments-admin-display.php:97
     159#: admin/partials/copito-comments-admin-display.php:105
    140160msgid "Give Your Feedback"
    141161msgstr "Dar tu opinión"
    142162
    143 #: admin/partials/copito-comments-admin-display.php:110
     163#: admin/partials/copito-comments-admin-display.php:118
    144164msgid "Copito System news"
    145165msgstr "Noticias de Copito System"
    146166
    147 #: admin/partials/copito-comments-admin-display.php:111
     167#: admin/partials/copito-comments-admin-display.php:119
    148168msgid "Find the best coding tutorials"
    149169msgstr "Encontrá los mejores tutoriales de programación"
    150170
    151 #: admin/partials/copito-comments-admin-display.php:113
     171#: admin/partials/copito-comments-admin-display.php:121
    152172msgid "Services"
    153173msgstr "Servicios"
    154174
    155 #: admin/partials/copito-comments-admin-display.php:114
     175#: admin/partials/copito-comments-admin-display.php:122
    156176msgid "Would you like to learn how to code?"
    157177msgstr "¿Te gustaría aprender a programar?"
    158178
    159 #: admin/partials/copito-comments-admin-display.php:114
     179#: admin/partials/copito-comments-admin-display.php:122
    160180msgid "Let's us teach you in a simple and easy way!"
    161181msgstr "¡Dejanos enseñarte de una forma simple y rápida!"
Note: See TracChangeset for help on using the changeset viewer.