<commit_before><?php
/**
 * Plugin Name: Sample Form
 * Description: A sample plugin showing a customizeable form
 * Version: 0.1
 * Author: <NAME>
 *
 * Created by IntelliJ IDEA.
 * User: nick
 * Date: 4/25/16
 * Time: 11:00 AM
 */<commit_msg>Got basic class with working form code working.<commit_after><?php
/**
 * Plugin Name: Sample Form
 * Description: A sample plugin showing a customizeable form, complete with
 *   adding AJAX form submit and a javascript-based anti-bot honeypot field.
 * Version: 0.1
 * Author: <NAME>
 *
 * Created by IntelliJ IDEA.
 * User: nick
 * Date: 4/25/16
 * Time: 11:00 AM
 */

class SampleForm {
    /**
     * SampleForm constructor.
     *
     * Sets up shortcode and any other configuration needed by the plugin
     */
    public function __construct()
    {
        add_shortcode('sample-form', array($this, 'shortcode'));
    }

    /**
     * Processes and sets up the form from the shortcode input
     *
     * @param array $atts
     * @param string $content
     * @param string $tag
     *
     * @return string
     *
     * @todo This is a stub that simply returns the form (with provided atts)
     *   back
     */
    public function shortcode($atts, $content, $tag)
    {
        // Create attributes for form
        $atts_string = '';
        foreach ($atts as $name => $value) {
            $atts_string = sprintf(' %1$s="%2$s"', htmlentities2($name), htmlentities2($value));
        }

        $output = sprintf('<form%1$s>%2$s</form>', $atts_string, $content);
        return $output;
    }
}

$sampleForm = new SampleForm();
{'fraction_non_alphanumeric': 0.1253148614609572, 'fraction_numerical': 0.017632241813602016, 'mean_word_length': 2.5869074492099324, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2525946', 'n_tokens_mistral': 503, 'n_tokens_neox': 482, 'n_words': 160}