← スキル一覧に戻る

wp-activation
by dreamworks2050
RetroLogin WordPress plugin - A retro-themed login experience for WordPress
⭐ 0🍴 0📅 2025年12月29日
SKILL.md
name: wp-activation description: Handle WordPress plugin activation and deactivation hooks.
WP Activation Handler
Instructions
When implementing activation/deactivation logic:
- Activation hook:
register_activation_hook(__FILE__, $callback) - Deactivation hook:
register_deactivation_hook(__FILE__, $callback) - Set default options on activation
- Flush rewrite rules if needed
- Clean up on deactivation
Activation Pattern
register_activation_hook(retrologin_plugin_file(), 'retrologin_activate');
function retrologin_activate(): void {
// Set default options
$defaults = [
'color' => '#ff6b9d',
'font' => 'Press Start 2P',
'enabled' => true,
];
if (! get_option('retrologin_settings')) {
add_option('retrologin_settings', $defaults);
}
// Flush rewrite rules if needed
flush_rewrite_rules();
}
Deactivation Pattern
register_deactivation_hook(retrologin_plugin_file(), 'retrologin_deactivate');
function retrologin_deactivate(): void {
// Clear scheduled events
wp_clear_scheduled_hook('retrologin_daily_task');
// Optionally: Remove options
// delete_option('retrologin_settings');
}
Uninstaller Pattern
// In uninstall.php
if (! defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
// Clean up all plugin data
delete_option('retrologin_settings');
delete_transient('retrologin_cache');
// Clean up user meta if any
delete_metadata('user', '', '_retrologin_preferences', '', true);
Guidelines
- Keep callbacks in
inc/directory - Don't output anything in activation
- Handle multi-site activation if needed
- Test activation on fresh install
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です