<commit_before><?php
/**
 * @package Grabbber
 * @version 1.3
 */
/*
Plugin Name: Grabbber
Description: Plugin will grab freebie items from the Dribbble API and generate content on native site
Version: 1.3
Author: <NAME>
Author URI: http://www.pixelpusher.ninja
*/

require 'Client.php';
require_once '/homepages/19/d402940043/htdocs/TimeWise2014/wp-admin/includes/image.php';
require_once '/homepages/19/d402940043/htdocs/TimeWise2014/wp-admin/includes/file.php';
require_once '/homepages/19/d402940043/htdocs/TimeWise2014/wp-admin/includes/media.php';

class Grabbber {

private $options_name = "grabbber";
private $default_options = array(
    'custom' => 'free',
    'draft' => 'true'
);

function __construct(){
	if ( ! wp_next_scheduled( 'my_task_hook' ) ) {
  		wp_schedule_event( time(), 'hourly', 'my_task_hook' );
	}

	add_action('admin_init', array($this, 'admin_init'));
	
	add_action('admin_menu', array($this, 'add_page'));
	
	register_activation_hook('/homepages/19/d402940043/htdocs/TimeWise2014/wp-content/plugins/Grabbber/untitled.php', array($this, 'on_activate'));
	register_deactivation_hook('/homepages/19/d402940043/htdocs/TimeWise2014/wp-content/plugins/Grabbber/untitled.php', array($this, 'on_deactivate'));
	register_uninstall_hook('/homepages/19/d402940043/htdocs/TimeWise2014/wp-content/plugins/Grabbber/untitled.php', array($this, 'on_uninstall'));
	
	add_action('my_task_hook', $this->grab_freebies());
}

public function on_activate() {
    update_option($this->options_name, $this->default_options);
}

public function on_deactivate() {
    delete_option($this->option_name);
}

public function on_uninstall()
    {
        if ( ! current_user_can( 'activate_plugins' ) )
            return;
        check_admin_referer( 'bulk-plugins' );

        // Important: Check if the file is the one
        // that was registered during the uninstall hook.
        if ( '/homepages/19/d402940043/htdocs/TimeWise2014/wp-content/plugins/Grabbber/untitled.php' != WP_UNINSTALL_PLUGIN )
            return;

        # Uncomment the following line to see the function in action
        # exit( var_dump( $_GET ) );
    }

public function admin_init() {
    register_setting('grabbber_options', $this->options_name);
}

public function add_page() {
    add_options_page('Grabbber Options', 'Grabbber Options', 'manage_options', 'grabbber_options', array($this, 'options_do_page'));
}

public function options_do_page() {
    $options = get_option($this->options_name);<commit_msg>Updated path names<commit_after><?php
/**
 * @package Grabbber
 * @version 1.3
 */
/*
Plugin Name: Grabbber
Description: Plugin will grab freebie items from the Dribbble API and generate content on native site
Version: 1.3
Author: <NAME>
Author URI: http://www.pixelpusher.ninja
*/

require 'Client.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/media.php';

class Grabbber {

private $options_name = "grabbber";
private $default_options = array(
    'custom' => 'free',
    'draft' => 'true'
);

function __construct(){
	if ( ! wp_next_scheduled( 'my_task_hook' ) ) {
  		wp_schedule_event( time(), 'hourly', 'my_task_hook' );
	}

	add_action('admin_init', array($this, 'admin_init'));
	
	add_action('admin_menu', array($this, 'add_page'));
	
	register_activation_hook(ABSPATH . 'wp-content/plugins/Grabbber/untitled.php', array($this, 'on_activate'));
	register_deactivation_hook(ABSPATH . 'wp-content/plugins/Grabbber/untitled.php', array($this, 'on_deactivate'));
	register_uninstall_hook(ABSPATH . 'wp-content/plugins/Grabbber/untitled.php', array($this, 'on_uninstall'));
	
	add_action('my_task_hook', $this->grab_freebies());
}

public function on_activate() {
    update_option($this->options_name, $this->default_options);
}

public function on_deactivate() {
    delete_option($this->option_name);
}

public function on_uninstall()
    {
        if ( ! current_user_can( 'activate_plugins' ) )
            return;
        check_admin_referer( 'bulk-plugins' );

        // Important: Check if the file is the one
        // that was registered during the uninstall hook.
        // can also use plugin_dir_path( __FILE__ ) . '/untitled.php' to get path!
        if (ABSPATH . 'wp-content/plugins/Grabbber/untitled.php' != WP_UNINSTALL_PLUGIN )
            return;

        # Uncomment the following line to see the function in action
        # exit( var_dump( $_GET ) );
    }

public function admin_init() {
    register_setting('grabbber_options', $this->options_name);
}

public function add_page() {
    add_options_page('Grabbber Options', 'Grabbber Options', 'manage_options', 'grabbber_options', array($this, 'options_do_page'));
}

public function options_do_page() {
    $options = get_option($this->options_name);
{'fraction_non_alphanumeric': 0.13946280991735538, 'fraction_numerical': 0.023347107438016528, 'mean_word_length': 4.463882618510158, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3544573', 'n_tokens_mistral': 1705, 'n_tokens_neox': 1609, 'n_words': 313}