Fix remaining code quality issues

- Fixed method names to use snake_case as required by WordPress coding standards
- Added proper spacing in filter_input function call
- Added periods at the end of inline comments
- Fixed parameter documentation in Plugin class
- Updated CSS media query to use context notation
This commit is contained in:
2025-04-21 15:18:11 +01:00
parent 67c6c65611
commit cdc73bc010
3 changed files with 9 additions and 9 deletions

View File

@@ -124,7 +124,7 @@
}
/* Responsive Styles */
@media screen and (max-width: 782px) {
@media screen and (width <= 782px) {
.wpst-form-table th {
width: 100%;
display: block;

View File

@@ -28,14 +28,14 @@ class Admin {
*/
public function __construct( Core $core ) {
$this->core = $core;
$this->initializeHooks();
$this->initialize_hooks();
}
/**
* Initializes WordPress hooks.
*/
private function initializeHooks(): void {
\add_action( 'admin_enqueue_scripts', array( $this, 'enqueueAdminAssets' ) );
private function initialize_hooks(): void {
\add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
}
/**
@@ -48,11 +48,11 @@ class Admin {
*
* @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
*/
public function enqueueAdminAssets(): void {
public function enqueue_admin_assets(): void {
// @phpcs:disable WordPress.Security.NonceVerification.Recommended
// @phpcs:disable WordPress.Security.NonceVerification.Missing
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
if ( ! $page || 'wp_plugin_starter_template_settings' !== $page ) {
return;
}
@@ -78,7 +78,7 @@ class Admin {
true
);
// TODO: Implement localization when mocking is fixed (Issue #1)
// This will include ajax_url and nonce for security
// TODO: Implement localization when mocking is fixed (Issue #1).
// This will include ajax_url and nonce for security.
}
}

View File

@@ -45,7 +45,7 @@ class Plugin {
/**
* Constructor
*
* @param string $plugin_file Main plugin file path.
* @param string $pluginFile Main plugin file path.
* @param string $version Plugin version.
*/
public function __construct( string $pluginFile, string $version ) {