Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/build deploy #10

Merged
merged 9 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Directories
/.git
/.github
/.husky
/.wordpress-org
/assets
/node_modules
/vendor/bin

# Files
/.distignore
/.editorconfig
/.eslintignore
/.eslintrc.json
/.gitignore
/.lintstagedrc.json
/.npmrc
/.nvmrc
/CHANGELOG.md
/CODE_OF_CONDUCT.md
/composer.json
/composer.lock
/CONTRIBUTING.md
/CREDITS.md
/LICENSE.md
/package-lock.json
/package.json
/phpcs.xml
/README.md
28 changes: 0 additions & 28 deletions .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
run: |
npm install
npm run build
composer install --no-dev
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
run: |
npm install
npm run build
composer install --no-dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we also need vendor folder to exist (otherwise the deploy script might consider "Other files have been modified")

- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist/
sophi-debug-bar.zip
sophi-debug-bar/
.DS_Store
*.zip
12 changes: 6 additions & 6 deletions includes/class-sophi-debug-bar-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SophiDebugBarPanel extends \Debug_Bar_Panel {
* Constructor
*/
public function __construct() {
$this->title( __( 'Sophi', 'sophi-debug-bar' ) );
$this->title( __( 'Sophi', 'debug-bar-for-sophi' ) );

add_filter( 'sophi_request_args', array( $this, 'request_start' ), 10, 2 );
add_filter( 'sophi_request_result', array( $this, 'request_end' ), 10, 3 );
Expand Down Expand Up @@ -114,16 +114,16 @@ public function render() {
<?php echo esc_html( date_i18n( 'Y-m-d H:i:s', $request->get_start() ) ); ?>
</div>
<div class="sophi-request-header-item">
<?php esc_html_e( 'Response code:', 'sophi-debug-bar' ); ?> <?php echo esc_html( $request->get_response_code() ); ?>
<?php esc_html_e( 'Response code:', 'debug-bar-for-sophi' ); ?> <?php echo esc_html( $request->get_response_code() ); ?>
</div>
<div class="sophi-request-header-item">
<?php
/* translators: */
echo sprintf( esc_html__( 'Duration: %s ms', 'sophi-debug-bar' ), number_format( $request->get_time() * 1000 ) );
echo sprintf( esc_html__( 'Duration: %s ms', 'debug-bar-for-sophi' ), number_format( $request->get_time() * 1000 ) );
?>
</div>
<div class="sophi-request-header-item">
<?php esc_html_e( 'Context:', 'sophi-debug-bar' ); ?>
<?php esc_html_e( 'Context:', 'debug-bar-for-sophi' ); ?>
<?php
foreach ( $request->get_request_context_compact() as $context_key => $context_value ) {
echo '<br><span>' . esc_attr( $context_key ) . ':</span> ';
Expand All @@ -134,13 +134,13 @@ public function render() {
</div>
<div class="sophi-request-details">
<div>
<strong><?php esc_html_e( 'Request', 'sophi-debug-bar' ); ?></strong>
<strong><?php esc_html_e( 'Request', 'debug-bar-for-sophi' ); ?></strong>
<div class="sophi-json-view" id="sophi-request-body-<?php echo esc_attr( $key ); ?>">
<?php echo esc_attr( $request->get_request_body() ); ?>
</div>
</div>
<div>
<strong><?php esc_html_e( 'Response', 'sophi-debug-bar' ); ?></strong>
<strong><?php esc_html_e( 'Response', 'debug-bar-for-sophi' ); ?></strong>
<div class="sophi-json-view" id="sophi-response-body-<?php echo esc_attr( $key ); ?>">
<?php echo esc_attr( $request->get_response_body() ); ?>
</div>
Expand Down
4 changes: 2 additions & 2 deletions includes/classes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public function __construct() {
public function fields() {
add_settings_section(
'debug',
__( 'Debug', 'sophi-debug-bar' ),
__( 'Debug', 'debug-bar-for-sophi' ),
'',
SETTINGS_GROUP
);

add_settings_field(
'enable_debug_log',
__( 'Debug log', 'sophi-debug-bar' ),
__( 'Debug log', 'debug-bar-for-sophi' ),
array( $this, 'render_debug_log_field' ),
SETTINGS_GROUP,
'debug'
Expand Down
10 changes: 4 additions & 6 deletions includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ function setup() {
* @return void
*/
function i18n() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'sophi-debug-bar' );
load_textdomain( 'sophi-debug-bar', WP_LANG_DIR . '/sophi-debug-bar/sophi-debug-bar-' . $locale . '.mo' );
load_plugin_textdomain( 'sophi-debug-bar', false, plugin_basename( SOPHI_DEBUG_BAR_PATH ) . '/languages/' );
load_plugin_textdomain( 'debug-bar-for-sophi', false, plugin_basename( SOPHI_DEBUG_BAR_PATH ) . '/languages/' );
}

/**
Expand Down Expand Up @@ -293,7 +291,7 @@ function show_notices( $warnings = array(), $type = 'warning' ) {
* @return void
*/
function warning_sophi_required() {
show_notices( array( __( 'Sophi Debug Bar requires Sophi for WordPress plugin', 'sophi-debug-bar' ) ) );
show_notices( array( __( 'Sophi Debug Bar requires Sophi for WordPress plugin', 'debug-bar-for-sophi' ) ) );
}

/**
Expand All @@ -302,7 +300,7 @@ function warning_sophi_required() {
* @return void
*/
function warning_sophi_version() {
show_notices( array( __( 'Sophi Debug Bar requires Sophi for WordPress version 1.0.14 or higher', 'sophi-debug-bar' ) ) );
show_notices( array( __( 'Sophi Debug Bar requires Sophi for WordPress version 1.0.14 or higher', 'debug-bar-for-sophi' ) ) );
}

/**
Expand All @@ -311,7 +309,7 @@ function warning_sophi_version() {
* @return void
*/
function error_debug_bar_required() {
show_notices( array( __( 'Sophi Debug Bar requires Debug Bar plugin', 'sophi-debug-bar' ) ), 'error' );
show_notices( array( __( 'Sophi Debug Bar requires Debug Bar plugin', 'debug-bar-for-sophi' ) ), 'error' );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint-js": "10up-toolkit lint-js",
"lint-php": "./vendor/bin/phpcs",
"lint-style": "10up-toolkit lint-style",
"makepot": "wpi18n makepot --domain-path languages --pot-file sophi-debug-bar.pot --type plugin --main-file sophi-debug-bar.php --exclude bin,dist,node_modules,vendor",
"makepot": "wpi18n makepot --domain-path languages --pot-file debug-bar-for-sophi.pot --type plugin --main-file sophi-debug-bar.php --exclude bin,dist,node_modules,vendor",
"prepare": "husky install",
"start": "npm run watch",
"watch": "10up-toolkit watch --port=5010 --hot"
Expand Down
2 changes: 1 addition & 1 deletion sophi-debug-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author URI: https://10up.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: sophi-debug-bar
* Text Domain: debug-bar-for-sophi
*
* @package SophiDebugBar
*/
Expand Down