View Categories

Fix Deprecated Errors on PHP 8.2

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 #

  1. Update the plugin to latest version

    1. 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

  2. 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);

  1.  Important: This hides messages but does not fix deprecated code; update plugin ASAP.

  1. Test on staging after PHP upgrade

    1. When upgrading PHP, run the site on staging with latest plugins to detect deprecation warnings, then resolve before moving to production.

  2. Report persistent issues

    1. 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.

 

Download Plugins and Themes from WordPress Dashboard