Skip to content

Commit

Permalink
Stable 1
Browse files Browse the repository at this point in the history
  • Loading branch information
aadiityaak committed Jun 19, 2023
1 parent 3f5f951 commit b1e49c1
Show file tree
Hide file tree
Showing 17 changed files with 385 additions and 34 deletions.
104 changes: 104 additions & 0 deletions admin/class-sweetaddons-admin.php
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 );

}

}
14 changes: 7 additions & 7 deletions admin/class-sweetaddons-option-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct()

public function add_options_page()
{
add_options_page('Pengaturan Admin', 'Pengaturan Admin', 'manage_options', 'custom_admin_options', array($this, 'options_page_callback'));
add_options_page('Pengaturan Umum', 'Pengaturan Umum', 'manage_options', 'custom_admin_options', array($this, 'options_page_callback'));
}

public function register_settings()
Expand All @@ -55,7 +55,7 @@ public function options_page_callback()
{
?>
<div class="wrap">
<h1>Pengaturan Admin</h1>
<h1>Pengaturan Umum</h1>
<form method="post" action="options.php">
<?php settings_fields('custom_admin_options_group'); ?>
<?php do_settings_sections('custom_admin_options_group'); ?>
Expand Down Expand Up @@ -140,8 +140,8 @@ public function options_page_callback()
<tr>
<th scope="row">Classic Widget</th>
<td>
<input type="checkbox" id="classic_widget_velocity" name="classic_widget_velocity" value="1" <?php checked(get_option('classic_widget_velocity', '1'), 1); ?>>
<label for="classic_widget_velocity">
<input type="checkbox" id="classic_widget" name="classic_widget" value="1" <?php checked(get_option('classic_widget', '1'), 1); ?>>
<label for="classic_widget">
<small>
Opsi untuk menggunakan Widget Classic
</small>
Expand All @@ -162,8 +162,8 @@ public function options_page_callback()
<tr>
<th scope="row">Remove Slug Category</th>
<td>
<input type="checkbox" id="remove_slug_category_velocity" name="remove_slug_category_velocity" value="1" <?php checked(get_option('remove_slug_category_velocity', '1'), 1); ?>>
<label for="remove_slug_category_velocity">
<input type="checkbox" id="remove_slug_category" name="remove_slug_category" value="1" <?php checked(get_option('remove_slug_category', '1'), 1); ?>>
<label for="remove_slug_category">
<small>
Opsi ini untuk hapus /category/ dari URL
</small>
Expand Down Expand Up @@ -210,5 +210,5 @@ public function options_page_callback()
}
}

// Initialize the Pengaturan Admin page
// Initialize the Pengaturan Umum page
$custom_admin_options_page = new Custom_Admin_Option_Page();
4 changes: 4 additions & 0 deletions admin/css/sweetaddons-admin.css
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.
*/
32 changes: 32 additions & 0 deletions admin/js/sweetaddons-admin.js
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 );
1 change: 1 addition & 0 deletions admin/js/tinymce-table-plugin.min.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions admin/partials/sweetaddons-admin-display.php
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. -->
2 changes: 1 addition & 1 deletion assets/js/sweetaddon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/sweetaddon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions inc/class-sweetaddons.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @subpackage sweetaddons/includes
* @author Aditya Kristyanto <[email protected]>
*/
class sweetaddons
class Sweetaddons
{

/**
Expand Down Expand Up @@ -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.
Expand All @@ -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';


/**
Expand Down Expand Up @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sweetaddons",
"version": "1.6.5",
"version": "1.6.8",
"description": "A simple addon for the Sweetweb theme",
"author": "websweetstudio.com",
"homepage": "https://websweetstudio.com",
Expand Down
Loading

0 comments on commit b1e49c1

Please sign in to comment.