Skip to content

Commit

Permalink
Merge pull request #78 from bueltge/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
bueltge authored Jun 10, 2024
2 parents 6a28a1e + 9063da7 commit 6c4044b
Show file tree
Hide file tree
Showing 39 changed files with 2,452 additions and 1,121 deletions.
Binary file added .ddev/commands/favicon1.ico
Binary file not shown.
Binary file added .ddev/commands/favicon2.ico
Binary file not shown.
Binary file added .ddev/commands/favicon3.ico
Binary file not shown.
Binary file added .ddev/commands/favicon4.ico
Binary file not shown.
Binary file added .ddev/commands/favicon5.ico
Binary file not shown.
20 changes: 2 additions & 18 deletions .ddev/commands/web/orchestrate.d/10_wp_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@ if [ ! -z "${RECREATE_ENV}" ]; then
wp db clean --yes
fi

if [ "${WP_MULTISITE}" = "true" ]; then
wp core multisite-install \
--title="${WP_TITLE}" \
--admin_user="${ADMIN_USER}" \
--admin_password="${ADMIN_PASS}" \
--url="${DDEV_PRIMARY_URL}" \
--admin_email="${ADMIN_EMAIL}" \
--skip-email

readarray -d , -t slugs <<< "${WP_MULTISITE_SLUGS},"; unset "slugs[-1]";
for slug in "${slugs[@]}"; do
if [ ! -z "${slug}" ]; then
wp site create --slug="${slug}"
fi
done

else
wp core install \
wp core multisite-install \
--title="${WP_TITLE}" \
--admin_user="${ADMIN_USER}" \
--admin_password="${ADMIN_PASS}" \
--url="${DDEV_PRIMARY_URL}" \
--admin_email="${ADMIN_EMAIL}" \
--skip-email
fi

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

wp plugin is-installed akismet && wp plugin uninstall akismet
wp plugin is-installed hello && wp plugin uninstall hello
48 changes: 48 additions & 0 deletions .ddev/commands/web/orchestrate.d/50_setup_test_content.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

pushd "${DDEV_DOCROOT}"

wp user create usite1 usite1@example.com --role=administrator --porcelain --url="${DDEV_PRIMARY_URL}/site1"
wp user create usite2 usite2@example.com --role=administrator --porcelain --url="${DDEV_PRIMARY_URL}/site2"
wp user create usite3 usite3@example.com --role=administrator --porcelain --url="${DDEV_PRIMARY_URL}/site3"
wp user create usite4 usite4@example.com --role=administrator --porcelain --url="${DDEV_PRIMARY_URL}/site4"
wp user create usite5 usite5@example.com --role=administrator --porcelain --url="${DDEV_PRIMARY_URL}/site5"

wp site create --slug="site1" --email=usite1@example.com
wp site create --slug="site2" --email=usite2@example.com
wp site create --slug="site3" --email=usite3@example.com
wp site create --slug="site4" --email=usite4@example.com
wp site create --slug="site5" --email=usite5@example.com

wp user set-role ${ADMIN_USER} administrator --url="${DDEV_PRIMARY_URL}/site1"
wp user set-role ${ADMIN_USER} administrator --url="${DDEV_PRIMARY_URL}/site2"
wp user set-role ${ADMIN_USER} administrator --url="${DDEV_PRIMARY_URL}/site3"
wp user set-role ${ADMIN_USER} administrator --url="${DDEV_PRIMARY_URL}/site4"
wp user set-role ${ADMIN_USER} administrator --url="${DDEV_PRIMARY_URL}/site5"

wp plugin install user-switching --force --activate-network --version=1.7.0

wp plugin activate hello --url="${DDEV_PRIMARY_URL}/site2"
wp plugin activate hello --url="${DDEV_PRIMARY_URL}/site4"

wp theme install twentytwentyone --force
wp theme install twentytwentytwo --force
wp theme install twentytwentythree --force
wp theme install twentytwentyfour --force

wp theme enable twentytwentyfour --network
wp theme enable twentytwentythree --network
wp theme enable twentytwentytwo --network
wp theme enable twentytwentyone --network

cp "/var/www/html/.ddev/commands/favicon1.ico" "/var/www/html/.ddev/wordpress/wp-content/themes/twentytwentyone/favicon.ico"
cp "/var/www/html/.ddev/commands/favicon2.ico" "/var/www/html/.ddev/wordpress/wp-content/themes/twentytwentytwo/favicon.ico"
cp "/var/www/html/.ddev/commands/favicon3.ico" "/var/www/html/.ddev/wordpress/wp-content/themes/twentytwentythree/favicon.ico"
cp "/var/www/html/.ddev/commands/favicon4.ico" "/var/www/html/.ddev/wordpress/wp-content/themes/twentytwentyfour/favicon.ico"

wp theme activate twentytwentyfour --url="${DDEV_PRIMARY_URL}/site4"
wp theme activate twentytwentythree --url="${DDEV_PRIMARY_URL}/site3"
wp theme activate twentytwentytwo --url="${DDEV_PRIMARY_URL}/site2"
wp theme activate twentytwentyone --url="${DDEV_PRIMARY_URL}/site1"


5 changes: 0 additions & 5 deletions .ddev/commands/web/orchestrate.d/50_setup_whoops.sh

This file was deleted.

8 changes: 3 additions & 5 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: multisite-enhancements
type: php
docroot: .ddev/wordpress
php_version: "8.3"
php_version: "7.2"
nodejs_version: "18"
webserver_type: apache-fpm
router_http_port: "80"
Expand All @@ -20,11 +20,9 @@ hooks:
- exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}"

web_environment:
- WP_VERSION=6.5.3
- WP_VERSION=6.5.4
- WP_LOCALE=de_DE
- WP_TITLE=DDEV Search and Replace Test
- WP_MULTISITE=true
- WP_MULTISITE_SLUGS=seite1,seite2
- WP_TITLE=DDEV Multisite Enhancements Test
- ADMIN_USER=admin
- ADMIN_PASS=admin
- ADMIN_EMAIL=admin@example.com
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
php-versions: ['5.6', '7.2', '7.3', '7.4', '8.0']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -46,4 +46,7 @@ jobs:
run: composer install -q -n -a --no-progress --prefer-dist

- name: Run phpCS Scripts from composer.json
run: composer cs
run: composer cs

- name: Run Unit Test from composer.json
run: composer pu
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ vendor
.idea/
*.ipr
*.iws

# PHP Unit
.phpunit.result.cache
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. This projec
* Enhance the footer information to make more clear about the memory values. [#71](https://github.com/bueltge/wordpress-multisite-enhancements/issues/71)
* Fix php note for favicon functionality. [#65](https://github.com/bueltge/wordpress-multisite-enhancements/issues/65)
* Change dashicons from lock/unlock to yes/no to optimize the visual difference of the icon to spot http usage easier. Probs @Zodiac1978 [#76](https://github.com/bueltge/wordpress-multisite-enhancements/pull/70)
* Added functionality to see when a user last time logs in
* Update minimum PHP Version to 7.2
* Added Namespace, Autoloading, and many more PHP improvements and cleanups

## [1.6.1](https://github.com/bueltge/wordpress-multisite-enhancements/compare/1.6.0...1.6.1) - 2021-01-20
* Fix path for css/js files.
Expand Down
20 changes: 8 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,37 @@
"issues": "https://github.com/bueltge/wordpress-multisite-enhancements/issues"
},
"require": {
"php": ">=5.3",
"composer/installers": "^1"
"php": ">=7.2"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"squizlabs/php_codesniffer": "^3",
"wp-coding-standards/wpcs": "*"
"wp-coding-standards/wpcs": "*",
"phpunit/phpunit": "^8",
"brain/monkey": "^2.6"
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload-dev": {
"psr-4": {
"MultisiteEnhancements\\Tests\\": "tests/phpunit/"
"Multisite_Enhancements\\Tests\\": "tests/phpunit/"
}
},
"autoload": {
"psr-0": {
"": "src/"
},
"classmap": [
"src/",
"multisite-enhancements.php"
]
},
"scripts": {
"cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
"csf": "@php ./vendor/bin/phpcbf",
"cs": "@php ./vendor/bin/phpcs",
"cbf": "@php ./vendor/bin/phpcbf",
"pu": "@php ./vendor/bin/phpunit",
"qa": [
"@cs",
Expand Down
Loading

0 comments on commit 6c4044b

Please sign in to comment.