Skip to content

Commit

Permalink
Merge branch 'main' into #62
Browse files Browse the repository at this point in the history
  • Loading branch information
namithj committed Nov 9, 2024
2 parents 631572d + b5e2eb2 commit a354c7f
Show file tree
Hide file tree
Showing 23 changed files with 743 additions and 119 deletions.
Binary file added .DS_Store
Binary file not shown.
148 changes: 148 additions & 0 deletions .github/ISSUE_TEMPLATE/BugReport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Bug Report
description: File a bug report.
title: "[Bug]: "
labels: ["bug", "needs triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! You can use the Site Health option in your website to collect a lot of the data requested below.
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. [email protected]
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you are seeing or experiencing.
value: "A bug was witnessed!"

validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: What version of AspireUpdate are you running?
options:
- 0.5 (Default)
- 1.0
- Nightly
default: 0
validations:
required: true

- type: dropdown
id: os
attributes:
label: 'OS'
description: 'The operating system you are running on (Linux, Windows, Mac, etc).'
options:
- Windows
- MacOS
- iOS
- Android
- Linux
- Other


- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
- Other

- type: input
id: wordpress
attributes:
label: 'WordPress'
description: 'The version of WordPress that your site uses.'

- type: input
id: php
attributes:
label: 'PHP'
description: 'The version of PHP your site runs on.'

- type: input
id: server
attributes:
label: 'Server'
description: 'The server your site runs on (apache, nginx, etc).'

- type: input
id: database
attributes:
label: 'Database'
description: 'The database engine used by your site.'

- type: input
id: theme
attributes:
label: 'Theme'
description: 'The currently active theme.'

- type: input
id: must_use_plugins
attributes:
label: 'Must-Use Plugins'
description: 'A list of Must-Use Plugins.'

- type: input
id: plugins
attributes:
label: 'Plugins'
description: 'A list of active plugins.'



- type: textarea
id: sitehealth
attributes:
label: WordPress Site Health Output (optional)
description: Please copy and paste a SiteHealth report with details of your WordPress configuration. This will be automatically formatted into code, so no need for backticks.
render: shell


- type: textarea
id: logs
attributes:
label: Relevant debug log output
description: Please copy and paste any relevant debug log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
attributes:
label: Screenshots/Live demo link
description: Add some screenshots to help explain the problem.
validations:
required: false

- type: textarea
id: additional_notes
attributes:
label: 'Additional Notes'
description: 'Any additional details worth mentioning.'

- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow the AspirePress [Code of Conduct](https://github.com/aspirepress/AspireUpdate?tab=coc-ov-file).

options:
- label: I agree to follow the Code of Conduct.
required: true

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/FeatureRequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature Request
description: Suggest an idea for this project.
labels: ['enhancement', 'needs triage']
body:
- type: checkboxes
attributes:
label: 'I have checked the following:'
options:
- label: I've searched existing issues and found nothing related to my issue.
required: true
- type: markdown
attributes:
value: |
Suggest an idea for this project.
- type: textarea
attributes:
label: Describe the feature you want to add
description: A clear and concise description of the feature you want to be added.
validations:
required: true
- type: textarea
attributes:
label: Mockups or Images of the feature
description: Add some images to support your feature.
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discussions & Support
url: https://aspirepress.org/slack/
about: You can ask general questions or give feedback on the AspirePress community.
5 changes: 3 additions & 2 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ on:

jobs:
phpunit:
name: Run tests
name: Run tests (PHP ${{ matrix.php-version }}, ${{ matrix.multisite && 'Multisite' || 'Single Site' }})
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.3']
multisite: [ true, false ]
services:
database:
image: mysql:latest
Expand All @@ -38,4 +39,4 @@ jobs:
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true

- name: Run tests
run: phpunit
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/multisite.xml' || '' }}
44 changes: 44 additions & 0 deletions .github/workflows/playground-blueprint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update Blueprint Blueprint with Repository and Branch

on:
push:
branches:
- main
- playground-ready
tags:
- "**"

jobs:
update-blueprint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set Branch or Tag Name
id: branch-name
run: |
if [ "${{ github.ref_type }}" == "branch" ]; then
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV
elif [ "${{ github.ref_type }}" == "tag" ]; then
echo "CURRENT_REF=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Update Blueprint JSON
run: |
jq --tab '.plugins[0] |= "https://github-proxy.com/proxy/?repo='$GITHUB_REPOSITORY'&branch='$CURRENT_REF'"' assets/playground/blueprint.json > assets/playground/blueprint.json.tmp
mv assets/playground/blueprint.json.tmp assets/playground/blueprint.json
- name: Commit and Push Changes
run: |
if git diff --cached --quiet; then
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add assets/playground/blueprint.json
git commit -m "Update blueprint.json for branch/tag ${{ env.name }}"
git push
fi
env:
name: ${{ env.name }}

3 changes: 2 additions & 1 deletion aspire-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
* Text Domain: AspireUpdate
* Domain Path: /languages
* Network: true
* GitHub Plugin URI: https://github.com/aspirepress/AspireUpdate
* Primary Branch: main
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/playground/blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"blogname": "AspireUpdate Demo Site"
},
"plugins": [
"https://github-proxy.com/proxy/?repo=AspirePress/AspireUpdate&branch=playground-ready",
"https://github-proxy.com/proxy/?repo=namithj/AspireUpdate&branch=main",
"error-log-viewer",
"plugin-check"
],
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"scripts": {
"format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source",
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary, source",
"test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit" ]
"test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit" ],
"test:multisite": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit -c tests/multisite.xml" ]
}


Expand Down
35 changes: 27 additions & 8 deletions includes/class-branding.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Branding {
public function __construct() {
$admin_settings = Admin_Settings::get_instance();
if ( $admin_settings->get_setting( 'enable', false ) ) {
add_action( 'admin_notices', [ $this, 'output_admin_notice' ] );
$admin_notices_hook = is_multisite() ? 'network_admin_notices' : 'admin_notices';
add_action( $admin_notices_hook, [ $this, 'output_admin_notice' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
}
}
Expand Down Expand Up @@ -53,14 +54,15 @@ public function admin_enqueue_scripts( $hook ) {
}

$allowed_screens = [
'update-core.php',
'plugins.php',
'plugin-install.php',
'themes.php',
'theme-install.php',
'update-core',
'plugins',
'plugin-install',
'themes',
'theme-install',
];

if ( in_array( $hook, $allowed_screens, true ) ) {
$screen = \WP_Screen::get( $hook );
if ( in_array( $screen->id, $allowed_screens, true ) ) {
wp_enqueue_style( 'aspire_update_settings_css', plugin_dir_url( __DIR__ ) . 'assets/css/aspire-update.css', [], AP_VERSION );
}
}
Expand All @@ -81,9 +83,15 @@ public function output_admin_notice() {
}

$message = '';
switch ( $current_screen->base ) {
switch ( $current_screen->id ) {
case 'plugins':
case 'plugin-install':
if ( is_multisite() ) {
break;
}
// Fall-through.
case 'plugins-network':
case 'plugin-install-network':
$message = sprintf(
/* translators: 1: The name of the plugin, 2: The documentation URL. */
__( 'Your plugin updates are now powered by <strong>%1$s</strong>. <a href="%2$s">Learn more</a>', 'AspireUpdate' ),
Expand All @@ -93,6 +101,12 @@ public function output_admin_notice() {
break;
case 'themes':
case 'theme-install':
if ( is_multisite() ) {
break;
}
// Fall-through.
case 'themes-network':
case 'theme-install-network':
$message = sprintf(
/* translators: 1: The name of the plugin, 2: The documentation URL. */
__( 'Your theme updates are now powered by <strong>%1$s</strong>. <a href="%2$s">Learn more</a>', 'AspireUpdate' ),
Expand All @@ -101,6 +115,11 @@ public function output_admin_notice() {
);
break;
case 'update-core':
if ( is_multisite() ) {
break;
}
// Fall-through.
case 'update-core-network':
$message = sprintf(
/* translators: 1: The name of the plugin, 2: The documentation URL. */
__( 'Your WordPress, plugin, theme and translation updates are now powered by <strong>%1$s</strong>. <a href="%2$s">Learn more</a>', 'AspireUpdate' ),
Expand Down
Loading

0 comments on commit a354c7f

Please sign in to comment.