Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
manzwebdesigns committed Mar 9, 2022
2 parents bd45fd3 + 500e2b7 commit 718ee2e
Show file tree
Hide file tree
Showing 106 changed files with 93 additions and 13,671 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Deploy to WordPress.org
on:
push:
tags:
- "*"
- "*"
jobs:
tag:
name: New tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@1.5.0
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: debug-bar-timber
- uses: actions/checkout@master
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@1.5.0
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: debug-bar-timber
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.idea/workspace.xml
composer.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div style="text-align:center">
<img src="https://i.imgur.com/L0SVKIo.png" alt="" style="display:block; margin:auto; width:100%; max-width:100%"/>
<img alt="tdb-logo" src="https://i.imgur.com/L0SVKIo.png" style="display:block; margin:auto; width:100%; max-width:100%"/>
</div>

## Timber Debug Bar
Expand Down
28 changes: 14 additions & 14 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.x | :white_check_mark: |
| 0.0.x | :x: |

## Reporting a Vulnerability

For the sake of protecting those who use this plugin, please send an email
outlining the issue(s) to admin [at] manzwebdesigns [dot] com and thank you
for using our plugin!
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.x | :white_check_mark: |
| 0.0.x | :x: |

## Reporting a Vulnerability

For the sake of protecting those who use this plugin, please send an email
outlining the issue(s) to admin [at] manzwebdesigns [dot] com and thank you
for using our plugin!
25 changes: 13 additions & 12 deletions class-debug-bar-timber.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

<?php

use Symfony\Component\VarDumper\VarDumper;
use Timber\Timber;

include 'vendor/autoload.php';

Expand All @@ -9,23 +11,23 @@
*/
class Debug_Bar_Timber extends Debug_Bar_Panel {

public $files;
public $datas;
public $filenames;
public $php_files;
public array $files;
public array $datas;
public array $filenames;
public array $php_files;

/**
* Initialize the toolbar
*/
public function init() {
public function init(): void {
$this->php_files = array();
$this->datas = array();
$this->files = array();
$this->filenames = array();
$this->title('Timber');
add_action('wp_ajax_debug_bar_console', array($this, 'ajax'));

$timber = new \Timber\Timber();
$timber = new Timber();
if(version_compare($timber::$version, '2.0.0', '>=')) {
add_action( 'timber/loader/render_file', array( $this, 'add_file' ) );
add_filter( 'timber/render/file', array( $this, 'render_file' ) );
Expand Down Expand Up @@ -55,7 +57,7 @@ public function add_php_file($php_file){
/**
* @param $file
*/
public function add_file($file) {
public function add_file($file): void {
$this->files[] = $file;
}

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


public function prerender(){
public function prerender(): void {
$this->set_visible(true);
}

/**
* @param mixed ...$vars
*/
public function dumpAll(...$vars)
{
public function dumpAll(...$vars): void {
foreach ($vars as $v) {
VarDumper::dump($v);
}
}

public function render(){
public function render(): void {
$i = 0;
foreach($this->filenames as $filename){
echo '<h3>'.$filename.'</h3>';
Expand Down Expand Up @@ -135,7 +136,7 @@ public function render(){
$keynames .= "'" . $array_keyname . "', ";
}
$keynames = substr($keynames, 0, -2 );
echo "<div style='text-indent: .25in'>{$varName}: array of the form array[0][X] where X is {$keynames}</div>";
echo "<div style='text-indent: .25in'>$varName: array of the form array[0][X] where X is $keynames</div>";
}
$i++;
}
Expand Down
40 changes: 20 additions & 20 deletions composer-install.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/sh

if [ -f "composer.lock" ]
then
rm composer.lock
fi

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
rm composer-setup.php
#!/bin/sh

if [ -f "composer.lock" ]
then
rm composer.lock
fi

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
rm composer-setup.php
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"repositories": [],
"require": {
"symfony/var-dumper": "^5.2"
"symfony/polyfill-php74": "^1.17",
"symfony/var-dumper": "5.4.*"
}
,
"require-dev": {
"roave/security-advisories": "dev-latest"
},
"options": {
"symlink": false
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"replace": {
"symfony/polyfill-php80": "*",
"symfony/polyfill-php74": "*"
},
"name": "timber/debug-bar-timber",
"description": ""
}
28 changes: 17 additions & 11 deletions debug-bar-timber.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/upstatement/debug-bar-timber/
Description: Adds Timber render to the debug bar. Requires the debug bar plugin.
Author: Jared Nova + Upstatement
Version: 1.0.8
Version: 1.1.7
Author URI: https://upstatement.com/
*/

Expand All @@ -14,21 +14,27 @@
return $panels;
});

// bail early if Timber class does not exist
// useful when you switch themes to non timber based themes (ie. twentytwentyone) for debugging etc.
if ( !class_exists('Timber') ) {
return;
}

add_action('init', static function() {
if ( !class_exists('Debug_Bar') ) {
$class = 'error';
if ( !class_exists('Debug_Bar') ) {
$class = 'error';

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

$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";
$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";

add_action( 'admin_notices', static function() use ( $text, $class ) {
echo '<div class="'.$class.'"><p>'.$text.'</p></div>';
}, 1 );
}
}, 11);
add_action( 'admin_notices', static function() use ( $text, $class ) {
echo '<div class="'.$class.'"><p>'.$text.'</p></div>';
}, 1 );
}
});

function tdb_enqueue_styles() {
wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );
wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );
}
add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 );
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: jarednova, manzwebdesigns
Tags: timber, debug, twig
Requires at least: 3.5
Tested up to: 5.7
Stable tag: 1.0.10
Tested up to: 5.9.1
Stable tag: 1.1.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
4 changes: 4 additions & 0 deletions timber-debug-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
#debug-bar-actions span {
padding: 3px;
}

#debug-menu-links li a#debug-menu-link-Debug_Bar_JS, #wp-admin-bar-debug-bar-Debug_Bar_JS {
display: block;
}
7 changes: 0 additions & 7 deletions vendor/autoload.php

This file was deleted.

63 changes: 0 additions & 63 deletions vendor/bin/var-dump-server

This file was deleted.

Loading

0 comments on commit 718ee2e

Please sign in to comment.