Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP8.2+] Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::x is deprecated while adding external connection #1229

Closed
1 task done
kirtangajjar opened this issue Jun 16, 2024 · 0 comments · Fixed by #1230
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@kirtangajjar
Copy link
Member

kirtangajjar commented Jun 16, 2024

Describe the bug

We get the following deprecation warning while adding a new external connection:

[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$username is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentication.php on line 36
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] PHP   7. Distributor\Authentication->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php:43
[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$password is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentication.php on line 36
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] PHP   7. Distributor\Authentication->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php:43
[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$client_id is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentication.php on line 36
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] PHP   7. Distributor\Authentication->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php:43
[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$client_secret is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentication.php on line 36
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] PHP   7. Distributor\Authentication->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php:43
[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$redirect_uri is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentication.php on line 36
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] PHP   7. Distributor\Authentication->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php:43
[16-Jun-2024 12:23:10 UTC] PHP Deprecated:  Creation of dynamic property Distributor\Authentications\WordPressBasicAuth::$base64_encoded is deprecated in /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/classes/Authentications/WordPressBasicAuth.php on line 46
[16-Jun-2024 12:23:10 UTC] PHP Stack trace:
[16-Jun-2024 12:23:10 UTC] PHP   1. {main}() /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:0
[16-Jun-2024 12:23:10 UTC] PHP   2. do_action($hook_name = 'wp_ajax_dt_verify_external_connection') /Users/kirtangajjar/code/osp-mu/app/public/wp-admin/admin-ajax.php:192
[16-Jun-2024 12:23:10 UTC] PHP   3. WP_Hook->do_action($args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/plugin.php:517
[16-Jun-2024 12:23:10 UTC] PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:348
[16-Jun-2024 12:23:10 UTC] PHP   5. Distributor\ExternalConnectionCPT\ajax_verify_external_connection('') /Users/kirtangajjar/code/osp-mu/app/public/wp-includes/class-wp-hook.php:324
[16-Jun-2024 12:23:10 UTC] PHP   6. Distributor\Authentications\WordPressBasicAuth->__construct($args = ['username' => 'admin', 'password' => 'zDMC 1R7i drKr f38O h7ok XXfT', 'client_id' => '', 'client_secret' => '', 'redirect_uri' => 'http://osp-mu.test/wp-admin/post-new.php?post_type=dt_ext_connection&setupStatus=success&titleField=single&externalSiteUrlField=http3A2F2Fosp.test2F&restRoot=http3A2F2Fosp.test2Fwp-json2F&site_url=httposp.test&user_login=admin&password=zDMC1R7idrKrf38Oh7okXXfT']) /Users/kirtangajjar/code/osp-mu/app/public/wp-content/plugins/distributor/includes/external-connection-cpt.php:256
[16-Jun-2024 12:23:10 UTC] Xdebug: [Step Debug] Could not connect to debugging client. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port).
[16-Jun-2024 12:23:10 UTC] Xdebug: [Step Debug] Could not connect to debugging client. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port).
[16-Jun-2024 12:23:10 UTC] Xdebug: [Step Debug] Could not connect to debugging client. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port).

Steps to Reproduce

  1. Create a site with PHP 8.2+
  2. Create an external connection
  3. See the warning in debug logs

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kirtangajjar kirtangajjar added the type:bug Something isn't working. label Jun 16, 2024
@vikrampm1 vikrampm1 moved this from Incoming to Code Review in Open Source Practice Jun 17, 2024
@vikrampm1 vikrampm1 added this to the 2.1.0 milestone Jun 17, 2024
@jeffpaul jeffpaul moved this from Code Review to QA Testing in Open Source Practice Aug 19, 2024
@github-project-automation github-project-automation bot moved this from QA Testing to Done in Open Source Practice Aug 21, 2024
@dkotter dkotter modified the milestones: 2.1.0, 2.0.6 Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants