From ccd03ce1131ab650814a3841338ce5a0de4b2019 Mon Sep 17 00:00:00 2001 From: Alex Sirota Date: Tue, 5 Nov 2024 04:36:03 -0500 Subject: [PATCH] Updating Playground-ready from main (#98) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prevent Recursion on certain Host name patterns (#69) --------- Signed-off-by: Namith Jawahar <48271037+namithj@users.noreply.github.com> * 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 <48271037+namithj@users.noreply.github.com> * Switching blueprint.json to 2022 theme Signed-off-by: Alex Sirota --------- Signed-off-by: Alex Sirota Signed-off-by: Namith Jawahar <48271037+namithj@users.noreply.github.com> * `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 Co-authored-by: Alex Sirota * 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 <79332690+costdev@users.noreply.github.com> * Added German Translation (#111) * added German translation * added gitignore for .DS_Store Signed-off-by: Harikrishnan R * 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 <48271037+namithj@users.noreply.github.com> Signed-off-by: Alex Sirota Signed-off-by: Colin Stewart <79332690+costdev@users.noreply.github.com> Signed-off-by: Harikrishnan R Co-authored-by: Namith Jawahar <48271037+namithj@users.noreply.github.com> Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> Co-authored-by: Alex Lion Co-authored-by: Sébastien SERRE Co-authored-by: Harikrishnan R Co-authored-by: Andy Fragen --- .editorconfig | 21 + .gitattributes | 14 + .github/workflows/phpunit-tests.yml | 41 + .github/workflows/releases.yml | 43 + .gitignore | 10 + aspire-update.php | 26 +- assets/css/aspire-update.css | 33 +- assets/js/aspire-update.js | 195 +- bin/install-wp-tests.sh | 181 ++ composer.json | 20 + composer.lock | 1825 +++++++++++++++++ includes/class-admin-settings.php | 170 +- includes/class-controller.php | 11 + includes/class-debug.php | 22 +- includes/class-themes-screens.php | 9 +- languages/AspireUpdate-de_DE.I10n.php | 25 + languages/AspireUpdate-de_DE.mo | Bin 0 -> 2236 bytes languages/AspireUpdate-de_DE.po | 110 + languages/AspireUpdate-fr_FR.l10n.php | 2 + languages/AspireUpdate-fr_FR.mo | Bin 0 -> 2513 bytes languages/AspireUpdate-fr_FR.po | 130 ++ languages/AspireUpdate-zh_TW.l10n.php | 2 + languages/AspireUpdate-zh_TW.mo | Bin 0 -> 2659 bytes languages/AspireUpdate-zh_TW.po | 131 ++ languages/AspireUpdate.pot | 127 ++ phpunit.xml.dist | 30 + .../AdminSettings_GetSettingTest.php | 26 + tests/bootstrap.php | 40 + 28 files changed, 3109 insertions(+), 135 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/phpunit-tests.yml create mode 100644 .github/workflows/releases.yml create mode 100644 .gitignore create mode 100755 bin/install-wp-tests.sh create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 languages/AspireUpdate-de_DE.I10n.php create mode 100644 languages/AspireUpdate-de_DE.mo create mode 100644 languages/AspireUpdate-de_DE.po create mode 100644 languages/AspireUpdate-fr_FR.l10n.php create mode 100644 languages/AspireUpdate-fr_FR.mo create mode 100644 languages/AspireUpdate-fr_FR.po create mode 100644 languages/AspireUpdate-zh_TW.l10n.php create mode 100644 languages/AspireUpdate-zh_TW.mo create mode 100644 languages/AspireUpdate-zh_TW.po create mode 100644 languages/AspireUpdate.pot create mode 100644 phpunit.xml.dist create mode 100644 tests/AdminSettings/AdminSettings_GetSettingTest.php create mode 100644 tests/bootstrap.php diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d018a0d --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7eabc68 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml new file mode 100644 index 0000000..2a935a1 --- /dev/null +++ b/.github/workflows/phpunit-tests.yml @@ -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 diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000..e5e3e36 --- /dev/null +++ b/.github/workflows/releases.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..88586c1 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/aspire-update.php b/aspire-update.php index 09ac602..da28371 100644 --- a/aspire-update.php +++ b/aspire-update.php @@ -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' ) ) { @@ -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(); +} diff --git a/assets/css/aspire-update.css b/assets/css/aspire-update.css index 1738f39..89be84f 100644 --- a/assets/css/aspire-update.css +++ b/assets/css/aspire-update.css @@ -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); @@ -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; -} \ No newline at end of file +} + +#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; + } +} diff --git a/assets/js/aspire-update.js b/assets/js/aspire-update.js index b376223..fa9b96f 100644 --- a/assets/js/aspire-update.js +++ b/assets/js/aspire-update.js @@ -1,50 +1,76 @@ jQuery(document).ready(function () { - new FieldRules(); - new ApiHost(); + new ApiRewrites(); + new ApiDebug(); }); - -class ApiHost { +class ApiRewrites { constructor() { - ApiHost.host_selector.init(); - ApiHost.other_hosts.init(); - ApiHost.api_key.init(); + ApiRewrites.host_selector.init(); + ApiRewrites.other_hosts.init(); + ApiRewrites.api_key.init(); + ApiRewrites.enabled_rewrites.init(); + } + + static enabled_rewrites = { + field: jQuery('#aspireupdate-settings-field-enable'), + sub_fields: [], + init() { + ApiRewrites.enabled_rewrites.sub_fields = [ + ApiRewrites.host_selector, + ApiRewrites.api_key + ]; + + ApiRewrites.enabled_rewrites.field.change(function () { + if (jQuery(this).is(':checked')) { + ApiRewrites.enabled_rewrites.show_options(); + } else { + ApiRewrites.enabled_rewrites.hide_options(); + } + }).change(); + }, + show_options() { + Fields.show(ApiRewrites.enabled_rewrites.sub_fields); + }, + hide_options() { + Fields.hide(ApiRewrites.enabled_rewrites.sub_fields); + } } static host_selector = { field: jQuery('#aspireupdate-settings-field-api_host'), init() { - ApiHost.host_selector.field.change(function () { - let selected_option = ApiHost.host_selector.field.find(":selected"); + ApiRewrites.host_selector.field.change(function () { + let selected_option = ApiRewrites.host_selector.field.find(":selected"); if ('other' === selected_option.val()) { - ApiHost.other_hosts.show(); + ApiRewrites.other_hosts.show(); } else { - ApiHost.other_hosts.hide(); + ApiRewrites.other_hosts.hide(); } - if (ApiHost.host_selector.is_api_key_required()) { - ApiHost.api_key.make_required(); + if (ApiRewrites.host_selector.is_api_key_required()) { + ApiRewrites.api_key.make_required(); } else { - ApiHost.api_key.remove_required(); + ApiRewrites.api_key.remove_required(); } - if (ApiHost.host_selector.has_api_key_url()) { - ApiHost.api_key.show_action_button(); + if (ApiRewrites.host_selector.has_api_key_url()) { + ApiRewrites.api_key.show_action_button(); } else { - ApiHost.api_key.hide_action_button(); + ApiRewrites.api_key.hide_action_button(); } }).change(); }, is_api_key_required() { - let selected_option = ApiHost.host_selector.field.find(":selected"); + let is_api_rewrites_enabled = jQuery('#aspireupdate-settings-field-enable').is(':checked'); + let selected_option = ApiRewrites.host_selector.field.find(":selected"); let require_api_key = selected_option.attr('data-require-api-key'); - if ('true' === require_api_key) { + if (is_api_rewrites_enabled && 'true' === require_api_key) { return true; } return false; }, has_api_key_url() { - let selected_option = ApiHost.host_selector.field.find(":selected"); + let selected_option = ApiRewrites.host_selector.field.find(":selected"); let api_url = selected_option.attr('data-api-key-url'); if ('' !== api_url) { return true; @@ -52,7 +78,7 @@ class ApiHost { return false; }, get_api_key_url() { - let selected_option = ApiHost.host_selector.field.find(":selected"); + let selected_option = ApiRewrites.host_selector.field.find(":selected"); let api_url = selected_option.attr('data-api-key-url'); if ('' !== api_url) { return api_url; @@ -64,27 +90,27 @@ class ApiHost { static other_hosts = { field: jQuery('#aspireupdate-settings-field-api_host_other'), init() { - ApiHost.other_hosts.field.on("blur", function () { - let value = ApiHost.other_hosts.field.val(); - value = ApiHost.other_hosts.strip_protocol(value); - value = ApiHost.other_hosts.strip_dangerous_characters(value); - ApiHost.other_hosts.field.val(value); + ApiRewrites.other_hosts.field.on("blur", function () { + let value = ApiRewrites.other_hosts.field.val(); + value = ApiRewrites.other_hosts.strip_protocol(value); + value = ApiRewrites.other_hosts.strip_dangerous_characters(value); + ApiRewrites.other_hosts.field.val(value); }); }, show() { - ApiHost.other_hosts.field.parent().show(); - ApiHost.other_hosts.field.focus(); - ApiHost.other_hosts.make_required(); + ApiRewrites.other_hosts.field.parent().show(); + ApiRewrites.other_hosts.field.focus(); + ApiRewrites.other_hosts.make_required(); }, hide() { - ApiHost.other_hosts.field.parent().hide(); - ApiHost.other_hosts.remove_required(); + ApiRewrites.other_hosts.field.parent().hide(); + ApiRewrites.other_hosts.remove_required(); }, make_required() { - ApiHost.other_hosts.field.prop('required', true); + ApiRewrites.other_hosts.field.prop('required', true); }, remove_required() { - ApiHost.other_hosts.field.prop('required', false); + ApiRewrites.other_hosts.field.prop('required', false); }, strip_protocol(value) { const protocol_regex = /^(https?|ftp|sftp|smtp|ftps|file):\/\/|^www\./i; @@ -100,15 +126,15 @@ class ApiHost { field: jQuery('#aspireupdate-settings-field-api_key'), action_button: jQuery('#aspireupdate-generate-api-key'), init() { - ApiHost.api_key.action_button.click(function () { - ApiHost.api_key.hide_error(); - ApiHost.api_key.get_api_key(); + ApiRewrites.api_key.action_button.click(function () { + ApiRewrites.api_key.hide_error(); + ApiRewrites.api_key.get_api_key(); }); - ApiHost.api_key.hide_error(); + ApiRewrites.api_key.hide_error(); }, get_api_key() { let parameters = { - "url": ApiHost.host_selector.get_api_key_url(), + "url": ApiRewrites.host_selector.get_api_key_url(), "type": "POST", "contentType": 'application/json', "data": JSON.stringify({ @@ -117,94 +143,97 @@ class ApiHost { }; jQuery.ajax(parameters) .done(function (response) { - ApiHost.api_key.field.val(response.apikey); + ApiRewrites.api_key.field.val(response.apikey); }) .fail(function (response) { if ((response.status === 400) || (response.status === 401)) { - ApiHost.api_key.show_error(response.responseJSON?.error); + ApiRewrites.api_key.show_error(response.responseJSON?.error); } else { - ApiHost.api_key.show_error('Unexpected Error: ' + response.status); + ApiRewrites.api_key.show_error('Unexpected Error: ' + response.status); } }); }, show() { - ApiHost.api_key.field.parent().parent().parent().show(); + ApiRewrites.api_key.field.parent().parent().parent().show(); }, hide() { - ApiHost.api_key.field.parent().parent().parent().hide(); + ApiRewrites.api_key.field.parent().parent().parent().hide(); }, show_action_button() { - ApiHost.api_key.action_button.show(); + ApiRewrites.api_key.action_button.show(); }, hide_action_button() { - ApiHost.api_key.action_button.hide(); + ApiRewrites.api_key.action_button.hide(); }, make_required() { - ApiHost.api_key.field.prop('required', true); + ApiRewrites.api_key.field.prop('required', true); }, remove_required() { - ApiHost.api_key.field.prop('required', false); + ApiRewrites.api_key.field.prop('required', false); }, show_error(message) { - ApiHost.api_key.field.parent().find('.error').html(message).show(); + ApiRewrites.api_key.field.parent().find('.error').html(message).show(); }, hide_error() { - ApiHost.api_key.field.parent().find('.error').html('').hide(); + ApiRewrites.api_key.field.parent().find('.error').html('').hide(); } } } -class FieldRules { +class ApiDebug { constructor() { - FieldRules.check_enabled_rewrites.init(); - FieldRules.check_enabled_debug_mode.init(); + ApiDebug.enabled_debug.init(); } - static check_enabled_rewrites = { + static enabled_debug = { + field: jQuery('#aspireupdate-settings-field-enable_debug'), + sub_fields: [], init() { - jQuery('#aspireupdate-settings-field-enable').change(function () { - if (jQuery(this).is(':checked')) { - FieldRules.show_field('api_host'); - FieldRules.show_field('api_key'); - } else { - FieldRules.hide_field('api_host'); - FieldRules.hide_field('api_key'); - } - }).change(); - } - } + ApiDebug.enabled_debug.sub_fields = [ + ApiDebug.debug_type, + ApiDebug.disable_ssl_verification + ]; - static check_enabled_debug_mode = { - init() { - jQuery('#aspireupdate-settings-field-enable_debug').change(function () { + ApiDebug.enabled_debug.field.change(function () { if (jQuery(this).is(':checked')) { - FieldRules.show_field('enable_debug_type'); - FieldRules.show_field('disable_ssl_verification'); + ApiDebug.enabled_debug.show_options(); } else { - FieldRules.hide_field('enable_debug_type'); - FieldRules.hide_field('disable_ssl_verification'); + ApiDebug.enabled_debug.hide_options(); } }).change(); + }, + show_options() { + Fields.show(ApiDebug.enabled_debug.sub_fields); + }, + hide_options() { + Fields.hide(ApiDebug.enabled_debug.sub_fields); } } - static hide_field(id) { - jQuery('.aspireupdate-settings-field-wrapper-' + id).parent().parent().hide(); + static debug_type = { + field: jQuery('.aspireupdate-settings-field-wrapper-enable_debug_type'), } - static show_field(id) { - let field_row = jQuery('.aspireupdate-settings-field-wrapper-' + id).parent().parent(); - field_row.show().addClass('glow-reveal'); - setTimeout(function () { - field_row.removeClass('glow-reveal'); - }, 500); + static disable_ssl_verification = { + field: jQuery('#aspireupdate-settings-field-disable_ssl_verification'), } +} - static remove_required(id) { - jQuery('#aspireupdate-settings-field-' + id).prop('required', false); +class Fields { + static show(sub_fields) { + jQuery.each(sub_fields, function (index, sub_field) { + sub_field.field.closest('tr').show().addClass('glow-reveal'); + sub_field.field.change(); + setTimeout(function () { + sub_field.field.closest('tr').removeClass('glow-reveal'); + }, 500); + }); } - static make_required(id) { - jQuery('#aspireupdate-settings-field-' + id).prop('required', true); + static hide(sub_fields) { + jQuery.each(sub_fields, function (index, sub_field) { + sub_field.field.closest('tr').hide(); + sub_field.field.change(); + }); } } \ No newline at end of file diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh new file mode 100755 index 0000000..c6f53dc --- /dev/null +++ b/bin/install-wp-tests.sh @@ -0,0 +1,181 @@ +#!/usr/bin/env bash + +if [ $# -lt 3 ]; then + echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" + exit 1 +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +DB_HOST=${4-localhost} +WP_VERSION=${5-latest} +SKIP_DB_CREATE=${6-false} + +TMPDIR=${TMPDIR-/tmp} +TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") +WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} +WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} + +download() { + if [ `which curl` ]; then + curl -s "$1" > "$2"; + elif [ `which wget` ]; then + wget -nv -O "$2" "$1" + fi +} + +if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then + WP_BRANCH=${WP_VERSION%\-*} + WP_TESTS_TAG="branches/$WP_BRANCH" + +elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then + WP_TESTS_TAG="branches/$WP_VERSION" +elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + WP_TESTS_TAG="tags/${WP_VERSION%??}" + else + WP_TESTS_TAG="tags/$WP_VERSION" + fi +elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + WP_TESTS_TAG="trunk" +else + # http serves a single offer, whereas https serves multiple. we only want one + download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json + grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json + LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') + if [[ -z "$LATEST_VERSION" ]]; then + echo "Latest WordPress version could not be found" + exit 1 + fi + WP_TESTS_TAG="tags/$LATEST_VERSION" +fi +set -ex + +install_wp() { + + if [ -d $WP_CORE_DIR ]; then + return; + fi + + mkdir -p $WP_CORE_DIR + + if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + mkdir -p $TMPDIR/wordpress-trunk + rm -rf $TMPDIR/wordpress-trunk/* + svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress + mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR + else + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then + # https serves multiple offers, whereas http serves single. + download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + LATEST_VERSION=${WP_VERSION%??} + else + # otherwise, scan the releases and get the most up to date minor version of the major release + local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` + LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) + fi + if [[ -z "$LATEST_VERSION" ]]; then + local ARCHIVE_NAME="wordpress-$WP_VERSION" + else + local ARCHIVE_NAME="wordpress-$LATEST_VERSION" + fi + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz + tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR + fi + + download https://raw.githubusercontent.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php +} + +install_test_suite() { + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i.bak' + else + local ioption='-i' + fi + + # set up testing suite if it doesn't yet exist + if [ ! -d $WP_TESTS_DIR ]; then + # set up testing suite + mkdir -p $WP_TESTS_DIR + rm -rf $WP_TESTS_DIR/{includes,data} + svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes + svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data + fi + + if [ ! -f wp-tests-config.php ]; then + download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php + # remove all forward slashes in the end + WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s:__DIR__ . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php + fi + +} + +recreate_db() { + shopt -s nocasematch + if [[ $1 =~ ^(y|yes)$ ]] + then + mysqladmin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA + create_db + echo "Recreated the database ($DB_NAME)." + else + echo "Leaving the existing database ($DB_NAME) in place." + fi + shopt -u nocasematch +} + +create_db() { + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA +} + +install_db() { + + if [ ${SKIP_DB_CREATE} = "true" ]; then + return 0 + fi + + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + if [ $(mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA --execute='show databases;' | grep ^$DB_NAME$) ] + then + echo "Reinstalling will delete the existing test database ($DB_NAME)" + read -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB + recreate_db $DELETE_EXISTING_DB + else + create_db + fi +} + +install_wp +install_test_suite +install_db diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c5a7ae5 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "aspirepress/aspire-update", + "description": "Update plugins and themes for WordPress.", + "type": "wordpress-plugin", + "license": "GPL-3.0-or-later", + "authors": [ + { + "name": "AspirePress" + } + ], + "require": { + "php": ">=7.4.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.0" + }, + "scripts": { + "test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit" ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..e7dcd4e --- /dev/null +++ b/composer.lock @@ -0,0 +1,1825 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "0916844f3ac21ff922fe9b414c14d840", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.3.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + }, + "time": "2024-10-08T18:51:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.32", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.21", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-09-19T10:50:18+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "e9c8413de4c8ae03d2923a44f17d0d7dad1b96be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/e9c8413de4c8ae03d2923a44f17d0d7dad1b96be", + "reference": "e9c8413de4c8ae03d2923a44f17d0d7dad1b96be", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2024-09-06T22:03:10+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.4.0" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/includes/class-admin-settings.php b/includes/class-admin-settings.php index b7d6fc0..86c0a95 100644 --- a/includes/class-admin-settings.php +++ b/includes/class-admin-settings.php @@ -44,11 +44,14 @@ class Admin_Settings { * The Constructor. */ public function __construct() { - add_action( 'admin_menu', array( $this, 'register_admin_menu' ) ); + add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( $this, 'register_admin_menu' ) ); add_action( 'admin_init', array( $this, 'reset_settings' ) ); add_action( 'admin_init', array( $this, 'register_settings' ) ); add_action( 'admin_notices', array( $this, 'reset_admin_notice' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); + + add_action( 'admin_init', array( $this, 'update_settings' ) ); + add_action( 'network_admin_edit_aspireupdate-settings', array( $this, 'update_settings' ) ); } /** @@ -87,8 +90,8 @@ public function reset_settings() { wp_verify_nonce( sanitize_key( $_GET['reset-nonce'] ), 'aspireupdate-reset-nonce' ) ) { $options = $this->get_default_settings(); - update_option( $this->option_name, $options ); - update_option( 'aspireupdate-reset', 'true' ); + update_site_option( $this->option_name, $options ); + update_site_option( 'aspireupdate-reset', 'true' ); wp_safe_redirect( add_query_arg( @@ -96,13 +99,22 @@ public function reset_settings() { 'reset-success' => 'success', 'reset-success-nonce' => wp_create_nonce( 'aspireupdate-reset-success-nonce' ), ), - admin_url( 'index.php?page=aspireupdate-settings' ) + network_admin_url( 'index.php?page=aspireupdate-settings' ) ) ); exit; } } + /** + * Delete all settings. + * + * @return void + */ + public function delete_all_settings() { + delete_site_option( $this->option_name ); + } + /** * The Admin Notice to convey a Reset Operation has happened. * @@ -110,14 +122,14 @@ public function reset_settings() { */ public function reset_admin_notice() { if ( - ( 'true' === get_option( 'aspireupdate-reset' ) ) && + ( 'true' === get_site_option( 'aspireupdate-reset' ) ) && isset( $_GET['reset-success'] ) && ( 'success' === $_GET['reset-success'] ) && isset( $_GET['reset-success-nonce'] ) && wp_verify_nonce( sanitize_key( $_GET['reset-success-nonce'] ), 'aspireupdate-reset-success-nonce' ) ) { - echo '

Settings have been reset to default.

'; - delete_option( 'aspireupdate-reset' ); + echo '

' . esc_html__( 'Settings have been reset to default.', 'AspireUpdate' ) . '.

'; + delete_site_option( 'aspireupdate-reset' ); } } @@ -131,13 +143,13 @@ public function reset_admin_notice() { */ public function get_setting( $setting_name, $default_value = false ) { if ( null === $this->options ) { - $options = get_option( $this->option_name, false ); + $options = get_site_option( $this->option_name, false ); /** * If the options are not set load defaults. */ if ( false === $options ) { $options = $this->get_default_settings(); - update_option( $this->option_name, $options ); + update_site_option( $this->option_name, $options ); } $config_file_options = $this->get_settings_from_config_file(); if ( is_array( $options ) ) { @@ -210,6 +222,31 @@ private function get_settings_from_config_file() { return $options; } + /** + * Update settings for single site or network activated. + * + * @link http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message + * @link http://benohead.com/wordpress-network-wide-plugin-settings/ + * + * @return void + */ + public function update_settings() { + // Exit if improper privileges. + if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'aspireupdate-settings' ) ) { + return; + } + + // Save settings and redirect. + if ( ( isset( $_POST['option_page'] ) && 'aspireupdate_settings' === $_POST['option_page'] ) ) { + update_site_option( $this->option_name, $this->sanitize_settings( wp_unslash( $_POST['aspireupdate_settings'] ) ) ); + + wp_safe_redirect( + add_query_arg( array( network_admin_url( 'index.php?page=aspireupdate-settings' ) ) ) + ); + exit; + } + } + /** * Register the Admin Menu. * @@ -224,7 +261,7 @@ public function register_admin_menu() { 'index.php', 'AspireUpdate', 'AspireUpdate', - 'manage_options', + is_multisite() ? 'manage_network_options' : 'manage_options', 'aspireupdate-settings', array( $this, 'the_settings_page' ) ); @@ -238,7 +275,7 @@ public function register_admin_menu() { * @return void */ public function admin_enqueue_scripts( $hook ) { - if ( 'dashboard_page_aspireupdate-settings' !== $hook ) { + if ( ! in_array( $hook, array( 'dashboard_page_aspireupdate-settings','index_page_aspireupdate-settings' ) ) ) { return; } wp_enqueue_style( 'aspire_update_settings_css', plugin_dir_url( __DIR__ ) . 'assets/css/aspire-update.css', array(), AP_VERSION ); @@ -247,7 +284,7 @@ public function admin_enqueue_scripts( $hook ) { 'aspire_update_settings_js', 'aspireupdate', array( - 'ajax_url' => admin_url( 'admin-ajax.php' ), + 'ajax_url' => network_admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'aspireupdate-ajax' ), 'domain' => Utilities::get_top_level_domain(), ) @@ -265,21 +302,89 @@ public function the_settings_page() { 'reset' => 'reset', 'reset-nonce' => wp_create_nonce( 'aspireupdate-reset-nonce' ), ), - admin_url( 'index.php?page=aspireupdate-settings' ) + network_admin_url( 'index.php?page=aspireupdate-settings' ) ); ?>

-
+ option_group ); do_settings_sections( 'aspireupdate-settings' ); ?>

- - Reset + + + +

+
+...................................................................................................:?%,.............................................................................
+.................................................................................................,;*%:..............................................................................
+...............................................................................................,++?+,...............................................................................
+..............................................................................................;**?+.................................................................................
+............................................................................................:*+;?;:++++:,...........................................................................
+..........................................................................................:*+:;%*++::;;;+++:........................................................................
+........................................................................................,+*:,+S*::+%#@#+.,*?........................................................................
+......................................................................................,+*;,.,;:;?#@@@%;,;*+,........................................................................
+....................................................................................,+*;:..,+?S@@@@@%,.+*,..........................................................................
+...................................................................................:*+:*+,;:*#@@@@@@?.;*,...........................................................................
+.................................................................................,+*:;?;:?*%.;S@@@@#+.++............................................................................
+...............................................................................,*+::?S:;%:,%:,%@@@@#?.++............................................................................
+.............................................................................,+*;,*@%,;%:.,%:,?@@@@@%.++............................................................................
+............................................................................;*;,+#@?,+%:..,%::%@@@@@?.++............................................................................
+..........................................................................:*+,;S@@*,*?,...,%,:S@@@@@?.++............................................................................
+........................................................................,**::%@@#;,?%+;;;;+?.:S@@@@@?.;*:;;;:.......................................................................
+......................................................................,+*::?##@S::%??;,::::,,;S#####?,,::;;;%;......................................................................
+.....................................................................;*;,+S###%,:%??::?SSS%%SS#######SS%SS%:,?+.....................................................................
+...................................................................:*;,+S####?,;%%*,+S#####################S;,*+....................................................................
+.................................................................:*+::%##S##*,+%?+,*#SSSSSSSSSSSSSSSSSSSSSSSS+,**,..................................................................
+...............................................................,+*::?#SSSS#+,*%%;,?#SSSSS?*?#SSSSSSS##%SSSSSSS*,+*,.................................................................
+.............................................................,+*:,*SSSSSSS;,?S?::%SSSSSS*,.*@SSSSSSS@S.+SSSSSSS?,;?:.........................................................,;;;;;:
+............................................................;*;,+SSSSSS#S::%S?,.???%??%+,.,%#%SSSSSS#S..+SSSSSSS%,:?:.......................................................:%;;;;;S
+..........................................................:*+,;%#S%%%%#%,:%?%;:;;;;;:,,,:,,S#%%%%%%S@S,..,;++;;++;:;S;.....................................................,?+,?S+.%
+++:::::::::::::::::::::::::::;;.........................:*+,:?SS%%%%%#?,;%:,::::::+%,.,%S,,@S%%%%%%S@#?+;,:+?%*+;;::;:.....................................................;S.+#S*,%
+:?*,,,;+++++++++++++++++++++;,*+......................,+*:,*SS%%%%%S#*,*%,.......;?,+*,S%,;@S%%%%%%S@#%%S%?+;:;++;:.................................,+;...................,%;:%SS*,%
+..+?;.:%#SSSSSSSSSSSSSSSSSSS%;,?;...................,;*;,*SS%%%%%%S#;,??,.......;?,+@S:;:,*@%%%%%%%S@#%%%%%%S%*;:;+*+;,................:*;..........;%S+..................+?.+#%S*,%
+...,+*:.;SS%%%%%%%%%%%%%%%%%%%::?:.................;*;,;%S%%%%%%%SS:,%*........*?,+#SS;..,%#%%%%%%%S@#%%%%%%%%%S%?+;:;+*+:,..........:*+;?*,........;?:*?,...............,S::S%%S*,%
+.....:*+,,*SS%%%%%%%%%%%%%%%%S?,+*,..............:*+,:%S%%%%%%%%#%::%+........+?,+#%%#+.,,##%%%%%%%S@#%%%%%%%%%%%%%%%*+::;++;:,....,+*:,;:+?;.......;?:.;%:..............?*,?S%%S*,%
+.......+?;.:%#S%%%%%%%%%%%%%%%S*.*+............:++,:?#S%%%%%%%%#?,;%;........+*,+#%%%#?,.,@S%%%%%%%S@#%%%%%%%%%%%%%%%%%%?*;:;+*+::+*;,+%S%;:?*,.....;?:.::?+............;%,:#%%%S*,%
+........,+*:.;SS%%%%%%%%%%%%%%%S+.?;.........,+*:,*SS%%%%%%%%S#*.+%:........+*,*#%%%%S%:.+@%%%%%%%%S@#%%%%%%%%%%%%%%%%%%%%S%?;::;;;,:%S%%%S*,+?;....;?:.#*,??,.........,%+,%S%%%S*,%
+..........:**,,*SS%%%%%%%%%%%%%SS:,?:......,;*;,+SS%%%%%%%%%S#+,*%:.......,**,*#%%%%%%#;.*#%%%%%%%%S@#%%%%%%%%S@##S%%%%%%%%%%%%?*;;?S%%%%%%S%::?*,..;?:.#S?:+%;........+?,+#%%%%S+,%
+...........,;*;.:?#%%%%%%%%%%%%%S%,:%,....;*;,;%S%%%%%%%%%%SS;,*+,.......,**,*#%%%%%%%@+.%#%%%%%%%%%@#%%%%%%%%S@@@@#%%%%%%%%%%%S@@S%????????%S+,+?;.;?:.#%%%;;%+......,%;,S%%%%%S+,%
+.............,*?:.+S?????????????S?,;?,.:++,:?S%??????????S@;.;*.........**,*#%???????#?,#S?????????@#????????%@@S????????????S@#%????????????%?::?*;?:.#???%+:?*,....*?,*S?????S;.%
+...............:%+.;S?************S*.+?**:,*S%***********SS%?:,?+......,**,*#?********%%;@?*********@#********?S?***********%@#%***************?%+,+S%:.#?***?*:*?:..:%;,S?*****S;.%
+................,%+.+S*++++++++++++S;,+:,*S?*++++++++++*S%*+?%;,**....,?*.*#?+++++++++*S*#*++++++++*@#*+++++++++++++++++++?#@%*++++++++?*++++++++?*:;+,.#*++++*?:;%;.*?.??++++++S;.%
+.................,%;.*%+;++++;;;;;;+S,.;%%+;;;;;;;;;;;*#?;++;+S+,**,.,?+.*#*;++++++++;;#SS++++++++++##+++++++++++++;;;;;*S@%+;;+++;;;+?@S*;;+++++;+?;...#+++++;+*+:?%%,;?+;;;;;;%;.%
+..................:%:,*?;;;;;;;;;;;;*S?%+;;;;;;;;;;;;?S+;;;;;;;%*,**:?+.*#+;;;;;;;;;;;*#@%;;;;;;;;;+##;;;;;;;;;;;;;;;;;?#S*;;;;;;;;;?#@@@@*;;;;;;;;;?*,.#;;;;;;;;**:+;,?*;;;;;;;%;.%
+...................;?:,??::::::::::::*+:::::::::::::%S;::::::::;?*,+%;.?#+::::::::::;%@@@*:::::::::+##;::::::::::::::*S#*:::::::::;S@@@@@@#*:::::::::+?:#:::::::::;*;.+?;:::::::%;.%
+....................;?,,?*::::::::::::::::::::::::;%?:::::*%;::::??,..?#+::::::::::*#@@@@;:::::::::;#S:::::::::::::::%@*::::::::;?@@@@@@@@@@?::::::::::%@:::::::::::**%+::::::::%;.%
+.....................+*,,%*::::::::::::::::::::::+S?:::::*@@%;::::*?:?#+:::::::::;%@@@@@@;:::::::::;##;:::::::::::::::?#?:::::::;S@@@@@@@@@@@+::::::::+#@::::::::::::*?:::::::::?;.%
+.....................,**,,S+::::::::::::::::::::*S*:;;;:*#@@@S;;;;:*##+:::::::::*#@@@@@@S;:::::::::;##;::::;;;+::::::::?@S+::::::;?@@@@@@@@#*;;:::::;%%*@;::::::::::::::::::::::*:.%
+.......................?+.:%*;;;;;;;;;;;;;;;;;+*SS;;;;;+#@@@@@*+++;*S*;;;;;;;;+S@@@@@@@@%+;;;;;;;;;+@#+;;;;;;+%?;;;;;;;;?@@?+;;;;;;*S@@@@@%+;;;;;;;?S*,:@+;;;;++;;;;;;;;;;;;;;;;?;.%
+.......................,?;.:S?+++++++++++++*+*?;,?%*+***%@@@@%***+?S?+++++++*%@@@@@@@@@@?++++++++++*@#*++++++*S@?++++++++?#@S*++++++*%@@#?+++++++*S%:..:@*++++?S?+++++++++++++++%;.%
+........................:%;.;S?*************??:,:.*S????*%@@%???*?#%*???????#@@@@@@####@?*??????????@#?*????*?S@#?*****?**?#@@%*????**?%?*??????%S+,**,:@???*%?:*%???***********%;.%
+.........................:%:.;#%%%%%%%%%%%%%?,;%?+.;SS%%%%%%%%%%%#S%%%%%%%%SSS%%%%%%%?S#%%%%%%%%%%%%@@%%%%%%%%S@@#%%%%%%%%%%#@@S%%%%%%%%%%%%%%%#%::*%*,:@%%%S?,,,;S%%%%%%%%%%%%%S;.%
+..........................:%:.+#SSSSSSSSSSS*,+?,,**,:%#SSSSSSSSS@#SSSSSSSSSS%SSSSSSSSS##SSSSSSSSSS%S@@SSSSSSSSS@@@#SSSSSSSSSS#@@@SS%SSSSSSS%S##+,+*,;*,:@SSSS:,%%::%SSSSSSSSSSSSS;.S
+...........................:%,.*#SSSSSSSSS+,**,...+?:,?#SSSSSS#@#SSSSSSSSSSSSSSSSSSSS#@#SSSSSSSSSSS#@@SSSSSSSS#@@@@#SSSSSSSSSS#@@@@SSSSSSSS##?,:*+..;+,:@SS#;,%+;%;,?#SSSSSSSSSS#:.#
+............................;?,.?@######S;,?+......:?;.+##S#S#@#S####################@@#S###########@@#SSSSSSS#@@@@@#SSSSSSSSSS#@@@@##S#S#@S;,+*:...;+,:@##*,?*,.,?*,+##SSSSSSS##:.#
+.............................+?,,%@####%::?;........,*+.;S###@@#####################@@@#############@@#########@@@@@@############@@@@@###@?,:?+.....;+,:@@?,*?,....*?,;S#########:.#
+.............................,**,,%@##?,;?:...........+*,,%@#%%%%%%%%%%%%%%%%%%%%%%%%S@#############@#########################@@@@@@@@@#S+,+?:......;+,,?*,+%,......;?::%########;.#
+..............................,*+.,%@*,+*,.............;?:,+:.,,,,,,,,,,,,,,,,,,,,...;##############%,::::::::::::::::::::::::;;;;;;;;;:,:*+,.......;*+;;;+?:........;%+,?######S:.#
+...............................,?+.,;,**,...............:?+.,*;;;;;;;;;;;;;;;;;;;+?,.*@@@@@@@@@@@@@@?..**;;;;;;;;;;;;;;;;::::::::::::::::+:.........,::::::,..........:?*,+#@@@@%:.#
+................................,%;.,?+..................,**?;...................,#..+@@@@@@@@@@@@@@?..*+..............................................................,*?,:S@@@%:.#
+.................................:%+?:.....................;:....................,++,.+#@@@@@@@@@@@@S..*;................................................................;%:,%@@%:.#
+..................................:+,..............................................;?:.:S@@@@@@@@@@@%..*+.................................................................:%+,*@S:.#
+....................................................................................:?;.,%@@@@@@@@@@+.:?:..................................................................,?*,+?:.#
+.....................................................................................,?+.,?@@@@@@@@%,;?;....................................................................,*?:.,.#
+......................................................................................,**,.+@@@@@@*,;?:.......................................................................;%;..#
+........................................................................................;?:.;#@@#+.+?,.........................................................................:%+.#
+.........................................................................................:?;.:S#;.*?,...........................................................................,?*#
+..........................................................................................,**,,,,**..............................................................................,*S
+............................................................................................+?,,?+.................................................................................,
+.............................................................................................;?%;...................................................................................
+
option_name, false ); + $options = get_site_option( $this->option_name, false ); /** * If the options are not set load defaults. */ if ( false === $options ) { $options = $this->get_default_settings(); - update_option( $this->option_name, $options ); + update_site_option( $this->option_name, $options ); } register_setting( @@ -347,12 +452,12 @@ public function register_settings() { array( 'value' => 'api.aspirecloud.org', 'label' => 'AspireCloud (api.aspirecloud.org)', - 'require-api-key' => 'true', + 'require-api-key' => 'false', 'api-key-url' => 'api.aspirecloud.org/v1/apitoken', ), array( 'value' => 'other', - 'label' => 'Other', + 'label' => esc_html__( 'Other', 'AspireUpdate' ), 'require-api-key' => 'false', ), ), @@ -491,7 +596,7 @@ public function add_settings_field_callback( $args = array() ) { case 'api-key': ?> - +

-