<commit_before><?php
/*
Plugin Name: Kintassa Catalog
Plugin URI: http://www.kintassa.com/projects/kintassa_catalog/
Description: A catalog page editing and presentation plugin
Version: 1.0
Author: <NAME>
Author URI: http://www.kintassa.com
Copyright: Copyright (c) 2011 Kintassa.
License: All rights reserved.  Contact Kintassa for licensing.
*/

if (!function_exists('kintassa_core')) {
	echo "This plugin requires Kintassa Core";
} else {
	function kin_cat_inc($subpath) {
		$full_subpath = "src/" . $subpath;
		if (DIRECTORY_SEPARATOR == "/") {
			$real_subpath = $full_subpath;
		} else {
			$real_subpath = str_replace("/", DIRECTORY_SEPARATOR, $full_subpath);
		}
		return dirname(__file__) . DIRECTORY_SEPARATOR . $real_subpath;
	}
	
	require_once(kintassa_core('kin_wp_plugin.php'));
	require_once(kin_cat_inc('kcat_config.php'));
	require_once(kin_cat_inc('kcat_db.php'));
	require_once(kin_cat_inc('kcat_menu.php'));
	require_once(kin_cat_inc('kcat_shortcode.php'));
	require_once(kin_cat_inc('kcat_db.php'));
	require_once(kin_cat_inc('kcat_tags.php'));
	
	class KintassaCatalogPlugin extends KintassaWPPlugin {
		function __construct() {
			parent::__construct(__file__);
	
			$kintassa_catalogs_menu = new KintassaCatalogMenu();
			$kintassa_catalogs_shortcode = new KintassaCatalogShortcode();
	
			add_action('init', array($this, 'install_scripts'));
	
			$write_dirs = array(KCAT_UPLOAD_PATH, KCAT_CACHE_PATH);
			foreach ($write_dirs as $wd) {
				if (!file_exists($wd)) {
					exit("ERROR: '$wd' does not exist!");
				}
	
				if (!is_writeable($wd)) {
					exit("ERROR: '$wd' is not writeable!");
				}
			}
		}
	
		function reg_script($name, $relpath) {
			$abs_url = plugins_url("scripts" . DIRECTORY_SEPARATOR . $relpath, __file__);
			wp_register_script($name, $abs_url, false, null);
	        $myStyleUrl = plugins_url('/stylesheets/kintassa_catalog.css', __file__);
		    wp_register_style('kintassa_catalog', $myStyleUrl);
		}
	
		function install_scripts() {
			$this->reg_script("jquery_cycle", "jquery.cycle.all.min.js");
	
			wp_enqueue_script("jquery");
			wp_enqueue_script("jquery_cycle");
	        wp_enqueue_style('kintassa_catalog');
		}
	
		function install() {
			kintassa_catalogs_setup_db();
		}
	
		function remove() {
		}
	}

	// instanciate the plugin
	$kCatalogPlugin = new KintassaCatalogPlugin();
	$kCatalogPlugin->install();
}

?><commit_msg>include Kintassa_Core based on function presence; don't rely on wordpress plugin loaded checking.<commit_after><?php
/*
Plugin Name: Kintassa Catalog
Plugin URI: http://www.kintassa.com/projects/kintassa_catalog/
Description: A catalog page editing and presentation plugin
Version: 1.0
Author: <NAME>
Author URI: http://www.kintassa.com
Copyright: Copyright (c) 2011 Kintassa.
License: All rights reserved.  Contact Kintassa for licensing.
*/


if (!function_exists('kintassa_core')) {
	require_once ( WP_PLUGIN_DIR . '/Kintassa_Core/kintassa_core.php' );
}

function kin_cat_inc($subpath) {
	$full_subpath = "src/" . $subpath;
	if (DIRECTORY_SEPARATOR == "/") {
		$real_subpath = $full_subpath;
	} else {
		$real_subpath = str_replace("/", DIRECTORY_SEPARATOR, $full_subpath);
	}
	return dirname(__file__) . DIRECTORY_SEPARATOR . $real_subpath;
}

require_once(kintassa_core('kin_wp_plugin.php'));
require_once(kin_cat_inc('kcat_config.php'));
require_once(kin_cat_inc('kcat_db.php'));
require_once(kin_cat_inc('kcat_menu.php'));
require_once(kin_cat_inc('kcat_shortcode.php'));
require_once(kin_cat_inc('kcat_db.php'));
require_once(kin_cat_inc('kcat_tags.php'));

class KintassaCatalogPlugin extends KintassaWPPlugin {
	function __construct() {
		parent::__construct(__file__);

		$kintassa_catalogs_menu = new KintassaCatalogMenu();
		$kintassa_catalogs_shortcode = new KintassaCatalogShortcode();

		add_action('init', array($this, 'install_scripts'));

		$write_dirs = array(KCAT_UPLOAD_PATH, KCAT_CACHE_PATH);
		foreach ($write_dirs as $wd) {
			if (!file_exists($wd)) {
				exit("ERROR: '$wd' does not exist!");
			}

			if (!is_writeable($wd)) {
				exit("ERROR: '$wd' is not writeable!");
			}
		}
	}

	function reg_script($name, $relpath) {
		$abs_url = plugins_url("scripts" . DIRECTORY_SEPARATOR . $relpath, __file__);
		wp_register_script($name, $abs_url, false, null);
        $myStyleUrl = plugins_url('/stylesheets/kintassa_catalog.css', __file__);
	    wp_register_style('kintassa_catalog', $myStyleUrl);
	}

	function install_scripts() {
		$this->reg_script("jquery_cycle", "jquery.cycle.all.min.js");

		wp_enqueue_script("jquery");
		wp_enqueue_script("jquery_cycle");
        wp_enqueue_style('kintassa_catalog');
	}

	function install() {
		kintassa_catalogs_setup_db();
	}

	function remove() {
	}
}

// instanciate the plugin
$kCatalogPlugin = new KintassaCatalogPlugin();
$kCatalogPlugin->install();

?>
{'fraction_non_alphanumeric': 0.14173064951234696, 'fraction_numerical': 0.0024901431832330357, 'mean_word_length': 5.418109187749667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6498262', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1710, 'n_words': 294}