Plugin Directory

Changeset 2888744


Ignore:
Timestamp:
03/29/2023 12:05:24 AM (2 years ago)
Author:
sunnysonic
Message:
  • fixed cron jobs
  • table design improved in lists
  • captcha added to form
  • tasks can now contain multimedia and html formatting
Location:
wp-easy-crm
Files:
36 added
6 edited

Legend:

Unmodified
Added
Removed
  • wp-easy-crm/trunk/easy-crm.php

    r2887196 r2888744  
    44 * Plugin Name:       Easy CRM
    55 * Description:       Collect new leads, manage clients, quotations, invoices, tasks and more for your entire team
    6  * Version:           1.0.8
     6 * Version:           1.0.9
    77 * Author:            IT-iCO SRL
    88 * Author URI:        https://it-ico.com
     
    279279}
    280280
     281//warning before deleting the plugin
     282function eacr_plugin_delete_warning( $plugin ) {
     283    // Check if the plugin being deleted is your plugin
     284    if ( 'wp-easy-crm/easy-crm.php' === $plugin ) {
     285        // Display a warning message
     286        wp_die( sprintf( __( 'Are you sure you want to delete this plugin and all the data it created? This action cannot be undone.', 'wp-easy-crm' ), 'Easy CRM' ), __( 'Delete Plugin' ), array( 'response' => 200, 'back_link' => true ) );
     287    }
     288}
     289add_action( 'before_delete_plugin', 'eacr_plugin_delete_warning' );
     290
    281291//short code contact form
    282292function eacr_display_contact_form() {
    283     $form = '<form method="post" action="' . esc_url(admin_url('admin-post.php')) . '">
    284             <label for="client-name">Full Name</label><br>
    285             <input type="text" name="client-name" maxlength="400" class="input-text" required style="width:70%">
    286             <br><br>
    287             <label for="client-email">Email</label><br>
    288             <input type="email" name="client-email" maxlength="400" class="input-text" required style="width:70%">
    289             <br><br>
    290             <label for="client-phone">Phone</label><br>
    291             <input type="tel" name="client-phone" maxlength="400" class="input-text" required style="width:70%">
    292             <br><br>
    293             <label for="client-note">Message</label><br>
    294             <textarea type="text" name="client-note" maxlength="1980" class="input-text" required style="width:70%" rows="5"></textarea><br><br>
    295             <br>
    296             <input type="hidden" name="action" value="submit_contact_form">
    297             <input type="datetime-local" name="lastupdate_at" value="'.esc_html(date('Y-m-d\TH:i:s')).'" hidden/>
    298             <input type="datetime-local" name="created_at" value="'.esc_html(date('Y-m-d\TH:i:s')).'" hidden/>
    299             <input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response">
    300             <input type="submit" class="button wp-element-button" value="Submit">
     293
     294    if(get_option( 'eacr_recaptcha_site_key' ) == "" || get_option( 'eacr_recaptcha_site_key' ) == null || get_option( 'eacr_recaptcha_secret_key' ) == "" || get_option( 'eacr_recaptcha_secret_key' ) == null){
     295        return '<h2>Google reCaptcha keys missing. Please go to the forms menu of Easy CRM and input your reCaptcha keys to make this form work.</h2>';
     296    }
     297    else{
     298        $form = '
     299                <script src="https://www.google.com/recaptcha/api.js" async defer></script>
     300
     301                <form id="easycrmcontactform" method="post" action="' . esc_url(admin_url('admin-post.php')) . '">
     302                <label for="client-name">Full Name</label><br>
     303                <input type="text" name="client-name" maxlength="400" class="input-text" required style="width:70%">
     304                <br><br>
     305                <label for="client-email">Email</label><br>
     306                <input type="email" name="client-email" maxlength="400" class="input-text" required style="width:70%">
     307                <br><br>
     308                <label for="client-phone">Phone</label><br>
     309                <input type="tel" name="client-phone" maxlength="400" class="input-text" required style="width:70%">
     310                <br><br>
     311                <label for="client-note">Message</label><br>
     312                <textarea type="text" name="client-note" maxlength="1980" class="input-text" required style="width:70%" rows="5"></textarea><br>
     313                <input type="hidden" name="action" value="submit_contact_form">
     314                <input type="datetime-local" name="lastupdate_at" value="'.esc_html(date('Y-m-d\TH:i:s')).'" hidden/>
     315                <input type="datetime-local" name="created_at" value="'.esc_html(date('Y-m-d\TH:i:s')).'" hidden/>
     316                <div class="g-recaptcha" data-sitekey="'.get_option( 'eacr_recaptcha_site_key' ).'"></div>
     317                <div class="error" style="display:none">Please complete the reCAPTCHA verification.</div>
     318                <input type="submit" id="easysubmit" class="button wp-element-button" value="Submit">
     319               
     320            </form>
     321            <script>
     322            function onSubmit(token) {
     323              // Code to handle successful reCAPTCHA verification
     324              // ...
     325            }
    301326           
    302         </form>';
    303             // <script src="https://www.google.com/recaptcha/api.js?render=RECAPTCHA_SITE_KEY"></script>
    304             // <script>
    305             //     grecaptcha.ready(function() {
    306             //         grecaptcha.execute('RECAPTCHA_SITE_KEY', {action: 'submit'}).then(function(token) {
    307             //             document.getElementById("g-recaptcha-response").value = token;
    308             //         });
    309             //     });
    310             // </script>';
    311     return $form;
     327            function onFormSubmit(event) {
     328              var response = grecaptcha.getResponse();
     329              if(response.length == 0) {
     330                event.preventDefault();
     331                alert("Please complete the reCAPTCHA");
     332              } else {
     333                // Call the onSubmit() function to handle successful reCAPTCHA verification
     334                onSubmit(response);
     335              }
     336            }
     337           
     338            // Add an event listener to the forms submit event
     339            document.getElementById("easycrmcontactform").addEventListener("submit", onFormSubmit);
     340            </script>
     341            ';
     342        return $form;
     343    }
    312344}
    313345add_shortcode('contact_form_clients', 'eacr_display_contact_form');
    314346
    315347function eacr_submit_contact_form() {
    316     if (isset($_POST['client-name']) && isset($_POST['client-phone']) && isset($_POST['client-email']) && isset($_POST['client-note'])) {
    317         global $wpdb;
    318         $table_name = $wpdb->prefix . 'clients';
    319         $data = array(
    320             'clientname' => sanitize_text_field($_POST['client-name']),
    321             'nombrecontacto' => sanitize_text_field($_POST['client-name']),
    322             'telefono' => sanitize_text_field($_POST['client-phone']),
    323             'email' => sanitize_email($_POST['client-email']),
    324             'nota' => sanitize_text_field($_POST['client-note']),
    325             "clientstatus"=>sanitize_text_field('lead'),
    326             "clientsource"=>sanitize_text_field('website'),
    327             "lastupdate_at"=>sanitize_text_field($_POST['lastupdate_at']),
    328             "created_at"=>sanitize_text_field($_POST['created_at'])
    329         );
    330         $wpdb->insert($table_name, $data);
    331         if($wpdb->insert_id > 0){
    332             // $msg = "<div class='updated update'>".esc_html(__( 'client successfully saved', 'wp-easy-crm' ))."</div>";
    333             $msg = esc_html(__( 'Form successfully submitted. Thank you! We will get in touch with you shortly. Feel free to look through our website.', 'wp-easy-crm' ));
    334             echo '<script>alert("'.sanitize_text_field($msg).'");window.location.href = "/";'.
    335             '</script>';
    336             // wp_redirect(get_permalink(get_page_by_title('Thank You')));
    337             // wp_redirect(home_url());
    338 
    339             //send email
    340             $to = get_option( 'admin_email' );
    341             $subject = 'New Lead added from Website form';
    342             $message = ('A new lead from '.sanitize_text_field($_POST['client-name'])." has been added to your CRM. The lead left the following note: ".sanitize_text_field($_POST['client-note']));
    343             wp_mail($to, $subject, $message );
    344 
    345 
    346         }else{
    347             // $msg = "<div style='color:red'>".esc_html(__( 'error - client information couldn\'t be stored', 'wp-easy-crm' ))."</div>";
    348             $msg = esc_html(__( 'error - client information couldn\'t be stored: ', 'wp-easy-crm' )).$wpdb->last_error;
    349 
    350             echo '<script>alert("'.sanitize_text_field($msg).'")</script>';
     348
     349    // Check if the reCAPTCHA response is valid
     350    if (isset($_POST['g-recaptcha-response'])) {
     351        $response = $_POST['g-recaptcha-response'];
     352        $isValid = eacr_verifyRecaptcha($response);
     353        if ($isValid) {
     354        // reCAPTCHA verification succeeded. Process the form data.
     355        // ...
     356            if (isset($_POST['client-name']) && isset($_POST['client-phone']) && isset($_POST['client-email']) && isset($_POST['client-note'])) {
     357                global $wpdb;
     358                $table_name = $wpdb->prefix . 'clients';
     359                $data = array(
     360                    'clientname' => sanitize_text_field($_POST['client-name']),
     361                    'nombrecontacto' => sanitize_text_field($_POST['client-name']),
     362                    'telefono' => sanitize_text_field($_POST['client-phone']),
     363                    'email' => sanitize_email($_POST['client-email']),
     364                    'nota' => sanitize_text_field($_POST['client-note']),
     365                    "clientstatus"=>sanitize_text_field('lead'),
     366                    "clientsource"=>sanitize_text_field('website'),
     367                    "lastupdate_at"=>sanitize_text_field($_POST['lastupdate_at']),
     368                    "created_at"=>sanitize_text_field($_POST['created_at'])
     369                );
     370                $wpdb->insert($table_name, $data);
     371                if($wpdb->insert_id > 0){
     372                    // $msg = "<div class='updated update'>".esc_html(__( 'client successfully saved', 'wp-easy-crm' ))."</div>";
     373                    $msg = esc_html(__( 'Form successfully submitted. Thank you! We will get in touch with you shortly. Feel free to look through our website.', 'wp-easy-crm' ));
     374                    echo '<script>alert("'.sanitize_text_field($msg).'");window.location.href = "/";'.
     375                    '</script>';
     376                    // wp_redirect(get_permalink(get_page_by_title('Thank You')));
     377                    // wp_redirect(home_url());
     378       
     379                    //send email
     380                    $to = get_option( 'admin_email' );
     381                    $subject = 'New Lead added from Website form';
     382                    $message = ('A new lead from '.sanitize_text_field($_POST['client-name'])." has been added to your CRM. The lead left the following note: ".sanitize_text_field($_POST['client-note']));
     383                    wp_mail($to, $subject, $message );
     384       
     385       
     386                }else{
     387                    // $msg = "<div style='color:red'>".esc_html(__( 'error - client information couldn\'t be stored', 'wp-easy-crm' ))."</div>";
     388                    $msg = esc_html(__( 'error - client information couldn\'t be stored: ', 'wp-easy-crm' )).$wpdb->last_error;
     389       
     390                    echo '<script>alert("'.sanitize_text_field($msg).'")</script>';
     391                }
     392                exit;
     393            }
     394        }
     395        else {
     396        // reCAPTCHA verification failed. Display an error message.
     397        // ...
     398        $msg = esc_html(__( 'error - reCAPTCHA verification failed. Please go back and try again ', 'wp-easy-crm' ));
     399       
     400                    echo '<script>alert("'.sanitize_text_field($msg).'")</script>';
    351401        }
    352         exit;
    353     }
     402   
     403    }   
     404    else {
     405        // The reCAPTCHA response was not set.
     406        // ...
     407        $msg = esc_html(__( 'error - reCAPTCHA verification not set. Do not forget to set the Captcha to submit the form. Please go back and try again. ', 'wp-easy-crm' ));
     408       
     409                    echo '<script>alert("'.sanitize_text_field($msg).'")</script>';
     410    }
     411   
     412
     413
     414   
    354415}
    355416add_action('admin_post_nopriv_submit_contact_form', 'eacr_submit_contact_form');
    356417add_action('admin_post_submit_contact_form', 'eacr_submit_contact_form');
    357418
     419function eacr_verifyRecaptcha($response) {
     420    $url = "https://www.google.com/recaptcha/api/siteverify";
     421    $data = array(
     422      'secret' => get_option( 'eacr_recaptcha_secret_key' ),
     423      'response' => $response
     424    );
     425    $options = array(
     426      'http' => array(
     427        'header'  => 'Content-type: application/x-www-form-urlencoded',
     428        'method'  => 'POST',
     429        'content' => http_build_query($data),
     430      ),
     431    );
     432    $context  = stream_context_create($options);
     433    $result = file_get_contents($url, false, $context);
     434    $resultJson = json_decode($result);
     435    return $resultJson->success;
     436  }
    358437
    359438//Dashboard widget
     
    429508    $parsed_url = parse_url( $home_url );
    430509    $domain_name = $parsed_url['host'];
     510
    431511    //check for each task if due in the next 24 hours
    432512    if(count($alltasks) > 0){
     
    447527
    448528}
    449 
    450 wp_schedule_event( strtotime('6:00am'), 'daily', 'eacr_send_email_reminder' );
     529add_action( 'eacr_send_email_reminder', 'eacr_send_email_reminder' );
     530
     531if ( ! wp_next_scheduled( 'eacr_send_email_reminder' ) ) {
     532    // wp_schedule_event( time(), 'hourly', 'my_custom_cron_job' );
     533    wp_schedule_event( strtotime('6:00am'), 'daily', 'eacr_send_email_reminder' );
     534 
     535}
     536
    451537
    452538
  • wp-easy-crm/trunk/readme.txt

    r2887196 r2888744  
    44Requires at least: 5.9
    55Tested up to: 6.1.1
    6 Stable tag: 1.0.8
     6Stable tag: 1.0.9
    77Contributors: sunnysonic
    88License: GPLv2 or later
     
    6161== Changelog ==
    6262
     63= 1.0.9 =
     64* fixed cron jobs
     65* table design improved in lists
     66* captcha added to form
     67* tasks can now contain multimedia and html formatting
     68
    6369= 1.0.8 =
    6470* fixed php8+ issues
  • wp-easy-crm/trunk/views/addTask.php

    r2887196 r2888744  
    3737$id = $row_details_task['clientidfk'];
    3838
    39  
     39$allowed_tags = array(
     40    'div' => array(),
     41    'p' => array(),
     42    'br' => array(),
     43    'img' => array(
     44        'src' => array(),
     45        'alt' => array(),
     46        'width' => array(),
     47        'height' => array()
     48    ),
     49    'strong' => array(),
     50    'em' => array(),
     51    'ul' => array(),
     52    'ol' => array(),
     53    'li' => array(),
     54    'blockquote' => array(),
     55    'ins' => array(),
     56    'del' => array(),
     57    'code' => array(),
     58    'a' => array(
     59        'href' => array()
     60    )
     61);
    4062
    4163        if($action == "delete"){
     
    95117
    96118    $id = sanitize_text_field($_POST['clientidfk']);
     119    $taskdescription = wpautop($_POST['taskdescription']);
     120
    97121 
    98122    if(!empty($action)){
     
    104128            "completed"=>sanitize_text_field($_POST['completed']),
    105129            "tasktitle"=>sanitize_text_field($_POST['tasktitle']),
    106             "taskdescription"=>sanitize_text_field($_POST['taskdescription']),
     130            "taskdescription"=>wp_kses( $taskdescription, $allowed_tags ),
    107131            "start_at"=>sanitize_text_field($_POST['start_at']),
    108132            "end_at"=>sanitize_text_field($_POST['end_at']),
     
    123147            "completed"=>sanitize_text_field($_POST['completed']),
    124148            "tasktitle"=>sanitize_text_field($_POST['tasktitle']),
    125             "taskdescription"=>sanitize_text_field($_POST['taskdescription']),
     149            "taskdescription"=>wp_kses( $taskdescription, $allowed_tags ),
    126150            "start_at"=>sanitize_text_field($_POST['start_at']),
    127151            "end_at"=>sanitize_text_field($_POST['end_at']),
     
    154178    }
    155179    else{
     180        // Allowed HTML tags and attributes
     181       
     182
     183        $taskdescription = wpautop($_POST['taskdescription']);
    156184
    157185         //add new task
     
    161189            "completed"=>sanitize_text_field($_POST['completed']),
    162190            "tasktitle"=>sanitize_text_field($_POST['tasktitle']),
    163             "taskdescription"=>sanitize_text_field($_POST['taskdescription']),
     191            "taskdescription"=>wp_kses( $taskdescription, $allowed_tags ),
    164192            "start_at"=>sanitize_text_field($_POST['start_at']),
    165193            "end_at"=>sanitize_text_field($_POST['end_at']),
     
    245273           
    246274            ?><br><br>
    247             <!-- <input type="text" name="useridfk" id="useridfk" required value="<?php echo esc_html( $current_user->display_name )?>"><br><br> -->
    248275           
     276            <div>
     277                <div style="float: left; margin-right: 1em;">
     278                <label for="start_at"><?php echo __('Start time', 'wp-easy-crm')?></label></br>
     279                <input type="datetime-local" id="start_at" name="start_at" required value="<?php echo esc_html(@$row_details_task['start_at']) ?>"></div>
     280                <div>
     281                <label for="end_at"><?php echo __('End time', 'wp-easy-crm')?></label></br>
     282                <input type="datetime-local" id="end_at" name="end_at" required value="<?php echo esc_html(@$row_details_task['end_at']) ?>"></div><br>   
     283            </div>
     284
    249285            <label for="tasktitle"><?php echo __('Task Title*', 'wp-easy-crm')?></label></br>
    250286            <input type="text" name="tasktitle" id="tasktitle" maxlength="198" style="width:70%" required value="<?php echo esc_html(@$row_details_task['tasktitle']) ?>"><br><br>
    251287
    252288            <label for="taskdescription"><?php echo __('Task Description', 'wp-easy-crm')?></label></br>
    253             <textarea name="taskdescription" id="taskdescription" maxlength="19800" style="width:70%" rows="6"><?php echo esc_html(@$row_details_task['taskdescription']) ?></textarea><br><br>
    254 
    255             <label for="start_at"><?php echo __('Start time', 'wp-easy-crm')?></label></br>
    256             <input type="datetime-local" id="start_at" name="start_at" required value="<?php echo esc_html(@$row_details_task['start_at']) ?>"><br><br>
    257 
    258             <label for="end_at"><?php echo __('End time', 'wp-easy-crm')?></label></br>
    259             <input type="datetime-local" id="end_at" name="end_at" required value="<?php echo esc_html(@$row_details_task['end_at']) ?>"><br><br>           
     289            <!-- <textarea name="taskdescription" id="taskdescription" maxlength="19800" style="width:70%" rows="6"><?php echo esc_html(@$row_details_task['taskdescription']) ?></textarea><br><br> -->
     290            <?php wp_editor( @$row_details_task['taskdescription'], 'taskdescription', array( 'textarea_name' => 'taskdescription','textarea_rows' => get_option('default_post_edit_rows', 6), ),
     291            array('editor_id' => 'taskdescription' // Editor ID, which must match the ID used in the selector in the filter
     292            ) ); ?>
     293            <br> 
    260294
    261295            <input type="submit" name="submit" value="<?php echo __('Submit', 'wp-easy-crm')?>">
    262296        </form>
     297
     298        <script>
     299            function eacr_checklengthsetMaxlengthForTextarea() {
     300                // Get the textarea element by ID
     301                var textarea = document.getElementById('taskdescription');
     302
     303                // Set the maximum length of characters
     304                var maxlength = 19800;
     305
     306                // Add an event listener to the textarea to limit its length
     307                textarea.addEventListener('input', function () {
     308                    if (textarea.value.length > maxlength) {
     309                        textarea.value = textarea.value.substring(0, maxlength);
     310                    }
     311                });
     312            }
     313
     314            jQuery(document).ready(function ($) {
     315                // Call the function after document ready
     316                eacr_checklengthsetMaxlengthForTextarea();
     317            });
     318
     319        </script>
     320
     321        <script>
     322            setTimeout(eacr_checklength, 3000);
     323
     324            function eacr_checklength() {
     325
     326            jQuery(document).ready(function($) {
     327                var editor = $('#taskdescription_ifr').contents().find('#tinymce');
     328                var maxChars = 19800;
     329
     330                editor.on('keyup', function(e) {
     331                    var content = $(this).text();
     332                    if (content.length >= maxChars && e.keyCode !== 8) {
     333                        e.preventDefault();
     334                        alert('You have reached the maximum character limit.');
     335                    }
     336                });
     337            });
     338
     339            }
     340        </script>
     341     
     342
    263343    </div>
  • wp-easy-crm/trunk/views/clientProfile.php

    r2887196 r2888744  
    174174                    echo '<td class="column-columnname" style="width:20%">'.esc_html($singletask['tasktitle']).'</td>';
    175175                   
    176                     echo '<td class="column-columnname" style="width:40%">'.esc_html($singletask['taskdescription']).'</td>';
     176                    // echo '<td class="column-columnname" style="width:40%">'.esc_html($singletask['taskdescription']).'</td>';
     177                    echo '<td class="column-columnname" style="width:40%">'.wp_kses_post($singletask['taskdescription']).'</td>';
     178
    177179
    178180                    if($singletask['completed'] == 0){
     
    191193                    | <a onclick="return eacr_confirmDeleteTask();" href="admin.php?page=wp-easy-crm-addtask&action=delete&taskid='.esc_html($singletask['id']).'&id='.esc_html($id).'">'.__( 'delete', 'wp-easy-crm' ).'</a></td>';
    192194                   
    193                     echo '<tr>';
     195                    echo '</tr>';
    194196                }
    195197            }
     
    250252                    | <a onclick="return eacr_confirmDeleteQuote();" href="admin.php?page=wp-easy-crm-addquote&action=delete&quoteid='.esc_html($singlequote['id']).'&id='.esc_html($id).'">'.__( 'delete', 'wp-easy-crm' ).'</a></td>';
    251253                   
    252                     echo '<tr>';
     254                    echo '</tr>';
    253255                }
    254256            }
  • wp-easy-crm/trunk/views/forms.php

    r2879878 r2888744  
    11<?php
    22// actual short code in main plugin file
     3
     4if ( !empty( $_POST ) ){
     5
     6    //code
     7    //Echo('We have post data, update settings');
     8    //update_option( 'wp-easy-crm-settings', $_POST );
     9
     10    // $sanitized_values = wp_easy_CRM_sanitize_settings($_POST);
     11    // update_option( 'wp-easy-crm-settings', $sanitized_values );
     12
     13    // Get the new values from the form submission
     14        $new_site_key = $_POST['eacr_recaptcha_site_key'];
     15        $new_secret_key = $_POST['eacr_recaptcha_secret_key'];
     16
     17        // Update the site key option
     18        update_option( 'eacr_recaptcha_site_key', $new_site_key );
     19
     20        // Update the secret key option
     21        update_option( 'eacr_recaptcha_secret_key', $new_secret_key );
     22
     23   
     24    $settings_updated = 'true';
     25
     26
     27}
     28
    329
    430
     
    632echo '<p>'.__( 'You can display the form below on your front end using the short code <pre>[contact_form_clients]</pre> on any page you like. ', 'wp-easy-crm' ).'</p>';
    733echo '<p>'.__( 'Once somebody submits the form below, it will appear in your contacts as a Lead.', 'wp-easy-crm' ).'</p>';
     34echo '<b>'.__( 'This form below only works with Google reCAPTCHA v2. Please enter the keys below. More info can be found in this link --> ', 'wp-easy-crm' ).'<a target="_blank" href="https://www.google.com/recaptcha/about/"> Google Captcha Information</a></b>';
     35
    836
    937?>
    10 <div>
     38    <div class="wrap">
     39       
     40        <?php if (@$settings_updated == 'true') : ?>
     41            <div class="notice notice-success">
     42                <p><?php esc_html_e( 'Settings saved.', 'wp-easy-crm' ); ?></p>
     43            </div>
     44        <?php endif; ?>
     45
     46        <h1>reCAPTCHA Settings</h1>
     47        <form method="post">
     48            <?php
     49            settings_fields( 'eacr-recaptcha-settings' );
     50            do_settings_sections( 'eacr-recaptcha-settings' );
     51            ?>
     52            <table class="form-table">
     53                <tr valign="top">
     54                    <th scope="row">Site Key</th>
     55                    <td><input style="width:50%" type="password" name="eacr_recaptcha_site_key" value="<?php echo esc_attr( get_option( 'eacr_recaptcha_site_key' ) ); ?>" /></td>
     56                </tr>
     57                <tr valign="top">
     58                    <th scope="row">Secret Key</th>
     59                    <td><input style="width:50%" type="password" name="eacr_recaptcha_secret_key" value="<?php echo esc_attr( get_option( 'eacr_recaptcha_secret_key' ) ); ?>" /></td>
     60                </tr>
     61            </table>
     62            <?php submit_button(); ?>
     63        </form>
     64    </div>
     65    <?php
     66
     67
     68// Register the reCAPTCHA settings fields
     69function eacr_captcha_register_settings() {
     70    register_setting( 'eacr-recaptcha-settings', 'eacr_recaptcha_site_key' );
     71    register_setting( 'eacr-recaptcha-settings', 'eacr_recaptcha_secret_key' );
     72}
     73add_action( 'admin_init', 'eacr_captcha_register_settings' );
     74?>
     75
     76<div style="background-color:lightgray;">
     77<h1>Form Example</h1>
    1178<form method="post" action="#">
    1279            <label for="client-name">Full Name</label><br>
  • wp-easy-crm/trunk/views/tasks.php

    r2881359 r2888744  
    142142                    | <a onclick="return aecr_confirmDeleteTask();" href="admin.php?page=wp-easy-crm-addtask&action=delete&taskid='.esc_html($singletask['id']).'&id='.esc_html($id).'">'.__( 'delete', 'wp-easy-crm' ).'</a></td>';
    143143                   
    144                     echo '<tr>';
     144                    echo '</tr>';
    145145                }
    146146            }
     
    183183
    184184                   
    185                     echo '<td class="column-columnname" style="width:40%">'.esc_html($singletask['taskdescription']).'</td>';
     185                    // echo '<td class="column-columnname" style="width:40%">'.esc_html($singletask['taskdescription']).'</td>';
     186                    echo '<td class="column-columnname" style="width:40%">'.wp_kses_post($singletask['taskdescription']).'</td>';
    186187
    187188                    if($singletask['completed'] == 0){
     
    200201                    | <a onclick="return aecr_confirmDeleteTask();" href="admin.php?page=wp-easy-crm-addtask&action=delete&taskid='.esc_html($singletask['id']).'&id='.esc_html($id).'">'.__( 'delete', 'wp-easy-crm' ).'</a></td>';
    201202                   
    202                     echo '<tr>';
     203                    echo '</tr>';
    203204                }
    204205            }
Note: See TracChangeset for help on using the changeset viewer.