diff --git a/dummylab.php b/dummylab.php index c86102d..ba253c5 100644 --- a/dummylab.php +++ b/dummylab.php @@ -3,7 +3,7 @@ * Plugin Name: DummyLab โ Dummy Post & Content Generator * Plugin URI: https://apps.masbudikusuma.my.id/dummylab-wp * Description: Advanced dummy content generator for WordPress development with safety controls and bulk purge features. - * Version: 1.1.0 + * Version: 1.2.0 * Author: masbudikusuma * Author URI: https://masbudi.my.id * Text Domain: dummylab @@ -28,10 +28,25 @@ class DummyLab { private function __construct() { add_action('admin_menu', [$this, 'add_admin_menu']); + add_action('admin_init', [$this, 'handle_activation_redirect']); add_action('admin_post_dummylab_generate', [$this, 'handle_generate']); add_action('admin_post_dummylab_purge', [$this, 'handle_purge']); } + public static function activate_plugin() { + add_option('dummylab_do_activation_redirect', true); + } + + public function handle_activation_redirect() { + if (get_option('dummylab_do_activation_redirect', false)) { + delete_option('dummylab_do_activation_redirect'); + if (!isset($_GET['activate-multi'])) { + wp_safe_redirect(admin_url('tools.php?page=dummylab')); + exit; + } + } + } + public function add_admin_menu() { add_management_page( 'DummyLab Generator', @@ -99,21 +114,33 @@ class DummyLab { .dummylab-badge-count { display: inline-block; background: #fcf0f0; color: #d63638; font-weight: 700; font-size: 16px; padding: 4px 12px; border-radius: 20px; border: 1px solid #f5c6cb; margin-left: 6px; } .dummylab-guide-list { margin: 0; padding-left: 20px; color: #3c434a; font-size: 13px; line-height: 1.6; } .dummylab-guide-list li { margin-bottom: 8px; } - .dummylab-guide-list li:last-child { margin-bottom: 0; } - .dummylab-safety-list { margin: 0; padding-left: 18px; color: #3c434a; font-size: 13px; line-height: 1.6; list-style-type: square; } .dummylab-safety-list li { margin-bottom: 6px; } - .dummylab-btn-primary { background: #2271b1 !important; border-color: #2271b1 !important; border-radius: 6px !important; padding: 6px 18px !important; font-size: 14px !important; height: auto !important; } + .dummylab-btn-primary { background: #2271b1 !important; border-color: #2271b1 !important; border-radius: 6px !important; padding: 8px 20px !important; font-size: 14px !important; height: auto !important; cursor: pointer; } .dummylab-btn-danger { background: #d63638 !important; border-color: #d63638 !important; color: #fff !important; border-radius: 6px !important; padding: 6px 18px !important; font-size: 13px !important; height: auto !important; width: 100%; text-align: center; } .dummylab-btn-danger:disabled { background: #f6f7f7 !important; border-color: #dcdcde !important; color: #a7aaad !important; cursor: not-allowed; } + + /* Loading Overlay Styles */ + .dummylab-loading-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 999999; align-items: center; justify-content: center; flex-direction: column; color: #fff; } + .dummylab-spinner { width: 50px; height: 50px; border: 5px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: #38bdf8; animation: dummylab-spin 1s ease-in-out infinite; margin-bottom: 16px; } + @keyframes dummylab-spin { to { transform: rotate(360deg); } } + .dummylab-loading-text { font-size: 18px; font-weight: 600; text-align: center; } + .dummylab-loading-subtext { font-size: 13px; color: #cbd5e1; margin-top: 6px; text-align: center; } + +
++
' . esc_html(intval($_GET['count'])) . ' ' . esc_html($t['msg_generated']); + $gen_type = isset($_GET['type']) && $_GET['type'] === 'page' ? 'page' : 'post'; + $type_label = ($gen_type === 'page') ? ($ui_lang === 'en' ? 'Pages' : 'Halaman (Page)') : ($ui_lang === 'en' ? 'Posts' : 'Post'); + $target_url = ($gen_type === 'page') ? admin_url('edit.php?post_type=page') : admin_url('edit.php'); + + echo '๐ ' . esc_html(intval($_GET['count'])) . ' ' . esc_html($t['msg_generated']) . ' ' . sprintf(esc_html($t['check_msg']), '' . esc_html($type_label) . '') . ''; + echo '' . esc_html($t['btn_view_list']) . ' ' . esc_html($type_label) . ' →'; } elseif ($_GET['status'] === 'purged') { - echo '๐งน ' . esc_html(intval($_GET['count'])) . ' ' . esc_html($t['msg_purged']); + echo '๐งน ' . esc_html(intval($_GET['count'])) . ' ' . esc_html($t['msg_purged']) . ''; } ?>
@@ -140,7 +172,7 @@ class DummyLab {