Problem Description #
After upgrading the server to PHP 8.1 / 8.2, the site shows deprecated notices such as Creation of dynamic property ClassName::$prop is deprecated that reference the plugin PHP files.
Common symptoms / messages:
- Deprecation warnings that reference plugin class files like class-alg-download-plugins.php and class-alg-download-plugins-settings.php. The site may show warnings in frontend or logs. WordPress.org
Cause:
PHP 8.2 deprecated dynamic property creation. Older plugin class code that creates properties dynamically without declaring them triggers these notices. Plugin authors commonly update code to remove these deprecations.
Solution – step-by-step #
- Update the plugin to latest version
- Check plugin changelog and update to the newest plugin release. The plugin maintainer patched PHP 8.2-related deprecation warnings in an update (e.g., v1.8.4 addressed these warnings). WordPress.org
- If update is not possible, suppress deprecation display (temporary)
On production sites, hide deprecation notices by disabling display of errors in wp-config.php:
// Turn off display of errors
@ini_set(‘display_errors’, 0);
define(‘WP_DEBUG_DISPLAY’, false);
// Keep WP_DEBUG_LOG true to capture logs if desired
define(‘WP_DEBUG_LOG’, true);
- Important: This hides messages but does not fix deprecated code; update plugin ASAP.
- Test on staging after PHP upgrade
- When upgrading PHP, run the site on staging with latest plugins to detect deprecation warnings, then resolve before moving to production.
- Report persistent issues
- If you updated the plugin and deprecation warnings remain, collect WP_DEBUG logs and the exact warnings and post them to the plugin support forum. The plugin dev responded previously and released a fix, so they’ll likely address new or missed deprecations. WordPress.org
- If you updated the plugin and deprecation warnings remain, collect WP_DEBUG logs and the exact warnings and post them to the plugin support forum. The plugin dev responded previously and released a fix, so they’ll likely address new or missed deprecations. WordPress.org
Prerequisites
- Admin access to update plugins.
- Access to staging environment recommended.
Additional notes / prevention
- Always test PHP upgrades on staging and ensure plugin/theme compatibility.
Keep WP_DEBUG_LOG enabled temporarily to capture runtime notices without exposing them to visitors.
