Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fnpen committed Feb 23, 2022
1 parent 6c48929 commit 1ed8842
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 48 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file.

### 0.8.20 (2022-02-23)

### 0.8.19 (2022-02-22)

### 0.8.18 (2022-02-22)
Expand Down
4 changes: 2 additions & 2 deletions barista.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author: WP Busters
* Author URI: https://wpbusters.com/
*
* Version: 0.8.19
* Version: 0.8.20
* Requires at least: 5.8
* Tested up to: 5.9
* Requires PHP: 7.1
Expand All @@ -26,7 +26,7 @@
define( 'BARISTA_URL', \plugins_url( '/', __FILE__ ) );
define( 'BARISTA_PLUGIN_FILE', __FILE__ );
define( 'BARISTA_PLUGIN_DIR', __DIR__ );
define( 'BARISTA_VERSION', '0.8.19' );
define( 'BARISTA_VERSION', '0.8.20' );

// define( 'BARISTA_DEMO', 'animate-up' ); phpcs:ignore Squiz.PHP.CommentedOutCode.Found.

Expand Down
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'ac30ee897364440a7f043a4a2f363fbc');
<?php return array('dependencies' => array(), 'version' => '1ccf43932f307f9df2f2348633b99025');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/main.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions classes/class-action-response.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function commands( $data ) {
* @param array|Collection $data Data.
* @return $this
*/
public function replace( $parent, $group, $data) {
public function replace( $parent, $group, $data ) {
$this->touched = true;

if ( $data instanceof Collection ) {
Expand All @@ -194,7 +194,7 @@ public function replace( $parent, $group, $data) {
}

$this->data['replaceCommandsInParent'][] = [
'parent' => $parent,
'parent' => $parent,
'group' => $group,
'commands' => $data,
];
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A blazing fast, highly extendable command launcher that helps to do your routine tasks much faster. You can search posts, control your site, and much more.",
"type": "wordpress-plugin",
"license": "ISC",
"version": "0.8.19",
"version": "0.8.20",
"require": {
"php": ">=7.1"
}
Expand Down
16 changes: 8 additions & 8 deletions inc/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ function scripts() {
'script-barista',
'BARISTA_DATA',
[
'demo' => defined( 'BARISTA_DEMO' ) ? constant( 'BARISTA_DEMO' ) : '',
'debug' => WP_DEBUG,
'nonce' => wp_create_nonce( 'barista-base' ),
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'collection' => Collection::get_instance()->get_all(),
'isAdmin' => is_admin(),
'demo' => defined( 'BARISTA_DEMO' ) ? constant( 'BARISTA_DEMO' ) : '',
'debug' => WP_DEBUG,
'nonce' => wp_create_nonce( 'barista-base' ),
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'collection' => Collection::get_instance()->get_all(),
'isAdmin' => is_admin(),
'openAtStart' => BARISTA_DEVELOPMENT,
// 'startParent'=> 'history',
'startParent'=> BARISTA_DEVELOPMENT ? 'plugins' : null,
// 'startParent'=> BARISTA_DEVELOPMENT ? 'level1_1' : null,
// 'startParent'=> 'level1_1',
// 'startParent'=> 'woocommerce_settings_sections',
// 'startParent'=> 'barista-settings',
'settings' => Settings::get_instance()->get_all(),
'settings' => Settings::get_instance()->get_all(),
]
);

Expand Down
4 changes: 2 additions & 2 deletions inc/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Init all hooks.
*/
function init() {
if( ! is_user_logged_in() ) {
if ( ! is_user_logged_in() ) {
return;
}

Expand All @@ -51,7 +51,7 @@ function init() {
function admin_init() {
global $menu, $menu_order, $default_menu_order, $_wp_menu_nopriv, $_wp_submenu_nopriv; // it's important for including.

if ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'barista_run_action' === $_REQUEST['action'] ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'barista_run_action' === ($_REQUEST['action'] ?? '') ) {
if ( ! defined( 'WP_NETWORK_ADMIN' ) ) {
define( 'WP_NETWORK_ADMIN', false );
}
Expand Down
2 changes: 1 addition & 1 deletion inc/commands/admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function wp_menu_to_collection() {
$collection = array_filter(
$collection,
function( $item ) use ( $link ) {
return isset($item['href']) && $item['href'] !== $link;
return isset( $item['href'] ) && $item['href'] !== $link;
}
);

Expand Down
13 changes: 8 additions & 5 deletions inc/commands/bookmarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function commands() {
'title' => __( 'Bookmarks', 'barista' ),
'icon' => 'dashicons-star-filled',
'group' => __( 'Features', 'barista' ),
'actions' => [
'actions' => [
[
'name' => 'enter',
'setAsParent' => true,
Expand All @@ -107,7 +107,7 @@ function commands() {
function bookmarks_to_commands( array $bookmarks ) {
$collection = new Collection();

if( count($bookmarks) ) {
if ( count( $bookmarks ) ) {
foreach ( $bookmarks as $bookmark ) {
$group = timestamp_to_day_human( $bookmark['time'] );

Expand Down Expand Up @@ -179,7 +179,8 @@ function add_to_bookmarks( \Barista\Ajax\Action_Response $response, \Barista\Aja
]
)
->replace(
'bookmarks', false,
'bookmarks',
false,
bookmarks_to_commands( $bookmarks->get_all() )
);
}
Expand All @@ -202,7 +203,8 @@ function remove_url_from_bookmarks( \Barista\Ajax\Action_Response $response, \Ba

if ( $result ) {
return $response->success( $result_text )->replace(
'bookmarks', false,
'bookmarks',
false,
bookmarks_to_commands( $bookmarks->get_all() )
);
}
Expand All @@ -226,7 +228,8 @@ function remove_item_from_bookmarks( \Barista\Ajax\Action_Response $response, \B

if ( $result ) {
return $response->success( $result_text )->replace(
'bookmarks', false,
'bookmarks',
false,
bookmarks_to_commands( $bookmarks->get_all() )
);
}
Expand Down
28 changes: 14 additions & 14 deletions inc/commands/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ function load_children( \Barista\Ajax\Action_Response $response ) {

foreach ( $all_plugins as $plugin_file => $plugin ) {
$id = COMMAND_NAME . '-' . $plugin_file;
$title = implode( ' ', array_filter([ $plugin['Title'], $plugin['Version'] ? '(v.' . $plugin['Version'] . ')' : '', 'by ' . $plugin['Author'] ] ));
$title = implode( ' ', array_filter( [ $plugin['Title'], $plugin['Version'] ? '(v.' . $plugin['Version'] . ')' : '', 'by ' . $plugin['Author'] ] ) );

$status = 'Inactive';
if( is_plugin_active( $plugin_file ) ) {
if ( is_plugin_active( $plugin_file ) ) {
$status = 'Active';
}

Expand All @@ -77,17 +77,17 @@ function load_children( \Barista\Ajax\Action_Response $response ) {
'title' => $title,
'titleShort' => $plugin['Title'],
'description' => $plugin['Description'],
'group' => $status,
'group' => $status,
'icon' => 'dashicons-admin-plugins',
'actions' => [
'actions' => [
[
'title' => 'Activate',
'name' => 'activate_plugin',
'name' => 'activate_plugin',
],
[
'title' => 'Deactivate',
'name' => 'deactivate_plugin',
]
'name' => 'deactivate_plugin',
],
],
'suffix' => $status,
'pluginFile' => $plugin_file,
Expand All @@ -96,20 +96,20 @@ function load_children( \Barista\Ajax\Action_Response $response ) {
}

$mustuse_plugins = get_mu_plugins();
//dd($mustuse_plugins);
// dd($mustuse_plugins);

foreach ( $mustuse_plugins as $plugin_file => $plugin ) {
$id = COMMAND_NAME . '-' . $plugin_file;
$title = implode( ' ', array_filter([ $plugin['Title'], $plugin['Version'] ? '(v.' . $plugin['Version'] . ')' : '', 'by ' . $plugin['Author'] ] ));
$title = implode( ' ', array_filter( [ $plugin['Title'], $plugin['Version'] ? '(v.' . $plugin['Version'] . ')' : '', 'by ' . $plugin['Author'] ] ) );

$items[] = [
'parent' => COMMAND_NAME,
'id' => $id,
'title' => $title,
'titleShort' => $plugin['Title'],
'selectable' => false,
'selectable' => false,
'description' => $plugin['Description'],
'group' => 'Must-Use',
'group' => 'Must-Use',
'icon' => 'dashicons-admin-plugins',
'suffix' => 'Active',
'pluginFile' => $plugin_file,
Expand Down Expand Up @@ -138,10 +138,10 @@ function activate_plugin( \Barista\Ajax\Action_Response $response, \Barista\Ajax

$result = \activate_plugin( $request['pluginFile'], '', false, null );
if ( is_wp_error( $result ) ) {
return load_children($response)->failure( $result->get_error_message() );
return load_children( $response )->failure( $result->get_error_message() );
}

return load_children($response)->success( __( 'The plugin successfully activated.', 'barista' ) );
return load_children( $response )->success( __( 'The plugin successfully activated.', 'barista' ) );
}


Expand All @@ -158,5 +158,5 @@ function deactivate_plugin( \Barista\Ajax\Action_Response $response, \Barista\Aj

\deactivate_plugins( $request['pluginFile'], '', false, null );

return load_children($response)->success( __( 'The plugin successfully deactivated.', 'barista' ) );
return load_children( $response )->success( __( 'The plugin successfully deactivated.', 'barista' ) );
}
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit1b197ec008078e0f903941049f6784a1::getLoader();
return ComposerAutoloaderInitcedca64eb7c948419795d6316a6cbcb5::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit1b197ec008078e0f903941049f6784a1
class ComposerAutoloaderInitcedca64eb7c948419795d6316a6cbcb5
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit1b197ec008078e0f903941049f6784a1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitcedca64eb7c948419795d6316a6cbcb5', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit1b197ec008078e0f903941049f6784a1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitcedca64eb7c948419795d6316a6cbcb5', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit1b197ec008078e0f903941049f6784a1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitcedca64eb7c948419795d6316a6cbcb5::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -51,12 +51,12 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit1b197ec008078e0f903941049f6784a1::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitcedca64eb7c948419795d6316a6cbcb5::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire1b197ec008078e0f903941049f6784a1($fileIdentifier, $file);
composerRequirecedca64eb7c948419795d6316a6cbcb5($fileIdentifier, $file);
}

return $loader;
Expand All @@ -68,7 +68,7 @@ public static function getLoader()
* @param string $file
* @return void
*/
function composerRequire1b197ec008078e0f903941049f6784a1($fileIdentifier, $file)
function composerRequirecedca64eb7c948419795d6316a6cbcb5($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit1b197ec008078e0f903941049f6784a1
class ComposerStaticInitcedca64eb7c948419795d6316a6cbcb5
{
public static $files = array (
'49a1299791c25c6fd83542c6fedacddd' => __DIR__ . '/..' . '/yahnis-elsts/plugin-update-checker/load-v4p11.php',
Expand All @@ -17,7 +17,7 @@ class ComposerStaticInit1b197ec008078e0f903941049f6784a1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInit1b197ec008078e0f903941049f6784a1::$classMap;
$loader->classMap = ComposerStaticInitcedca64eb7c948419795d6316a6cbcb5::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 1ed8842

Please sign in to comment.