Skip to content

Commit

Permalink
Prepare Matomo 4 Minor Release
Browse files Browse the repository at this point in the history
  • Loading branch information
DevDavido authored Dec 20, 2023
2 parents 12299e2 + b1a3ac2 commit 39924f6
Show file tree
Hide file tree
Showing 125 changed files with 2,284 additions and 1,099 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=77KW4LBEYBD9U"
custom: "https://www.buymeacoffee.com/devdavido"
5 changes: 2 additions & 3 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- nostale
# Label to use when marking an issue as stale
Expand All @@ -13,6 +12,6 @@ staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs
within the next 7 days. Thank you for your contributions.
within the next 30 days. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
76 changes: 23 additions & 53 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,37 @@ on:
paths-ignore:
- '*.md'

env:
PLUGIN_NAME: PerformanceAudit
TEST_SUITE: PluginTests
MYSQL_ADAPTER: PDO_MYSQL

jobs:
phpunit:
tests:
strategy:
fail-fast: false
matrix:
php-versions: ['7.1']
#php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
matomo-versions: ['3.12.0', '3.14.0']
node-version: [12.x]
#node-version: [10.x, 12.x]
php: ['7.2', '7.4', '8.0', '8.3']
matomo-target: ['minimum_required_matomo', 'maximum_supported_matomo']
node: ['12.x', '20.x']

runs-on: ubuntu-latest

name: PHPUnit with PHP ${{ matrix.php-versions }}, Node.js ${{ matrix.node-version }} and Matomo ${{ matrix.matomo-versions }}
permissions:
checks: write
pull-requests: write
contents: read

steps:
- uses: actions/checkout@v2
name: Tests w/ PHP ${{ matrix.php }}, Node.js ${{ matrix.node }}, Target Matomo '${{ matrix.matomo-target }}'

- name: Setup PHP
uses: shivammathur/setup-php@v2
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
php-version: ${{ matrix.php-versions }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv
coverage: none
tools: composer, phpunit:7.5.20
lfs: true
persist-credentials: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Run plugin tests
uses: matomo-org/github-action-tests@main
with:
node-version: ${{ matrix.node-version }}

- name: Create database
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS matomo_tests;'
- name: Clone Matomo and run plugin Tests
# TODO
run: |
shopt -s extglob
mkdir ${{ env.PLUGIN_NAME }}
cp -R !(${{ env.PLUGIN_NAME }}) ${{ env.PLUGIN_NAME }}
cp -R .git/ ${{ env.PLUGIN_NAME }}/
git clone --config filter.lfs.smudge=true -q https://github.com/matomo-org/matomo.git matomo
cd matomo
git fetch --all
git submodule update
git checkout -f -q tags/${{ matrix.matomo-versions }}
[ -d ./tests/travis/.git ] || sh -c "rm -rf ./tests/travis && git clone https://github.com/matomo-org/travis-scripts.git ./tests/travis"
cd ./tests/travis
git checkout master
cd ../..
[ ! -f ./tests/travis/check_plugin_compatible_with_piwik.php ] || php ./tests/travis/check_plugin_compatible_with_piwik.php "${{ env.PLUGIN_NAME }}"
composer install --no-dev --no-progress
rm -rf plugins/${{ env.PLUGIN_NAME }}
mv ../${{ env.PLUGIN_NAME }} plugins
echo './console tests:run PerformanceAudit'
env:
DB_PASSWORD: root
plugin-name: 'PerformanceAudit'
test-type: 'PluginTests'
php-version: ${{ matrix.php }}
matomo-test-branch: ${{ matrix.matomo-target }}
node-version: ${{ matrix.node }}
mysql-service: true
6 changes: 0 additions & 6 deletions API.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit;

Expand Down
7 changes: 0 additions & 7 deletions Archiver.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\PerformanceAudit;

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog
## 2.1.0
- Added: Site setting to group URLs by anchor which removes auditing duplicates of URLs which only differ in their anchors
- Added: Support to find latest Node executable in Plesk environment
- Added: Initial (partial) translation available for Albanian, Basque, Bokmål, Brazilian Portuguese, Bulgarian, Catalan, Chinese (Traditional), Dutch, French, German, Greek, Indonesian, Italian, Japanese, Portuguese, Spanish, Swedish, Turkish, Ukrainian
- Updated: Bumped `symfony/process`, `ducks-project/spl-types`, `symfony/polyfill-mbstring` and `friendsofphp/php-cs-fixer` dependency version
- Updated donation links

## 2.0.0
- Release stable version for Matomo 4
- Updated: Bumped `symfony/process` and `symfony/polyfill-mbstring` dependency version
Expand Down
6 changes: 0 additions & 6 deletions Columns/Filters/AuditScoreClassifier.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Filters;

Expand Down
6 changes: 0 additions & 6 deletions Columns/Metrics/Audit.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

Expand Down
6 changes: 0 additions & 6 deletions Columns/Metrics/Max.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

Expand Down
12 changes: 6 additions & 6 deletions Columns/Metrics/MaxPercent.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

require PIWIK_INCLUDE_PATH . '/plugins/PerformanceAudit/vendor/autoload.php';

use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use TypeError;

class MaxPercent extends Max
{
Expand Down Expand Up @@ -41,9 +36,14 @@ public function getDocumentation()
* @param mixed $value
* @param Formatter $formatter
* @return mixed $value
* @throws TypeError
*/
public function format($value, Formatter $formatter)
{
if (!is_numeric($value)) {
throw new TypeError("A non-numeric value encountered");
}

return mb_substr($formatter->getPrettyPercentFromQuotient($value / 100), 0, -1);
}
}
12 changes: 6 additions & 6 deletions Columns/Metrics/MaxSeconds.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

require PIWIK_INCLUDE_PATH . '/plugins/PerformanceAudit/vendor/autoload.php';

use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use TypeError;

class MaxSeconds extends Max
{
Expand Down Expand Up @@ -41,9 +36,14 @@ public function getDocumentation()
* @param mixed $value
* @param Formatter $formatter
* @return mixed $value
* @throws TypeError
*/
public function format($value, Formatter $formatter)
{
if (!is_numeric($value)) {
throw new TypeError("A non-numeric value encountered");
}

if ($value == 0) {
return '0.000';
}
Expand Down
6 changes: 0 additions & 6 deletions Columns/Metrics/Median.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

Expand Down
12 changes: 6 additions & 6 deletions Columns/Metrics/MedianPercent.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

require PIWIK_INCLUDE_PATH . '/plugins/PerformanceAudit/vendor/autoload.php';

use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use TypeError;

class MedianPercent extends Median
{
Expand Down Expand Up @@ -41,9 +36,14 @@ public function getDocumentation()
* @param mixed $value
* @param Formatter $formatter
* @return mixed $value
* @throws TypeError
*/
public function format($value, Formatter $formatter)
{
if (!is_numeric($value)) {
throw new TypeError("A non-numeric value encountered");
}

return mb_substr($formatter->getPrettyPercentFromQuotient($value / 100), 0, -1);
}
}
12 changes: 6 additions & 6 deletions Columns/Metrics/MedianSeconds.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

require PIWIK_INCLUDE_PATH . '/plugins/PerformanceAudit/vendor/autoload.php';

use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use TypeError;

class MedianSeconds extends Median
{
Expand Down Expand Up @@ -41,9 +36,14 @@ public function getDocumentation()
* @param mixed $value
* @param Formatter $formatter
* @return mixed $value
* @throws TypeError
*/
public function format($value, Formatter $formatter)
{
if (!is_numeric($value)) {
throw new TypeError("A non-numeric value encountered");
}

if ($value == 0) {
return '0.000';
}
Expand Down
6 changes: 0 additions & 6 deletions Columns/Metrics/Min.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

Expand Down
12 changes: 6 additions & 6 deletions Columns/Metrics/MinPercent.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\PerformanceAudit\Columns\Metrics;

require PIWIK_INCLUDE_PATH . '/plugins/PerformanceAudit/vendor/autoload.php';

use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use TypeError;

class MinPercent extends Min
{
Expand Down Expand Up @@ -41,9 +36,14 @@ public function getDocumentation()
* @param mixed $value
* @param Formatter $formatter
* @return mixed $value
* @throws TypeError
*/
public function format($value, Formatter $formatter)
{
if (!is_numeric($value)) {
throw new TypeError("A non-numeric value encountered");
}

return mb_substr($formatter->getPrettyPercentFromQuotient($value / 100), 0, -1);
}
}
Loading

0 comments on commit 39924f6

Please sign in to comment.