Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.0' ]
php-versions: [ '8.2' ]

env:
cache_version: 1 # increment to flush all caches
php_extensions: tokenizer, xmlwriter, simplexml

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5

- name: Setup PHP extension cache
id: cache-php-extensions
Expand All @@ -34,7 +34,7 @@ jobs:
key: ${{ matrix.operating-system }}-${{ env.cache_version }}-phpextensions-${{ matrix.php-versions }}

- name: Cache PHP extensions
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.cache-php-extensions.outputs.dir }}
key: ${{ steps.cache-php-extensions.outputs.key }}
Expand All @@ -53,11 +53,11 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Check for Cached Composer Dependencies
id: cache-composer-dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ env.cache_version }}-phpextensions-${{ matrix.php-versions }}-composer-${{ hashFiles('composer.json') }}
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.4', '8.0', '8.1' ]
wordpress-version: [ 'latest', '5.3.12', '5.9.3' ]
exclude:
- php-versions: '8.0'
wordpress-version: '5.3.12'
- php-versions: '8.1'
wordpress-version: '5.3.12'
php-versions: [ '8.2', '8.3', '8.4' ]
wordpress-version: [ 'latest' ]
# exclude:
# - php-versions: '8.0'
# wordpress-version: '5.3.12'
# - php-versions: '8.1'
# wordpress-version: '5.3.12'
fail-fast: false

env:
cache_version: 1 # increment to flush all caches
cache_version: 3 # increment to flush all caches
php_extensions: memcached, mysql, bz2, gd, igbinary, imagick, imap, mbstring, bcmath, zip, intl
PROJECT_ID: square1
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand All @@ -44,7 +44,7 @@ jobs:
services:

mysql:
image: mariadb:10
image: mariadb:11.4
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
Expand All @@ -54,7 +54,7 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Setup PHP extension cache
id: cache-php-extensions
Expand All @@ -65,7 +65,7 @@ jobs:
key: ${{ matrix.operating-system }}-${{ env.cache_version }}-phpextensions-${{ matrix.php-versions }}-${{ matrix.wordpress-version }}

- name: Cache PHP extensions
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.cache-php-extensions.outputs.dir }}
key: ${{ steps.cache-php-extensions.outputs.key }}
Expand All @@ -88,15 +88,15 @@ jobs:

- name: Create config files
run: |
touch ./tests/.env
cp ./tests/.env-dist ./tests/.env

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Check for Cached Composer Dependencies
id: cache-composer-dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ env.cache_version }}-phpextensions-${{ matrix.php-versions }}-composer-${{ hashFiles('composer.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
coverage: none

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- uses: ramsey/composer-install@v2

- name: Set repo matrix
id: set-matrix
run: echo "::set-output name=matrix::$(php ./dev/monorepo/scripts/repo-map.php)"
run: echo "matrix=$(php ./dev/monorepo/scripts/repo-map.php)" >> $GITHUB_OUTPUT

split:
needs: list-repos
Expand All @@ -43,7 +43,7 @@ jobs:
package: ${{ fromJson(needs.list-repos.outputs.matrix) }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sub-repo-branch-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
coverage: none

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5

- uses: ramsey/composer-install@v2

- name: Set repo matrix
id: set-matrix
run: echo "::set-output name=matrix::$(./monorepo.sh packages-json)"
run: echo "matrix=$(./monorepo.sh packages-json)" >> $GITHUB_OUTPUT

create-sub-repo-branches:
needs: list-repos
Expand All @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout sub-repo
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: ${{ env.org }}/${{ matrix.package }}
token: ${{ secrets.TR1B0T_TRIBE_LIBS_MONOREPO_TOKEN }}
Expand Down
42 changes: 42 additions & 0 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: tribe-libs
recipe: wordpress

config:
php: '8.4'
database: mariadb:11.4
composer_version: 2-latest
xdebug: false
memcached: true
config:
# Uncomment the line below to enable the correct Nginx conf for a WordPress subDIRECTORY multisite install.
#vhosts: dev/lando/ms-subdirectory.conf

# Uncomment the following lines and update the URLs to enable a WordPress subDOMAIN multisite install.
#proxy:
# appserver_nginx:
# - 'moose.lndo.site'
# - '*.moose.lndo.site'

services:
appserver:
overrides:
environment:
- XDEBUG_TRIGGER=1
database:
run_as_root:
# Create separate DB for tests
- mysql -uroot -e "CREATE DATABASE IF NOT EXISTS tribe_libs_test; GRANT ALL PRIVILEGES ON tribe_libs_test.* TO 'wordpress'@'%' IDENTIFIED by 'wordpress';"

tooling:
npm:
service: node
xdebug-on:
service: appserver
description: Enable xdebug for nginx.
cmd: docker-php-ext-enable xdebug && pkill -o -USR2 php-fpm && echo "Xdebug enabled"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for nginx.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm && echo "Xdebug disabled"
user: root
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
"test:integration": "@test run integration",
"test:unit": "@test run unit",
"test:all": [
"@test:unit",
"@test:integration"
"@test:unit",
"@test:integration"
]
},
"require": {
"php": ">=7.4",
"php": ">=8.2",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-zlib": "*",
"composer-plugin-api": "^1.0 || ^2.0",
"enshrined/svg-sanitize": "^0.15",
"enshrined/svg-sanitize": "^0.22",
"filp/whoops": "^2.2@dev",
"mhcg/monolog-wp-cli": "^2.0",
"php-di/php-di": "^6.0",
Expand All @@ -54,7 +54,7 @@
"brain/monkey": "2.*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || ^0.7.0",
"fakerphp/faker": "^1.20",
"lucatume/wp-browser": "^3.1",
"lucatume/wp-browser": "^4.0",
"nelexa/zip": "^4.0",
"nette/utils": "^3.2 || ^4.0",
"phpcompatibility/php-compatibility": "10.x-dev#a726377 as 9.3.5",
Expand Down
97 changes: 97 additions & 0 deletions dev/lando/ms-subdirectory.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# WordPress site rules.
# Designed to be included in any server {} block.
# LANDOWORDPRESSNGINXCONF

# Customized for a Subdirectory Multisite Install

# Upstream to abstract backend connection(s) for php
upstream php {
server fpm:9000;
}

# nginx directive to fix warnings when server initializes
variables_hash_max_size 2048;
variables_hash_bucket_size 128;

server {

listen 80 default_server;
listen 443 ssl;

server_name localhost;

ssl_certificate /certs/cert.crt;
ssl_certificate_key /certs/cert.key;
ssl_verify_client off;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

port_in_redirect off;
client_max_body_size 100M;

## Your only path reference.
root "{{LANDO_WEBROOT}}";

## This should be in your http block and if it is, it's not needed here.
index index.php;

# Used to resolve missing assets from a remote server so you don't need a client's uploads folder
# Replace "livedomain.tld" with your production/dev URL to pull assets from another server.
#location @images {
# resolver 1.1.1.1 ipv6=off;
# proxy_ssl_server_name on;
# proxy_set_header Host livedomain.tld;
# proxy_pass https://livedomain.tld;
#}

# WordPress subdirectory multisite rules.
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}

location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|eot|ttf|woff|mp4|m4v|mov|wmv|avi|mpg|ogv|3gp|3g2|flv|webm|aac|m4a|f4a|mp3|ogg|oga)$ {
try_files $uri =404;
# If proxying files from an upstream (e.g., dev, production) server using @images, switch the above for the
# following lines:
# try_files $uri @images;
expires max;
log_not_found off;
add_header Pragma public;
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
1 change: 0 additions & 1 deletion src/Log/Log_Definer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Log_Definer implements Definer_Interface {
public function define(): array {
return [
StreamHandler::class => static function ( ContainerInterface $c ) {
// @phpstan-ignore-next-line
$path = WP_CONTENT_DIR . '/square-one-' . date( 'Y-m-d' ) . '.log';
$path = apply_filters( 'tribe/log/path', $path );

Expand Down
2 changes: 1 addition & 1 deletion src/Media/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ext-libxml": "*",
"ext-zlib": "*",
"ext-simplexml": "*",
"enshrined/svg-sanitize": "^0.15",
"enshrined/svg-sanitize": "^0.22",
"moderntribe/square1-container": "^4.3",
"moderntribe/square1-cli": "^4.3"
},
Expand Down
1 change: 1 addition & 0 deletions src/Twig/Twig_Definer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private function twig_cache_dir(): string {
if ( defined( 'TWIG_CACHE_DIR' ) && TWIG_CACHE_DIR ) {
return TWIG_CACHE_DIR;
}
// @phpstan-ignore-next-line
if ( defined( 'WP_CONTENT_DIR' ) && WP_CONTENT_DIR ) {
return WP_CONTENT_DIR . '/cache/twig/';
}
Expand Down
23 changes: 14 additions & 9 deletions tests/codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ extensions:
enabled:
- Codeception\Extension\RunFailed
commands:
- Codeception\Command\GenerateWPUnit
- Codeception\Command\GenerateWPRestApi
- Codeception\Command\GenerateWPRestController
- Codeception\Command\GenerateWPRestPostTypeController
- Codeception\Command\GenerateWPAjax
- Codeception\Command\GenerateWPCanonical
- Codeception\Command\GenerateWPXMLRPC
- "lucatume\\WPBrowser\\Command\\GenerateWPUnit"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestApi"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestController"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestPostTypeController"
- "lucatume\\WPBrowser\\Command\\GenerateWPAjax"
- "lucatume\\WPBrowser\\Command\\GenerateWPCanonical"
- "lucatume\\WPBrowser\\Command\\GenerateWPXMLRPC"
- "lucatume\\WPBrowser\\Command\\RunOriginal"
- "lucatume\\WPBrowser\\Command\\RunAll"
- "lucatume\\WPBrowser\\Command\\DbExport"
- "lucatume\\WPBrowser\\Command\\DbImport"
- "lucatume\\WPBrowser\\Command\\MonkeyCachePath"
- "lucatume\\WPBrowser\\Command\\MonkeyCacheClear"
params:
- .env
- env

##
# Module configurations that apply to all suites,
Expand All @@ -41,7 +47,6 @@ modules:
domain: "%WP_DOMAIN%"
configFile: "%TEST_CONFIG_FILE%"
multisite: false
theme: core
plugins:
- advanced-custom-fields/acf.php
- acf-color-swatches/acf-swatch.php
Expand Down
Loading