Skip to content

Commit

Permalink
Merge branch 'playground-ready' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Sirota <[email protected]>
  • Loading branch information
asirota authored Nov 5, 2024
2 parents c8238ba + ccd03ce commit 072fcd1
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/css/aspire-update.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@keyframes glow {
0% {
background-color: rgba(255, 223, 0, 0.1);
Expand Down
2 changes: 2 additions & 0 deletions assets/js/aspire-update.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

jQuery(document).ready(function () {
new ApiRewrites();
new ApiDebug();
Expand Down Expand Up @@ -237,3 +238,4 @@ class Fields {
});
}
}

2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"php": ">=7.4.0"
},
"require-dev": {

"squizlabs/php_codesniffer": "3.10.3",
"wp-coding-standards/wpcs": "~3.1.0",
"yoast/phpunit-polyfills": "^1.1.0"
Expand All @@ -28,4 +29,5 @@
"test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit" ]
}


}
8 changes: 8 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions includes/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Admin_Settings {
* The Constructor.
*/
public function __construct() {

add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', [ $this, 'register_admin_menu' ] );
add_action( 'admin_init', [ $this, 'reset_settings' ] );
add_action( 'admin_init', [ $this, 'register_settings' ] );
Expand All @@ -52,6 +53,7 @@ public function __construct() {

add_action( 'admin_init', [ $this, 'update_settings' ] );
add_action( 'network_admin_edit_aspireupdate-settings', [ $this, 'update_settings' ] );

}

Check failure on line 57 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Function closing brace must go on the next line following the body; found 1 blank lines before brace

/**
Expand Down Expand Up @@ -98,7 +100,9 @@ public function reset_settings() {
[
'reset-success' => 'success',
'reset-success-nonce' => wp_create_nonce( 'aspireupdate-reset-success-nonce' ),

],

Check failure on line 105 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Empty lines are not allowed in multi-line function calls
network_admin_url( 'index.php?page=aspireupdate-settings' )
)
);
Expand Down Expand Up @@ -241,7 +245,9 @@ 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' ) ] )

Check failure on line 249 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

The first argument in a multi-line function call must be on the line after the opening parenthesis

Check failure on line 250 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Empty lines are not allowed in multi-line function calls
);
exit;
}
Expand Down Expand Up @@ -275,15 +281,19 @@ public function register_admin_menu() {
* @return void
*/
public function admin_enqueue_scripts( $hook ) {

if ( ! in_array( $hook, [ 'dashboard_page_aspireupdate-settings', 'index_page_aspireupdate-settings' ], true ) ) {

return;
}
wp_enqueue_style( 'aspire_update_settings_css', plugin_dir_url( __DIR__ ) . 'assets/css/aspire-update.css', [], AP_VERSION );
wp_enqueue_script( 'aspire_update_settings_js', plugin_dir_url( __DIR__ ) . 'assets/js/aspire-update.js', [ 'jquery' ], AP_VERSION, true );
wp_localize_script(
'aspire_update_settings_js',
'aspireupdate',

Check failure on line 294 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Empty lines are not allowed in multi-line function calls
[

'ajax_url' => network_admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'aspireupdate-ajax' ),
'domain' => Utilities::get_top_level_domain(),
Expand All @@ -301,7 +311,9 @@ public function the_settings_page() {
[
'reset' => 'reset',
'reset-nonce' => wp_create_nonce( 'aspireupdate-reset-nonce' ),

],

Check failure on line 316 in includes/class-admin-settings.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Empty lines are not allowed in multi-line function calls
network_admin_url( 'index.php?page=aspireupdate-settings' )
);
?>
Expand Down
3 changes: 3 additions & 0 deletions includes/class-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public function __construct() {
Themes_Screens::get_instance();
$this->api_rewrite();

Check failure on line 22 in includes/class-controller.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Functions must not contain multiple empty lines in a row; found 2 empty lines

add_action( 'init', [ $this, 'load_textdomain' ] );

}

Check failure on line 26 in includes/class-controller.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Function closing brace must go on the next line following the body; found 1 blank lines before brace

/**
Expand Down Expand Up @@ -55,4 +57,5 @@ private function api_rewrite() {
public function load_textdomain() {
\load_plugin_textdomain( 'AspireUpdate', false, AP_PATH . '/languages/' );
}

}

Check failure on line 61 in includes/class-controller.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

The closing brace for the class must go on the next line after the body
2 changes: 2 additions & 0 deletions languages/AspireUpdate-de_DE.I10n.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
return ['project-id-version'=>'AspireUpdate','report-msgid-bugs-to'=>'','pot-creation-date'=>'2024-11-04 00:29+0000','po-revision-date'=>'2024-11-04 00:29+0000','last-translator'=>'','language-team'=>'German (Germany)','language'=>'de_DE','plural-forms'=>'nplurals=2; plural=n != 1;','mime-version'=>'1.0','content-type'=>'text/plain; charset=UTF-8','content-transfer-encoding'=>'8bit','x-generator'=>'Loco https://localise.biz/','x-loco-version'=>'2.6.11; wp-6.6.2','x-domain'=>'AspireUpdate','messages'=>[

'API Configuration'=>'API-Konfiguration',
'API Debug Configuration'=>'API-Debug-Konfiguration',
'API Host'=>'API-Host',
Expand All @@ -22,4 +23,5 @@
'String'=>'Zeichenkette',
'Update plugins and themes for WordPress.'=>'Aktualisiert Plugins und Themes für WordPress.',
'Your new API Host.'=>'Ihr neuer API-Host'

]];
2 changes: 2 additions & 0 deletions languages/AspireUpdate-zh_TW.l10n.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<?php

return ['domain'=>NULL,'plural-forms'=>NULL,'language'=>'zh_TW','project-id-version'=>'AspireUpdate','pot-creation-date'=>'2024-11-02 12:34-0700','po-revision-date'=>'2024-11-02 12:40-0700','x-generator'=>'Poedit 3.5','messages'=>['Settings have been reset to default.'=>'設定已重設為預設值。','AspireUpdate Settings'=>'AspireUpdate 設定','Save Changes'=>'儲存設定','Reset'=>'重設','API Configuration'=>'API 組態','Enable AspireUpdate API Rewrites'=>'啟用 AspireUpdate API 重寫','API Host'=>'API 主機','Your new API Host.'=>'設定新的 API 主機。','Other'=>'其他主機','API Key'=>'API 金鑰','Provides an API key for repositories that may require authentication.'=>'為需要驗證的存放庫提供 API 金鑰。','API Debug Configuration'=>'API 偵錯組態','Enable Debug Mode'=>'啟用偵錯模式','Enables debug mode for the plugin.'=>'為外掛啟用偵錯模式。','Enable Debug Type'=>'啟用偵錯類型','Request'=>'要求','Response'=>'回應','String'=>'字串','Outputs the request URL and headers / response headers and body / string that is being rewritten.'=>'輸出經過重寫的要求網址、標頭、回應標頭、內容及字串。','Disable SSL Verification'=>'停用 SSL 驗證','Disables the verification of SSL to allow local testing.'=>'停用 SSL 驗證,便能在本機環境進行測試。','Generate API Key'=>'產生 API 金鑰','AspireUpdate'=>'AspireUpdate','https://aspirepress.org/'=>'https://aspirepress.org/','Update plugins and themes for WordPress.'=>'更新 WordPress 的外掛及佈景主題。','AspirePress'=>'AspirePress','https://docs.aspirepress.org/aspireupdate/'=>'https://docs.aspirepress.org/aspireupdate/']];

2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {

require dirname( __DIR__ ) . '/aspire-update.php';

}

Check failure on line 37 in tests/bootstrap.php

View workflow job for this annotation

GitHub Actions / Run coding standards checks

Function closing brace must go on the next line following the body; found 1 blank lines before brace

tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Expand Down

0 comments on commit 072fcd1

Please sign in to comment.