<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Malgin
 * Date: 23.01.15
 * Time: 17:52
 */

function dwr_activate_plugin()
{
    global $wpdb;

    $table_donations = $wpdb->prefix . DWR_DONATIONS_TABLE_NAME;

    $sql =
        "
            CREATE TABLE IF NOT EXISTS `" . $table_donations . "` (
                `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
                `amount` FLOAT UNSIGNED NOT NULL,
                `currencyLabel` VARCHAR(255) NOT NULL,
                `currencyName` VARCHAR(255) NOT NULL,
                `message` TEXT DEFAULT NULL,
                `start_date` DATETIME NOT NULL,
                `finish_date` DATETIME DEFAULT NULL,
                `accomplished` BOOL DEFAULT 0,
                PRIMARY KEY (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8
        ";

    $sql_result = $wpdb->query($sql);

    if ($sql_result === false) {
        error_log("Could not create required tables. SQL: " . $sql);
    }

    add_option('dwr_confirm_page_url', '');

    add_option('dwr_result_url', 'robokassa_result');
    add_option('dwr_result_url_method', 'POST');

    add_option('dwr_merchant_login', '');
    add_option('dwr_merchant_pass_one', '');
    add_option('dwr_merchant_pass_two', '');

    add_option('dwr_default_donation_amont');
    add_option('dwr_operation_description', '');

    add_option('dwr_force_delete_tables', '');
}

function dwr_deactivate_plugin()
{
    global $wpdb;

    $forceDeleteTables = get_option('dwr_force_delete_tables');

    if ($forceDeleteTables) {
        $table_donations = $wpdb->prefix . DWR_DONATIONS_TABLE_NAME;

        $sql = "DROP TABLE `" . $table_donations . "`";

        $wpdb->query($sql);
    }

    delete_option('dwr_confirm_page_url');

    delete_option('dwr_result_url');
    delete_option('dwr_result_url_method');

    delete_option('dwr_merchant_login');
    delete_option('dwr_merchant_pass_one');
    delete_option('dwr_merchant_pass_two');

    delete_option('dwr_default_donation_amont');
    delete_option('dwr_operation_description');

    delete_option('dwr_force_delete_tables');
}<commit_msg>Fix option name for default_donation_amount<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Malgin
 * Date: 23.01.15
 * Time: 17:52
 */

function dwr_activate_plugin()
{
    global $wpdb;

    $table_donations = $wpdb->prefix . DWR_DONATIONS_TABLE_NAME;

    $sql =
        "
            CREATE TABLE IF NOT EXISTS `" . $table_donations . "` (
                `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
                `amount` FLOAT UNSIGNED NOT NULL,
                `currencyLabel` VARCHAR(255) NOT NULL,
                `currencyName` VARCHAR(255) NOT NULL,
                `message` TEXT DEFAULT NULL,
                `start_date` DATETIME NOT NULL,
                `finish_date` DATETIME DEFAULT NULL,
                `accomplished` BOOL DEFAULT 0,
                PRIMARY KEY (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8
        ";

    $sql_result = $wpdb->query($sql);

    if ($sql_result === false) {
        error_log("Could not create required tables. SQL: " . $sql);
    }

    add_option('dwr_confirm_page_url', '');

    add_option('dwr_result_url', 'robokassa_result');
    add_option('dwr_result_url_method', 'POST');

    add_option('dwr_merchant_login', '');
    add_option('dwr_merchant_pass_one', '');
    add_option('dwr_merchant_pass_two', '');

    add_option('dwr_default_donation_amount');
    add_option('dwr_operation_description', '');

    add_option('dwr_force_delete_tables', '');
}

function dwr_deactivate_plugin()
{
    global $wpdb;

    $forceDeleteTables = get_option('dwr_force_delete_tables');

    if ($forceDeleteTables) {
        $table_donations = $wpdb->prefix . DWR_DONATIONS_TABLE_NAME;

        $sql = "DROP TABLE `" . $table_donations . "`";

        $wpdb->query($sql);
    }

    delete_option('dwr_confirm_page_url');

    delete_option('dwr_result_url');
    delete_option('dwr_result_url_method');

    delete_option('dwr_merchant_login');
    delete_option('dwr_merchant_pass_one');
    delete_option('dwr_merchant_pass_two');

    delete_option('dwr_default_donation_amount');
    delete_option('dwr_operation_description');

    delete_option('dwr_force_delete_tables');
}
{'fraction_non_alphanumeric': 0.1254094525035096, 'fraction_numerical': 0.009358914365933552, 'mean_word_length': 3.052132701421801, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '776619', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1398, 'n_words': 230}