Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.
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
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/homeboy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Homeboy

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: homeboy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
uses: Extra-Chill/homeboy-action/.github/workflows/ci.yml@v2
with:
commands: review lint
expected-commands: review lint
secrets: inherit
4 changes: 2 additions & 2 deletions assets/js/auth-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
url.pathname += '/';
}
return url.toString();
} catch (err) {
} catch {
return '';
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@

window.localStorage.setItem(key, generated);
return generated;
} catch (err) {
} catch {
return '';
}
}
Expand Down
6 changes: 5 additions & 1 deletion assets/js/google-signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@
*/
function init(config) {
if (!config || !config.clientId) {
// eslint-disable-next-line no-console
console.error('ECGoogleSignIn: clientId is required');
return;
}

if (!utils) {
// eslint-disable-next-line no-console
console.error('ECGoogleSignIn: ECAuthUtils not loaded');
return;
}

if (typeof google === 'undefined' || !google.accounts) {
// eslint-disable-next-line no-console
console.error('ECGoogleSignIn: Google Identity Services not loaded');
return;
}
Expand Down Expand Up @@ -181,7 +184,7 @@
try {
const params = new URL(window.location.href).searchParams;
return params.get('from_join') === 'true';
} catch (e) {
} catch {
return false;
}
}
Expand All @@ -196,6 +199,7 @@
if (container && utils) {
utils.renderNotice(container, 'error', message);
} else {
// eslint-disable-next-line no-console
console.error('ECGoogleSignIn:', message);
}
}
Expand Down
15 changes: 11 additions & 4 deletions blocks/concert-attendance/src/AttendanceButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@
* - button-2 (green accent) when marked
* - button-3 (neutral) when unmarked
*
* @package ExtraChillUsers
* @package
*/

/**
* WordPress dependencies
*/
import { useState } from '@wordpress/element';

/**
* Internal dependencies
*/
import useMarkAttendance from './useMarkAttendance';

/**
* @param {Object} props
* @param {Object} props Component properties.
* @param {number} props.eventId Event post ID.
* @param {number} props.blogId Blog ID the event lives on.
* @param {boolean} props.isLoggedIn Whether a user is logged in.
Expand All @@ -29,8 +36,8 @@ import useMarkAttendance from './useMarkAttendance';
* @param {string} props.labelActive Label when marked.
* @param {string} props.loginUrl Login URL for logged-out users.
* @param {string} props.redirectTo Optional explicit post-login return URL.
* When empty, the current request URL is
* used (prior default behavior).
* When empty, the current request URL is
* used (prior default behavior).
*/
const AttendanceButton = ( {
eventId,
Expand Down
9 changes: 8 additions & 1 deletion blocks/concert-attendance/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
* the server's first-paint state (not an imperative control surface — the
* React component owns all interaction after mount).
*
* @package ExtraChillUsers
* @package
*/

/**
* WordPress dependencies
*/
import domReady from '@wordpress/dom-ready';
import { createRoot } from '@wordpress/element';

/**
* Internal dependencies
*/
import AttendanceButton from './AttendanceButton';

domReady( () => {
Expand Down
5 changes: 4 additions & 1 deletion blocks/concert-attendance/src/useMarkAttendance.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
* The hook owns ONLY the network write + its in-flight / error state. The
* caller owns its own optimistic UI.
*
* @package ExtraChillUsers
* @package
*/

/**
* WordPress dependencies
*/
import { useState, useCallback, useRef } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { __ } from '@wordpress/i18n';
Expand Down
1 change: 0 additions & 1 deletion blocks/login-register/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion blocks/login-register/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
$initial_notice = $registration_notice;
}

// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Read-only invite context from signed URL parameters for rendering.
if ( isset( $_GET['action'] ) && 'ec_accept_invite' === $_GET['action'] && isset( $_GET['token'] ) && isset( $_GET['artist_id'] ) ) {
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Read-only invite context from signed URL parameters for rendering.
$token_from_url = sanitize_text_field( wp_unslash( $_GET['token'] ) );
$artist_id_from_url = absint( $_GET['artist_id'] );

Expand Down
1 change: 0 additions & 1 deletion blocks/password-reset/index.js

This file was deleted.

8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
"php": ">=8.0"
},
"require-dev": {
"phpstan/phpstan": "^2.0",
"php-stubs/wp-cli-stubs": "^2.10",
"squizlabs/php_codesniffer": "^3.7",
"szepeviktor/phpstan-wordpress": "^2.0",
"wp-coding-standards/wpcs": "^3.0",
"phpunit/phpunit": "^9.0"
},
"autoload-dev": {
"files": [
"tests/phpstan-stubs.php"
]
},
"scripts": {
"lint:php": "vendor/bin/phpcs --standard=WordPress --extensions=php .",
"lint:fix": "vendor/bin/phpcbf --standard=WordPress --extensions=php .",
Expand Down
4 changes: 2 additions & 2 deletions inc/artist-dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function ec_users_write_artist_dispatch_state( $user_id, array $next, array $cur
function ec_users_acquire_artist_dispatch_lock( $user_id, $request_id ) {
$user_id = absint( $user_id );
$key = EC_USERS_ARTIST_DISPATCH_LOCK_META . '_' . $user_id;
$blog_id = ec_users_get_artist_dispatch_blog_id();
$blog_id = ec_users_get_artist_dispatch_blog_id();
for ( $attempt = 0; 5 > $attempt; ++$attempt ) {
$now = time();
$lock = array(
Expand Down Expand Up @@ -505,7 +505,7 @@ function ec_users_mark_artist_dispatch_delivery_receipt( $user_id, $channel, $ev
$delivered = $receipt;
$delivered['status'] = 'delivered';
$delivered['delivered_at'] = time();
$blog_id = ec_users_get_artist_dispatch_blog_id();
$blog_id = ec_users_get_artist_dispatch_blog_id();
switch_to_blog( $blog_id );
try {
return update_option( ec_users_get_artist_dispatch_delivery_meta_key( $user_id, $channel, $event_type, $request_id ), $delivered, false );
Expand Down
9 changes: 8 additions & 1 deletion inc/auth-tokens/browser-handoff-token.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
const EXTRACHILL_USERS_BROWSER_HANDOFF_TTL = 60;
const EXTRACHILL_USERS_BROWSER_HANDOFF_CLAIM_CLEANUP_HOOK = 'extrachill_users_cleanup_browser_handoff_claim';

add_action( EXTRACHILL_USERS_BROWSER_HANDOFF_CLAIM_CLEANUP_HOOK, 'extrachill_users_cleanup_browser_handoff_claim', 10, 2 );
add_action(
EXTRACHILL_USERS_BROWSER_HANDOFF_CLAIM_CLEANUP_HOOK,
static function ( $claim_key, $expected_claim ): void {
extrachill_users_cleanup_browser_handoff_claim( $claim_key, $expected_claim );
},
10,
2
);

/**
* Create a single-use browser handoff token.
Expand Down
2 changes: 2 additions & 0 deletions inc/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ function ec_rate_limit_login( $user, $username ) {
* @param WP_User $user User object.
*/
function ec_clear_attempts_on_login( $user_login, $user ) {
unset( $user );
if ( empty( $user_login ) ) {
return;
}
Expand Down Expand Up @@ -262,6 +263,7 @@ function ec_clear_attempts_on_two_factor( WP_User $user ) {
* @param string $username Username attempted
*/
function extrachill_handle_login_failed( $username ) {
unset( $username );
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
return;
}
Expand Down
11 changes: 10 additions & 1 deletion inc/auth/password-reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function ec_custom_lostpassword_url( $lostpassword_url, $redirect ) {
* @return array Modified email content with the reset URL pointing at /reset-password/.
*/
function ec_filter_password_reset_email( $email, $key, $user_login, $user_data ) {
unset( $user_data );
$reset_url = add_query_arg(
array(
'action' => 'reset',
Expand Down Expand Up @@ -81,6 +82,7 @@ function ec_filter_password_reset_email( $email, $key, $user_login, $user_data )
* @return array Modified email content.
*/
function ec_filter_new_user_notification_email( $email, $user, $blogname ) {
unset( $user, $blogname );
if ( ! isset( $email['message'] ) || ! is_string( $email['message'] ) ) {
return $email;
}
Expand Down Expand Up @@ -134,7 +136,14 @@ function extrachill_users_clear_unclaimed_after_password_reset( $user, $new_pass
delete_user_meta( $user->ID, 'ec_unclaimed' );
return ! metadata_exists( 'user', $user->ID, 'ec_unclaimed' );
}
add_action( 'after_password_reset', 'extrachill_users_clear_unclaimed_after_password_reset', 10, 2 );
add_action(
'after_password_reset',
static function ( $user, $new_pass ): void {
extrachill_users_clear_unclaimed_after_password_reset( $user, $new_pass );
},
10,
2
);

/**
* Get the transient key for password reset attempts.
Expand Down
2 changes: 1 addition & 1 deletion inc/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function extrachill_users_validate_password_registration( string $email, string
* Production uses Extra Chill Network's verifier. Tests can substitute a
* deterministic callable without making external Cloudflare requests.
*
* @param callable $verifier Turnstile verifier callable.
* @param callable(string):(true|WP_Error)|string $verifier Turnstile verifier callable.
*/
$turnstile_verifier = apply_filters( 'extrachill_users_registration_turnstile_verifier', 'ec_turnstile_check_request' );
if ( ! is_callable( $turnstile_verifier ) ) {
Expand Down
4 changes: 2 additions & 2 deletions inc/concert-tracking/buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ function ec_users_enqueue_concert_tracking_assets() {
// generated .asset.php supplies dependency handles (wp-element, wp-api-fetch,
// wp-dom-ready, …) and a content-hash version, so no manual dependency list
// or window global is needed. Replaces the legacy data-* IIFE.
$script_path = EXTRACHILL_USERS_PLUGIN_DIR . 'build/concert-attendance/index.js';
$asset_path = EXTRACHILL_USERS_PLUGIN_DIR . 'build/concert-attendance/index.asset.php';
$script_path = EXTRACHILL_USERS_PLUGIN_DIR . 'build/concert-attendance/index.js';
$asset_path = EXTRACHILL_USERS_PLUGIN_DIR . 'build/concert-attendance/index.asset.php';

if ( file_exists( $script_path ) && file_exists( $asset_path ) ) {
$asset = require $asset_path;
Expand Down
4 changes: 2 additions & 2 deletions inc/concert-tracking/import/EventCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static function build_event_block_content( ExternalEvent $event ): strin
$attrs = array_filter(
$attrs,
static function ( $value ) {
return '' !== $value && null !== $value;
return '' !== $value;
}
);

Expand Down Expand Up @@ -365,7 +365,7 @@ private static function ensure_venue_term( ExternalEvent $event ): ?int {
);

if ( class_exists( '\\DataMachineEvents\\Core\\Venue_Taxonomy' ) ) {
$result = \DataMachineEvents\Core\Venue_Taxonomy::find_or_create_venue(
$result = \DataMachineEvents\Core\Venue_Taxonomy::find_or_create_venue(
$event->venue_name,
$venue_data
);
Expand Down
8 changes: 4 additions & 4 deletions inc/concert-tracking/import/EventMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ private function score_candidate( int $post_id, ExternalEvent $event ): int {
$venue_terms = wp_get_post_terms( $post_id, 'venue' );
$artist_terms = wp_get_post_terms( $post_id, 'artist' );

$venue_score = 0;
$artist_score = 0;
$venue_weight = 0.6;
$artist_weight = 0.4;
$venue_score = 0;
$artist_score = 0;
$venue_weight = 0.6;
$artist_weight = 0.4;

if ( ! is_wp_error( $venue_terms ) && ! empty( $venue_terms ) ) {
$best = 0;
Expand Down
28 changes: 14 additions & 14 deletions inc/concert-tracking/import/ImportOrchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

final class ImportOrchestrator {

public const HOOK = 'extrachill_concert_import_process';
public const GROUP = 'extrachill-concert-import';
public const HOOK = 'extrachill_concert_import_process';
public const GROUP = 'extrachill-concert-import';
public const STATUS_PENDING = 'pending';
public const STATUS_RUNNING = 'running';
public const STATUS_COMPLETE = 'complete';
Expand Down Expand Up @@ -192,11 +192,11 @@ public static function process( int $run_id ): void {
return;
}

$events = isset( $result['events'] ) && is_array( $result['events'] ) ? $result['events'] : array();
$total_pages = isset( $result['total_pages'] ) ? max( 1, (int) $result['total_pages'] ) : $page;
$matcher = new EventMatcher();
$events_blog = $matcher->blog_id();
$source_slug = (string) $run['source_slug'];
$events = isset( $result['events'] ) && is_array( $result['events'] ) ? $result['events'] : array();
$total_pages = isset( $result['total_pages'] ) ? max( 1, (int) $result['total_pages'] ) : $page;
$matcher = new EventMatcher();
$events_blog = $matcher->blog_id();
$source_slug = (string) $run['source_slug'];

$seen = 0;
$matched = 0;
Expand Down Expand Up @@ -242,9 +242,9 @@ public static function process( int $run_id ): void {
}

// 1. external_id idempotency check. The source's stable
// identifier is more authoritative than name similarity, so
// we look here BEFORE running the similarity matcher.
// Re-imports for previously-created events become a no-op.
// identifier is more authoritative than name similarity, so
// we look here BEFORE running the similarity matcher.
// Re-imports for previously-created events become a no-op.
$resolved_id = EventCreator::find_by_external_id( $source_slug, $external->source_id );

// 2. Similarity match against existing events on the same date.
Expand All @@ -255,9 +255,9 @@ public static function process( int $run_id ): void {
$was_created = false;

// 3. Fall through to create. Skipping is data loss — every
// other event-import path on the platform creates events,
// and we already have the user's confirmation to bring this
// history in.
// other event-import path on the platform creates events,
// and we already have the user's confirmation to bring this
// history in.
if ( null === $resolved_id ) {
$resolved_id = EventCreator::create( $external, $source_slug );
if ( null === $resolved_id ) {
Expand Down Expand Up @@ -431,7 +431,7 @@ public static function get_user_runs( int $user_id, int $limit = 20 ): array {

private static function update_run( int $run_id, array $changes ): void {
global $wpdb;
$table = extrachill_users_concert_import_runs_table_name();
$table = extrachill_users_concert_import_runs_table_name();
$changes['updated_at'] = current_time( 'mysql', true );
$wpdb->update( $table, $changes, array( 'id' => $run_id ) );
}
Expand Down
Loading