From c0da6e057a33b8682740b30d2c972de5b6f312f7 Mon Sep 17 00:00:00 2001 From: namithj <48271037+namithj@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:26:25 +0530 Subject: [PATCH] #122 1) Hide Voltron on Mobile 2) Newly installed coding standards fixed several CS issues. --- assets/css/aspire-update.css | 79 ++++++++++++++++--------------- includes/class-admin-settings.php | 6 --- includes/class-controller.php | 3 -- tests/bootstrap.php | 1 - 4 files changed, 42 insertions(+), 47 deletions(-) diff --git a/assets/css/aspire-update.css b/assets/css/aspire-update.css index c8d1825..4ea0861 100644 --- a/assets/css/aspire-update.css +++ b/assets/css/aspire-update.css @@ -1,64 +1,69 @@ - @keyframes glow { - 0% { - background-color: rgba(255, 223, 0, 0.1); - } + 0% { + background-color: rgba(255, 223, 0, 0.1); + } - 100% { - background-color: none; - } + 100% { + background-color: none; + } } .glow-reveal { - animation: glow 0.5s ease-in-out; + animation: glow 0.5s ease-in-out; } .aspireupdate-settings-field-hosts-wrapper .aspireupdate-settings-field-hosts-row { - margin: 0 0 10px; + margin: 0 0 10px; } #aspireupdate-generate-api-key { - display: inline-block; - width: 30px; - height: 30px; - background: url(../images/icon-key.svg) no-repeat center center / 24px 24px; - background-color: #cbcbcb; - border: 1px solid #8c8f94; - border-radius: 3px; - clip-path: inset(0 0 0 0); - color: transparent; - cursor: pointer; - transition: background-color 0.3s ease; + display: inline-block; + width: 30px; + height: 30px; + background: url(../images/icon-key.svg) no-repeat center center / 24px 24px; + background-color: #cbcbcb; + border: 1px solid #8c8f94; + border-radius: 3px; + clip-path: inset(0 0 0 0); + color: transparent; + cursor: pointer; + transition: background-color 0.3s ease; } #aspireupdate-generate-api-key:hover { - background-color: #e3e3e3; + background-color: #e3e3e3; } .aspireupdate-settings-field-wrapper p.error { - color: #bc3b3b; - display: none; + color: #bc3b3b; + display: none; } #voltron { - color: transparent; - font-size: 8px; - line-height: 6px; - display: inline-block; - cursor: default; + color: transparent; + font-size: clamp(4px, 0.9vw, 8px); + line-height: 6px; + display: inline-block; + cursor: default; } #voltron:hover { - animation: blink 1.8s ease-in-out infinite; - animation-delay: 5s; + animation: blink 1.8s ease-in-out infinite; + animation-delay: 5s; } @keyframes blink { - 0%, - 100% { - color: inherit; - } - 50% { - color: transparent; - } + 0%, + 100% { + color: inherit; + } + 50% { + color: transparent; + } +} + +@media only screen and (max-width: 576px) { + #voltron { + display: none; + } } diff --git a/includes/class-admin-settings.php b/includes/class-admin-settings.php index 1105ad9..fe29840 100644 --- a/includes/class-admin-settings.php +++ b/includes/class-admin-settings.php @@ -53,7 +53,6 @@ public function __construct() { add_action( 'admin_init', [ $this, 'update_settings' ] ); add_action( 'network_admin_edit_aspireupdate-settings', [ $this, 'update_settings' ] ); - } /** @@ -102,7 +101,6 @@ public function reset_settings() { 'reset-success-nonce' => wp_create_nonce( 'aspireupdate-reset-success-nonce' ), ], - network_admin_url( 'index.php?page=aspireupdate-settings' ) ) ); @@ -245,9 +243,7 @@ public function update_settings() { update_site_option( $this->option_name, $this->sanitize_settings( wp_unslash( $_POST['aspireupdate_settings'] ) ) ); wp_safe_redirect( - add_query_arg( [ network_admin_url( 'index.php?page=aspireupdate-settings' ) ] ) - ); exit; } @@ -291,7 +287,6 @@ public function admin_enqueue_scripts( $hook ) { wp_localize_script( 'aspire_update_settings_js', 'aspireupdate', - [ 'ajax_url' => network_admin_url( 'admin-ajax.php' ), @@ -313,7 +308,6 @@ public function the_settings_page() { 'reset-nonce' => wp_create_nonce( 'aspireupdate-reset-nonce' ), ], - network_admin_url( 'index.php?page=aspireupdate-settings' ) ); ?> diff --git a/includes/class-controller.php b/includes/class-controller.php index 6099736..32110e1 100644 --- a/includes/class-controller.php +++ b/includes/class-controller.php @@ -20,9 +20,7 @@ public function __construct() { Themes_Screens::get_instance(); $this->api_rewrite(); - add_action( 'init', [ $this, 'load_textdomain' ] ); - } /** @@ -57,5 +55,4 @@ private function api_rewrite() { public function load_textdomain() { \load_plugin_textdomain( 'AspireUpdate', false, AP_PATH . '/languages/' ); } - } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b851569..c44d4d8 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -33,7 +33,6 @@ function _manually_load_plugin() { require dirname( __DIR__ ) . '/aspire-update.php'; - } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );