WPGear Debugger

Debug System.

Tool for detailed viewing the processes of performing PHP Scripts Plugins and Themes.
Including remotely, without direct access to the administration of the target site.

= Futured =
* It is easy to embed in any PHP scripts.
* Easy control.
* Any number of Processes.
* Detailing for each Variable or Object whose values you need to know.
(Time Stamp, Process name, Function name, Line in the file)
* Selection of Processes for research.
* General stream Process.
* Write the Log in Files for each of the Processes.
* Files tagged Time Stamp.
* Individual Files for each User.
* General statistics of files.
* Remotely remove the Log from the current Date for a specific Data Source. (Use: www.yoursite.com?clear_debug=NameSource)

Current Version: 1.5 (2025.03.14) can be downloaded from this site.

Download “WPGear Debugger” wpgear-debugger_v1.5.zip – Downloaded 33 times – 16 KB

In the official WordPress repository – this plugin is Not Exist!
The Moderators WordPress Plugin Review Team officially refused the publication.
The Explain: “Your plugin has been rejected because we no longer accepting frameworks, boilerplates, and libraries as stand-alone plugins…”
“…I can understand that this is a tool for developers, and that’s great, but that’s not something that this directory is accepting because of the reasons – in our review process, we look for plugins that provide direct functionality to end users rather than serving as a library.”

== Installation ==

Normal automatic installation.

1. Upload.
2. Activate.
3. Enjoy. Go to Settings: WPGear Debugger. Set up the options you need.
4. If you have any problems – please ask for support.

== Frequently Asked Questions ==

What needs to be done to start using it?

1. The name of the Data Source.
Each Plugin or Theme that you want to explore is a Source of Data. Come up with a meaningful Name for him.
For example: plugin “Hello Dolly” (Sample of the plugin “Hello Dolly” with all working examples can be found in the “sample” folder, File: “hello.txt”):

Let’s call the Data Source: “Hello_Dolly”. All Log Processes of this Data Source will contain the “Hello_Dolly” label.

2. Add a function for Debugger.
You need to insert into the main file of the plugin under explore – a small Function with a unique name for each Source.
(And if this is a Theme, then insert into the functions.php file)
For our example, the plugin “Hello Dolly”, add the function: “Hellodolly_debugger”.
We will set the invented Name of the Source:

$Source = ‘Hello_Dolly’;

This is how it looks:

/* Debugger. 
----------------------------------------------------------------- */
function HelloDolly_Debugger ($Content, $Subject = null, $Process = null, $Function = '', $Line = '') {
   if (function_exists( 'WPGear_Debugger' )) {
      $Source = 'Hello_Dolly';
      $TimeStamp = true;

      $Parameters = array(
         'source' => $Source,
         'content' => $Content,
         'subject' => esc_html( $Subject ),
         'process' => esc_html( $Process ),
         'function' => esc_html( $Function ),
         'timestamp' => $TimeStamp,
         'line' => esc_html( $Line ),
     );

     WPGear_Debugger ($Parameters);
   }
}

3. Add the Name of the Process.
In each Function, you can add different meaningful Names of Processes.
For example, for the Function: “Hello_Dolly ()” from the plugin “Hello Dolly”:

$debug_process = ‘get_random_sublyric’;

4. Add control points.
For each Variable, the Value of which we need to track (for example: $chosen), we need to add the call of Debugger Function on the new line.

HelloDolly_Debugger ($chosen, ‘$chosen’, $debug_process, __FUNCTION__, __LINE__);

This is how it looks like an example of the Function “Hello_Dolly ()” for plugin “Hello Dolly”:

function hello_dolly() {
   $debug_process = 'get_random_sublyric';

   $chosen = hello_dolly_get_lyric();
   HelloDolly_Debugger ($chosen, '$chosen', $debug_process, __FUNCTION__, __LINE__);

   $lang = '';
   if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {
      $lang = ' lang="en"';
   }

   printf(
      '<p id="dolly"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',__( 'Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly' ),$lang,$chosen);
}

5. The result
This is what will be written in the file “/wp-content/uploads/wpgear_debugger/hello_dolly/2025.02.27-2_hello_dolly.get_random_sublyric”:

---- 2025.02.27 17:21:48 ---- 
"get_random_sublyric", "hello_dolly", Line:58
$chosen: 'I can tell, Dolly'

== Screenshots ==

    1. screenshot-1.png Admin page “Settings”.

Leave a Reply

Your email address will not be published. Required fields are marked *