Skip to content

ms13th-cyber/admin-menu-ghost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Admin Menu Ghost

A lightweight, single-function WordPress plugin that allows you to hide parent and child admin menus on a per-user basis, with automatic direct URL access blocking.

ユーザーごとに管理画面の親・子メニューを個別に非表示にし、URLの直打ち(強制アクセス)も自動でブロックする軽量・単一機能のWordPressプラグインです。クライアントワークや複数ユーザーでの運用時に、不要なメニューをサクッと隠して管理画面をスリム化・安全化します。


Key Features

  • Per-User Configuration: Select any user via a dropdown menu and customize their visible admin panel layout individually.
  • Dynamic Menu Detection: Automatically scans all registered menus—including those generated by third-party plugins—by utilizing a late-priority hook execution.
  • Granular Control (Parent/Child): Hide entire main menus or isolate specific sub-menus (e.g., allow post editing but hide category management).
  • Hard Access Control: Automatically intercepts unauthorized direct URL entries to hidden menus and triggers a 403 Access Denied error.
  • Ultra-Lightweight: Built as a pure, single-file plugin with zero external library bloat and optimal performance.

主な機能(日本語)

  • ユーザー個別のメニュー設定: ドロップダウンからユーザーを選択し、それぞれのユーザー専用の非表示メニューを個別にカスタマイズ可能。
  • 他プラグインのメニュー自動検出: 優先度を極限まで下げてメニューを取得するため、サードパーティ製プラグインが生成した独自のメニューも自動で検出して一覧化。
  • 親・子メニューの細かな制御: メニュー全体を隠すだけでなく、「投稿は許可するが、カテゴリー編集(子メニュー)だけを隠す」といった柔軟な制御に対応。
  • URL直打ちの強力なブロック: メニューから非表示にするだけでなく、URLを直接入力してアクセスしようとした場合も自動的に検知して403(Access Denied)でシャットアウト。
  • 超軽量・単一機能: 外部ライブラリを一切使用せず、わずか1ファイルで完結する質実剛健でクリーンな設計。

Features Overview / 機能概要

Admin Settings Features / 管理画面設定機能

  • Interactive target user switcher / 設定対象ユーザーのシームレスな切り替え
  • Dynamic multi-user setting retention / 別ユーザーの設定を壊さない安全なデータ保持構造
  • Self-hiding prevention / 自分自身のプラグイン設定画面を隠して迷子になるのを防ぐセーフティ設計

Access Control Features / アクセス制御機能

  • remove_menu_page & remove_submenu_page integration / コア関数に準拠したクリーンなメニュー削除
  • admin_page_access_denied hook redirection / 権限エラーフックを捉えたスマートな403強制終了

Installation / インストール

  1. Upload the plugin folder to your /wp-content/plugins/ directory. (wp-content/plugins/ ディレクトリにプラグインフォルダをアップロードします)
  2. Activate the plugin through the 'Plugins' menu in WordPress. (管理画面の「プラグイン」メニューから有効化してください)
  3. Navigate to Settings > Admin Menu Ghost in your WordPress dashboard. (管理画面の「設定 > Admin Menu Ghost」へ移動します)
  4. Select a target user from the dropdown, check the menus you want to hide, and click "Save". (ドロップダウンから対象ユーザーを選択し、隠したいメニューにチェックを入れて保存します)

Technical Details

Hook Priority

add_action( 'admin_menu', ..., 9999 ); Ensures compatibility with WooCommerce, Contact Form 7, and other heavy plugins by running after all standard menus have been registered.

Security & Hardening

  • Direct file access prevention (ABSPATH check)
  • Capabilities enforcement (manage_options required for the settings page)
  • Non-destructive option updates using hidden input fields for inactive user data

Roadmap / 今後の予定

  • Role-based configuration (Apply settings to 'Editor' or 'Author' roles at once)
  • Safe-mode override link via emergency bypass parameter
  • Export/Import settings for easier staging-to-production deployment

Developer Info / 開発者情報

About

A lightweight WordPress plugin to hide admin menus per user with automatic URL access blocking. / ユーザーごとに管理画面メニューを隠蔽しURL直打ちも防ぐ軽量プラグイン。

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages