Skip to content
Closed
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
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/composer.lock
/gruntfile.js
/package.json
/package-lock.json
/phpcs.xml
/README.md
/SECURITY.md
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/.jshintrc export-ignore
/composer.lock export-ignore
/gruntfile.js export-ignore
/package-lock.json export-ignore
/phpcs.xml export-ignore
/phpstan.neon.dist export-ignore
/README.md export-ignore
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/deploy-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -19,8 +19,11 @@ jobs:
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2

- name: Install Strauss
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'

- name: Build
run: composer install -a --no-dev
run: composer install -o --no-dev

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/lint_phpcs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP CodeSniffer lint
name: PHPCS

on:
pull_request:
Expand All @@ -18,11 +18,11 @@ jobs:
operating-system: [ubuntu-latest]
php-versions: ['8.3']

name: WPRocket lint with PHPCS. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
name: PHP ${{ matrix.php-versions }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -31,8 +31,11 @@ jobs:
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2

- name: Install Strauss
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts
run: composer install --no-interaction

- name: Lint with phpcs
- name: Run PHPCS
run: composer phpcs
16 changes: 9 additions & 7 deletions .github/workflows/lint_phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP Stan lint
name: PHPStan

on:
pull_request:
Expand All @@ -15,15 +15,14 @@ jobs:
runs-on: ${{ matrix.operating-system }}

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
php-versions: ['8.3']

name: WPRocket lint with PHP Stan. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
name: PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,9 +31,12 @@ jobs:
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: composer:v2

- name: Install Strauss
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts
run: composer install --no-interaction

- name: Lint with PHP Stan
- name: Run PHPStan
run: composer run-stan -- --error-format=github

18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
wp-versions: ['latest']

name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }}

env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
Expand All @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -62,14 +62,20 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Strauss
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts --ignore-platform-reqs
run: composer install --no-interaction

- name: Install tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}

- name: Mysql8 auth plugin workaround
run: sudo mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"

- name: Test
run: composer run-tests
- name: Unit tests
run: composer test-unit

- name: Integration tests
run: composer test-integration
18 changes: 12 additions & 6 deletions .github/workflows/test_legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4']
php-versions: ['7.4']
wp-versions: ['5.9']

name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }}

env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
Expand All @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -72,11 +72,17 @@ jobs:
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Strauss
run: sh -c 'test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/latest/download/strauss.phar'

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-scripts
run: composer install --no-interaction

- name: Install tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}

- name: Test
run: composer run-tests
- name: Unit tests
run: composer test-unit

- name: Integration tests
run: composer test-integration
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
/node_modules
/Tests/env/local
/vendor

# Files
.DS_Store
/gruntlocalconf.json
composer.lock
package-lock.json
/_dev/node_modules
.phpunit.result.cache
bin/strauss.phar
composer.lock
Empty file added bin/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions classes/Admin/AdminBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct( User $user ) {
*/
public static function get_subscribed_events(): array {
return [
// @action
'wp_ajax_imagify_get_admin_bar_profile' => 'get_admin_bar_profile_callback',
// @action
'admin_bar_menu' => [ 'add_imagify_admin_bar_menu', IMAGIFY_INT_MAX ],
];
}
Expand Down
2 changes: 2 additions & 0 deletions classes/Admin/AdminSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public static function get_subscribed_events() {
$basename = plugin_basename( IMAGIFY_FILE );

return [
// @filter
'plugin_action_links_' . $basename => 'plugin_action_links',
// @filter
'network_admin_plugin_action_links_' . $basename => 'plugin_action_links',
];
}
Expand Down
46 changes: 46 additions & 0 deletions classes/Admin/PluginFamilySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,50 @@ public function install_activate() {
public function display_error_notice() {
$this->plugin_family->display_error_notice();
}

/**
* Enqueue block editor assets.
*
* @return void
*/
public function enqueue_assets(): void {
$this->plugin_family->enqueue_assets();
}

/**
* Install Imagify using the ajax request.
*
* @return void
*/
public function install_imagify(): void {
$this->plugin_family->install_imagify();
}

/**
* Enqueue Admin assets.
*
* @param string $page Page ID.
* @return void
*/
public function enqueue_admin_assets( $page ): void {
$this->plugin_family->enqueue_admin_assets( $page );
}

/**
* Insert admin footer JS templates.
*
* @return void
*/
public function insert_footer_templates(): void {
$this->plugin_family->insert_footer_templates();
}

/**
* Dismiss promote Imagify using the ajax request.
*
* @return void
*/
public function dismiss_promote_imagify(): void {
$this->plugin_family->dismiss_promote_imagify();
}
}
1 change: 1 addition & 0 deletions classes/CDN/CDN.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CDN implements SubscriberInterface {
*/
public static function get_subscribed_events() {
return [
// @filter
'imagify_cdn_source_url' => 'get_cdn_source',
];
}
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading