=== PHP Upgrade Check ===
Contributors: moondakhilesh
Tags: php, php 8, compatibility, upgrade, php version
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Find out which plugins and themes will break before you upgrade PHP. Checks PHP 7.4 to 8.5, works on every host, and explains each problem.

== Description ==

Your host is moving you to a newer PHP version, or WordPress is telling you your PHP is outdated. Before you switch, you want to know: **will anything on my site break?**

PHP Upgrade Check reads the code of your plugins and themes and tells you, file by file and line by line, what will stop working on the PHP version you pick.

**What makes it different**

* **Checks PHP 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5.** It uses the current development version of the PHPCompatibility rules, so changes made in recent PHP releases are covered, not just PHP 7.
* **Works on any host.** The scan runs inside PHP itself. It does not need `exec()`, `shell_exec()` or any command-line tools, so it works on managed hosts that disable them.
* **Tells you what actually changes for you.** Problems that already exist on the PHP version you run today are listed separately, so the report shows what the upgrade itself will break, not old code that never runs.
* **Sorted by how bad it is.** "Site may go down" (PHP cannot even read the file), "Will break" (fails when that code runs) and "Deprecated" (still works, logs a warning) are kept apart, worst first.
* **Explains each problem in plain words** and what to do: update the plugin, ask the author, or change one line.
* **Spots updates you have not installed.** If a plugin with problems has a newer version available, the report tells you to update first and scan again.
* **Fewer false alarms on WordPress.** Functions that WordPress itself provides on older PHP versions (polyfills) are not reported.
* **Safe.** It only reads files. Nothing on your site is changed. The scan runs in small batches, so it finishes even on hosts with short time limits, and it keeps memory use low on large sites.
* **Share the result.** Copy the report as text or download it as CSV to send to your developer or plugin authors.

**How to use it**

1. Go to **Tools → PHP Upgrade Check**.
2. Pick the PHP version you want to move to. The recommended one is preselected.
3. Select the plugins and themes to check (active ones are preselected) and click **Start scan**.
4. Read the report. Anything marked "Site may go down" or "Will break" should be fixed or updated before you upgrade.

**Important**

This is a static check of the code. It finds most compatibility problems, but not all of them: some depend on data that only exists when the site runs. Always test on a staging copy before upgrading a live site.

== Frequently Asked Questions ==

= Does it change anything on my site? =

No. It only reads plugin and theme files. It stores the last report in your database so you can see it again later; uninstalling the plugin deletes it.

= My host disables exec(). Will it work? =

Yes. That is one of the main reasons this plugin exists. The scanner runs inside PHP and never starts other programs.

= Which PHP versions can I check against? =

7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5. The list shows your current version and anything newer.

= A popular plugin shows problems. Is the scan wrong? =

Check the label first. "Already on current PHP" means the issue exists on the version you run today, so upgrading does not change it. For "Will break" issues, first install any available update for that plugin and scan again. If the problem is still there, send the report to the plugin's author.

= Why are vendor/ folders skipped by default? =

Third-party libraries inside plugins are usually maintained and checked by their own authors, and skipping them makes the scan much faster. Untick the option to include them.

= How long does a scan take? =

Small sites take seconds. A very large plugin such as WooCommerce (about 3,000 PHP files) takes a few minutes. You can keep the page open and watch the progress bar.

= Does it work on multisite? =

Yes. Because the report covers plugins and themes installed for the whole network, only super admins can run it (Tools → PHP Upgrade Check on any site of the network).

== Screenshots ==

1. Pick the PHP version and the plugins and themes to check.
2. The report, worst problems first, with the file, line and what to do.

== Changelog ==

= 1.0.0 =
* First release.

== Credits ==

The scan is powered by PHP_CodeSniffer (BSD-3-Clause), PHPCSUtils (LGPL-3.0-or-later), PHPCompatibility, PHPCompatibilityWP and PHPCompatibilityParagonie (LGPL-3.0-or-later). Their licence files are included in the lib/ folder.
