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

issue/594 - Prefer "require_once" in a few spots. #595

Merged
merged 1 commit into from
Feb 29, 2024
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
6 changes: 3 additions & 3 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static function get_providers() {
* For each filtered provider,
*/
foreach ( $providers as $provider_key => $path ) {
include_once $path;
require_once $path;

$class = $provider_key;

Expand Down Expand Up @@ -785,7 +785,7 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg

if ( ! function_exists( 'login_header' ) ) {
// We really should migrate login_header() out of `wp-login.php` so it can be called from an includes file.
include_once TWO_FACTOR_DIR . 'includes/function.login-header.php';
require_once TWO_FACTOR_DIR . 'includes/function.login-header.php';
}

// Disable the language switcher.
Expand Down Expand Up @@ -913,7 +913,7 @@ function() {
</script>
<?php
if ( ! function_exists( 'login_footer' ) ) {
include_once TWO_FACTOR_DIR . 'includes/function.login-footer.php';
require_once TWO_FACTOR_DIR . 'includes/function.login-footer.php';
}

login_footer();
Expand Down
4 changes: 2 additions & 2 deletions providers/class-two-factor-fido-u2f-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static function show_user_profile( $user ) {
<p><a href="https://support.google.com/accounts/answer/6103523"><?php esc_html_e( 'You can find FIDO U2F Security Key devices for sale from here.', 'two-factor' ); ?></a></p>

<?php
require TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php';
require_once TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php';
$u2f_list_table = new Two_Factor_FIDO_U2F_Admin_List_Table();
$u2f_list_table->items = $security_keys;
$u2f_list_table->prepare_items();
Expand Down Expand Up @@ -328,7 +328,7 @@ public static function delete_link( $item ) {
public static function wp_ajax_inline_save() {
check_ajax_referer( 'keyinlineeditnonce', '_inline_edit' );

require TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php';
require_once TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php';
$wp_list_table = new Two_Factor_FIDO_U2F_Admin_List_Table();

if ( ! isset( $_POST['keyHandle'] ) ) {
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
tests_add_filter(
'muplugins_loaded',
function() {
require dirname( __DIR__ ) . '/two-factor.php';
require_once dirname( __DIR__ ) . '/two-factor.php';
}
);

// Start up the WP testing environment.
require getenv( 'WP_PHPUNIT__DIR' ) . '/includes/bootstrap.php';
require_once getenv( 'WP_PHPUNIT__DIR' ) . '/includes/bootstrap.php';
Loading