Skip to content
Open
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Files and directories to exclude from `composer require`.
/.github export-ignore
/.wordpress-org export-ignore
/src export-ignore
/tests/ export-ignore

# Don't include the dotfiles for distribution.
Expand Down
16 changes: 4 additions & 12 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,9 @@ export default {
* @todo Simplify when we can use PHPCS 4.x's improved exit codes.
* @see https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/184
*/
'**/*.php': ( filenames ) => {
const cwd = process.cwd();
const relativeFilenames = filenames
.map( ( filename ) => `"${ filename.replace( cwd + '/', '' ) }"` )
.join( ' ' );

// Only fail if phpcbf itself failed (exit code 3).
// Run under a shell so the `||` operator works reliably.
return [
`sh -c "./vendor/bin/phpcbf ${ relativeFilenames } || [ \$? -eq 3 ]"`,
];
},
'**/*.php': [
// phpcbf 3.x exits 1 when it fixed everything.
`sh -c './vendor/bin/phpcbf "$@" || [ $? -eq 1 ]' --`,
],
'**/*.{json,md,css,scss,js,jsx,ts,tsx}': [ 'wp-scripts format --' ],
};
2 changes: 1 addition & 1 deletion assets/src/css/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
z-index: 1000000;
}

.components-notice-content {
.components-notice__content {
white-space: pre-line !important;
}

Expand Down
5 changes: 1 addition & 4 deletions inc/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ static function (): void {

wp_admin_notice(
$error_message,
[
'type' => 'error',
'dismiss' => false,
]
[ 'type' => 'error' ]
);
}
);
Expand Down
2 changes: 1 addition & 1 deletion inc/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function has_pretty_permalinks(): bool {
static function () {
wp_admin_notice(
sprintf(
/* translators: 1: Plugin name */
/* translators: %s: URL of the Permalink Settings screen. */
__( 'OneSearch: The plugin requires pretty permalinks to be enabled. Please go to <a href="%s">Permalink Settings</a> and enable an option other than <code>Plain</code>.', 'onesearch' ),
admin_url( 'options-permalink.php' ),
),
Expand Down
1 change: 0 additions & 1 deletion inc/Modules/Core/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public function __construct() {
* {@inheritDoc}
*/
public function register_hooks(): void {
add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ] );

// Add defer attribute to certain plugin bundles to improve admin load performance.
Expand Down
2 changes: 1 addition & 1 deletion inc/Modules/Rest/Abstract_REST_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Base REST controller class.
*
* Includes the shared namespace, version and hook registration.
* Includes the shared namespace and hook registration.
*
* @package OneSearch\Modules\Rest
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/Modules/Rest/Remote_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function disconnect_brand_site( array $site_data ): bool {
$site_data['api_key'],
[
'method' => \WP_REST_Server::DELETABLE,
'timeout' => 5, // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout -- Only runs when an admin removes a brand site or uninstalls the plugin.
'timeout' => 5, // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout -- Only runs when an admin removes a brand site or the plugin's data is deleted.
]
);

Expand Down
1 change: 0 additions & 1 deletion inc/Modules/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ public static function get_shared_site_by_url( string $site_url ): ?array {
* logo_id?: int,
* name?: string,
* url?: string,
* is_editable?: bool
* }> $sites The sites to set.
*/
public static function set_shared_sites( array $sites ): bool {
Expand Down
Loading
Loading