Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions admin/class-wordpress-diffy-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,9 @@ public function __construct($plugin_name, $version) {
add_action('admin_menu', array($this, 'addPluginAdminMenu'), 9);
add_action('admin_init', array($this, 'registerAndBuildFields'));

// Init function on plugin activation
add_action( 'init', array( $this, 'load_plugin' ) );

// Add javascript to the form.
add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
add_action('admin_enqueue_scripts', array($this, 'scripts'));
add_action( 'wp_ajax_diffy_register', array( $this, 'diffy_register' ) );

// Add styles to the admin page.
add_action( 'admin_enqueue_scripts', array( $this, 'styles' ) );
}

/**
* Activate the plugin
*/
public function activate() {
add_option( 'activated_plugin', 'wordpress-diffy' ); //ToDo
}

/**
* Enqueue styles and scripts after plugin activation
*/
public function load_plugin() {
if ( is_admin() && get_option( 'activated_plugin' ) == 'wordpress-diffy' ) {

delete_option( 'activated_plugin' );

wp_enqueue_script(
'diffy-custom',
plugin_dir_url(__FILE__) . '../js/custom.js',
array('jquery'),
NULL,
TRUE
);

// set variables for script
wp_localize_script(
'diffy-custom',
'params',
array(
'pluginPath' => plugin_dir_url(__DIR__),
)
);
}
}

/**
Expand Down Expand Up @@ -87,18 +47,6 @@ public function scripts($hook) {
);
}

/**
* Add styles to the plugin.
*/
public function styles() {
wp_enqueue_style(
'diffy-stylesheet',
plugin_dir_url(__FILE__) . '../css/style.css',
array(),
NULL
);
}

/**
* Register an account with Diffy.
*/
Expand Down Expand Up @@ -343,4 +291,4 @@ public function diffy_validate_project_id_callback($project_id) {
return $project_id;
}

}
}
13 changes: 0 additions & 13 deletions css/style.css

This file was deleted.

8 changes: 0 additions & 8 deletions img/arrow.svg

This file was deleted.

11 changes: 2 additions & 9 deletions wordpress-diffy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Description: Diffy allows you to see if any of your updates caused visual changes on the site.
* Author: Diffy
* Author URI: https://diffy.website/
* Version: 0.9.4
* Version: 0.9.5
* License: GPLv2 or later (license.txt)
*/

Expand All @@ -35,14 +35,7 @@

// Load admin pages.
require_once dirname( __FILE__ ) . '/admin/class-wordpress-diffy-admin.php';

if ( class_exists( 'Diffy_Admin' ) ) {
// Installation hook
register_activation_hook( __FILE__, array( 'Diffy_Admin', 'activate' ) );

// instantiate the plugin class
$admin = new Diffy_Admin( 'wordpress-diffy', '0.9.0' );
}
$admin = new Diffy_Admin('wordpress-diffy', '0.9.0');

/**
* Throw an error if the Composer autoload is missing and self-deactivate plugin.
Expand Down