diff --git a/dummylab.php b/dummylab.php index ba253c5..295cf5b 100644 --- a/dummylab.php +++ b/dummylab.php @@ -3,9 +3,10 @@ * 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.2.0 + * Version: 1.3.0 * Author: masbudikusuma * Author URI: https://masbudi.my.id + * Donate link: https://saweria.co/masbudikusuma * Text Domain: dummylab * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt @@ -31,6 +32,10 @@ class DummyLab { 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']); + + // Filter untuk deskripsi dinamis (ID/EN) dan Link Donasi di halaman Plugin Admin + add_filter('all_plugins', [$this, 'dynamic_plugin_description']); + add_filter('plugin_row_meta', [$this, 'add_plugin_row_meta'], 10, 2); } public static function activate_plugin() { @@ -47,6 +52,30 @@ class DummyLab { } } + // Mengubah deskripsi plugin di wp-admin/plugins.php sesuai bahasa situs (ID / EN) + public function dynamic_plugin_description($all_plugins) { + $plugin_file = plugin_basename(__FILE__); + if (isset($all_plugins[$plugin_file])) { + $locale = get_locale(); + if (strpos($locale, 'id') === 0) { + $all_plugins[$plugin_file]['Description'] = 'Generate post dummy (bahasa Indonesia atau Inggris) lengkap dengan judul, isi artikel, gambar unggulan, kategori, tag, penulis, tanggal, dan komentar dummy. Cocok untuk melihat simulasi tampilan tema sebelum diisi konten asli.'; + } else { + $all_plugins[$plugin_file]['Description'] = 'Generate dummy posts and pages (Indonesian or English) with custom titles, article body, featured images, categories, tags, author, date, and comments. Perfect for testing theme layouts before publishing real content.'; + } + } + return $all_plugins; + } + + // Menambahkan Link Donasi di sebelah "Visit plugin site" + public function add_plugin_row_meta($links, $file) { + if ($file === plugin_basename(__FILE__)) { + $locale = get_locale(); + $donate_label = (strpos($locale, 'id') === 0) ? 'โ˜• Donasi' : 'โ˜• Donate'; + $links[] = '' . $donate_label . ''; + } + return $links; + } + public function add_admin_menu() { add_management_page( 'DummyLab Generator', @@ -121,7 +150,6 @@ class DummyLab { .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); } } @@ -129,7 +157,6 @@ class DummyLab { .dummylab-loading-subtext { font-size: 13px; color: #cbd5e1; margin-top: 6px; text-align: center; } -
@@ -137,13 +164,11 @@ class DummyLab {
-
-

๐Ÿงช DummyLab v1.2.0

-

masbudikusuma

+

๐Ÿงช DummyLab v1.3.0

+

masbudikusumaโ˜•

-
๐Ÿ‡ฎ๐Ÿ‡ฉ ID ๐Ÿ‡ฌ๐Ÿ‡ง EN @@ -170,14 +195,12 @@ class DummyLab {
-
-
โš™๏ธ
@@ -209,7 +232,6 @@ class DummyLab {
-
๐Ÿท๏ธ
@@ -241,7 +263,6 @@ class DummyLab {
-
๐Ÿ“
@@ -275,9 +296,7 @@ class DummyLab {
-
-

๐Ÿ—‘๏ธ

@@ -292,7 +311,6 @@ class DummyLab {

-

๐Ÿ“˜

    @@ -303,7 +321,6 @@ class DummyLab {
-

๐Ÿ›ก๏ธ

    @@ -342,6 +359,7 @@ class DummyLab { return [ 'created_by' => 'Created by', 'plugin_doc' => 'Plugin Documentation', + 'link_donate' => 'Donate Support', 'msg_generated' => 'dummy item(s) generated successfully!', 'check_msg' => 'Please check your %s section.', 'btn_view_list' => 'View List of', @@ -402,6 +420,7 @@ class DummyLab { return [ 'created_by' => 'Dibuat oleh', 'plugin_doc' => 'Dokumentasi Plugin', + 'link_donate' => 'Dukung Donasi', 'msg_generated' => 'konten dummy berhasil dibuat!', 'check_msg' => 'Silakan cek daftar %s Anda.', 'btn_view_list' => 'Lihat Daftar',