-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f5f951
commit b1e49c1
Showing
17 changed files
with
385 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
|
||
/** | ||
* Fired during plugin activation | ||
* | ||
* @link https://websweetstudio.com | ||
* @since 1.0.0 | ||
* | ||
* @package sweetaddons | ||
* @subpackage sweetaddons/includes | ||
*/ | ||
|
||
/** | ||
* Fired during plugin activation. | ||
* | ||
* This class defines all code necessary to run during the plugin's activation. | ||
* | ||
* @since 1.0.0 | ||
* @package sweetaddons | ||
* @subpackage sweetaddons/includes | ||
* @author Aditya Kristyanto <[email protected]> | ||
*/ | ||
|
||
class Sweetaddons_Admin { | ||
|
||
/** | ||
* The ID of this plugin. | ||
* | ||
* @since 1.0.0 | ||
* @access private | ||
* @var string $plugin_name The ID of this plugin. | ||
*/ | ||
private $plugin_name; | ||
|
||
/** | ||
* The version of this plugin. | ||
* | ||
* @since 1.0.0 | ||
* @access private | ||
* @var string $version The current version of this plugin. | ||
*/ | ||
private $version; | ||
|
||
/** | ||
* Initialize the class and set its properties. | ||
* | ||
* @since 1.0.0 | ||
* @param string $plugin_name The name of this plugin. | ||
* @param string $version The version of this plugin. | ||
*/ | ||
public function __construct( $plugin_name, $version ) { | ||
|
||
$this->plugin_name = $plugin_name; | ||
$this->version = $version; | ||
|
||
} | ||
|
||
/** | ||
* Register the stylesheets for the admin area. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public function enqueue_styles() { | ||
|
||
/** | ||
* This function is provided for demonstration purposes only. | ||
* | ||
* An instance of this class should be passed to the run() function | ||
* defined in Sweet_Addons_Loader as all of the hooks are defined | ||
* in that particular class. | ||
* | ||
* The Sweet_Addons_Loader will then create the relationship | ||
* between the defined hooks and the functions defined in this | ||
* class. | ||
*/ | ||
|
||
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/sweetaddons-admin.css', array(), $this->version, 'all' ); | ||
|
||
} | ||
|
||
/** | ||
* Register the JavaScript for the admin area. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public function enqueue_scripts() { | ||
|
||
/** | ||
* This function is provided for demonstration purposes only. | ||
* | ||
* An instance of this class should be passed to the run() function | ||
* defined in Sweet_Addons_Loader as all of the hooks are defined | ||
* in that particular class. | ||
* | ||
* The Sweet_Addons_Loader will then create the relationship | ||
* between the defined hooks and the functions defined in this | ||
* class. | ||
*/ | ||
|
||
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/sweetaddons-admin.js', array( 'jquery' ), $this->version, false ); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* All of the CSS for your admin-specific functionality should be | ||
* included in this file. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(function( $ ) { | ||
'use strict'; | ||
|
||
/** | ||
* All of the code for your admin-facing JavaScript source | ||
* should reside in this file. | ||
* | ||
* Note: It has been assumed you will write jQuery code here, so the | ||
* $ function reference has been prepared for usage within the scope | ||
* of this function. | ||
* | ||
* This enables you to define handlers, for when the DOM is ready: | ||
* | ||
* $(function() { | ||
* | ||
* }); | ||
* | ||
* When the window is loaded: | ||
* | ||
* $( window ).load(function() { | ||
* | ||
* }); | ||
* | ||
* ...and/or other possibilities. | ||
* | ||
* Ideally, it is not considered best practise to attach more than a | ||
* single DOM-ready or window-load handler for a particular page. | ||
* Although scripts in the WordPress core, Plugins and Themes may be | ||
* practising this, we should strive to set a better example in our own work. | ||
*/ | ||
|
||
})( jQuery ); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
<?php | ||
|
||
/** | ||
* Fired during plugin activation | ||
* | ||
* @link https://websweetstudio.com | ||
* @since 1.0.0 | ||
* | ||
* @package sweetaddons | ||
* @subpackage sweetaddons/includes | ||
*/ | ||
|
||
/** | ||
* Fired during plugin activation. | ||
* | ||
* This class defines all code necessary to run during the plugin's activation. | ||
* | ||
* @since 1.0.0 | ||
* @package sweetaddons | ||
* @subpackage sweetaddons/includes | ||
* @author Aditya Kristyanto <[email protected]> | ||
*/ | ||
?> | ||
|
||
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
* @subpackage sweetaddons/includes | ||
* @author Aditya Kristyanto <[email protected]> | ||
*/ | ||
class sweetaddons | ||
class Sweetaddons | ||
{ | ||
|
||
/** | ||
|
@@ -90,7 +90,7 @@ public function __construct() | |
* - sweetaddons_Loader. Orchestrates the hooks of the plugin. | ||
* - sweetaddons_i18n. Defines internationalization functionality. | ||
* - sweetaddons_Admin. Defines all hooks for the admin area. | ||
* - sweetaddons_Public. Defines all hooks for the public side of the site. | ||
* - Sweetaddons_Public. Defines all hooks for the public side of the site. | ||
* | ||
* Create an instance of the loader which will be used to register the hooks | ||
* with WordPress. | ||
|
@@ -105,73 +105,73 @@ private function load_dependencies() | |
* The class responsible for orchestrating the actions and filters of the | ||
* core plugin. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-loader.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-loader.php'; | ||
|
||
/** | ||
* The class responsible for defining internationalization functionality | ||
* of the plugin. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-i18n.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-i18n.php'; | ||
|
||
/** | ||
* Berisi Class untuk mematikan fungsi komentar di wordpress. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-disable-comments.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-disable-comments.php'; | ||
|
||
/** | ||
* Berisi Class untuk mematikan semua notice di wp-admin. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-hide-admin-notice.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-hide-admin-notice.php'; | ||
|
||
/** | ||
* Berisi Class untuk membatasi gagal login. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-limit-login-attempts.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-limit-login-attempts.php'; | ||
|
||
/** | ||
* Berisi Class untuk fungsi maintenance mode. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-maintenance-mode.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-maintenance-mode.php'; | ||
|
||
/** | ||
* Berisi Class untuk disable XML RPC. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-disable-xmlrpc.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-disable-xmlrpc.php'; | ||
|
||
/** | ||
* Berisi Class untuk disable REST API. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-disable-rest-api.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-disable-rest-api.php'; | ||
|
||
/** | ||
* Berisi Class untuk disable visual editor. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-disable-gutenberg.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-disable-gutenberg.php'; | ||
|
||
/** | ||
* Berisi Class untuk block akses ke wp-admin berdasarkan kode negara. | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-block-wp-login.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-block-wp-login.php'; | ||
|
||
/** | ||
* Berisi Class untuk auto update plugin | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-auto-updater.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-auto-updater.php'; | ||
|
||
/** | ||
* Berisi Class untuk Classic Widget | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-classic-widget.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-classic-widget.php'; | ||
|
||
/** | ||
* Berisi Class untuk standar Editor | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-standar-editor.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-standar-editor.php'; | ||
|
||
/** | ||
* Berisi Class untuk hapus slug category | ||
*/ | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-sweetaddons-remove-slug-category.php'; | ||
require_once plugin_dir_path(dirname(__FILE__)) . 'inc/class-sweetaddons-remove-slug-category.php'; | ||
|
||
|
||
/** | ||
|
@@ -237,7 +237,7 @@ private function define_admin_hooks() | |
private function define_public_hooks() | ||
{ | ||
|
||
$plugin_public = new sweetaddons_Public($this->get_plugin_name(), $this->get_version()); | ||
$plugin_public = new Sweetaddons_Public($this->get_plugin_name(), $this->get_version()); | ||
|
||
$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); | ||
$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.