| 开发者 |
hackrepair
tvcnet |
|---|---|
| 更新时间 | 2026年11月22日 04:57 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
exec() or shell access needed), automatically filters out runtime version guards and polyfills, and prioritizes potential fatal errors and unknown-impact findings for review.
Open Tools > PHP Checker, pick your target PHP version (8.1, 8.2, 8.3, 8.4, or 8.5), and click Scan. It checks:
version_compare(), PHP_VERSION_ID, function_exists(), class_exists(), defined(), extension_loaded()), automatically downgrading safe backward-compatibility code to informational notes so you only see real issues#[AllowDynamicProperties] (including inheritance), stdClass, magic __set() handlers, constructor-promoted properties, and declared propertiesfile:line, target PHP version, rule code, and code origin — clearly distinguishing between the plugin or theme's own code and a bundled third-party library (vendor/, freemius/, action-scheduler/, pear/, phpmailer/, etc.)file:line error tables open; minor deprecation warnings are grouped below with collapsible technical drawers so you are never overwhelmed by a wall of stack traces.
Your scans build a local history. Completed scans are saved on your own site (up to 25 reports within a 600,000-byte limit), showing what is new and what you have fixed since your previous check for that PHP version. Pause, reopen, delete, or clear history anytime.
Share or email a report. Copy the plain-text report for a developer or support ticket, download a .txt file, print a clean summary, or email a formatted HTML and plain-text PHP readiness briefing to site administrators with [domain] [PHP Checker] subject tags.
Optional scheduled PHP readiness email. Off by default. Choose weekly (with a day of the week) or monthly (day 1 to 28) to automatically email site administrators a PHP readiness report, or only when errors or warnings are found.
Privacy
Static scans inspect local PHP source files on your server in 5-second AJAX steps without executing plugin/theme code or sending source code or report contents to any outside service. Optional Update Pre-Scan (off by default) downloads pending update zip packages from their configured update URLs to a temporary file, inspects PHP entries in memory, and deletes the temporary file immediately.
Scan results and report history stay in your site's database and automatically prune uninstalled plugins/themes. Reports leave your site only when an administrator copies, downloads, prints, or emails them, or enables the monthly email.
See External services below for the few requests PHP Checker makes, and when.
What it is not
Static analysis parses PHP source tokens without executing your site's code. While version-guard handling downgrades common backward-compatibility code to notes, static analysis cannot replace testing critical workflows (like WooCommerce checkout or membership forms) on a staging server before switching PHP versions in production. If you want a deeper look or hands-on help with a tricky PHP upgrade, The Hack Repair Guy can help.
Credits
Static analysis uses PHP_CodeSniffer 4.0.4 (BSD-3-Clause), PHPCSUtils 1.2.3 (LGPL-3.0-or-later), PHPCompatibility (development snapshot, commit a0fd248812fd, LGPL-3.0-or-later), PHPCompatibilityWP 3.0.0-alpha2 (LGPL-3.0-or-later) and PHPCompatibilityParagonie 2.0.0-alpha2 (LGPL-3.0-or-later). They are bundled in vendor/thrg-scan-engine/ as runtime code, loaded only when an administrator runs a scan; unused tools and tests are removed and each folder keeps its license.
thrg-php-checker folder to wp-content/plugins/.E_DEPRECATED notice to let developers know it will be removed in a future PHP version. Your site can still run on the target PHP version today (keep WP_DEBUG_DISPLAY off on live production sites and update the plugin as new releases arrive).Many WordPress plugins support both older and newer PHP versions by wrapping legacy calls in version_compare( PHP_VERSION, '8.0', '<' ) or if ( ! function_exists( 'str_contains' ) ) polyfills. Those lines never run on newer PHP versions, so they are not real problems. PHP Checker's token-stream analyzer (THRG_PC_Context) inspects surrounding if/elseif/else conditions and early-return guards, automatically downgrading safe fallbacks to collapsed informational notes.
PHP 8.2 deprecated creating undeclared properties on class instances, with official exceptions documented in the PHP 8.2 Migration Guide. PHP Checker inspects class declarations and inheritance chains in each file and skips classes with #[AllowDynamicProperties] (direct or inherited), stdClass and its subclasses, classes implementing magic __set(), constructor-promoted properties, and declared properties.
Every file:line finding shows whether the file lives in the plugin/theme's own code (Plugin code / Theme code) or inside a bundled third-party library (Bundled dependency, such as vendor/, freemius/, action-scheduler/, pear/, or phpmailer/). This helps developers and site owners know immediately whether an issue is in custom code they control or an upstream SDK that will be updated by the vendor.
No. Scanning runs only when an administrator starts it (or turns on the scheduled readiness email) and processes files in 5-second time-boxed AJAX slices. If a single large plugin has thousands of files, PHP Checker saves file-level progress after 5 seconds and resumes on the next slice automatically. Files larger than 2 MB are skipped safely and marked as partial rather than crashing PHP memory.
PHP Checker automatically prunes uninstalled plugins/themes and outdated component versions whenever results are loaded. Uninstalling PHP Checker itself removes all of its options and scheduled hooks cleanly.
scanned/total counts on partial scans, widened the scan scope dropdown, and stopped "active plugins only" scans from reporting unscanned inactive plugins as incomplete.function ClassName()) as errors when scanning for PHP 8.0 or higher.<hr class="wp-header-end" /> after the PHP Checker header and tucked third-party WordPress/plugin notices behind a collapsible Show bar while keeping PHP Checker's own notices visible.mcrypt_*, mysql_*, and ereg_* symbols inside function_exists() and extension_loaded() checks.Internal.* formatting/line-ending sniffs (such as Internal.LineEndings.Mixed) from compatibility scan results.THRG_PC_Context guard analysis to recognize if (function_exists(...)) when checking core built-in functions guaranteed on the target PHP version (such as error_clear_last on PHP 7.0+), downgrading their dead else branches and variables only assigned inside guarded branches (isset($var)).RemovedIniDirectives, ArgumentFunctionsReportCurrentValue) are distinguished from hard fatal-error rules in card summaries and the Readiness Verdict banner.since PHP 7.0, since PHP 8.2) in finding tables and deprioritized ArgumentFunctionsReportCurrentValue.NeedsInspection warnings below actionable findings.THRG_PC_Results::file_origin() bundled dependency detection to include libraries, library, lib, libs, sdk, sdks, mailer, and imap2 directories.(?) pop-out tooltips next to each item in the left-column Tools & Settings navigation explaining what each section is for.THRG_PC_Prescan::check_wporg_fix()), checking whether a plugin from WordPress.org that fails a scan has a newer release, stream-scanning the newer package in memory against the target PHP version, and badging the card (Fixed in vX.Y on WordPress.org, Fatal errors fixed in vX.Y, or Still fails in vX.Y) with a one-click Check if fixed on WP.org button.THRG_PC_Runtime_Log), with an opt-in live E_DEPRECATED / E_USER_DEPRECATED collector (including backtrace attribution for WordPress _deprecated_function() calls) plus an on-demand wp-content/debug.log deprecation importer.breaks) now appear at the very top of Checks & Findings above the fold, followed by deprecation warnings, server lifecycle status, and a collapsible table of compatible components.in plugin code vs. in bundled library), a highlighted What to do callout, and sorted tables that place ERROR rows and first-party code at the top.Pear, PHPMailer, TCPDF, Dompdf, mPDF, Strauss, Mozart, and vendor-prefixed directories..button CSS specificity so the Stop Scan button stays hidden when no scan is running, and improved long rule-code wrapping inside finding tables.Tools > PHP Checker).PHP_CodeSniffer 4.0.4 and PHPCompatibilityWP 3.0.0-alpha2 with zero exec() calls.THRG_PC_Context) that downgrades version-guarded code to informational notes.#[AllowDynamicProperties] inheritance, stdClass, magic __set(), and constructor property promotion.file:line, target PHP version, triggered rule code, and Plugin code vs. Bundled dependency origin classification.