Skip to content

nftushar/DevXpert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DevXpert - WordPress Developer Tools

A comprehensive WordPress plugin designed specifically for developers working with WordPress and WooCommerce. DevXpert provides visual inspection tools, hook locators, debugging helpers, and productivity boosters to streamline your development workflow.

๐Ÿš€ Features

1. Woo Hook Inspector

  • Visual overlay of all hooks (do_action, apply_filters) on front-end
  • Works across all templates: WooCommerce, theme templates, etc.
  • Hover to view:
    • Hook name
    • Hook type (action / filter)
    • Priority & attached functions
  • Click to:
    • Copy hook name
    • Inject test content (for action hooks)
    • Open hook context (see which plugin/theme added it)

2. Hook Logger Panel

  • Admin toolbar dropdown or standalone admin page
  • Logs:
    • Hooks fired on the current page
    • Callback functions, with priority and origin
    • Time taken (performance profiling)

3. Function Tracer

  • Find where a function is defined (theme or plugin)
  • Search WordPress core, plugin, or theme directories
  • Shows:
    • File path
    • Line number
    • Syntax highlight

4. PHP Code Runner (Safe Sandbox)

  • Safely run custom PHP snippets for testing
  • Sandbox mode with optional WP nonce/role check
  • Ideal for hook testing, debugging

5. Template Locator

  • Shows template override paths for:
    • WooCommerce
    • Theme templates
  • Highlights whether template is being overridden and from where

6. WooCommerce Conditional Helper

  • Visual breakdown of:
    • is_product(), is_cart(), is_checkout(), etc.
  • Tells you which conditionals return true on the current page

7. Admin Area Tools

  • Find post meta
  • Inspect global $post, $product, $user, $order objects
  • Optionally dump info into admin bar or console

๐Ÿ“ฆ Installation

Method 1: Manual Installation

  1. Download the plugin files
  2. Upload the devxpert folder to your /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Go to Tools โ†’ DevXpert to access the developer tools

Method 2: ZIP Upload

  1. Create a ZIP file of the plugin folder
  2. Go to Plugins โ†’ Add New โ†’ Upload Plugin
  3. Upload the ZIP file and activate
  4. Access via Tools โ†’ DevXpert

๐Ÿ› ๏ธ Usage

Hook Inspector

  1. Go to Tools โ†’ DevXpert โ†’ Hook Inspector
  2. Enable "Hook Overlay"
  3. Visit any page on your site
  4. Hover over elements to see hook information
  5. Click hooks to copy names or view details

Function Tracer

  1. Go to Tools โ†’ DevXpert โ†’ Function Tracer
  2. Enter a function name (e.g., wp_head)
  3. Click "Search"
  4. View results showing file locations

PHP Runner

  1. Go to Tools โ†’ DevXpert โ†’ PHP Runner
  2. Enter PHP code in the textarea
  3. Click "Run Code"
  4. View output and return values

Template Locator

  1. Go to Tools โ†’ DevXpert โ†’ Template Locator
  2. Enter template name (e.g., single.php)
  3. Click "Search"
  4. See template locations and override status

WooCommerce Conditionals

  1. Go to Tools โ†’ DevXpert โ†’ WooCommerce Conditionals
  2. Click "Check Current Page Conditionals"
  3. View which conditionals return true

๐ŸŽฏ Keyboard Shortcuts

  • Ctrl/Cmd + Shift + H: Toggle hook overlay on frontend

๐Ÿ”ง Configuration

Settings

All plugin settings are managed through the admin interface at Tools โ†’ DevXpert. You can enable/disable individual features:

  • Hook Overlay
  • Hook Logger
  • Function Tracer
  • PHP Runner
  • Template Locator
  • WooCommerce Conditionals
  • Admin Tools

Security

  • Plugin only loads for administrators or when WP_DEBUG is true
  • PHP Runner includes security checks to prevent dangerous function execution
  • All AJAX requests include nonce verification

๐Ÿ—๏ธ Development

File Structure

devxpert/
โ”œโ”€โ”€ devxpert.php                 # Main plugin file
โ”œโ”€โ”€ includes/                    # PHP classes
โ”‚   โ””โ”€โ”€ Core/
โ”‚       โ”œโ”€โ”€ Plugin.php          # Main plugin class
โ”‚       โ”œโ”€โ”€ Admin/              # Admin interface
โ”‚       โ”œโ”€โ”€ HookInspector/      # Hook overlay functionality
โ”‚       โ”œโ”€โ”€ HookLogger/         # Hook logging
โ”‚       โ”œโ”€โ”€ FunctionTracer/     # Function location
โ”‚       โ”œโ”€โ”€ PhpRunner/          # Safe PHP execution
โ”‚       โ”œโ”€โ”€ TemplateLocator/    # Template finding
โ”‚       โ”œโ”€โ”€ WooConditionalHelper/ # WooCommerce conditionals
โ”‚       โ””โ”€โ”€ AdminTools/         # Admin debugging tools
โ”œโ”€โ”€ assets/                      # Frontend assets
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ”œโ”€โ”€ admin.css          # Admin styles
โ”‚   โ”‚   โ””โ”€โ”€ frontend.css       # Frontend overlay styles
โ”‚   โ””โ”€โ”€ js/
โ”‚       โ”œโ”€โ”€ admin.js           # Admin functionality
โ”‚       โ””โ”€โ”€ frontend.js        # Frontend overlay functionality
โ”œโ”€โ”€ templates/                   # PHP templates
โ”‚   โ””โ”€โ”€ admin-page.php         # Admin page template
โ””โ”€โ”€ languages/                  # Translation files

Hooks and Filters

The plugin provides several hooks for customization:

// Modify hook overlay behavior
add_filter('devxpert_hook_overlay_enabled', '__return_false');

// Add custom hook detection
add_action('devxpert_hook_detected', function($hook_name, $hook_data) {
    // Custom logic
}, 10, 2);

๐Ÿ› Troubleshooting

Hook Overlay Not Showing

  1. Ensure you're logged in as an administrator
  2. Check that "Hook Overlay" is enabled in settings
  3. Verify no JavaScript errors in browser console
  4. Check if theme conflicts with overlay positioning

PHP Runner Not Working

  1. Ensure you have administrator privileges
  2. Check that dangerous functions are not being used
  3. Verify nonce is valid
  4. Check server error logs

Function Tracer Not Finding Functions

  1. Ensure function name is correct
  2. Check file permissions on WordPress directories
  3. Verify search directories are accessible

๐Ÿ“ Changelog

Version 1.0.0

  • Initial release
  • Hook Inspector with visual overlay
  • Function Tracer
  • PHP Code Runner
  • Template Locator
  • WooCommerce Conditional Helper
  • Admin Tools

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

๐Ÿ“„ License

This plugin is licensed under the GPL v2 or later.

๐Ÿ†˜ Support

For support, feature requests, or bug reports:

  • Create an issue on GitHub
  • Check the troubleshooting section above
  • Review WordPress debugging guides

โš ๏ธ Important Notes

  • This plugin is designed for development environments
  • Some features may impact performance on production sites
  • Always test thoroughly before using on live sites
  • Keep WordPress and plugins updated for security

๐Ÿ”ฎ Future Features

  • Hook performance profiling
  • Advanced code analysis
  • Database query inspector
  • Custom hook creation wizard
  • Integration with popular IDEs
  • Real-time collaboration tools

DevXpert - Making WordPress development easier, one hook at a time! ๐Ÿš€ "# DevXpert"

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors