Analyzing WordPress Plugins

If you analyze a WordPress plugin, you might see warnings that built-in WordPress functions or classes were not found. In that case, WordPress is not yet set-up as a dependency of your project.

To fix this, add the WordPress mirror johnpbloch/wordpress as a composer dependency, simply run this command in your WordPress plugin folder:

composer require --dev johnpbloch/wordpress

After that, commit the composer.json and composer.lock file and re-run your inspection.

In case you do not want to commit the files, you can also just add those commands in your Scrutinizer config. Then they are only run in our build environment:

build:
    nodes:
        analysis:
            dependencies:
                before:
                    - composer require --dev johnpbloch/wordpress

Also, make sure to mark the new directory as a dependency in your project:

filter:
    dependency_paths:
        - wordpress/