Skip to content

Commit 718ee2e

Browse files
author
Bud Manz
committed
2 parents bd45fd3 + 500e2b7 commit 718ee2e

106 files changed

Lines changed: 93 additions & 13671 deletions

File tree

Some content is hidden

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

.github/workflows/deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Deploy to WordPress.org
22
on:
33
push:
44
tags:
5-
- "*"
5+
- "*"
66
jobs:
77
tag:
88
name: New tag
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@master
12-
- name: WordPress Plugin Deploy
13-
uses: 10up/action-wordpress-plugin-deploy@1.5.0
14-
env:
15-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
16-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
17-
SLUG: debug-bar-timber
11+
- uses: actions/checkout@master
12+
- name: WordPress Plugin Deploy
13+
uses: 10up/action-wordpress-plugin-deploy@1.5.0
14+
env:
15+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
16+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
17+
SLUG: debug-bar-timber

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/
22
.idea/workspace.xml
3+
composer.lock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div style="text-align:center">
2-
<img src="https://i.imgur.com/L0SVKIo.png" alt="" style="display:block; margin:auto; width:100%; max-width:100%"/>
2+
<img alt="tdb-logo" src="https://i.imgur.com/L0SVKIo.png" style="display:block; margin:auto; width:100%; max-width:100%"/>
33
</div>
44

55
## Timber Debug Bar

SECURITY.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Security Policy
2-
3-
## Supported Versions
4-
5-
| Version | Supported |
6-
| ------- | ------------------ |
7-
| 1.0.x | :white_check_mark: |
8-
| 0.0.x | :x: |
9-
10-
## Reporting a Vulnerability
11-
12-
For the sake of protecting those who use this plugin, please send an email
13-
outlining the issue(s) to admin [at] manzwebdesigns [dot] com and thank you
14-
for using our plugin!
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 1.0.x | :white_check_mark: |
8+
| 0.0.x | :x: |
9+
10+
## Reporting a Vulnerability
11+
12+
For the sake of protecting those who use this plugin, please send an email
13+
outlining the issue(s) to admin [at] manzwebdesigns [dot] com and thank you
14+
for using our plugin!

class-debug-bar-timber.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
12
<?php
23

34
use Symfony\Component\VarDumper\VarDumper;
5+
use Timber\Timber;
46

57
include 'vendor/autoload.php';
68

@@ -9,23 +11,23 @@
911
*/
1012
class Debug_Bar_Timber extends Debug_Bar_Panel {
1113

12-
public $files;
13-
public $datas;
14-
public $filenames;
15-
public $php_files;
14+
public array $files;
15+
public array $datas;
16+
public array $filenames;
17+
public array $php_files;
1618

1719
/**
1820
* Initialize the toolbar
1921
*/
20-
public function init() {
22+
public function init(): void {
2123
$this->php_files = array();
2224
$this->datas = array();
2325
$this->files = array();
2426
$this->filenames = array();
2527
$this->title('Timber');
2628
add_action('wp_ajax_debug_bar_console', array($this, 'ajax'));
2729

28-
$timber = new \Timber\Timber();
30+
$timber = new Timber();
2931
if(version_compare($timber::$version, '2.0.0', '>=')) {
3032
add_action( 'timber/loader/render_file', array( $this, 'add_file' ) );
3133
add_filter( 'timber/render/file', array( $this, 'render_file' ) );
@@ -55,7 +57,7 @@ public function add_php_file($php_file){
5557
/**
5658
* @param $file
5759
*/
58-
public function add_file($file) {
60+
public function add_file($file): void {
5961
$this->files[] = $file;
6062
}
6163

@@ -80,21 +82,20 @@ public function render_data($data) {
8082
}
8183

8284

83-
public function prerender(){
85+
public function prerender(): void {
8486
$this->set_visible(true);
8587
}
8688

8789
/**
8890
* @param mixed ...$vars
8991
*/
90-
public function dumpAll(...$vars)
91-
{
92+
public function dumpAll(...$vars): void {
9293
foreach ($vars as $v) {
9394
VarDumper::dump($v);
9495
}
9596
}
9697

97-
public function render(){
98+
public function render(): void {
9899
$i = 0;
99100
foreach($this->filenames as $filename){
100101
echo '<h3>'.$filename.'</h3>';
@@ -135,7 +136,7 @@ public function render(){
135136
$keynames .= "'" . $array_keyname . "', ";
136137
}
137138
$keynames = substr($keynames, 0, -2 );
138-
echo "<div style='text-indent: .25in'>{$varName}: array of the form array[0][X] where X is {$keynames}</div>";
139+
echo "<div style='text-indent: .25in'>$varName: array of the form array[0][X] where X is $keynames</div>";
139140
}
140141
$i++;
141142
}

composer-install.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
#!/bin/sh
2-
3-
if [ -f "composer.lock" ]
4-
then
5-
rm composer.lock
6-
fi
7-
8-
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
9-
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
10-
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
11-
12-
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
13-
then
14-
>&2 echo 'ERROR: Invalid installer checksum'
15-
rm composer-setup.php
16-
exit 1
17-
fi
18-
19-
php composer-setup.php --quiet
20-
rm composer-setup.php
1+
#!/bin/sh
2+
3+
if [ -f "composer.lock" ]
4+
then
5+
rm composer.lock
6+
fi
7+
8+
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
9+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
10+
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
11+
12+
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
13+
then
14+
>&2 echo 'ERROR: Invalid installer checksum'
15+
rm composer-setup.php
16+
exit 1
17+
fi
18+
19+
php composer-setup.php --quiet
20+
rm composer-setup.php

composer.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{
22
"repositories": [],
33
"require": {
4-
"symfony/var-dumper": "^5.2"
4+
"symfony/polyfill-php74": "^1.17",
5+
"symfony/var-dumper": "5.4.*"
6+
}
7+
,
8+
"require-dev": {
9+
"roave/security-advisories": "dev-latest"
10+
},
11+
"options": {
12+
"symlink": false
513
},
614
"config": {
715
"preferred-install": {
816
"*": "dist"
917
},
1018
"sort-packages": true
1119
},
20+
"replace": {
21+
"symfony/polyfill-php80": "*",
22+
"symfony/polyfill-php74": "*"
23+
},
1224
"name": "timber/debug-bar-timber",
1325
"description": ""
1426
}

debug-bar-timber.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin URI: https://github.com/upstatement/debug-bar-timber/
55
Description: Adds Timber render to the debug bar. Requires the debug bar plugin.
66
Author: Jared Nova + Upstatement
7-
Version: 1.0.8
7+
Version: 1.1.7
88
Author URI: https://upstatement.com/
99
*/
1010

@@ -14,21 +14,27 @@
1414
return $panels;
1515
});
1616

17+
// bail early if Timber class does not exist
18+
// useful when you switch themes to non timber based themes (ie. twentytwentyone) for debugging etc.
19+
if ( !class_exists('Timber') ) {
20+
return;
21+
}
22+
1723
add_action('init', static function() {
18-
if ( !class_exists('Debug_Bar') ) {
19-
$class = 'error';
24+
if ( !class_exists('Debug_Bar') ) {
25+
$class = 'error';
2026

21-
$url = admin_url('plugin-install.php?tab=plugin-information&amp;plugin=debug-bar&amp;TB_iframe=true&amp;width=772&amp;height=300');
27+
$url = admin_url('plugin-install.php?tab=plugin-information&amp;plugin=debug-bar&amp;TB_iframe=true&amp;width=772&amp;height=300');
2228

23-
$text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin";
29+
$text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin";
2430

25-
add_action( 'admin_notices', static function() use ( $text, $class ) {
26-
echo '<div class="'.$class.'"><p>'.$text.'</p></div>';
27-
}, 1 );
28-
}
29-
}, 11);
31+
add_action( 'admin_notices', static function() use ( $text, $class ) {
32+
echo '<div class="'.$class.'"><p>'.$text.'</p></div>';
33+
}, 1 );
34+
}
35+
});
3036

3137
function tdb_enqueue_styles() {
32-
wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );
38+
wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );
3339
}
3440
add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 );

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: jarednova, manzwebdesigns
33
Tags: timber, debug, twig
44
Requires at least: 3.5
5-
Tested up to: 5.7
6-
Stable tag: 1.0.10
5+
Tested up to: 5.9.1
6+
Stable tag: 1.1.7
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

timber-debug-bar.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
#debug-bar-actions span {
2626
padding: 3px;
2727
}
28+
29+
#debug-menu-links li a#debug-menu-link-Debug_Bar_JS, #wp-admin-bar-debug-bar-Debug_Bar_JS {
30+
display: block;
31+
}

0 commit comments

Comments
 (0)