Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught Error: Call to undefined function WordPress\Plugin_Check\wp_normalize_path() #68

Closed
jcvignoli opened this issue Apr 7, 2024 · 3 comments

Comments

@jcvignoli
Copy link

The workflow fails to run with the following message:

✔ Ran `wp plugin list-check-categories` in 'cli'. (in 0s 532ms)
ℹ Starting 'wp plugin check dist --format=json --exclude-directories=vendor,.wordpress-org --require=./wp-content/plugins/plugin-check/cli.php' on the cli container. 

[07-Apr-2024 13:33:54 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function WordPress\Plugin_Check\wp_normalize_path() in /var/www/html/wp-content/plugins/plugin-check/includes/Plugin_Context.php:45
Stack trace:
#0 /var/www/html/wp-content/plugins/plugin-check/cli.php(32): WordPress\Plugin_Check\Plugin_Context->__construct('/var/www/html/w...')
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php(141): require_once('/var/www/html/w...')
#2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadRequiredCommand.php(56): WP_CLI\Utils\load_file('./wp-content/pl...')
#3 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LoadRequiredCommand->process(Object(WP_CLI\Bootstrap\BootstrapState))
#4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#5 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('phar:///usr/loc...')
#6 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#7 {main}
  thrown in /var/www/html/wp-content/plugins/plugin-check/includes/Plugin_Context.php on line 45
✖ Command failed with exit code 255
Command failed with exit code 255

until three days ago, it wasn't throwing this error. My yml:

name: 'WP plugin check'
on:
  push:
    branches: "*"
  pull_request:
jobs:
  standard:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Run plugin check
      uses: swissspidy/wp-plugin-check-action@v1
      with:
        build-dir: './dist'
        exclude-directories: 'vendor,.wordpress-org'

@swissspidy
Copy link
Member

Oh that‘s odd, looks like a bug in the plugin itself in the current development version.
As a workaround you can use the @main version for now

@swissspidy
Copy link
Member

This will be fixed in WordPress/plugin-check#453

@jcvignoli
Copy link
Author

It has been fixed, thanks @swissspidy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants