Automattic / Automattic/media-explorer

Deprecation Warning Thrown on PHP8.2

Open
#84 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
123
Forks
30
PR merge metrics
No merged PRs in 30d

Description

## Issue

On PHP 8.2, the plugin throws the following deprecation warnings:

```php
PHP Deprecated: Creation of dynamic property Media_Explorer::$file is deprecated in /my-cool-path/wp-content/plugins/media-explorer/class.plugin.php on line 27
```

```php
PHP Deprecated: Creation of dynamic property Media_Explorer::$plugin is deprecated in /my-cool-path/wp-content/plugins/media-explorer/class.plugin.php on line 89

```

## Proposed solution

Add the props to the class so that they aren't dynamically created.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open class.plugin.php and inspect the Media_Explorer class around lines 27 and 89, where the warnings identify dynamic properties. Define the mentioned properties on the class, then verify on PHP 8.2 that the plugin no longer emits those deprecation warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.