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

Bumped PHP in CI to 8.4 #1138

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches: "*"
pull_request:
env:
php-version: 8.2
php-version: 8.4
cache-version: 1
jobs:
platform-check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- "*"
env:
php-version: 8.2
php-version: 8.4
cache-version: 1
jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion src/php/skautis-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace Skautis_Integration;

if ( ! defined( 'ABSPATH' ) ) {
die();
exit();
}

define( 'SKAUTIS_INTEGRATION_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
8 changes: 4 additions & 4 deletions src/php/src/auth/class-connect-and-disconnect-wp-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private function set_skautis_user_id_to_wp_account( int $wp_user_id, int $skauti
update_user_meta( $wp_user_id, 'skautisUserId_' . $this->skautis_gateway->get_env(), absint( $skautis_user_id ) );

wp_safe_redirect( $return_url, 302 );
die();
exit();
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ public function connect() {
if ( ! $this->skautis_login->set_login_data_to_local_skautis_instance( $_POST ) ) {
$return_url = Helpers::get_return_url() ?? Helpers::get_current_url();
wp_safe_redirect( esc_url_raw( $this->skautis_gateway->get_skautis_instance()->getLoginUrl( $return_url ) ), 302 );
die();
exit();
}
}

Expand Down Expand Up @@ -216,10 +216,10 @@ public function disconnect() {
$return_url = Helpers::get_return_url();
if ( ! is_null( $return_url ) ) {
wp_safe_redirect( $return_url, 302 );
die();
exit();
} else {
wp_safe_redirect( get_home_url(), 302 );
die();
exit();
}
}
}
2 changes: 1 addition & 1 deletion src/php/src/auth/class-skautis-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function get_env(): string {
public function get_skautis_instance(): Skautis\Skautis {
if ( ! ( $this->skautis instanceof Skautis\Skautis ) ) {
wp_die( esc_html__( 'The SkautIS integration plugin cannot be used without setting a valid App ID.', 'skautis-integration' ) );
die();
exit();
}
return $this->skautis;
}
Expand Down
10 changes: 5 additions & 5 deletions src/php/src/auth/class-skautis-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public function login() {

if ( ! $this->is_user_logged_in_skautis() ) {
wp_safe_redirect( esc_url_raw( $this->skautis_gateway->get_skautis_instance()->getLoginUrl( $return_url ) ), 302 );
die();
exit();
}

if ( strpos( $return_url, 'noWpLogin' ) !== false ) {
$this->wp_login_logout->try_to_login_to_wp();
wp_safe_redirect( esc_url_raw( $return_url ), 302 );
die();
exit();
} else {
$this->wp_login_logout->login_to_wp();
}
Expand All @@ -121,7 +121,7 @@ public function login_confirm() {
$return_url = Helpers::get_return_url();
if ( null === $return_url ) {
wp_die( esc_html__( "Couldn't find return URL.", 'skautis-integration' ) );
die();
exit();
}
// phpcs:ignore WordPress.Security.NonceVerification.Missing
if ( $this->set_login_data_to_local_skautis_instance( $_POST ) ) {
Expand All @@ -130,14 +130,14 @@ public function login_confirm() {
}
$this->wp_login_logout->try_to_login_to_wp();
wp_safe_redirect( $return_url, 302 );
die();
exit();
} elseif ( $this->is_user_logged_in_skautis() ) {
if ( strpos( $return_url, 'noWpLogin' ) === false ) {
$this->wp_login_logout->login_to_wp();
}
$this->wp_login_logout->try_to_login_to_wp();
wp_safe_redirect( $return_url, 302 );
die();
exit();
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/php/src/auth/class-wp-login-logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function login_wp_user_by_skautis_user_id( int $skautis_user_id, $dont_d

if ( is_user_logged_in() && get_current_user_id() === $wp_user->ID ) {
wp_safe_redirect( $return_url, 302 );
die();
exit();
}

wp_destroy_current_session();
Expand All @@ -95,7 +95,7 @@ private function login_wp_user_by_skautis_user_id( int $skautis_user_id, $dont_d
do_action( 'wp_login', $wp_user->user_login, $wp_user );

wp_safe_redirect( $return_url, 302 );
die();
exit();
}
}

Expand Down Expand Up @@ -206,6 +206,6 @@ public function logout() {

$return_url = Helpers::get_login_logout_redirect();
wp_safe_redirect( esc_url_raw( $return_url ), 302 );
die();
exit();
}
}
2 changes: 1 addition & 1 deletion src/php/src/general/class-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function auth_actions_router( \WP_Query $wp_query ) {
wp_die( sprintf( esc_html__( 'Pro správné fungování pluginu skautIS integrace, je potřeba %1$snastavit APP ID%2$s', 'skautis-integration' ), '<a href="' . esc_url( admin_url( 'admin.php?page=' . SKAUTIS_INTEGRATION_NAME ) ) . '">', '</a>' ), esc_html__( 'Chyba v konfiguraci pluginu', 'skautis-integration' ) );
} else {
wp_safe_redirect( get_home_url(), 302 );
die();
exit();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/php/src/modules/Register/class-register.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private function loginUserAfterRegistration() {
$return_url = Helpers::get_login_logout_redirect();
$return_url = remove_query_arg( SKAUTIS_INTEGRATION_NAME . '_registerToWpBySkautis', urldecode( $return_url ) );
wp_safe_redirect( esc_url_raw( $this->wp_login_logout->get_login_url( $return_url ) ), 302 );
die();
exit();
}

/**
Expand Down Expand Up @@ -222,7 +222,7 @@ public function register() {
if ( ! $this->skautis_login->is_user_logged_in_skautis() ) {
$return_url = Helpers::get_return_url() ?? Helpers::get_current_url();
wp_safe_redirect( esc_url_raw( $this->skautis_gateway->get_skautis_instance()->getLoginUrl( $return_url ) ), 302 );
die();
exit();
}

$this->registerUser();
Expand Down Expand Up @@ -293,7 +293,7 @@ public function registerUserManually() {

if ( $this->wp_register->register_to_wp_manually( $wp_role, $skautis_user_id ) ) {
wp_safe_redirect( $return_url, 302 );
die();
exit();
} else {
wp_die( esc_html__( 'Uživatele se nepodařilo zaregistrovat', 'skautis-integration' ), esc_html__( 'Chyba při registraci uživatele', 'skautis-integration' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/php/src/modules/Register/class-wp-register.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static function ( $user_id ) {
}
/* translators: The error message */
wp_die( sprintf( esc_html__( 'Při registraci nastala neočekávaná chyba: %s', 'skautis-integration' ), esc_html( $user_id->get_error_message() ) ), esc_html__( 'Chyba při registraci', 'skautis-integration' ) );
die();
exit();
}

return $user_id;
Expand Down
Loading