Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-66681: Theme My Login <= 7.1.14 Cross-Site Request Forgery PoC, Patch Analysis & Rule

Severity Medium (CVSS 4.3)
CWE 352
Vulnerable Version 7.1.14
Patched Version 7.1.15
Disclosed August 5, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66681: This is a Cross-Site Request Forgery (CSRF) vulnerability in the Theme My Login WordPress plugin versions up to and including 7.1.14. The flaw resides in the plugin’s AJAX license activation and deactivation handlers, which lacked nonce verification. An unauthenticated attacker can craft a request that, when triggered by a logged-in administrator, performs unauthorized extension license operations. CVSS score is 4.3 (Medium).

The root cause is the absence of a nonce check in the AJAX functions `tml_admin_ajax_activate_extension_license()` and `tml_admin_ajax_deactivate_extension_license()` in `admin/extensions.php`. These functions are hooked to `wp_ajax_tml-activate-extension-license` and `wp_ajax_tml-deactivate-extension-license` (see `admin/hooks.php`). They verify the user’s capability with `current_user_can( ‘manage_options’ )` but fail to validate a nonce. Because WordPress’s `wp_ajax_` hooks only require authentication (not CSRF protection), an attacker can forge a request that executes the action on behalf of a logged-in administrator. The patch adds `check_ajax_referer( ‘theme-my-login-licenses-options’, ‘_wpnonce’, false )` at the start of both functions, restoring CSRF protection.

Exploitation requires the attacker to first obtain a valid nonce for the `theme-my-login-licenses-options` action. In the vulnerable version, the nonce is exposed in the admin page’s JavaScript or HTML when an administrator visits the Licenses settings page (the plugin localizes scripts with `wp_create_nonce( ‘theme-my-login-licenses-options’ )`). The attacker can then craft a malicious page containing a form that submits a POST request to `/wp-admin/admin-ajax.php` with `action=tml-activate-extension-license`, `extension=`, and the stolen nonce. When an administrator visits the attacker’s page while logged in, the browser sends the request with the administrator’s cookies, activating or deactivating the specified extension license. No user interaction beyond visiting the page is required.

The patch adds the missing nonce verification using `check_ajax_referer()` at the beginning of both AJAX handlers. Before the patch, the functions only checked user capabilities; after the patch, they first verify the nonce, returning an error if it is missing or invalid. This ensures that requests originate from the plugin’s own administrative interface and not from a third-party site. The patch also includes other code quality and security hardening changes (e.g., escaping output, strict comparisons, but those are not directly related to this CSRF issue).

Successful exploitation allows an attacker to activate or deactivate extension licenses on the target site. This could lead to unauthorized changes in licensing status, potentially causing financial loss (e.g., deactivating a valid license) or enabling features that require a valid license without proper authorization. The impact is limited to license management, but it demonstrates a failure to enforce CSRF protections on administrative actions, which could be chained with other vulnerabilities to escalate privileges or disrupt site functionality.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/theme-my-login/admin/class-theme-my-login-admin.php
+++ b/theme-my-login/admin/class-theme-my-login-admin.php
@@ -61,14 +61,17 @@
 	 *                not have the capability required.
 	 */
 	public function add_menu_item( $args = array() ) {
-		$args = wp_parse_args( $args, array(
-			'page_title'  => '',
-			'menu_title'  => '',
-			'menu_slug'   => '',
-			'parent_slug' => 'theme-my-login',
-			'capability'  => 'manage_options',
-			'function'    => 'tml_admin_settings_page',
-		) );
+		$args = wp_parse_args(
+			$args,
+			array(
+				'page_title'  => '',
+				'menu_title'  => '',
+				'menu_slug'   => '',
+				'parent_slug' => 'theme-my-login',
+				'capability'  => 'manage_options',
+				'function'    => 'tml_admin_settings_page',
+			)
+		);

 		if ( empty( $args['page_title'] ) || empty( $args['menu_title'] ) || empty( $args['menu_slug'] ) ) {
 			return;
@@ -115,6 +118,7 @@
 	 * Get a page hook.
 	 *
 	 * @since 7.0
+	 * @deprecated 7.1.15 Unused internally, with no known external callers.
 	 *
 	 * @param string $page The plugin page.
 	 * @return string The page hook.
--- a/theme-my-login/admin/class-theme-my-login-walker-nav-menu-edit.php
+++ b/theme-my-login/admin/class-theme-my-login-walker-nav-menu-edit.php
@@ -1,54 +0,0 @@
-<?php
-
-/**
- * Theme My Login Nav Menu Edit Walker
- *
- * @package Theme_My_Login_Restrictions
- * @subpackage Walker
- */
-
-class Theme_My_Login_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
-
-	/**
-	 * Start the element output
-	 *
-	 * @since 7.0
-	 *
-	 * @param string $output The current output of the walker.
-	 * @param object $item   The menu item.
-	 * @param int    $depth  The current walker depth.
-	 * @param array  $args   An array of arguments for walking the tree.
-	 * @param int    $id     The nav menu ID.
-	 */
-	function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
-		$item_output = '';
-
-		// Get the item content from the parent class
-		parent::start_el( $item_output, $item, $depth, $args, $id );
-
-		// Start an output buffer
-		ob_start();
-
-		/**
-		 * Fires just before the move field of a nav menu item in the menu editor.
-		 *
-		 * @since unknown
-		 *
-		 * @param int    $item_id The item ID.
-		 * @param object $item    The nav menu item.
-		 * @param int    $depth   The current walker depth.
-		 * @param array  $args    An array of arguments for walking the tree.
-		 */
-		do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args );
-
-		// Get the contents of the output buffer
-		$custom_fields = ob_get_clean();
-
-		// Append the contents of the output buffer to the nav menu item and
-		// append that to the walker output
-		$output .= preg_replace( '/(?=<(fieldset|p)[^>]+class="[^"]*field-move)/',
-			$custom_fields,
-			$item_output
-		);
-	}
-}
--- a/theme-my-login/admin/extensions.php
+++ b/theme-my-login/admin/extensions.php
@@ -18,9 +18,12 @@
  * @return array|WP_Error The extensions array or WP_Error on failure.
  */
 function tml_admin_get_extensions_feed( $args = array() ) {
-	$args = wp_parse_args( $args, array(
-		'number' => 12,
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'number' => 12,
+		)
+	);

 	$transient_key = 'tml_extensions_feed-' . md5( http_build_query( $args ) );

@@ -28,9 +31,12 @@
 	if ( false === $feed ) {
 		$url = add_query_arg( $args, THEME_MY_LOGIN_EXTENSIONS_API_URL );

-		$response = wp_remote_get( $url, array(
-			'timeout' => 30,
-		) );
+		$response = wp_remote_get(
+			$url,
+			array(
+				'timeout' => 30,
+			)
+		);
 		if ( is_wp_error( $response ) ) {
 			return $response;
 		}
@@ -38,7 +44,7 @@
 		$code    = wp_remote_retrieve_response_code( $response );
 		$message = wp_remote_retrieve_response_message( $response );

-		if ( '200' != $code ) {
+		if ( 200 !== (int) $code ) {
 			return new WP_Error( 'http_error_' . $code, $message );
 		}

@@ -60,16 +66,21 @@
 	global $title, $plugin_page;

 	$extensions = tml_admin_get_extensions_feed();
-?>
+	?>

 <div class="wrap">
-	<h1><?php echo esc_html( $title ) ?></h1>
+	<h1><?php echo esc_html( $title ); ?></h1>
 	<hr class="wp-header-end">

 	<?php if ( is_wp_error( $extensions ) ) : ?>

 		<h3><?php echo esc_html_e( 'Whoops! Looks like there was an error fetching extensions from the server. Please try again.', 'theme-my-login' ); ?></h3>
-		<p><?php echo esc_html( sprintf( __( 'Error: %s', 'theme-my-login' ), $extensions->get_error_message() ) ); ?></p>
+		<p>
+		<?php
+		/* translators: %s: The error message. */
+		echo esc_html( sprintf( __( 'Error: %s', 'theme-my-login' ), $extensions->get_error_message() ) );
+		?>
+		</p>

 	<?php else : ?>

@@ -101,11 +112,11 @@
 	<?php endif; ?>

 	<div class="tml-view-all-extensions-wrap">
-		<a class="tml-view-all-extensions-link" href="<?php echo THEME_MY_LOGIN_EXTENSIONS_URL; ?>"><?php esc_html_e( 'View All Extensions', 'theme-my-login' ); ?></a>
+		<a class="tml-view-all-extensions-link" href="<?php echo esc_url( THEME_MY_LOGIN_EXTENSIONS_URL ); ?>"><?php esc_html_e( 'View All Extensions', 'theme-my-login' ); ?></a>
 	</div>
 </div>

-<?php
+	<?php
 }

 /**
@@ -119,13 +130,14 @@
 		return;
 	}

-	if ( tml_get_request_value('option_page') !== 'theme-my-login-licenses' ) {
+	if ( tml_get_request_value( 'option_page' ) !== 'theme-my-login-licenses' ) {
 		return;
 	}

 	check_admin_referer( 'theme-my-login-licenses-options' );

 	if ( ! current_user_can( 'manage_options' ) ) {
+		// phpcs:ignore WordPress.WP.I18n.MissingArgDomain, WordPress.Security.EscapeOutput.OutputNotEscaped -- reusing WP core's translated string verbatim (see wp-admin/options-general.php), not a TML-specific string.
 		wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
 	}

@@ -134,10 +146,12 @@

 		// Handle license activations
 		if ( isset( $_POST['tml_activate_license'][ $extension->get_name() ] ) ) {
-			if ( $response = tml_activate_extension_license( $extension ) ) {
+			$response = tml_activate_extension_license( $extension );
+			if ( $response ) {
 				if ( is_wp_error( $response ) ) {
 					$extension->set_license_status();
-					add_settings_error( 'tml_activate_license',
+					add_settings_error(
+						'tml_activate_license',
 						$response->get_error_code(),
 						$response->get_error_message()
 					);
@@ -149,9 +163,11 @@

 		// Handle license deactivations
 		if ( isset( $_POST['tml_deactivate_license'][ $extension->get_name() ] ) ) {
-			if ( $response = tml_deactivate_extension_license( $extension ) ) {
+			$response = tml_deactivate_extension_license( $extension );
+			if ( $response ) {
 				if ( is_wp_error( $response ) ) {
-					add_settings_error( 'tml_deactivate_license',
+					add_settings_error(
+						'tml_deactivate_license',
 						$response->get_error_code(),
 						$response->get_error_message()
 					);
@@ -169,11 +185,18 @@
  * @since 7.1
  */
 function tml_admin_ajax_activate_extension_license() {
-	if ( ! $extension = tml_get_extension( tml_get_request_value( 'extension', 'post' ) ) ) {
+	if ( ! check_ajax_referer( 'theme-my-login-licenses-options', '_wpnonce', false ) ) {
+		// phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string verbatim (see wp-includes/class-wp-customize-manager.php), not a TML-specific string.
+		tml_send_ajax_error( __( 'There was an authentication problem. Please reload and try again.' ) );
+	}
+
+	$extension = tml_get_extension( tml_get_request_value( 'extension', 'post' ) );
+	if ( ! $extension ) {
 		tml_send_ajax_error( __( 'Invalid extension.', 'theme-my-login' ) );
 	}

 	if ( ! current_user_can( 'manage_options' ) ) {
+		// phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string verbatim (see wp-admin/options-general.php), not a TML-specific string.
 		tml_send_ajax_error( __( 'Sorry, you are not allowed to manage options for this site.' ) );
 	}

@@ -199,11 +222,18 @@
  * @since 7.1
  */
 function tml_admin_ajax_deactivate_extension_license() {
-	if ( ! $extension = tml_get_extension( tml_get_request_value( 'extension', 'post' ) ) ) {
+	if ( ! check_ajax_referer( 'theme-my-login-licenses-options', '_wpnonce', false ) ) {
+		// phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string verbatim (see wp-includes/class-wp-customize-manager.php), not a TML-specific string.
+		tml_send_ajax_error( __( 'There was an authentication problem. Please reload and try again.' ) );
+	}
+
+	$extension = tml_get_extension( tml_get_request_value( 'extension', 'post' ) );
+	if ( ! $extension ) {
 		tml_send_ajax_error( __( 'Invalid extension.', 'theme-my-login' ) );
 	}

 	if ( ! current_user_can( 'manage_options' ) ) {
+		// phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string verbatim (see wp-admin/options-general.php), not a TML-specific string.
 		tml_send_ajax_error( __( 'Sorry, you are not allowed to manage options for this site.' ) );
 	}

@@ -230,7 +260,7 @@
 		return;
 	}

-	if ( 'theme-my-login-licenses' != $plugin_page ) {
+	if ( 'theme-my-login-licenses' !== $plugin_page ) {
 		return;
 	}

@@ -238,7 +268,7 @@
 		if ( ! $extension->get_license_key() ) {
 			continue;
 		}
-		if ( 'valid' != $extension->get_license_status() ) {
+		if ( 'valid' !== $extension->get_license_status() ) {
 			continue;
 		}
 		$status = tml_check_extension_license( $extension );
@@ -268,7 +298,7 @@
 	if ( empty( $response->package ) ) {
 		echo ' ' . sprintf(
 			'<em>In order to enable automatic updates, please enter and activate your <a href="%1$s">license key</a>.',
-			admin_url( 'admin.php?page=theme-my-login-licenses' )
+			esc_url( admin_url( 'admin.php?page=theme-my-login-licenses' ) )
 		);
 	}
 }
--- a/theme-my-login/admin/functions.php
+++ b/theme-my-login/admin/functions.php
@@ -30,7 +30,7 @@
 	global $plugin_page;

 	if ( ! empty( $page ) ) {
-		return ( "theme-my-login-$page" == $plugin_page ) || ( "tml-$page" == $plugin_page );
+		return ( "theme-my-login-$page" === $plugin_page ) || ( "tml-$page" === $plugin_page );
 	}

 	return ( strpos( $plugin_page, 'theme-my-login' ) === 0 ) || ( strpos( $plugin_page, 'tml-' ) === 0 );
@@ -62,23 +62,29 @@
 	}

 	// Add the main menu item
-	tml_admin_add_menu_item( array(
-		'page_title'  => esc_html__( 'Theme My Login Settings', 'theme-my-login' ),
-		'menu_title'  => esc_html__( 'Theme My Login',          'theme-my-login' ),
-		'menu_slug'   => 'theme-my-login',
-		'menu_icon'   => 'data:image/svg+xml;base64,' . base64_encode(
-			file_get_contents( THEME_MY_LOGIN_PATH . 'admin/assets/images/logo.svg' )
-		),
-		'parent_slug' => false,
-	) );
+	tml_admin_add_menu_item(
+		array(
+			'page_title'  => esc_html__( 'Theme My Login Settings', 'theme-my-login' ),
+			'menu_title'  => esc_html__( 'Theme My Login', 'theme-my-login' ),
+			'menu_slug'   => 'theme-my-login',
+			// phpcs:disable WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- reading a local plugin asset and base64-encoding it into a data: URI for the admin menu icon, not a remote fetch or obfuscation.
+			'menu_icon'   => 'data:image/svg+xml;base64,' . base64_encode(
+				file_get_contents( THEME_MY_LOGIN_PATH . 'admin/assets/images/logo.svg' )
+			),
+			// phpcs:enable WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
+			'parent_slug' => false,
+		)
+	);

 	// Add the submenu item
-	tml_admin_add_menu_item( array(
-		'page_title'  => esc_html__( 'Theme My Login Settings', 'theme-my-login' ),
-		'menu_title'  => esc_html__( 'General',                 'theme-my-login' ),
-		'menu_slug'   => 'theme-my-login',
-		'parent_slug' => 'theme-my-login',
-	) );
+	tml_admin_add_menu_item(
+		array(
+			'page_title'  => esc_html__( 'Theme My Login Settings', 'theme-my-login' ),
+			'menu_title'  => esc_html__( 'General', 'theme-my-login' ),
+			'menu_slug'   => 'theme-my-login',
+			'parent_slug' => 'theme-my-login',
+		)
+	);

 	$has_licenses = false;

@@ -95,23 +101,27 @@

 	if ( $has_licenses ) {
 		// Add the licenses menu item
-		tml_admin_add_menu_item( array(
-			'page_title'  => esc_html__( 'Theme My Login Licenses', 'theme-my-login' ),
-			'menu_title'  => esc_html__( 'Licenses',                'theme-my-login' ),
-			'menu_slug'   => 'theme-my-login-licenses',
-			'parent_slug' => 'theme-my-login',
-		) );
+		tml_admin_add_menu_item(
+			array(
+				'page_title'  => esc_html__( 'Theme My Login Licenses', 'theme-my-login' ),
+				'menu_title'  => esc_html__( 'Licenses', 'theme-my-login' ),
+				'menu_slug'   => 'theme-my-login-licenses',
+				'parent_slug' => 'theme-my-login',
+			)
+		);
 		add_settings_section( 'tml_settings_licenses', '', '__return_null', 'theme-my-login-licenses' );
 	}

 	// Add the extensions menu item
-	tml_admin_add_menu_item( array(
-		'page_title'  => esc_html__( 'Theme My Login Extensions', 'theme-my-login' ),
-		'menu_title'  => esc_html__( 'Extensions',                'theme-my-login' ),
-		'menu_slug'   => 'theme-my-login-extensions',
-		'parent_slug' => 'theme-my-login',
-		'function'    => 'tml_admin_extensions_page',
-	) );
+	tml_admin_add_menu_item(
+		array(
+			'page_title'  => esc_html__( 'Theme My Login Extensions', 'theme-my-login' ),
+			'menu_title'  => esc_html__( 'Extensions', 'theme-my-login' ),
+			'menu_slug'   => 'theme-my-login-extensions',
+			'parent_slug' => 'theme-my-login',
+			'function'    => 'tml_admin_extensions_page',
+		)
+	);
 }

 /**
@@ -124,14 +134,24 @@

 	wp_enqueue_style( 'theme-my-login-admin', THEME_MY_LOGIN_URL . "admin/assets/styles/theme-my-login-admin$suffix.css", array(), THEME_MY_LOGIN_VERSION );

-	wp_enqueue_script( 'theme-my-login-admin', THEME_MY_LOGIN_URL . "admin/assets/scripts/theme-my-login-admin$suffix.js", array( 'jquery', 'postbox' ), THEME_MY_LOGIN_VERSION );
-	wp_localize_script( 'theme-my-login-admin', 'tmlAdmin', array(
-		'ajaxUrl'         => admin_url( 'admin-ajax.php' ),
-		'interimLoginUrl' => site_url( add_query_arg( array(
-			'interim-login' => 1,
-			'wp_lang'       => get_user_locale(),
-		), 'wp-login.php' ), 'login' ),
-	) );
+	wp_enqueue_script( 'theme-my-login-admin', THEME_MY_LOGIN_URL . "admin/assets/scripts/theme-my-login-admin$suffix.js", array( 'jquery', 'postbox' ), THEME_MY_LOGIN_VERSION, true );
+	wp_localize_script(
+		'theme-my-login-admin',
+		'tmlAdmin',
+		array(
+			'ajaxUrl'         => admin_url( 'admin-ajax.php' ),
+			'interimLoginUrl' => site_url(
+				add_query_arg(
+					array(
+						'interim-login' => 1,
+						'wp_lang'       => get_user_locale(),
+					),
+					'wp-login.php'
+				),
+				'login'
+			),
+		)
+	);
 }

 /**
@@ -145,7 +165,7 @@
 	$screen = get_current_screen();

 	// Bail if not on Dashboard or a TML page
-	if ( 'dashboard' != $screen->id && 'theme-my-login' != $screen->parent_base ) {
+	if ( 'dashboard' !== $screen->id && 'theme-my-login' !== $screen->parent_base ) {
 		return;
 	}

@@ -154,13 +174,14 @@
 		return;
 	}

-	$is_pre_7 = ( $previous_version = tml_get_previous_version() ) && version_compare( $previous_version, '7.0', '<' );
+	$previous_version = tml_get_previous_version();
+	$is_pre_7         = $previous_version && version_compare( $previous_version, '7.0', '<' );

-	if ( 'theme-my-login-extensions' == $plugin_page && $is_pre_7 ) {
+	if ( 'theme-my-login-extensions' === $plugin_page && $is_pre_7 ) {
 		?>

 		<div class="notice notice-info">
-			<p><?php _e( 'As a token of our gratitude, we would like to offer your an incentive for upgrading Theme My Login to version 7.0. For a limited time, we are offering a <strong>20% discount</strong> when you use the code <strong>SAVINGFACE</strong> at checkout. Act now - this offer won't last!', 'theme-my-login' ); ?></p>
+			<p><?php echo wp_kses_post( __( 'As a token of our gratitude, we would like to offer your an incentive for upgrading Theme My Login to version 7.0. For a limited time, we are offering a <strong>20% discount</strong> when you use the code <strong>SAVINGFACE</strong> at checkout. Act now - this offer won't last!', 'theme-my-login' ) ); ?></p>
 		</div>

 		<?php
@@ -172,23 +193,34 @@

 		$notice_key = 'new_extension-' . $extension->info->slug;

-		if ( ! in_array( $notice_key, get_site_option( '_tml_dismissed_notices', array() ) ) ) : ?>
+		if ( ! in_array( $notice_key, get_site_option( '_tml_dismissed_notices', array() ), true ) ) :
+			?>

-		<div class="notice notice-info tml-notice is-dismissible" data-notice="<?php echo $notice_key; ?>" data-nonce="<?php echo wp_create_nonce( $notice_key ); ?>">
-			<?php echo implode( "n", array(
-				'<p>' . __( 'A new <strong>Theme My Login</strong> extension is available!', 'theme-my-login' ) . '</p>',
-				'<p>' . sprintf( '<strong>%s</strong>: %s',
-					$extension->info->title,
-					$extension->info->excerpt
-				) . '</p>',
-				'<p>' . sprintf( '<a class="button button-primary" href="%s">%s</a>',
-					$extension->info->link,
-					__( 'Get This Extension', 'theme-my-login' )
-				) . '</p>',
-			) ); ?>
+		<div class="notice notice-info tml-notice is-dismissible" data-notice="<?php echo esc_attr( $notice_key ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( $notice_key ) ); ?>">
+			<?php
+			echo wp_kses_post(
+				implode(
+					"n",
+					array(
+						'<p>' . __( 'A new <strong>Theme My Login</strong> extension is available!', 'theme-my-login' ) . '</p>',
+						'<p>' . sprintf(
+							'<strong>%s</strong>: %s',
+							esc_html( $extension->info->title ),
+							esc_html( $extension->info->excerpt )
+						) . '</p>',
+						'<p>' . sprintf(
+							'<a class="button button-primary" href="%s">%s</a>',
+							esc_url( $extension->info->link ),
+							__( 'Get This Extension', 'theme-my-login' )
+						) . '</p>',
+					)
+				)
+			);
+			?>
 		</div>

-		<?php endif;
+			<?php
+		endif;
 	}
 }

@@ -204,7 +236,7 @@
 	if ( ! current_user_can( 'activate_plugins' ) ) {
 		wp_send_json_error( null, 403 );
 	}
-	$dismissed_notices = get_site_option( '_tml_dismissed_notices', array() );
+	$dismissed_notices   = get_site_option( '_tml_dismissed_notices', array() );
 	$dismissed_notices[] = sanitize_key( $_POST['notice'] );
 	update_site_option( '_tml_dismissed_notices', $dismissed_notices );
 	wp_send_json_success();
@@ -237,11 +269,11 @@

 	// Set the first time install date
 	if ( ! get_site_option( '_tml_installed_at' ) ) {
-		update_site_option( '_tml_installed_at', current_time( 'timestamp' ) );
+		update_site_option( '_tml_installed_at', time() );
 	}

 	// Set the update date
-	update_site_option( '_tml_updated_at', current_time( 'timestamp' ) );
+	update_site_option( '_tml_updated_at', time() );

 	// Store the previous version
 	if ( ! empty( $version ) ) {
@@ -277,7 +309,8 @@
  * @since 7.0
  */
 function tml_admin_add_nav_menu_meta_box() {
-	add_meta_box( 'tml_actions',
+	add_meta_box(
+		'tml_actions',
 		__( 'Theme My Login Actions', 'theme-my-login' ),
 		'tml_admin_nav_menu_meta_box',
 		'nav-menus',
@@ -294,24 +327,34 @@
 function tml_admin_nav_menu_meta_box() {
 	global $_nav_menu_placeholder, $nav_menu_selected_id;

+	// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- mirrors WP core's own placeholder-ID counter pattern in wp-admin/includes/nav-menu.php.
 	$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;

-	$actions = wp_list_filter( tml_get_actions(), array(
-		'show_in_nav_menus' => true
-	) );
+	$actions = wp_list_filter(
+		tml_get_actions(),
+		array(
+			'show_in_nav_menus' => true,
+		)
+	);
 	?>

 	<div id="tml-action" class="posttypediv">
 		<div class="tabs-panel tabs-panel-active">
 			<ul class="categorychecklist form-no-clear">
-				<?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $actions ), 0, (object) array(
-					'walker' => new Walker_Nav_Menu_Checklist(),
-				) ); ?>
+				<?php
+				echo walk_nav_menu_tree(
+					array_map( 'wp_setup_nav_menu_item', $actions ),
+					0,
+					(object) array(
+						'walker' => new Walker_Nav_Menu_Checklist(),
+					)
+				);
+				?>
 			</ul>
 		</div>
 		<p class="button-controls wp-clearfix">
 			<span class="add-to-menu">
-				<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-tml-action-menu-item" id="submit-tml-action" />
+				<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Add to Menu" string (see wp-admin/includes/nav-menu.php), not a TML-specific string. */ ?>" name="add-tml-action-menu-item" id="submit-tml-action" />
 				<span class="spinner"></span>
 			</span>
 		</p>
@@ -328,7 +371,7 @@
  * @param string $walker The name of the walker class.
  * @return string The name of the walker class.
  */
-function tml_admin_filter_edit_nav_menu_walker( $walker )  {
+function tml_admin_filter_edit_nav_menu_walker( $walker ) {
 	$walker = 'Theme_My_Login_Walker_Nav_Menu_Edit';
 	if ( ! class_exists( $walker ) ) {
 		require_once THEME_MY_LOGIN_PATH . 'admin/class-theme-my-login-walker-nav-menu-edit.php';
@@ -347,13 +390,15 @@
  * @param string $context The plugin context.
  * @return array The plugin action links.
  */
-function tml_admin_filter_plugin_action_links( $actions, $file, $data, $context ) {
-	if ( 'theme-my-login/theme-my-login.php' == $file ) {
-		$actions['settings'] = sprintf( '<a href="%1$s">%2$s</a>',
+function tml_admin_filter_plugin_action_links( $actions, $file, $data, $context ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed -- $data/$context are unused but required by the plugin_action_links_{$file} filter signature.
+	if ( 'theme-my-login/theme-my-login.php' === $file ) {
+		$actions['settings']   = sprintf(
+			'<a href="%1$s">%2$s</a>',
 			admin_url( 'admin.php?page=theme-my-login' ),
-			__( 'Settings' )
+			__( 'Settings' ) // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Settings" string, not a TML-specific string.
 		);
-		$actions['extensions'] = sprintf( '<a href="%1$s">%2$s</a>',
+		$actions['extensions'] = sprintf(
+			'<a href="%1$s">%2$s</a>',
 			admin_url( 'admin.php?page=theme-my-login-extensions' ),
 			__( 'Extensions', 'theme-my-login' )
 		);
--- a/theme-my-login/admin/hooks.php
+++ b/theme-my-login/admin/hooks.php
@@ -15,21 +15,21 @@
 add_action( 'admin_enqueue_scripts', 'tml_admin_enqueue_style_and_scripts' );

 // Notices
-add_action( 'admin_notices',              'tml_admin_notices'             );
+add_action( 'admin_notices', 'tml_admin_notices' );
 add_action( 'wp_ajax_tml-dismiss-notice', 'tml_admin_ajax_dismiss_notice' );

 // Extensions
-add_action( 'admin_init', 'tml_admin_handle_extension_licenses'     );
-add_action( 'admin_init', 'tml_admin_check_extension_licenses'      );
+add_action( 'admin_init', 'tml_admin_handle_extension_licenses' );
+add_action( 'admin_init', 'tml_admin_check_extension_licenses' );
 add_action( 'admin_init', 'tml_admin_add_extension_update_messages' );

 // Settings
 if ( is_multisite() ) {
-	add_action( 'network_admin_menu',                'tml_admin_add_menu_items'    );
-	add_action( 'admin_init',                        'tml_admin_register_settings' );
-	add_action( 'network_admin_edit_theme-my-login', 'tml_admin_save_ms_settings'  );
+	add_action( 'network_admin_menu', 'tml_admin_add_menu_items' );
+	add_action( 'admin_init', 'tml_admin_register_settings' );
+	add_action( 'network_admin_edit_theme-my-login', 'tml_admin_save_ms_settings' );
 } else {
-	add_action( 'admin_menu', 'tml_admin_add_menu_items'    );
+	add_action( 'admin_menu', 'tml_admin_add_menu_items' );
 	add_action( 'admin_init', 'tml_admin_register_settings' );
 }
 add_action( 'current_screen', 'tml_admin_add_settings_help_tabs' );
@@ -41,7 +41,7 @@
 add_action( 'admin_head-nav-menus.php', 'tml_admin_add_nav_menu_meta_box', 10 );

 // AJAX
-add_action( 'wp_ajax_tml-activate-extension-license',   'tml_admin_ajax_activate_extension_license' );
+add_action( 'wp_ajax_tml-activate-extension-license', 'tml_admin_ajax_activate_extension_license' );
 add_action( 'wp_ajax_tml-deactivate-extension-license', 'tml_admin_ajax_deactivate_extension_license' );

 /**
--- a/theme-my-login/admin/settings.php
+++ b/theme-my-login/admin/settings.php
@@ -93,28 +93,31 @@
 	 *
 	 * @param array $sections The settings sections.
 	 */
-	return (array) apply_filters( 'tml_admin_get_settings_sections', array(
-		'tml_settings_general' => array(
-			'title'    => __( 'General', 'theme-my-login' ),
-			'callback' => '__return_null',
-			'page'     => 'theme-my-login',
-		),
-		'tml_settings_login' => array(
-			'title'    => __( 'Log In' ),
-			'callback' => '__return_null',
-			'page'     => 'theme-my-login',
-		),
-		'tml_settings_registration' => array(
-			'title'    => __( 'Registration', 'theme-my-login' ),
-			'callback' => '__return_null',
-			'page'     => 'theme-my-login',
-		),
-		'tml_settings_slugs' => array(
-			'title'    => __( 'Slugs', 'theme-my-login' ),
-			'callback' => 'tml_admin_setting_callback_slugs_section',
-			'page'     => 'theme-my-login',
-		),
-	) );
+	return (array) apply_filters(
+		'tml_admin_get_settings_sections',
+		array(
+			'tml_settings_general'      => array(
+				'title'    => __( 'General', 'theme-my-login' ),
+				'callback' => '__return_null',
+				'page'     => 'theme-my-login',
+			),
+			'tml_settings_login'        => array(
+				'title'    => __( 'Log In' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Log In" string, not a TML-specific string.
+				'callback' => '__return_null',
+				'page'     => 'theme-my-login',
+			),
+			'tml_settings_registration' => array(
+				'title'    => __( 'Registration', 'theme-my-login' ),
+				'callback' => '__return_null',
+				'page'     => 'theme-my-login',
+			),
+			'tml_settings_slugs'        => array(
+				'title'    => __( 'Slugs', 'theme-my-login' ),
+				'callback' => 'tml_admin_setting_callback_slugs_section',
+				'page'     => 'theme-my-login',
+			),
+		)
+	);
 }

 /**
@@ -134,7 +137,7 @@
 			'title'             => __( 'AJAX', 'theme-my-login' ),
 			'callback'          => 'tml_admin_setting_callback_checkbox_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for' => 'tml_ajax',
 				'label'     => __( 'Enable AJAX requests', 'theme-my-login' ),
 				'value'     => '1',
@@ -150,13 +153,13 @@
 			'title'             => __( 'Login Type', 'theme-my-login' ),
 			'callback'          => 'tml_admin_setting_callback_radio_group_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for' => 'tml_login_type',
 				'legend'    => __( 'Login Type', 'theme-my-login' ),
 				'options'   => array(
-					'default'  => __( 'Default',       'theme-my-login' ),
+					'default'  => __( 'Default', 'theme-my-login' ),
 					'username' => __( 'Username only', 'theme-my-login' ),
-					'email'    => __( 'Email only',    'theme-my-login' ),
+					'email'    => __( 'Email only', 'theme-my-login' ),
 				),
 				'checked'   => get_site_option( 'tml_login_type', 'default' ),
 			),
@@ -170,22 +173,22 @@
 			'title'             => __( 'Registration Type', 'theme-my-login' ),
 			'callback'          => 'tml_admin_setting_callback_radio_group_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for' => 'tml_registration_type',
 				'legend'    => __( 'Registration Type', 'theme-my-login' ),
 				'options'   => array(
-					'default'  => __( 'Default',    'theme-my-login' ),
-					'email'    => __( 'Email only', 'theme-my-login' ),
+					'default' => __( 'Default', 'theme-my-login' ),
+					'email'   => __( 'Email only', 'theme-my-login' ),
 				),
 				'checked'   => get_site_option( 'tml_registration_type', 'default' ),
 			),
 		),
 		// User passwords
-		'tml_user_passwords' => array(
+		'tml_user_passwords'    => array(
 			'title'             => __( 'Passwords', 'theme-my-login' ),
 			'callback'          => 'tml_admin_setting_callback_checkbox_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for' => 'tml_user_passwords',
 				'label'     => __( 'Allow users to set their own password', 'theme-my-login' ),
 				'value'     => '1',
@@ -193,11 +196,11 @@
 			),
 		),
 		// Auto-login
-		'tml_auto_login' => array(
+		'tml_auto_login'        => array(
 			'title'             => __( 'Auto-Login', 'theme-my-login' ),
 			'callback'          => 'tml_admin_setting_callback_checkbox_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for' => 'tml_auto_login',
 				'label'     => __( 'Automatically log in users after registration', 'theme-my-login' ),
 				'value'     => '1',
@@ -219,12 +222,12 @@
 			'title'             => $action->get_title(),
 			'callback'          => 'tml_admin_setting_callback_input_field',
 			'sanitize_callback' => 'sanitize_text_field',
-			'args' => array(
+			'args'              => array(
 				'label_for'   => $slug_option,
 				'value'       => get_site_option( $slug_option, $action->get_slug() ),
 				'attributes'  => array(
-					'checked' => true,
-					'class' => 'regular-text code',
+					'checked'  => true,
+					'class'    => 'regular-text code',
 					'required' => true,
 				),
 				'description' => sprintf( '<a href="%1$s">%1$s</a>', $action->get_url() ),
@@ -248,11 +251,11 @@
  * @since 7.0.5
  */
 function tml_admin_setting_callback_slugs_section() {
-?>
+	?>

 <p><?php esc_html_e( 'The slugs defined here will be used to generate the URL to the corresponding action. You can see this URL below the slug field. If you would like to use pages for these actions, simply make sure the slug for the action below matches the slug of the page you would like to use for that action.', 'theme-my-login' ); ?></p>

-<?php
+	<?php
 }

 /**
@@ -272,43 +275,64 @@
  * }
  */
 function tml_admin_setting_callback_input_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'label_for'   => '',
-		'value'       => '',
-		'description' => '',
-		'attributes'  => array(),
-		'input_type'  => 'text',
-		'input_class' => 'regular-text',
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'label_for'   => '',
+			'value'       => '',
+			'description' => '',
+			'attributes'  => array(),
+			'input_type'  => 'text',
+			'input_class' => 'regular-text',
+		)
+	);

 	$attributes = is_array( $args['attributes'] ) ? array_filter( $args['attributes'] ) : array();

-	isset( $args['label_for'] ) && $attributes['name'] = $args['label_for'];
-	isset( $args['label_for'] ) && $attributes['id'] = $args['label_for'];
-	isset( $args['value'] ) && $attributes['value'] = $args['value'];
-	isset( $args['input_type'] ) && empty( $attributes['type'] ) && $attributes['type'] = $args['input_type'];
-	isset( $args['input_class'] ) && empty( $attributes['class'] ) && $attributes['class'] = $args['input_class'];
-
-	$attributes = array_map( function ( $key ) use ( $attributes ) {
-		return is_bool( $attributes[ $key ] ) ? $key : "{$key}='{$attributes[ $key ]}'";
-	}, array_keys( $attributes ) );
-
-	usort( $attributes, function ( $a, $b ) {
-		$x = strpos( $a, '=' ) === false;
-		$y = strpos( $b, '=' ) === false;
-		if ( $x && !$y ) return 1;
-		if ( $y && !$x ) return -1;
-		return strcmp( $a, $b );
-	} );
-?>
+	if ( isset( $args['label_for'] ) ) {
+		$attributes['name'] = $args['label_for'];
+		$attributes['id']   = $args['label_for'];
+	}
+	if ( isset( $args['value'] ) ) {
+		$attributes['value'] = $args['value'];
+	}
+	if ( isset( $args['input_type'] ) && empty( $attributes['type'] ) ) {
+		$attributes['type'] = $args['input_type'];
+	}
+	if ( isset( $args['input_class'] ) && empty( $attributes['class'] ) ) {
+		$attributes['class'] = $args['input_class'];
+	}

-	<input <?php echo implode( ' ', $attributes ); ?>/>
+	$attributes = array_map(
+		function ( $key ) use ( $attributes ) {
+			return is_bool( $attributes[ $key ] ) ? esc_attr( $key ) : sprintf( "%s='%s'", esc_attr( $key ), esc_attr( $attributes[ $key ] ) );
+		},
+		array_keys( $attributes )
+	);
+
+	usort(
+		$attributes,
+		function ( $a, $b ) {
+			$x = strpos( $a, '=' ) === false;
+			$y = strpos( $b, '=' ) === false;
+			if ( $x && ! $y ) {
+				return 1;
+			}
+			if ( $y && ! $x ) {
+				return -1;
+			}
+			return strcmp( $a, $b );
+		}
+	);
+	?>
+
+	<input <?php echo implode( ' ', $attributes ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each attribute string is already built via esc_attr() above. */ ?>/>

 	<?php if ( ! empty( $args['description'] ) ) : ?>
-		<p class="description"><?php echo $args['description']; ?></p>
+		<p class="description"><?php echo wp_kses_post( $args['description'] ); ?></p>
 	<?php endif; ?>

-<?php
+	<?php
 }

 /**
@@ -327,22 +351,25 @@
  * }
  */
 function tml_admin_setting_callback_checkbox_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'label_for'   => '',
-		'label'       => '',
-		'value'       => '1',
-		'checked'     => '',
-		'description' => '',
-	) );
-?>
+	$args = wp_parse_args(
+		$args,
+		array(
+			'label_for'   => '',
+			'label'       => '',
+			'value'       => '1',
+			'checked'     => '',
+			'description' => '',
+		)
+	);
+	?>

-	<input type="checkbox" name="<?php echo esc_attr( $args['label_for'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" value="<?php echo $args['value']; ?>" <?php checked( ! empty( $args['checked'] ) ); ?> /> <label for="<?php echo esc_attr( $args['label_for'] ); ?>"><?php echo esc_html( $args['label'] ); ?></label>
+	<input type="checkbox" name="<?php echo esc_attr( $args['label_for'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" value="<?php echo esc_attr( $args['value'] ); ?>" <?php checked( ! empty( $args['checked'] ) ); ?> /> <label for="<?php echo esc_attr( $args['label_for'] ); ?>"><?php echo esc_html( $args['label'] ); ?></label>

 	<?php if ( ! empty( $args['description'] ) ) : ?>
-		<p class="description"><?php echo $args['description']; ?></p>
+		<p class="description"><?php echo wp_kses_post( $args['description'] ); ?></p>
 	<?php endif; ?>

-<?php
+	<?php
 }

 /**
@@ -359,11 +386,14 @@
  * }
  */
 function tml_admin_setting_callback_checkbox_group_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'legend'      => '',
-		'options'     => array(),
-		'description' => '',
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'legend'      => '',
+			'options'     => array(),
+			'description' => '',
+		)
+	);

 	$options = array();
 	foreach ( (array) $args['options'] as $option_name => $option ) {
@@ -375,18 +405,18 @@
 			esc_html( $option['label'] )
 		);
 	}
-?>
+	?>

 	<fieldset>
 		<legend class="screen-reader-text"><span><?php echo esc_html( $args['legend'] ); ?></span></legend>
-		<?php echo implode( "<br />n", $options ); ?>
+		<?php echo implode( "<br />n", $options ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each $options entry is already built via esc_attr()/esc_html() above. */ ?>
 	</fieldset>

 	<?php if ( ! empty( $args['description'] ) ) : ?>
-		<p class="description"><?php echo $args['description']; ?></p>
+		<p class="description"><?php echo wp_kses_post( $args['description'] ); ?></p>
 	<?php endif; ?>

-<?php
+	<?php
 }

 /**
@@ -404,12 +434,15 @@
  * }
  */
 function tml_admin_setting_callback_dropdown_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'label_for'   => '',
-		'options'     => array(),
-		'selected'    => '',
-		'description' => '',
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'label_for'   => '',
+			'options'     => array(),
+			'selected'    => '',
+			'description' => '',
+		)
+	);

 	$options = array();
 	foreach ( (array) $args['options'] as $value => $label ) {
@@ -420,17 +453,17 @@
 			esc_html( $label )
 		);
 	}
-?>
+	?>

 	<select name="<?php echo esc_attr( $args['label_for'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>">
-		<?php echo implode( "<br />n", $options ); ?>
+		<?php echo implode( "<br />n", $options ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each $options entry is already built via esc_attr()/esc_html() above. */ ?>
 	</select>

 	<?php if ( ! empty( $args['description'] ) ) : ?>
-		<p class="description"><?php echo $args['description']; ?></p>
+		<p class="description"><?php echo wp_kses_post( $args['description'] ); ?></p>
 	<?php endif; ?>

-<?php
+	<?php
 }

 /**
@@ -449,13 +482,16 @@
  * }
  */
 function tml_admin_setting_callback_radio_group_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'label_for'   => '',
-		'legend'      => '',
-		'options'     => array(),
-		'checked'     => '',
-		'description' => '',
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'label_for'   => '',
+			'legend'      => '',
+			'options'     => array(),
+			'checked'     => '',
+			'description' => '',
+		)
+	);

 	$options = array();
 	foreach ( (array) $args['options'] as $value => $label ) {
@@ -467,18 +503,18 @@
 			esc_html( $label )
 		);
 	}
-?>
+	?>

 	<fieldset>
 		<legend class="screen-reader-text"><span><?php echo esc_html( $args['legend'] ); ?></span></legend>
-		<?php echo implode( "<br />n", $options ); ?>
+		<?php echo implode( "<br />n", $options ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each $options entry is already built via esc_attr()/esc_html() above. */ ?>
 	</fieldset>

 	<?php if ( ! empty( $args['description'] ) ) : ?>
-		<p class="description"><?php echo $args['description']; ?></p>
+		<p class="description"><?php echo wp_kses_post( $args['description'] ); ?></p>
 	<?php endif; ?>

-<?php
+	<?php
 }

 /**
@@ -494,22 +530,26 @@
  * }
  */
 function tml_admin_setting_callback_license_key_field( $args ) {
-	$args = wp_parse_args( $args, array(
-		'label_for' => '',
-		'extension' => '',
-	) );
+	$args = wp_parse_args(
+		$args,
+		array(
+			'label_for' => '',
+			'extension' => '',
+		)
+	);

-	if ( ! $extension = tml_get_extension( $args['extension'] ) ) {
+	$extension = tml_get_extension( $args['extension'] );
+	if ( ! $extension ) {
 		return;
 	}

 	$license = $extension->get_license_key();
 	$status  = $extension->get_license_status();

-	if ( 'valid' == $status ) {
+	if ( 'valid' === $status ) {
 		$class = 'tml-license-valid';
 		$text  = __( 'Active', 'theme-my-login' );
-	} elseif ( 'invalid' == $status ) {
+	} elseif ( 'invalid' === $status ) {
 		$class = 'tml-license-invalid';
 		$text  = __( 'Invalid', 'theme-my-login' );
 	} else {
@@ -522,7 +562,7 @@
 		esc_attr( $args['label_for'] ),
 		esc_attr( $license ),
 		esc_attr( $class ),
-		'valid' == $status ? 'readonly="readonly"' : ''
+		'valid' === $status ? 'readonly="readonly"' : ''
 	) . "n";

 	submit_button(
@@ -533,7 +573,7 @@
 		array(
 			'data-action'    => 'deactivate',
 			'data-extension' => $extension->get_name(),
-			'style'          => ( empty( $license ) || 'valid' != $status ) ? 'display: none;' : '',
+			'style'          => ( empty( $license ) || 'valid' !== $status ) ? 'display: none;' : '',
 		)
 	);

@@ -545,7 +585,7 @@
 		array(
 			'data-action'    => 'activate',
 			'data-extension' => $extension->get_name(),
-			'style'          => ( empty( $license ) || 'valid' == $status ) ? 'display: none;' : '',
+			'style'          => ( empty( $license ) || 'valid' === $status ) ? 'display: none;' : '',
 		)
 	);

@@ -567,21 +607,24 @@
 function tml_admin_settings_page() {
 	global $title, $plugin_page;

-	if ( 'theme-my-login' == $plugin_page ) {
+	if ( 'theme-my-login' === $plugin_page ) {
 		tml_flush_rewrite_rules();
 	}

 	settings_errors();
-?>
+	?>

 <div class="wrap">
-	<h1><?php echo esc_html( $title ) ?></h1>
+	<h1><?php echo esc_html( $title ); ?></h1>
 	<hr class="wp-header-end">

-	<form id="tml-settings" action="<?php echo is_network_admin()
+	<form id="tml-settings" action="
+	<?php
+	echo is_network_admin()
 		? 'edit.php?action=theme-my-login'
 		: 'options.php';
-	?>" method="post">
+	?>
+	" method="post">

 		<?php settings_fields( $plugin_page ); ?>

@@ -591,7 +634,7 @@
 	</form>
 </div>

-<?php
+	<?php
 }

 /**
@@ -605,10 +648,10 @@
 		return;
 	}

-	$action      = isset( $_REQUEST['action']      ) ? $_REQUEST['action']      : '';
-	$option_page = isset( $_REQUEST['option_page'] ) ? $_REQUEST['option_page'] : '';
+	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- the nonce action name below is derived from $option_page itself, so it must be read before check_admin_referer() can run; verified two lines down.
+	$option_page = ! empty( $_REQUEST['option_page'] ) ? $_REQUEST['option_page'] : '';

-	if ( ! theme_my_login_admin()->has_page( $option_page ) ) {
+	if ( empty( $option_page ) || ! theme_my_login_admin()->has_page( $option_page ) ) {
 		return;
 	}

@@ -623,7 +666,8 @@
 	if ( ! isset( $allowed_options[ $option_page ] ) ) {
 		wp_die(
 			sprintf(
-				__( '<strong>Error:</strong> The %s options page is not in the allowed options list.' ),
+				/* translators: %s: The options page name. */
+				__( '<strong>Error:</strong> The %s options page is not in the allowed options list.' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain, WordPress.Security.EscapeOutput.OutputNotEscaped -- reusing WP core's translated error string verbatim (see wp-admin/options.php); the dynamic value is already esc_html()'d below.
 				'<code>' . esc_html( $option_page ) . '</code>'
 			)
 		);
@@ -639,18 +683,22 @@
 			}
 			$value = wp_unslash( $value );
 		}
+
+		// update_site_option() skips sanitize_option(), unlike update_option() — apply it explicitly.
+		$value = sanitize_option( $option, $value );
+
 		update_site_option( $option, $value );
 	}

 	tml_flush_rewrite_rules();

 	if ( ! count( get_settings_errors() ) ) {
-		add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
+		add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' ); // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Settings saved." string, not a TML-specific string.
 	}
 	set_transient( 'settings_errors', get_settings_errors(), 30 );

 	$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );
-	wp_redirect( $goback );
+	wp_safe_redirect( $goback );
 	exit;
 }

@@ -664,23 +712,27 @@
 function tml_admin_add_settings_help_tabs( $screen ) {
 	global $plugin_page;

-	$help_tabs = $sidebar_links = array();
+	$help_tabs     = array();
+	$sidebar_links = array();

-	if ( ! theme_my_login_admin()->has_page( $plugin_page ) ) {
+	if ( empty( $plugin_page ) || ! theme_my_login_admin()->has_page( $plugin_page ) ) {
 		return;
 	}

 	// Core page
-	if ( 'theme-my-login' == $plugin_page ) {
+	if ( 'theme-my-login' === $plugin_page ) {
 		$help_tabs['overview'] = array(
 			'id'      => 'theme-my-login-overview',
-			'title'   => __( 'Overview' ),
-			'content' => '<p>' . implode( '</p><p>', array(
-				__( 'Welcome to Theme My Login!', 'theme-my-login' ),
-				__( 'Below, you can configure how you would like users to register and log in to your site.', 'theme-my-login' ),
-				__( 'Additionally, you can change the slugs that are used to generate the URLs that represent specific actions.', 'theme-my-login' ),
-				__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ),
-			) ) . '</p>',
+			'title'   => __( 'Overview' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Overview" string, not a TML-specific string.
+			'content' => '<p>' . implode(
+				'</p><p>',
+				array(
+					__( 'Welcome to Theme My Login!', 'theme-my-login' ),
+					__( 'Below, you can configure how you would like users to register and log in to your site.', 'theme-my-login' ),
+					__( 'Additionally, you can change the slugs that are used to generate the URLs that represent specific actions.', 'theme-my-login' ),
+					__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string (see wp-admin/options-general.php), not a TML-specific string.
+				)
+			) . '</p>',
 		);

 		$sidebar_links['documentation'] = array(
@@ -693,74 +745,91 @@
 			'url'   => 'https://wordpress.org/support/plugin/theme-my-login',
 		);

-	// Licenses page
-	} elseif ( 'theme-my-login-licenses' == $plugin_page ) {
+		// Licenses page
+	} elseif ( 'theme-my-login-licenses' === $plugin_page ) {
 		$help_tabs['overview'] = array(
 			'id'      => 'theme-my-login-licenses-overview',
-			'title'   => __( 'Overview' ),
-			'content' => '<p>' . implode( '</p><p>', array(
-				__( 'When you purchase extensions for Theme My Login, you will enter your license keys on this page.', 'theme-my-login' ),
-				__( 'After you enter your license keys and click the Save Changes button at the bottom of the screen, you will see a new button next to each field with a license in it.', 'theme-my-login' ),
-				__( 'If you have not yet activated your license, this button will say "Activate". Click this button to activate your license.', 'theme-my-login' ),
-				__( 'If you have already activated your license, this button will say "Deactivate". Click this button to deactivate your license.', 'theme-my-login' ),
-			) ) . '</p>',
+			'title'   => __( 'Overview' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Overview" string, not a TML-specific string.
+			'content' => '<p>' . implode(
+				'</p><p>',
+				array(
+					__( 'When you purchase extensions for Theme My Login, you will enter your license keys on this page.', 'theme-my-login' ),
+					__( 'After you enter your license keys and click the Save Changes button at the bottom of the screen, you will see a new button next to each field with a license in it.', 'theme-my-login' ),
+					__( 'If you have not yet activated your license, this button will say "Activate". Click this button to activate your license.', 'theme-my-login' ),
+					__( 'If you have already activated your license, this button will say "Deactivate". Click this button to deactivate your license.', 'theme-my-login' ),
+				)
+			) . '</p>',
 		);

 		$sidebar_links['documentation'] = array(
 			'title' => __( 'View Documentation', 'theme-my-login' ),
 			'url'   => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension',
 		);
-		$sidebar_links['support'] = array(
+		$sidebar_links['support']       = array(
 			'title' => __( 'Get Support', 'theme-my-login' ),
 			'url'   => 'https://thememylogin.com/support',
 		);

-	// Extensions page
-	} elseif ( 'theme-my-login-extensions' == $plugin_page ) {
+		// Extensions page
+	} elseif ( 'theme-my-login-extensions' === $plugin_page ) {
 		$help_tabs['overview'] = array(
 			'id'      => 'theme-my-login-extensions-overview',
-			'title'   => __( 'Overview' ),
-			'content' => '<p>' . implode( '</p><p>', array(
-				__( 'This page shows you all of the extensions available to purchase for Theme My Login.', 'theme-my-login' ),
-				__( 'Once you purchase an extension, you download it from your email receipt or your account page on our website. Then, you install it just like a normal WordPress plugin.', 'theme-my-login' ),
-			) ) . '</p>',
+			'title'   => __( 'Overview' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Overview" string, not a TML-specific string.
+			'content' => '<p>' . implode(
+				'</p><p>',
+				array(
+					__( 'This page shows you all of the extensions available to purchase for Theme My Login.', 'theme-my-login' ),
+					__( 'Once you purchase an extension, you download it from your email receipt or your account page on our website. Then, you install it just like a normal WordPress plugin.', 'theme-my-login' ),
+				)
+			) . '</p>',
 		);

 		$sidebar_links['documentation'] = array(
 			'title' => __( 'View Documentation', 'theme-my-login' ),
 			'url'   => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension',
 		);
-		$sidebar_links['store'] = array(
+		$sidebar_links['store']         = array(
 			'title' => __( 'Go to the Extensions Store', 'theme-my-login' ),
 			'url'   => 'https://thememylogin.com/extensions',
 		);
-		$sidebar_links['account'] = array(
+		$sidebar_links['account']       = array(
 			'title' => __( 'View your Theme My Login account', 'theme-my-login' ),
 			'url'   => 'https://thememylogin.com/your-account',
 		);

-	// Extension page
-	} elseif ( $extension = tml_get_extension( $plugin_page ) ) {
+		// Extension page
+	} else {
+		$extension = tml_get_extension( $plugin_page );
+	}
+
+	if ( ! empty( $extension ) ) {
 		$help_tabs['overview'] = array(
 			'id'      => $plugin_page . '-overview',
-			'title'   => __( 'Overview' ),
-			'content' => '<p>' . implode( '</p><p>', array(
-				sprintf(
-					__( 'On this page, you can configure the settings for the Theme My Login %s extension.', 'theme-my-login' ),
-					$extension->get_title()
-				),
-				__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ),
-			) ) . '</p>',
+			'title'   => __( 'Overview' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "Overview" string, not a TML-specific string.
+			'content' => '<p>' . implode(
+				'</p><p>',
+				array(
+					sprintf(
+						/* translators: %s: The extension title. */
+						__( 'On this page, you can configure the settings for the Theme My Login %s extension.', 'theme-my-login' ),
+						$extension->get_title()
+					),
+					// phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated string (see wp-admin/options-general.php), not a TML-specific string.
+					__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ),
+				)
+			) . '</p>',
 		);

-		if ( $documentation_url = $extension->get_documentation_url() ) {
+		$documentation_url = $extension->get_documentation_url();
+		if ( $documentation_url ) {
 			$sidebar_links['documentation'] = array(
 				'title' => __( 'View Documentation', 'theme-my-login' ),
 				'url'   => $documentation_url,
 			);
 		}

-		if ( $support_url = $extension->get_support_url() ) {
+		$support_url = $extension->get_support_url();
+		if ( $support_url ) {
 			$sidebar_links['support'] = array(
 				'title' => __( 'Get Support', 'theme-my-login' ),
 				'url'   => $support_url,
@@ -785,9 +854,10 @@

 	// Add the sidebar links
 	if ( ! empty( $sidebar_links ) ) {
-		$sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
+		$sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</strong></p>'; // phpcs:ignore WordPress.WP.I18n.MissingArgDomain -- reusing WP core's translated "For more information:" string, not a TML-specific string.
 		foreach ( $sidebar_links as $sidebar_link ) {
-			$sidebar_content .= sprintf( '<p><a href="%s">%s</a></p>',
+			$sidebar_content .= sprintf(
+				'<p><a href="%s">%s</a></p>',
 				$sidebar_link['url'],
 				$sidebar_link['title']
 			);
--- a/theme-my-login/includes/actions.php
+++ b/theme-my-login/includes/actions.php
@@ -14,77 +14,102 @@
  */
 function tml_register_default_actions() {

+	// phpcs:disable WordPress.WP.I18n.MissingArgDomain -- these action titles/labels intentionally reuse WP core's translated wp-login.php strings verbatim, not TML-specific strings.
+
 	// Dashboard
-	tml_register_action( 'dashboard', array(
-		'title'              => __( 'Dashboard' ),
-		'slug'               => 'dashboard',
-		'callback'           => 'tml_dashboard_handler',
-		'show_on_forms'      => false,
-		'show_nav_menu_item' => is_user_logged_in(),
-	) );
+	tml_register_action(
+		'dashboard',
+		array(
+			'title'              => __( 'Dashboard' ),
+			'slug'               => 'dashboard',
+			'callback'           => 'tml_dashboard_handler',
+			'show_on_forms'      => false,
+			'show_nav_menu_item' => is_user_logged_in(),
+		)
+	);

 	// Login
-	tml_register_action( 'login', array(
-		'title'              => isset( $_GET['checkemail'] ) ? __( 'Check your email' ) : __( 'Log In' ),
-		'slug'               => 'login',
-		'callback'           => 'tml_login_handler',
-		'ajax_callback'      => 'tml_login_handler',
-		'show_on_forms'      => __( 'Log in' ),
-		'show_nav_menu_item' => ! is_user_logged_in(),
-	) );
+	tml_register_action(
+		'login',
+		array(
+			'title'              => isset( $_GET['checkemail'] ) ? __( 'Check your email' ) : __( 'Log In' ), // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only: just picks a display title, not processed/acted on.
+			'slug'               => 'login',
+			'callback'           => 'tml_login_handler',
+			'ajax_callback'      => 'tml_login_handler',
+			'show_on_forms'      => __( 'Log in' ),
+			'show_nav_menu_item' => ! is_user_logged_in(),
+		)
+	);

 	// Logout
-	tml_register_action( 'logout', array(
-		'title'              => __( 'Log Out' ),
-		'slug'               => 'logout',
-		'callback'           => 'tml_logout_handler',
-		'show_on_forms'      => false,
-		'show_in_widget'     => false,
-		'show_nav_menu_item' => is_user_logged_in(),
-	) );
+	tml_register_action(
+		'logout',
+		array(
+			'title'              => __( 'Log Out' ),
+			'slug'               => 'logout',
+			'callback'           => 'tml_logout_handler',
+			'show_on_forms'      => false,
+			'show_in_widget'     => false,
+			'show_nav_menu_item' => is_user_logged_in(),
+		)
+	);

 	// Register
-	tml_register_action( 'register', array(
-		'title'              => __( 'Register' ),
-		'slug'               => 'register',
-		'callback'           => 'tml_registration_handler',
-		'ajax_callback'      => 'tml_registration_handler',
-		'show_on_forms'      => (bool) get_option( 'users_can_register' ),
-		'show_nav_menu_item' => ! is_user_logged_in(),
-	) );
+	tml_register_action(
+		'register',
+		array(
+			'title'              => __( 'Register' ),
+			'slug'               => 'register',
+			'callback'           => 'tml_registration_handler',
+			'ajax_callback'      => 'tml_registration_handler',
+			'show_on_forms'      => (bool) get_option( 'users_can_register' ),
+			'show_nav_menu_item' => ! is_user_logged_in(),
+		)
+	);

 	// Lost Password
-	tml_register_action( 'lostpassword', array(
-		'title'             => __( 'Lost Password' ),
-		'slug'              => 'lostpassword',
-		'callback'          => 'tml_lost_password_handler',
-		'ajax_callback'     => 'tml_lost_password_handler',
-		'network'           => true,
-		'show_on_forms'     => __( 'Lost your password?' ),
-		'show_in_nav_menus' => false,
-	) );
+	tml_register_action(
+		'lostpassword',
+		array(
+			'title'             => __( 'Lost Password' ),
+			'slug'              => 'lostpassword',
+			'callback'          => 'tml_lost_password_handler',
+			'ajax_callback'     => 'tml_lost_password_handler',
+			'network'           => true,
+			'show_on_forms'     => __( 'Lost your password?' ),
+			'show_in_nav_menus' => false,
+		)
+	);

 	// Reset Password
-	tml_register_action( 'resetpass', array(
-		'title'             => __( 'Reset Password' ),
-		'slug'              => 'resetpass',
-		'callback'          => 'tml_password_reset_handler',
-		'network'           => true,
-		'show_on_forms'     => false,
-		'show_in_widget'    => false,
-		'show_in_nav_menus' => false,
-	) );
+	tml_register_action(
+		'resetpass',
+		array(
+			'title'             => __( 'Reset Password' ),
+			'slug'              => 'resetpass',
+			'callback'          => 'tml_password_reset_handler',
+			'network'           => true,
+			'show_on_forms'     => false,
+			'show_in_widget'    => false,
+			'show_in_nav_menus' => false,
+		)
+	);
+
+	// phpcs:enable WordPress.WP.I18n.MissingArgDomain

 	// Confirm Action (Data Requests)
-	tml_register_action( 'confirmaction', array(
-		'title'                 => __( 'Your Data Request', 'theme-my-login' ),
-		'slug'                  => 'confirmaction',
-		'callback'              => 'tml_confirmaction_handler',
-		'show_on_forms'         => false,
-		'show_in_widget'        => false,
-		'show_in_nav_menus'     => false,
-		'show_in_slug_settings' => false,
-	) );
+	tml_register_action(
+		'confirmaction',
+		array(
+			'title'                 => __( 'Your Data Request', 'theme-my-login' ),
+			'slug'                  => 'confirmaction',
+			'callback'              => 'tml_confirmaction_handler',
+			'show_on_forms'         => false,
+			'show_in_widget'        => false,
+			'show_in_nav_menus'     => false,
+			'show_in_slug_settings' => false,
+		)
+	);
 }

 /**
@@ -104,7 +129,8 @@
 		$action = new Theme_My_Login_Action( $action, $args );
 	}

-	if ( $slug = get_site_option( 'tml_' . $action->get_name() . '_slug' ) ) {
+	$slug = get_site_option( 'tml_' . $action->get_name() . '_slug' );
+	if ( $slug ) {
 		$action->set_slug( $slug );
 	}

@@ -194,7 +220,7 @@
 	if ( $current_action && array_key_exists( $current_action->get_name(), tml_get_actions() ) ) {
 		if ( empty( $action ) ) {
 			$is_action = true;
-		} elseif ( $action == $current_action->get_name() ) {
+		} elseif ( $action === $current_action->get_name() ) {
 			$is_action = true;
 		}
 	}
@@ -219,7 +245,8 @@
  * @return string The action title.
  */
 function tml_get_action_title( $action = '' ) {
-	if ( ! $action = tml_get_action( $action ) ) {
+	$action = tml_get_action( $action );
+	if ( ! $action ) {
 		return;
 	}
 	return $action->get_title();
@@ -234,7 +261,8 @@
  * @return string The action slug.
  */
 function tml_get_action_slug( $action = '' ) {
-	if ( ! $action = tml_get_action( $action ) ) {
+	$action = tml_get_action( $action );
+	if ( ! $action ) {
 		return;
 	}
 	return $action->get_slug();
@@ -251,7 +279,8 @@
  * @return string The action URL.
  */
 function tml_get_action_url( $action = '', $scheme = 'login', $network = null ) {
-	if ( ! $action = tml_get_action( $action ) ) {
+	$action = tml_get_action( $action );
+	if ( ! $action ) {
 		return;
 	}
 	return $action->get_url( $scheme, $network );
@@ -267,23 +296,27 @@
  */
 function tml_action_has_page( $action = '' ) {

-	if ( ! $action = tml_get_action( $action ) ) {
+	$action = tml_get_action( $action );
+	if ( ! $action ) {
 		return false;
 	}

-	$pages = wp_cache_get( 'tml_pages' );
+	$pages = wp_cache_get( 'pages', 'theme-my-login' );
 	if ( false === $pages ) {
-		$pages = get_posts( [
-			'post_name__in'          => array_map( 'tml_get_action_slug', tml_get_actions() ),
-			'post_type'              => 'page',
-			'nopaging'               => true,
-			'update_post_meta_cache' => false,
-			'update_post_term_cache' => false,
-		] );
-		wp_cache_set( 'tml_pages', $pages );
+		$pages = get_posts(
+			array(
+				'post_name__in'          => array_map( 'tml_get_action_slug', tml_get_actions() ),
+				'post_type'              => 'page',
+				'nopaging'               => true,
+				'update_post_meta_cache' => false,
+				'update_post_term_cache' => false,
+			)
+		);
+		wp_cache_set( 'pages', $pages, 'theme-my-login' );
 	}

-	if ( $pages = wp_list_filter( $pages, [ 'post_name' => $action->get_slug() ] ) ) {
+	$pages = wp_list_filter( $pages, array( 'post_name' => $action->get_slug() ) );
+	if ( $pages ) {
 		return reset( $pages );
 	}

@@ -302,7 +335,7 @@

 	// Redirect to https login if forced to use SSL
 	if ( force_ssl_admin() && ! is_ssl() ) {
-		if ( 0 === strpos($_SERVER['R

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-66681
# Blocks CSRF attacks targeting Theme My Login AJAX license activation/deactivation
# endpoints. Matches requests to admin-ajax.php with the specific action parameter
# and a missing or empty _wpnonce parameter.

SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
    "id:20261994,phase:2,deny,status:403,chain,msg:'CVE-2026-66681 Theme My Login CSRF via AJAX license action',severity:'CRITICAL',tag:'CVE-2026-66681'"
    SecRule ARGS_POST:action "@rx ^(tml-activate-extension-license|tml-deactivate-extension-license)$" "chain"
        SecRule ARGS_POST:_wpnonce "@rx ^$" ""

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.