Skip to content

Commit

Permalink
Updating Playground-ready from main (#98)
Browse files Browse the repository at this point in the history
* Prevent Recursion on certain Host name patterns (#69)

---------

Signed-off-by: Namith Jawahar <[email protected]>

* Playground ready updating into main (#71)

* Update blueprint.json

Switching to default theme of 2022 to support minimum WP Playground support for WordPress version as 5.9.9

Signed-off-by: Namith Jawahar <[email protected]>

* Switching blueprint.json to 2022 theme

Signed-off-by: Alex Sirota <[email protected]>

---------

Signed-off-by: Alex Sirota <[email protected]>
Signed-off-by: Namith Jawahar <[email protected]>

* `Add New Plugin`: Remove 'Featured' and 'Favorites' tabs when API rewrite is enabled. (#80)

* Add class for overriding plugins screens.

* Remove unused tabs when API rewrite is enabled.

* `Add New Theme`: Remove 'Favorites' filter tab when API rewrite is enabled. (#82)

* Add class for overriding themes screens.

* Hide unsupported filters.

* Redirect unsupported filters to `theme-install.php`.

---------

Signed-off-by: Alex Sirota <[email protected]>
Co-authored-by: Alex Sirota <[email protected]>

* Add PHPUnit. (#87)

* Add PHPUnit scaffolding.

* Add Composer files for dependencies and test script.

* Add `.gitignore`.

* Add sample test for `Admin_Settings::get_setting()`.

* Add PHP 8.3 to the test matrix.

* Add `.cache/*` to `.gitignore`.

* Limit testing to PHP 7.4 (minimum) and 8.3 (latest).

* `Plugins Screens`: Initialize in `Controller::__construct()`. (#89)

* `Workflows`: Fix PHP version and add more workflow triggers. (#92)

* Fix PHP version.

* Add `push` and `workflow_dispatch` workflow triggers.

* `Tests`: Ensure options are not set when tests run. (#95)

* Introduce a test constant.

* Don't initialize when the tests are running.

* Use a new object for testing `Admin_Settings::get_setting()`.

* Warning when debug-aspire-update.log doesnt exist (#109)

* `Tests`: Add default coverage settings. (#97)

* Improve I18N Issues Based on version 0.5 (#104)

* Fixes Settings not getting saved when rewrites were turned off (#108)

* Add French Translation (#105)

* I18n fr fr (#113)

* Translations loading fix112 (#114)

* Add French translations. 

* load any available translations with code in the plugin

* #110 (#116)

Fixes #110

* Add nonce verification and sanitize `$_REQUEST/$_GET` values. (#115)

Signed-off-by: Colin Stewart <[email protected]>

* Added German Translation (#111)

* added German translation

* added gitignore for .DS_Store


Signed-off-by: Harikrishnan R <[email protected]>

* Voltron has landed. (#117)

The Voltron has landed. See if you can find where.

* `Admin Settings`: Delete all settings when the plugin is uninstalled. (#118)

* `Admin Settings`: Add multisite-safe deletion of all settings.

* Delete all settings when the plugin is uninstalled.

* add multisite support (#102)

* accidentally deleted (#124)

Fixed typo in code deleted when addressing #102

* Add `.editorconfig`. (#123)

* create zip with each new tagged release (#121)

* create zip with each new tagged release

* update .gitattributes

---------

Signed-off-by: Namith Jawahar <[email protected]>
Signed-off-by: Alex Sirota <[email protected]>
Signed-off-by: Colin Stewart <[email protected]>
Signed-off-by: Harikrishnan R <[email protected]>
Co-authored-by: Namith Jawahar <[email protected]>
Co-authored-by: Colin Stewart <[email protected]>
Co-authored-by: Alex Lion <[email protected]>
Co-authored-by: Sébastien SERRE <[email protected]>
Co-authored-by: Harikrishnan R <[email protected]>
Co-authored-by: Andy Fragen <[email protected]>
  • Loading branch information
7 people authored Nov 5, 2024
1 parent 594ef76 commit ccd03ce
Show file tree
Hide file tree
Showing 28 changed files with 3,109 additions and 135 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.txt]
end_of_line = crlf
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* text=auto

.gitattributes export-ignore
.gitignore export-ignore
.editorconfig export-ignore
composer.lock export-ignore
phpunit.xml export-ignore
phpunit.xml.dist export-ignore
phpcs.xml export-ignore
phpcs.xml.dist export-ignore
.phpcs.xml export-ignore
/.github export-ignore
/bin export-ignore
/tests export-ignore
41 changes: 41 additions & 0 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run PHPUnit Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
phpunit:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.3']
services:
database:
image: mysql:latest
env:
MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
steps:
- name: Check out source code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpunit-polyfills:1.1

- name: Setup tests
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true

- name: Run tests
run: phpunit
43 changes: 43 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
tags:
- "**"

name: Upload Release Asset

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build project
run: git archive -o /tmp/AspireUpdate-${{ steps.tag.outputs.tag }}.zip --prefix=AspireUpdate/ ${{ steps.tag.outputs.tag }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/AspireUpdate-${{ steps.tag.outputs.tag }}.zip
asset_name: AspireUpdate-${{ steps.tag.outputs.tag }}.zip
asset_content_type: application/zip
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# gitignore files for Aspire Update

# Files and folders related to build and test tools.
.phpunit.result.cache
/phpunit.xml
/vendor
.cache/*
/tests/cache
/tests/coverage
.DS_Store
26 changes: 25 additions & 1 deletion aspire-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: AspireUpdate
* Domain Path: /languages
* Network: true
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand All @@ -30,6 +31,29 @@
define( 'AP_VERSION', '0.5' );
}


add_action( 'plugins_loaded', 'define_constant' );
function define_constant() {
if ( ! defined( 'AP_PATH' ) ) {
define( 'AP_PATH', dirname( plugin_basename( __FILE__ ) ) );
}
}

require_once __DIR__ . '/includes/autoload.php';

new AspireUpdate\Controller();
add_action( 'plugins_loaded', 'aspire_update' );
function aspire_update() {
if ( ! defined( 'AP_RUN_TESTS' ) ) {
new AspireUpdate\Controller();
}
}

register_activation_hook( __FILE__, 'aspire_update_activation_hook' );
function aspire_update_activation_hook() {
register_uninstall_hook( __FILE__, 'aspire_update_uninstall_hook' );
}

function aspire_update_uninstall_hook() {
$admin_settings = AspireUpdate\Admin_Settings::get_instance();
$admin_settings->delete_all_settings();
}
33 changes: 28 additions & 5 deletions assets/css/aspire-update.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
width: 30px;
height: 30px;
background: url(../images/icon-key.svg) no-repeat center center / 24px 24px;
background-color: #CBCBCB;
background-color: #cbcbcb;
border: 1px solid #8c8f94;
border-radius: 3px;
clip-path: inset(0 0 0 0);
Expand All @@ -31,10 +31,33 @@
}

#aspireupdate-generate-api-key:hover {
background-color: #E3E3E3;
background-color: #e3e3e3;
}

.aspireupdate-settings-field-wrapper p.error {
color: #BC3B3B;
.aspireupdate-settings-field-wrapper p.error {
color: #bc3b3b;
display: none;
}
}

#voltron {
color: transparent;
font-size: 8px;
line-height: 6px;
display: inline-block;
cursor: default;
}

#voltron:hover {
animation: blink 1.8s ease-in-out infinite;
animation-delay: 5s;
}

@keyframes blink {
0%,
100% {
color: inherit;
}
50% {
color: transparent;
}
}
Loading

0 comments on commit ccd03ce

Please sign in to comment.