Skip to content

Commit 2d9be60

Browse files
version 1.2.0 initial commit
0 parents  commit 2d9be60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5461
-0
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# http://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[*.yml]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[*.md]
21+
trim_trailing_whitespace = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Development files
2+
/src/composer/
3+
/src/autoload.php
4+
5+
.idea/

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Kint PHP Debugger
2+
3+
A WordPress plugin available for install and activate through the [WordPress Plugin repository](https://wordpress.org/plugins/kint-php-debugger/).
4+
5+
Uses: Kint version 1.1
6+
7+
Why not the latest Kint version?
8+
9+
* Rendering is inconsistent with the video library on Know the Code - the new version wraps all of the dumps and packages them into one container. The container is rendered fixed at the bottom of the screen.
10+
* Composer required - the new version requires Composer to load all the files, which are extensive. To keep it simple, this plugin does not require Composer to run the plugin.
11+
12+
Tested up to WordPress 5.1.

composer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name" : "hellofromtonya/kint-php-debugger",
3+
"description" : "Kint PHP Debugger for WordPress",
4+
"type" : "project",
5+
"keywords" : ["wordpress", "wp", "kint", "php", "debug"],
6+
"homepage" : "https://github.com/KnowTheCode/kint-php-debugger",
7+
"license" : "GPL-2.0+",
8+
"authors": [
9+
{
10+
"name" : "hellofromTonya",
11+
"email" : "[email protected]"
12+
}
13+
],
14+
"require": {
15+
"php" : ">=5.3",
16+
"kint-php/kint": "^1"
17+
},
18+
"config": {
19+
"vendor-dir": "src"
20+
}
21+
}

composer.lock

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Kint PHP Debugger - a modern and powerful PHP debugging helper
4+
*
5+
* @package Know_The_Code\Kint_PHP_Debugger
6+
* @author hellofromTonya
7+
* @license dual license GPL-2.0+ & MIT (Kint is licensed MIT)
8+
* @link https://knowthecode.io/
9+
*
10+
* @wordpress-plugin
11+
* Plugin Name: Kint PHP Debugger
12+
* Plugin URI: https://github.com/KnowTheCode/kint-php-debugger
13+
* Description: Kint is a a modern and powerful PHP debugging helper, which requires zero-setup and replaces var_dump(), print_r() and debug_backtrace(). This plugin is a wrapper for Kint.
14+
* Version: 1.2.0
15+
* Author: hellofromTonya
16+
* Author URI: https://knowthecode.io/
17+
* Text Domain: wpkint
18+
* Requires WP: 3.5
19+
* Requires PHP: 5.3
20+
*/
21+
namespace Know_The_Code\Kint_PHP_Debugger;
22+
23+
$pathto_kint = trailingslashit( __DIR__ ) . 'src/kint-php/kint/Kint.class.php';
24+
25+
if ( ! class_exists( 'Kint' ) && is_readable( $pathto_kint ) ) {
26+
require_once $pathto_kint;
27+
}

readme.txt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
=== Kint PHP Debugger ===
2+
Contributors: hellofromTonya
3+
Donate link: https://hellofromtonya.com
4+
Tags: debug, debugger, kint, var_dump, print_r, backtrace, trace, debug_backtrace
5+
Requires at least: 3.5
6+
Tested up to: 5.1
7+
Stable tag: 1.2.0
8+
License: GPLv2 or later
9+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10+
11+
Kint is a modern and powerful PHP debugging helper, which requires zero-setup and replaces var_dump(), print_r() and debug_backtrace().
12+
13+
== Description ==
14+
15+
This WordPress plugin is a wrapper for the [Kint](https://kint-php.github.io/kint/) PHP Debugger utility version 1.x. Now instead of using var_dump() or print_r(), you simply use d() with zero, nadda, no formatting required.
16+
17+
Use this tool when you are debugging your website, in place of **[var_dump()](http://php.net/manual/en/function.var-dump.php)**, **[print_r()](http://php.net/manual/en/function.print-r.php)** and **[debug_backtrace()](http://php.net/manual/en/function.debug-backtrace.php)**.
18+
19+
= Handy Tools =
20+
21+
Some handy tools just for the PHP Developer:
22+
23+
* `d( $var );` to render a collapsible UI container which displays your variable data in "the most informative way"
24+
* `ddd( $var );` same as d() except that it also executes `die()` to halt execution.
25+
See the [screenshot 1](http://wordpress.org/extend/plugins/kint-php-debugger/screenshots/) for more details.
26+
27+
Here are some variations of d() to give you the display you want:
28+
29+
* '~d( $var );' outputs in plain text format.
30+
* '+d( $var );' disregards depth level limits and outputs everything
31+
* '!d( $var );' shows expanded rich output
32+
* '-d( $var );' attempts to ob_clean() the previous output (dump something inside of HTML)
33+
34+
= Profiler =
35+
36+
Kint even includes a naïve profiler, which can help you analyze which blocks of code take longer than others:
37+
`Kint::dump( microtime() ); // just pass microtime()
38+
sleep( 1 );
39+
Kint::dump( microtime(), 'after sleep(1)' );
40+
sleep( 2 );
41+
ddd( microtime(), 'final call, after sleep(2)' );`
42+
43+
See [screenshot 2](http://wordpress.org/extend/plugins/kint-php-debugger/screenshots/) for what is rendered out in your browser.
44+
45+
== Installation ==
46+
47+
= From your WordPress dashboard =
48+
49+
1. Visit 'Plugins > Add New'
50+
2. Search for 'Kint PHP Debugger'
51+
3. Activate Kint PHP Debugger from your Plugins page.
52+
53+
= Once Activated =
54+
55+
Whenever you want to dump out the data within a variable, simply use `d( $var )` to replace when you do pre + var_dump().
56+
57+
To dump and die, you use `ddd( $var );`.
58+
59+
== Frequently Asked Questions ==
60+
61+
= How do I use this utility? =
62+
63+
When you are testing your code, you use d( $var ) in place of var_dump( $var ) and print_r( $var ). No need to wrap it in pre's either.
64+
65+
= What does it render in the browser? =
66+
67+
Kint provides a handy UI that wraps up the data within the variable. Click to open it up and see the data.
68+
69+
See the [screenshot 1](http://wordpress.org/extend/plugins/kint-php-debugger/screenshots/) for an example.
70+
71+
= What else does Kint provide to help me debug? =
72+
73+
As you can see the [screenshot 1](http://wordpress.org/extend/plugins/kint-php-debugger/screenshots/), besides the handy UI, it also provides you with a full call stack. Click on the text below the UI to expand it out.
74+
75+
= Can I run this on a live site? =
76+
77+
I wouldn't unless you are testing. This tool is for debug only. Once you push the site live, deactivate and delete this plugin.
78+
79+
= What should I do when the site goes live? =
80+
81+
Deactivate and delete this plugin.
82+
83+
== Screenshots ==
84+
85+
1. An example of what gets rendered in the browser when using 'd( $var )'.
86+
2. Profiler example from Kint.
87+
88+
== ChangeLog ==
89+
90+
= Version 1.2.0 =
91+
92+
* Excluded Composer files.
93+
* Tested with WordPress 5.1.
94+
95+
= Version 1.1.0 to 1.1.4 =
96+
97+
* Changed to the kint-php package
98+
* Upgraded Kint to v1.1
99+
100+
= Version 1.0.1 =
101+
102+
* Upgraded Kint to v1.0.10
103+
104+
= Version 1.0.0 =
105+
106+
* First release
107+
108+
== Upgrade Notice ==

screenshot-1.png

42.2 KB
Loading

screenshot-2.png

133 KB
Loading

src/kint-php/kint/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
/config.php
3+
/.idea

0 commit comments

Comments
 (0)