Developer Debug Tools
- Settings
- Plugins
- Activity Logs
- Error Logs
- Error Types
- Error Suppressing
- WP-CONFIG
- HTACCESS
- Functions.php
- PHP.INI
- PHP Info
- Server
- Cron Jobs
- Cookies
- Transients
- Site Options
- Globals
- Defines
- DB Tables
- User Meta
- Post Meta
- Post Types
- Taxonomies
- Media Library
- Auto-Drafts
- Domain
- APIs
- Shortcode Finder
- Regex
- Testing
- Available Functions
- Available Hooks
- Resources
Settings
- Developer Account Email Addresses: Enter the email address of the developer account(s), separated by commas.
- Developer Timezone: Changes the timezone on Debug Log viewer and other areas in the plugin. Default is what the site uses.
- Menu Type: Allows you to change the type of menu - Tabs, Dropdown or Side Menu Only.
Testing Options
- View Sensitive Info: Displays redacted database login info, authentication keys and salts, IP addresses, etc. It is recommended to keep this disabled when sharing your screen with anyone, including support.
- Debugging Test Number: There is a function that you can use to display a test number on each page load:
ddtt_increase_test_number()
, which increases by one each time. This is helpful when developing or testing a script to ensure that the page has refreshed. - Centering Tool Column Width & Row Height: By default, a centering tool has been added to the admin bar on the front end of your site to assist you with lining up content on the page. When you click on the
✛ Off
link, it will refresh the page with a grid at the top underneath the admin bar. If you click this grid, it will expand down the page. Click it again to retract it. You can change the width and height of the cells in the grid. - Stop Heartbeat: The heartbeat API is a feature that allows real-time communication between the browser and the server. It is primarily used for features like auto-saving posts, tracking user activity (e.g., when a user is typing a post), session expiration notifications, and updating information in the background (such as monitoring the number of active users or saving draft changes). Stopping the heartbeat can often help to resolve 503 INTERNAL ERRORS and increase performance.
- Extend cURL Timeout: Extending the cURL timeout can be helpful in various situations where requests may take longer than usual. For example, if you're interacting with a slow or overloaded server, increasing the timeout allows the request to complete without being prematurely canceled. This is also beneficial when transferring large files or data, as such operations typically require more time to process. Additionally, high-latency networks or distant servers might need more time for communication, and extending the timeout can prevent failures in these cases. In instances where you're making complex API calls or dealing with external services that experience occasional slowdowns, a longer timeout can help ensure that the process completes successfully. By increasing the timeout, you can also support background processes or long-running tasks that require extended time for completion, such as data exports or system backups. However, it's important to balance the timeout extension to avoid unnecessary delays in case of system issues or unresponsive services.
- Add User IDs with Quick Debug Links to User Admin List Page: Adds a column to the Users list table with their IDs and a quick link to debug their user meta.
- Add Post/Page IDs with Quick Debug Links to Admin List Pages: Adds a column to the Posts and Pages list tables with their IDs and a quick link to debug their post meta.
- Add Debug Columns (Comment ID, Comment Type, and Karma) and Quick Debug Links to Comment Admin List Page: Just what it says. It adds ability to further debug comments.
- Add Quick Debug Links to Gravity Forms & Entries (if Gravity Forms is installed): Similar to the users and posts, quick links can be added to Gravity Forms for debugging forms and entries.
- Disable Extra Data on Plugins Page: This disables the Main File Path, File Size, and Last Modified Date that are added by this plugin to the main plugins page. You can still get the same information on the Plugins tab by navigating to Developer Debug Tools > Plugins. Some people just like to have it readily available when they are making updates rather than waiting for the in-depth info to load on the plugins tab, which is why it is enabled by default.
Logging Options
- Disable Error Counts: Disabling this will prevent counting log errors and improve page load time. Good to use when you have a lot of errors in your logs. Keeping it enabled during initial development is very helpful, but after a while it's worth turning off.
- Log Viewer: The default debug log reader shown on the Logs tab. The Easy Reader option breaks down the errors for you, counting and consolidating them so you can look at the different errors rather than being flooded with repeated errors. It also provides color filters and links to search errors externally. The Classic viewer shows you the last 100 lines just as you would see if you downloaded the log.
- Maximum Debug Log Size for Viewer: The maximum file size in MB allotted for viewing the debug log before giving a warning. This is set to prevent the page from crashing if it is too big and not allowing you to clear it.
- Also Log User and URL With Errors: Adds an additional line to debug.log errors with the user ID, user display name, and url with query strings when a user error is triggered. This should remain disabled unless you are specifically trying to debug a user error and need to know these details.
- Capture WP_Mail Failure Details in Debug.log: Does what it says, but only when debugging is enabled.
- View/clear path to debug.log: You can change the path to your debug log if it is not your standard debug.log file found in your /wp-content/ folder.
- View/clear path to error_log: You can also change the path to your error_log if it's not in the root folder.
- View/clear path to admin error_log: You can also change the path to your admin error_log if it's not in the /wp-admin/ folder.
- Log Files to Check: You can add additional .TXT files to the Logs tab.
- Discord Webhook URL: Send notifications to a Discord Webhook when a fatal error occurs. Webhook URL should look like this: https://discord.com/api/webhooks/xxx/xxx
- Send Fatal Errors to Discord Channel: This is what enables the sending of notifications so you don't have to remove the webhook URL to disable it each time.
- Log Activity: Select the type of activity you want to log to the activity log. Log can be viewed on the Activity tab.
- Activity Log: Omit User Meta Keys: Enter user meta keys (comma-separated) to exclude from the activity log. Use asterisks (*) as wildcards for prefixes or suffixes. For example, "wp_*" excludes all keys starting with "wp_". Suggested:
session_tokens
,user_activation_key
,wpfv_user_level
,_transient_*
,wp_persisted_preferences
- Activity Log: Omit Post Meta Keys: Enter post meta keys (comma-separated) to exclude from the activity log. Use asterisks (*) as wildcards for prefixes or suffixes. For example, "wp_*" excludes all keys starting with "wp_".
Suggested:ID
,post_modified
,post_modified_gmt
,filter
,_edit_lock
,_edit_last
,_wp_desired_post_slug
,_encloseme
,_wp_trash*
,_transient_*
,_yoast*
,wp_page_template
- Activity Log: Omit Setting/Option Keys: Enter options (comma-separated) to exclude from the activity log. Use asterisks (*) as wildcards for prefixes or suffixes. For example, "wp_*" excludes all options starting with "wp_".
Suggested:cron
,rewrite_rules
,recently_edited
,_site_transient_*
,_transient_*
Show Online Users
- Show Online Users: Adds an indicator to the admin bar that lists all currently online (logged-in) users. This does not show logged-out users. It also adds an admin list column to your Users list table that shows if the user is currently online or the last time they were. This feature uses transients to store the currently logged in users, so clearing transients will force refresh the data.
- # of Seconds: Checks if users were logged in this amount of time ago. Recommended 900 seconds (15 minutes).
Note that logged-in time is stored on page load, so if a user is on a page for longer than the amount of time you specify here, it may show them as offline when they are not. - Show Last Time in Admin Bar: Show the last online time in the admin bar. Note that the logged-in status only updates if they are not already stored.
- User Link URL: Link online users in the admin bar. Merge tags are available to use in the URL:
{user_id}
,{user_email}
ie.https://yourdomain.com/wp-admin/user-edit.php?user_id={user_id}
. Leave the URL blank for no link. - Roles to Prioritize on Top: This will move users with these roles to the top of the list so you can keep an eye on them rather than looking through the alphabetical list.
- Discord Webhook URL: Send notifications to a Discord Webhook when users do different things. Useful if you need to stop debugging when there is activity. Webhook URL should look like this: https://discord.com/api/webhooks/xxx/xxx...
- Login Notifications: Notifies you on Discord if a user with a priority role (selected above) has logged in.
- Intermittent Notifications: Notifies you on Discord if a user with a priority role is still logged in. Updates every 15 minutes; you may reset timer by clearing transients on the Site Options tab. Warning — this can get annoying, but is useful if only one person is logged in and you want to wait until they are done on the site to continue debugging.
- Page Load Notifications: Notifies you every time a user with a priority role loads a page (warning: this may cause rate limits on Discord if too many pages are loaded at once).
- Ignore Developer Notifications: Ignore developers for intermittent notifications and page load notifications.
Admin Bar
- Remove WordPress Logo: Removes the WordPress logo on the top left of the admin bar. Who needs that, really?
- Remove Resources: A resources icon is added by the plugin to assist with development and debugging, but if you don't need or want it you can remove it here.
- Remove Centering Tool: The centering tool is described above and is shown on the admin bar on the front-end of the site only. If it's not useful to you, it's better to just remove it.
- Remove Gravity Form Finder (if Gravity Forms is installed): The plugin adds a form finder that displays links to forms on the pages on the front-end. Helpful to jump to the form if there are issues. Some websites have reported this as not working as expected.
- Remove Shortcode Finder: The plugin adds a shortcode finder on the front-end as well so you can quickly see which shortcodes are used for reference so you can look up code for those shortcodes without going in and editing the page to find it.
- Remove Post Information: The plugin adds post information (post type, ID, and status) to the front-end of the site when you are on posts and pages. It is probably one of the most-used tools when debugging issues on specific areas of the site.
- Disable "My Account" Enhancements: The plugin adds your user ID, as well as the date and time the page was last loaded when you hover over your name in the admin bar. That is useful for verifying that a page has refreshed or when duplicating tabs and comparing apples to apples.
- Add All Admin Menu Links to Front End: Adds all admin menu links from the back-end to the front-end under the site name. You will have to resave the settings when new menu items are added in order to get the list updated on the front end. It is set up this way so that it doesn't have to check the back-end on every page load on the front-end, which would slow the site way down.
- Condense Admin Bar Items: This removes the words from core and commonly used admin bar menu items to help condense it down when you have a lot of things on there.
Colors
You can change the colors of the code on the WP-CONFIG and HTACCESS tabs, etc.
Security
- Hide Plugin: Hides the plugin from the left admin menu and disguises it on the plugins page as "Developer Notifications." Requires you to access this area directly (I highly recommend bookmarking the Settings page first).
- Require Passwords: Require a password to be entered to access tabs and other pages.
- Password: For requiring passwords (see above).
- Keep Logged In For: Enter the number of minutes until you have to re-enter your password.
- Admin Pages to Secure with Password: All DDT pages are added to the list automatically. If you have additional admin pages you would like users to require a password for, such as the Users page, enter the URL paths here.
Plugins
The plugins tab was designed to provide more in-depth information about each plugin.
- Extra information includes:
- Description
- Last updated by author (without having to click "View details")
- WordPress compatibility (without having to click "View details")
- Folder size
- Path to main file (which is very helpful when scripting if a plugin is active, etc.)
- Last modified on server
- Which sites it is active on (if on a multisite network)
- Shows red if something is not compatible with the latest version of WordPress or if it was last updated over a year ago.
- It requires API calls for each plugin to fetch the information, so it is cached temporarily (in a transient) to improve page refresh times.
- Click the "View Simple List" button to list just the plugin names and versions. This is here for you to easily copy and paste the list.
- Click the "Recommended Plugins" button to jump to the Add New Plugin page with a list of other plugins that are useful for development and debugging. If you know of any more that you feel should be added to the list. Feel free to drop it in the Support Forum. You can also update this list using a hook (see Available Hooks tab >
ddtt_recommended_plugins()
).
Activity Logs
You can log activity and view it here. Just enable which types of activity you want to log from your Settings tab.
- User-related
- Users Logging In: When a user logs in — includes their name, email and user ID
- Updating User Meta: Any time a users' meta is changed, you can see which keys and values were changed; this can quickly become overwhelming if you don't monitor it and omit keys in the Settings tab
- Creating Accounts: See if new user accounts were created on the back-end by an admin or other user with the "create_account" capability; this does not include accounts created on the front-end
- Deleting Accounts: When user accounts are deleted
- Updating User Roles: When a user's roles change
- Post-related
- Creating Posts & Pages: When posts and pages are created, or any other post type
- Updating Posts & Pages: See what meta data is updated along with their old and new values; this can quickly become overwhelming if you don't monitor it and omit keys in the Settings tab
- Deleting Posts & Pages: When posts and pages are deleted
- Changing Post Statuses: Any time a post status changes
- Visiting Posts & Pages: When any user visits a page on the front-end; this can be kind of annoying if you have high traffic, so you may want to use this temporarily — includes the post ID, type, title, and a link
- Plugin-related
- Activating Plugins: When a plugin is activated; recommended
- Updating Plugins: When a plugin is updated; recommended
- Deactivating Plugins: When a plugin is deactivated; recommended
- Deleting Plugins: When a plugin is deleted; recommended
- Theme-related
- Switching Themes: When theme is switched; recommended
- Updating Themes: When the theme is updated; recommended
- Settings-related
- Updating Site Settings: See what site options are updated along with their old and new values; this can quickly become overwhelming if you don't monitor it and omit options in the Settings tab
- Security-related
- Failed Login Attempts: See when there was a failed login attempt
- Resetting Passwords: See when a user initiates a password reset request; when passwords are changed, they will be logged when the user meta is updated if you have that enabled
Here is a breakdown of how to use the page:
- You can download the log with one click.
- You can clear the log with one click.
- Search and filter the log if you're looking for activity for a specific user, etc.
- You can easily switch between the Easy Reader and Classic View.
- Easy Reader:
- Extracts the information from the log file to show:
- The date and time in your timezone (rather than UTC).
- The activity type.
- The user performing the activity — includes their name, email and user ID.
- Notes about the activity including changes made.
- Colors are provided for the different categories of activities: user-related, post-related, plugin-related, theme-related, settings-related, and security-related. These can also be changed using a hook (see the Available Hooks tab >
ddtt_highlight_activity_log()
). - Filter the list by most recent.
- Extracts the information from the log file to show:
- Easy Reader:
Tip: Logs can quickly add up, especially if you are logging user updates, post updates, or setting changes. It is recommended to copy the keys you don't want to see from the activity log and omit them from the Settings tab. Doing so will no longer log them, but will keep the existing ones in the log. If you want to filter out keys from the existing log without clearing the whole thing, you can use the search bar at the top and add a minus (-) symbol before the key (ie. -key).
Error Logs
This tab shows you your core log file content. Out of the box, it includes the debug.log
, error_log
, and admin error_log
.
- You can download the logs with one click.
- You can clear the logs with one click.
- The debug log is the only one with the Easy Reader viewer option. The rest of the logs are using the Classic viewer, which simply shows the content as if you were to download the file and look at it.
- Debug Log Easy Reader:
- Counts and consolidates the errors so that you are no flooded by the same errors over and over again.
- Extracts the information from the log file to show:
- The date and time in your timezone (rather than UTC).
- The error type (if known).
- The actual error highlighted and separated from the rest of the information.
- The plugin or theme it's coming from.
- The file path and line in an organized way.
- Includes help links to quickly search Google and WordPress Stack Exchange.
- Colors the errors based on whether they are Fatal Errors, Parse Errors, from Plugins, from Themes, or from the DDT plugin. These can also be changed using a hook (see the Available Hooks tab >
ddtt_highlight_debug_log()
). - Filter the list by most recent.
- Search the log by keyword, or filter it by excluding keywords. These can also be changed using a hook (see the Available Hooks tab >
ddtt_debug_log_help_col()
).
- For the debug log, you can easily switch between the Easy Reader and Classic View.
- Debug Log Easy Reader:
- You can also add your own .TXT log files to this page from Settings.
Error Types
Choose which types of errors are reported to your debug.log
file. Your debug log must be enabled for any of the reporting to work. Note — not all web hosts allow these settings to be changed.
- First select "Enable Custom Debug Levels".
- In the "Debug Error Reporting Level" table, you will see a list of all the error types. The "Actual" column shows what is actually being reported. The "Enabled" column allows you to select and deselect which ones you want reported. After saving the changes, you can compare the Enabled column against the Actual column to see what is taking effect. If it stays "TRUE" even though it is deselected, that means your host is not allowing you to change it.
Error Suppressing
Suppress individual errors from being reported to your debug.log
file. Your debug log must be enabled for any of the reporting to work. Note — not all web hosts allow these settings to be changed.
- First select "Enable Error Suppressing".
- Where it says "Add Errors to Suppress from Debug Log," enter the exact string that the errors contain.
- Under "Currently Suppressed Errors," you will see a list of all keywords that you have suppressed. The list contains the date, the string, who added it, and the status.
- You can simply change the status with the dropdown rather than removing it and re-adding it.
- You can add a note underneath the error string to remind yourself what the error is.
WP-CONFIG
This tab allows you to view your current wp-config.php
file, and update it with pre-defined snippets.
The wp-config.php
file in WordPress is a crucial configuration file that contains important settings for your WordPress site. It defines the database connection details (like database name, username, password, and host), security keys, and various configuration options that affect the behavior of WordPress. Additionally, it allows you to set options like the WordPress debug mode, file permissions, and custom settings for advanced users. This file is essential for WordPress to function properly and is usually located in the root directory of your WordPress installation.
- Content Viewer: Shows the contents of the file.
- Redacts sensitive information if you have not enabled "View Sensitive Info" from Settings.
- Colors can be changed in Settings.
- Backups: All files in your root directory that contain "wp-config" in the filename are shown here for reference.
- Snippets (Beta Testing): Allows you to modify code snippets on your file.
- ALWAYS DOWNLOAD YOUR CURRENT FILE AS A BACKUP BEFORE ADDING SNIPPETS!
- Select actions (add, remove, update) using checkboxes.
- "Proposed" code is used for adding/updating, not "Current" code. If a snippet is detected and you want to keep the "Current" code, no action is necessary.
- Edited snippets will be moved to DDT section if detected elsewhere.
- Detected indicator shows with a blue border if the snippet is found, but does not match the proposed code.
- Plugin checks for errors when saving edited snippets (not foolproof, double-check).
- Saving an edited snippet doesn't modify the file yet. Preview changes before confirming or cancelling.
- You can modify or add some snippets that aren't listed here by hooking into the snippets array (see Available Hooks tab >
ddtt_wpconfig_snippets()
). - End-Of-Line Delimiter to Use: You can change which end-of-line delimiter to use. The file is currently using
\n
, and yourPHP_EOL
constant is set to\n
. If you don't know what this means, leave it alone.
HTACCESS
This tab allows you to view your current .htaccess
file, and update it with pre-defined snippets.
The .htaccess
file is a configuration file used by Apache web servers to control various server settings and behavior for a website. In WordPress, it is commonly used to manage URL rewriting for clean, SEO-friendly permalinks, as well as to set security rules, redirect URLs, and enable caching. It can also be used to control access, block certain IP addresses, or configure custom error pages. The .htaccess
file is located in the root directory of your WordPress installation and is vital for optimizing and securing your site.
- Content Viewer: Shows the contents of the file.
- Redacts sensitive information if you have not enabled "View Sensitive Info" from Settings.
- Colors can be changed in Settings.
- Backups: All files in your root directory that contain "wp-config" in the filename are shown here for reference.
- Snippets (Beta Testing): Allows you to modify code snippets on your file.
- ALWAYS DOWNLOAD YOUR CURRENT FILE AS A BACKUP BEFORE ADDING SNIPPETS!
- Select actions (add, remove) using checkboxes.
- If a snippet is detected and you want to keep the "Current" code, no action is necessary.
- Unlike the WPCONFIG tab, you cannot edit snippets here. This is due to the inability to detect changes since we don't store the data in a database (for security reasons) and cannot define the snippets with a unique variable or function.
- You can modify or add some snippets that aren't listed here by hooking into the snippets array (see Available Hooks tab >
ddtt_htaccess_snippets()
). - End-Of-Line Delimiter to Use: You can change which end-of-line delimiter to use. The file is currently using
\n
, and yourPHP_EOL
constant is set to\n
. If you don't know what this means, leave it alone.
Functions.php
A simple functions.php
viewer. You can view the file directly on the page, but if it's too large you may want to download it instead.
This file is a template file located in your theme's root folder, used by themes to define custom functionality and modify the default behavior of WordPress. It acts like a plugin, allowing users to add custom code, hooks, filters, and actions without altering core WordPress files. You can customize features such as adding theme support for features like post thumbnails, creating custom shortcodes, registering menus, and modifying the default settings. Essentially, it provides a way to enhance and tailor a WordPress site's functionality to meet specific needs without needing to write a full plugin.
PHP.INI
This tab shows you all registered configuration options from your php.ini
file. The configuration file is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation.
PHP Info
In-depth information about your PHP's configuration (using phpinfo()
).
- Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.
- Commonly used to check configuration settings and for available predefined variables on a given system.
- Contains all EGPCS (Environment, GET, POST, Cookie, Server) data.
Server
This page shows you some server metrics, including CPU and memory information. Accessing detailed server metrics can be crucial for developers when diagnosing performance issues, optimizing applications, and planning for scalability. For example, understanding CPU utilization patterns can help identify bottlenecks in processing, while monitoring memory usage can assist in avoiding application crashes caused by insufficient resources. By exposing these metrics, developers gain valuable insight into the server environment, allowing them to fine-tune their code and infrastructure for better efficiency and reliability.
The CPU Information shows the data from each logical processor in the value column. If you have 16 processors, you will see each processor numbered in order in the first row labeled processor
. If a value is the same across multiple processors, it will show each unique value followed by the number of processors it's found on. For example, the vendor_id
might show AuthenticAMD (x16)
, which means AuthenticAMD
is found on all 16 processors.
Cron Jobs
A list of all scheduled cron jobs.
Cron jobs are scheduled tasks that run automatically at specified intervals on a server. In a WordPress context, cron jobs are used to perform routine actions like checking for updates, publishing scheduled posts, sending email notifications, and cleaning up data. These tasks are set up using a time-based job scheduler called cron. WordPress uses a simulated cron system, known as WP-Cron, which triggers tasks when a user visits the site. However, for high-traffic or critical tasks, it's often recommended to set up real cron jobs on the server for more reliable performance.
Cookies
This tab shows your browser cookies currently on the site.
Cookies are small pieces of text sent to your browser by a website you visit. They help that website remember information about your visit, which can both make it easier to visit the site again and make the site more useful to you. You can also see your cookies in your developer console under Application > Store > Cookies > https://yourdomain.com.
- You can add a test cookie.
- You can clear all cookies or a single cookie from the table.
- You can also clear all browser local storage.
Transients
Your transients currently on the site.
Transients in WordPress are a way to cache data temporarily with an expiration time. They help improve performance by storing frequently accessed or expensive-to-generate data in the database, which reduces the need for repeated processing or queries.
- You can delete all transients from this page if you are having issues with caching.
- When a transient expires, WordPress doesn't immediately remove it from the database, but it will be cleaned up during the next request. In practice, expired transients are purged on the next page load or when WordPress performs its scheduled tasks (via WP-Cron). There is no exact time frame, but the cleanup typically happens fairly soon after the transient expires, as WordPress checks for expired data during routine operations. You can also purge just the expired transients from this page if you don't want to wait.
- The transient values are often stored in JSON format, so this page also makes it easier to read the data.
Site Options
A quick view of all the site's options for reference.
Site options are settings or configuration values stored in the database that can be accessed globally across the site. They typically include things like site name, URL, plugin settings, and theme preferences. These options are used to store persistent data that needs to be accessed throughout the WordPress site, and they don't expire unless manually deleted or updated.
- All Site Options: A link to the options page that is editable, but please be careful editing!
- Search Option by Keyword: Search for an option by name that may or may not be in the table.
- Table: Shows the option name, group, and value. Values in JSON format are made readable.
Globals
A list of available global variables in PHP that can be called with global $variable;
- Shows the variable name, type, and a button to inspect the value.
Defines
A full list of all the defined constants and their values. Constants are defined using define( "CONSTANT", "VALUE" )
.
DB Tables
A quick reference of the database table and column structure. No having to go into your database to view something and risk making any accidental changes. This tab is for viewing only; no editing allowed.
- Shows a quick glance of the database name, database version, and table prefix.
- You can select a table name from the dropdown and view the table records.
- Includes a list of all database tables and their column names in the correct order so you can quickly reference them in SQL calls, etc.
- Click on the table name to view the table records.
- When viewing records, you can search through them by keyword as well.
User Meta
A quick view of all the user's meta, roles, and capabilities.
- User: Shows the currently viewed user's display name with a link to edit their profile using the WP profile editor, user ID, and user email.
- User ID or Email: Enter a user's ID or email to search.
- Avatar: A thumbnail of the user's avatar if one exists.
- API Rest URL: The API Rest URL to the individual user, along with the status showing whether or not it is publicly available from the built-in API.
- Hide Meta Keys with Prefixes: If you are looking through meta data and refreshing the page regularly to test if it has been updated, it can be annoying seeing some values that are long and in the way. This field allows you to specify which meta keys to hide, and you can include prefixes instead of the whole meta key. For example, to hide all meta keys that start with
_transient_
, you would include just that. - Current Roles: Shows the current roles that the user has.
- Choose a Role: You can select a role to add or remove.
- Update Meta Key:
- What do you want to do?
- Add: You can easily add a new meta key/value pair.
- Meta Key: Enter the meta key exactly as you want it (case sensitive).
- Format: String, Array, or Object.
- Value: Enter the value. Arrays and objects are provided a template to work off of.
- Update: Allows you to update a meta value (Note — some object values cannot be edited if your host is blocking it; therefore, you will have to edit them from your database).
- Type (only when selecting Update):
- WP_USER OBJECT: The core meta data that WordPress uses for users.
- USER CUSTOM METADATA: Any custom user meta that is added by plugins and/or themes.
- Format: String, Array, or Object.
- Value: In most cases, the current value is auto-populated, making it easier to edit long values. Enter the value you want to update it to. (IMPORTANT: Please be careful updating array and object values. Test adding and updating one first before updating something critical. It's also a good idea to copy the serialized data just in case. You can enter a serialized array or object as a string. THIS DOES NOT WORK WELL WITH COMBINED ARRAY OF OBJECTS OR ARRAYS IN OBJECTS, SO DON'T TRY IT!)
- Type (only when selecting Update):
- Delete: You can delete meta keys from here.
- Meta Key: Choose the meta key that you want to delete. You can only delete custom meta keys as WordPress does not allow you to modify the user object keys.
- Delete Custom Meta Keys Starting with Keyword: Exactly what it says; if you have a bunch of meta keys that start with a prefix, you can enter the prefix by itself and it will delete all of them. Please use with caution.
- All Custom Meta Keys Starting With: Enter the prefix for the keys you want to delete.
- Choose One:
- Delete Blank Only: Delete all keys that do not have a value.
- Delete All: Delete all keys.
- Add: You can easily add a new meta key/value pair.
- What do you want to do?
- Separate lists showing object meta vs custom meta.
- JSON data is made readable.
- View all user capabilities.
Post Meta
A quick view of all the post's meta and taxonomies. Works for all post types including pages and custom post types.
- Most Recent Post (displays only if you have not searched for one): Shows the post title with a link to the page on the front-end of the site.
- Post Title (displays only if you have searched for one): Shows the currently searched for post title with a link to the page on the front-end of the site.
- Post ID: Enter a Post ID to search.
- Featured Image: A thumbnail of the featured image if one exists.
- API Rest URL: The API Rest URL to the individual post, along with the status showing whether or not it is publicly available from the built-in API.
- Hide Meta Keys with Prefixes: If you are looking through meta data and refreshing the page regularly to test if it has been updated, it can be annoying seeing some values that are long and in the way. This field allows you to specify which meta keys to hide, and you can include prefixes instead of the whole meta key. For example, to hide all meta keys that start with
_transient_
, you would include just that. - Update Meta Key:
- What do you want to do?
- Add: You can easily add a new meta key/value pair.
- Meta Key: Enter the meta key exactly as you want it (case sensitive).
- Format: String, Array, or Object.
- Value: Enter the value. Arrays and objects are provided a template to work off of.
- Update: Allows you to update a meta value.
- Type (only when selecting Update):
- WP_USER OBJECT: The core meta data that WordPress uses for users.
- USER CUSTOM METADATA: Any custom post meta that is added by plugins and/or themes.
- Format: String, Array, or Object.
- Value: In most cases, the current value is auto-populated, making it easier to edit long values. Enter the value you want to update it to. (IMPORTANT: Please be careful updating array and object values. Test adding and updating one first before updating something critical. It's also a good idea to copy the serialized data just in case. You can enter a serialized array or object as a string. THIS DOES NOT WORK WELL WITH COMBINED ARRAY OF OBJECTS OR ARRAYS IN OBJECTS, SO DON'T TRY IT!)
- Type (only when selecting Update):
- Delete: You can delete meta keys from here.
- Meta Key: Choose the meta key that you want to delete. You can only delete custom meta keys as WordPress does not allow you to modify the post object keys.
- Delete Custom Meta Keys Starting with Keyword: Exactly what it says; if you have a bunch of meta keys that start with a prefix, you can enter the prefix by itself and it will delete all of them. Please use with caution.
- All Custom Meta Keys Starting With: Enter the prefix for the keys you want to delete.
- Choose One:
- Delete Blank Only: Delete all keys that do not have a value.
- Delete All: Delete all keys.
- Add: You can easily add a new meta key/value pair.
- What do you want to do?
- Separate lists showing object meta vs custom meta.
- JSON data is made readable.
- View all taxonomies.
- Click the taxonomy name to view all tax terms.
- Click the tax term ID to edit the tax term.
- View all comments.
Post Types
Check out all of your registered taxonomies, along with their settings, labels and associated post types from one place. For more information about taxonomies, visit WordPress's Theme Handbook: https://developer.wordpress.org/themes/basics/post-types/
Taxonomies
Check out all of your registered post types, along with their settings, labels and associated taxonomies from one place. For more information about post types, visit WordPress's Theme Handbook: https://developer.wordpress.org/themes/basics/categories-tags-custom-taxonomies/
Media Library
Information about the media in your library.
- Includes totals of each media type
- Shows which posts and pages the media is used in. It will not show where images are used in CSS backgrounds or in the header, footer or sidebars. It only searches featured images and content.
- Table includes the following columns:
- Media ID
- Thumbnail
- Title
- Type
URL - Added date
- Alt Text
- File Size
- Dimensions
- Caption
- Description
- Used in Posts
Auto-Drafts
View current auto-drafts.
Auto-drafts are temporary drafts that are typically created when you start a new post. They can be left behind if you leave the page without saving it. They can be hidden in the database and not show up in your admin list table with the rest of your drafts. Since these are unnecessary, this page allows you to clear them easily.
- You can clear them all, those that are older than 7 days, or individual ones from the table.
- The table shows all of the auto-drafted posts with the ID, title, post type, created date and author.
- You can click on the ID to view it in the Post Meta tab.
Domain
Your domain's public DNS records, including nameservers. Your host will include all private and hidden records as well as record names, whereas we don't have access to them publicly. It's just helpful to get some basic information.
- Click on the "Propagation" link to see where your domain is being propagated after making changes to your DNS records.
- Click the "Whois" button to see expiration date, contacts and raw whois data.
- Click the "MX Toolbox" button to get a bunch of other useful information about your DNS records.
- You can also check other domains.
- Includes hostname, SSL Certificate Status, and SSL Certificate Expiration Date.
APIs
A list of the site's registered REST APIs.
A REST API (Representational State Transfer Application Programming Interface) is a set of rules that allow different software applications to communicate with each other over the web. It uses standard HTTP methods like GET, POST, PUT, and DELETE to perform operations on resources (such as data or services). REST APIs are designed to be lightweight, stateless, and easily scalable, making them popular for connecting web services, apps, and external systems. In WordPress, the REST API enables external applications to interact with your site, retrieve data, and perform actions like creating posts or managing users.
- Click the "Check All API Statuses" to check the status of each API. It will check asynchronously via Ajax and provide the Status Code and Message.
- You can also check the status of a single API rather than checking all of them.
- You can click on the root API endpoints to view them directly.
Shortcode Finder
Search through posts and pages for a shortcode. Example of how the shortcode is structured: [shortcode attribute="value"]
- Shortcode: Choose from the dropdown of shortcodes found on your site.
- Attribute & Attribute Value (optional): If you want to narrow it down and check for a shortcode with a specific parameter, include the attribute and it's corresponding value.
- Available Shortcodes (displays only when not searching): A list of all your available shortcodes with a count.
- Click the shortcode to search posts and pages that include that shortcode
- The source column shows where the code is located for the shortcode so you can look into how it is set up.
- If your plugin/theme editors are enabled, then the path will link to them. Just remember what line you are looking for so you can scroll to it; unfortunately the editors don't allow us to jump to the specific lines.
- Results (displays only when searching): Displays a table with the results. Includes page ID, title, post type, post status, and the number of times it is found on that page.
- Click on the title to jump to the page on the front-end of the site.
Regex
A small playground for learning and testing regex patterns. Although, I'll admit I end up using Regex101 more as it's much more robust.
- Test Results: Shows the results of the regex you enter.
- String: Enter the content you want to search through.
- Pattern: Enter your regex pattern including the wrapping forward slashes.
- Includes a couple samples.
- Includes a cheat sheet of regex patterns and descriptions.
Testing
You can use this tab as a testing ground for PHP. In basic terms, there is a file that you can edit with your test code and run the code when you load the page. It's an easy way to test functions, similar to editing your functions.php
file.
Method 1
- Use FTP or your host's File Manager to access the plugin root folder:
/wp-content/plugins/dev-debug-tools/
- Open the
"TESTING_PLAYGROUND.php"
file. - Edit the file by adding your test code AFTER where it says:
////////////// TEST YOUR PHP BELOW ////////////// - Save the file and refresh the page. Any non-commented out code below that line will trigger the instructions to be hidden and run your code instead.
Method 2 (Recommended)
Do the same thing as Method 1, but download the file provided and upload it to your current theme's root folder (/wp-content/themes/your-theme/
) instead. The benefit of doing it this way is that it won't reset when the plugin is updated.
Available Functions
A list of PHP functions that are available to use for making debugging easier. Note that if you continue to use these functions after deactivating or uninstalling this plugin, it will result in a fatal error.
:ddtt_is_dev( $email = false, $array = false )
- Checks if the current user is a developer (emails included in Settings).
- $email: If set to
true
, returns the developer emails. - $array: Only works if
$email
istrue
, returns the emails as anArray
orString
. Default isString
. - Usage:
<?php if ( ddtt_is_dev() ) { ... }
:ddtt_print_r( $var, $user_id = null, $left_margin = null, $write_bool = true )
- Wraps
print_r()
in<pre>
tags</pre>
. - Displays only to devs (or specified user).
- Displays
TRUE
orFALSE
instead of1
and nothing likeprint_r()
does. - $user_id: Display only to that user. Default is developers only.
- $left_margin: Will add # of pixels you specify to the left margin or
200
pixels if value is set totrue
. Useful if debugging in admin to avoid left admin menu which is 200px wide. - Alternatively use
dpr()
as a shorter version ofddtt_print_r()
as long as another theme or plugin hasn't used the same function for something else. - Usage:
- Debug an array in readable format:
dpr( $array );
- Debug an object while logged in as user with ID 3:
dpr( $object, 3 );
- Debug the global menu object while in the back end on
admin_init
:dpr( $menu, null, true );
- Debug an array in readable format:
- Wraps
ddtt_var_dump_to_string( $var )
:- Convert
var_dump()
to a string. - Usage:
ddtt_var_dump_to_string( $var );
- Convert
ddtt_alert( $msg, $user_id = null )
:- Add JavaScript alert in PHP.
- $msg: The message you want to display in the pop-up alert.
- $user_id: Only shows the alert to this user. Default is developers.
- Usage:
ddtt_alert( "Test 1" );
ddtt_console( $msg )
:- Add JavaScript
console.log
in PHP. - $msg: The message you want to display in the console.
- Usage:
ddtt_console( "Test 1" );
- Add JavaScript
ddtt_write_log( $log, $prefix = true, $backtrace = false, $full_stacktrace = false )
:- Our own version of
error_log()
that writes to thedebug.log
file. - $log: What you want to log, accepts strings, arrays, and objects.
- $prefix: By default, it adds "DDTT_LOG: " to beginning of the line so you can identify which error you are logging. You can use your own String as a prefix or
false
to remove. - $backtrace: Include file and line number the function is called on.
- $full_stacktrace: Include the full stack trace of where the function is called.
- Usage:
ddtt_write_log( "Test 1" );
- Our own version of
ddtt_backtrace( $ignore_class = null, $skip_frames = 0, $pretty = true )
:- Log a comma-separated String or Array of functions that have been called to get to the current point in code. Logs to
debug.log
. - $ignore_class: A class to ignore all function calls within – useful when you want to just give info about the callee.
- $skip_frames: A number of stack frames to skip – useful for unwinding back to the source of the issue.
- $pretty: Whether you want a comma separated string instead of the raw array returned.
- Usage:
ddtt_backtrace();
- Log a comma-separated String or Array of functions that have been called to get to the current point in code. Logs to
ddtt_debug_form_post( $email, $test_number = 1, $subject = "Test Form $_POST " )
:- Debug
$_POST
via email. - $email: The email you want to send debug email to.
- $test_number: Just adds a test number to the subject so you know which test you are attempting.
- $subject: Change the subject if you want.
- Usage:
ddtt_debug_form_post( "you@yourdomain.com", 1 );
- Debug
ddtt_admin_error( $msg, $include_pre = true, $br = true, $hide_error = false )
:- Displays an error notice on the front-end that only admins can see.
- $include_pre: Adds "ADMIN ERROR: " to the beginning of the message.
- $br: Adds a
<br>
tag before the message. - $hide_error: Will force the error to be hidden during testing.
- Usage:
echo ddtt_admin_error( "Please do this to fix the error..." );
ddtt_start_timer( $timeout_seconds = 300 )
andddtt_stop_timer( $start, $timeout = true, $milliseconds = false )
:- Add a timer to your processes to check processing speed. Returns number of seconds or milliseconds.
- Usage:
$start = ddtt_start_timer();
// run your functions
$total_time = ddtt_stop_timer( $start );
- Useful to count seconds per item you are processing, such as:
$sec_per_link = round( ( $total_time / $count_links ), 2 );
ddtt_increase_test_number( $reset = false )
:- Use it to increase the global test number (from Settings). It just shows you a new count by adding 1 for every page refresh to indicate that you have in fact refreshed the page.
ddtt_is_site( $site_to_check )
:- Check if the current domain contains a string.
- Usage:
- Returns true if the domain name includes the keyword:
if ( ddtt_is_site( "wordpressenhanced" ) ) { ... }
- Returns true if the domain name includes the keyword:
ddtt_get_plugins_data()
:- Fetch and cache plugins data that is used on the Plugins tab. Fetches data for all of your plugins and caches them to a transient named
ddtt_plugins_data
for 1 day. You can schedule this to run at night using WP Crontrol.
- Fetch and cache plugins data that is used on the Plugins tab. Fetches data for all of your plugins and caches them to a transient named
Available Hooks
A list of the action and filter hooks available for developers.
You can also use the page to look up hooks found on other plugins, but please note that we can only look for hooks that are not set up dynamically, so it would be wise to actually look at the plugin's documentation if they have any, or search for hooks (do_action
and apply_filters
) in your favorite IDE. This is just a good starting point to find things you may not know it exist. You might also want to see WP Core Actions and WP Core Filters.
ddtt_wpconfig_snippets
:- TYPE ⇢ Filter
- Add, remove or modify a snippet from the WP-CONFIG tab.
ddtt_htaccess_snippets
:- TYPE ⇢ Filter
- Add, remove or modify a snippet from the HTACCESS tab.
ddtt_highlight_debug_log
:- TYPE ⇢ Filter
- Change highlight colors on the Logs > Debug Log Easy Reader.
ddtt_debug_log_help_col
:- TYPE ⇢ Filter
- Add, remove or modify the Logs > Debug Log Easy Reader search links in the Help column.
ddtt_debug_log_max_filesize
:- TYPE ⇢ Filter
- Change the max file size for the Logs > Debug Log Easy Reader . Default is 2 MB.
ddtt_resource_links
:- TYPE ⇢ Filter
- Add your own links to Resources.
ddtt_recommended_plugins
:- TYPE ⇢ Filter
- Add or remove a recommended plugin.
- Note that you can only add plugins that are in the WordPress.org repository.
ddtt_quick_link_icon
:- TYPE ⇢ Filter
- Change the Quick Debug Link icon when quick links are added to posts and users in admin lists.
ddtt_quick_link_post_types
:- TYPE ⇢ Filter
- Add or remove post types that include quick links when enabled.
ddtt_admin_bar_dropdown_links
:- TYPE ⇢ Filter
- Add a link to the admin bar site name dropdown on the front-end.
ddtt_admin_bar_condensed_items
:- TYPE ⇢ Filter
- Modify the admin bar icons that get condensed when the option is set.
ddtt_omit_shortcodes
:- TYPE ⇢ Filter
- Omit shortcodes from the admin bar shortcode finder.
ddtt_admin_list_update_each_user
:- TYPE ⇢ Action
- Do something for each user when you load the users admin list. Must have Quick Debug Links enabled in Settings. Why? Because sometimes we have to update meta keys for all users (sometimes in the thousands), and running a function using pagination on a smaller amount of users at a time is better for testing, processing, preventing time-outs, etc. It's also easier to do this than to code a pagination script that you're only going to use once.
ddtt_admin_list_update_each_post
:- TYPE ⇢ Action
- Do something for each post or page when you load the post or page admin lists. Must have Quick Debug Links enabled in Settings. Why? Because sometimes we have to update meta keys for all posts (sometimes in the thousands), and running a function using pagination on a smaller amount of posts at a time is better for testing, processing, preventing time-outs, etc. It's also easier to do this than to code a pagination script that you're only going to use once.
ddtt_on_update_user_meta
:- TYPE ⇢ Action
- Do something when you update user meta on the User Meta tab.
ddtt_on_update_post_meta
:- TYPE ⇢ Action
- Do something when you update post meta on the Post Meta tab.
ddtt_ignore_pages_for_discord_notifications
:- TYPE ⇢ Filter
- Add, remove or modify pages that should be ignored when using Discord Notifications found in settings under Show Online Users.
Resources
Helpful resources for WP developers. The same links appear in the admin bar unless removed in Settings. You can also update these links using the ddtt_resource_links
hook.