<commit_before><?php
/*
Plugin Name: Dots United WordPress Editor Grid Plugin
Plugin URI: https://github.com/dotsunited/wordpress-plugin-editor-grid
Description: Editor extension to create and manage grids.
License: MIT
Author: Dots United GmbH
Version: 1.0.0
Author URI: https://dotsunited.de
*/

$baseUrl = trailingslashit(plugin_dir_url(__FILE__));

add_filter('mce_external_plugins', function ($plugins) use ($baseUrl) {
    global $tinymce_version;

    /* WP 3.8 with tinyMCE 3 */
    if (version_compare($tinymce_version, '400', '<')) {
        // We only support tinyMCE 4
        return $plugins;
    }

    /* WP 3.9 with tinyMCE 4 */
    $plugins['grid'] = $baseUrl . 'assets/editor.js?ver=' . urlencode(md5_file(__DIR__ . '/assets/editor.js'));

    return $plugins;
});

add_filter('mce_buttons_3', function ($buttons, $editor_id) {
    $editor_ids = apply_filters('wordpress_editor_grid_editor_ids', array('content'));

    if (!is_array($editor_ids)) {
        return $buttons;
    }

    if (!in_array($editor_id, $editor_ids)) {
        return $buttons;
    }

    array_push(
        $buttons,
        'grid_create'
    );

    return $buttons;
}, 1, 2);

add_filter('mce_css', function ($mce_css) use ($baseUrl) {
    $file = apply_filters(
        'wordpress_editor_grid_editor_css',
        $baseUrl . 'assets/editor.css?ver=' . urlencode(md5_file(__DIR__ . '/assets/editor.css'))
    );

    if ($file) {
        $mce_css .= ', ' . $file;
    }

    return $mce_css;<commit_msg>Small fixes<commit_after><?php
/*
Plugin Name: Dots United WordPress Editor Grid Plugin
Plugin URI: https://github.com/dotsunited/wordpress-plugin-editor-grid
Description: Editor extension to create and manage grids.
License: MIT
Author: Dots United GmbH
Version: 1.0.0
Author URI: https://dotsunited.de
*/

$baseUrl = trailingslashit(plugin_dir_url(__FILE__));

add_filter('mce_external_plugins', function ($plugins) use ($baseUrl) {
    global $tinymce_version;

    /* WP 3.8 with tinyMCE 3 */
    if (version_compare($tinymce_version, '400', '<')) {
        // We only support tinyMCE 4
        return $plugins;
    }

    /* WP 3.9 with tinyMCE 4 */
    $plugins['grid'] = $baseUrl . 'assets/editor.js?ver=' . urlencode(md5_file(__DIR__ . '/assets/editor.js'));

    return $plugins;
});

add_filter('mce_buttons_3', function ($buttons, $editor_id) {
    $editor_ids = apply_filters('wordpress_editor_grid_editor_ids', array('content'));

    if (!is_array($editor_ids)) {
        return $buttons;
    }

    if (!in_array($editor_id, $editor_ids, true)) {
        return $buttons;
    }

    $buttons[] = 'grid_create';

    return $buttons;
}, 1, 2);

add_filter('mce_css', function ($mce_css) use ($baseUrl) {
    $file = apply_filters(
        'wordpress_editor_grid_editor_css',
        $baseUrl . 'assets/editor.css?ver=' . urlencode(md5_file(__DIR__ . '/assets/editor.css'))
    );

    if ($file) {
        $mce_css .= ', ' . $file;
    }

    return $mce_css;
{'fraction_non_alphanumeric': 0.1503531786074672, 'fraction_numerical': 0.012108980827447022, 'mean_word_length': 3.347953216374269, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6669000', 'n_tokens_mistral': 1049, 'n_tokens_neox': 990, 'n_words': 216}