tinuzz / wp-plugin-trackserver

A WordPress plugin for GPS tracking and publishing
https://wordpress.org/plugins/trackserver/
36 stars 12 forks source link

Warning: Undefined array key "enable_proxy" #37

Closed SPalette closed 10 months ago

SPalette commented 1 year ago

Hello Mr. Grendelman,

a new warning occurs while configuring trackserver.

Warning: Undefined array key "enable_proxy" in [...]/wp-content/plugins/trackserver/class-trackserver-settings.php on line 257

My personal workarround: bevore setting "enable_proxy", check if isset($options['enable_proxy']).

Tested on IONOS-shared Server PHP 8.0 WP 6.1.1

Regards Stephan

SPalette commented 1 year ago

Another warning: I use your workarround for undefined var $url (we talked about in another issue). Now occurs a warning concerning var "ts_user_meta" in class-trackserver.php on line 1438. I avoided this warning also via check if isset($_POST['ts_user_meta']).

Tested on IONOS-shared Server PHP 8.0 WP 6.1.1

Have a nice day Stephan

tinuzz commented 10 months ago

Late reply, I'm sorry. I fixed the first warning; it was indeed occurring when you update the settings with the proxy disabled.

The second warning, I don't understand, and I have not been able to reproduce it. The only way that that code is run, is when you update your profile from the backend, and in that case, $POST['ts_user_meta'] should always be set. What's more, that function is only called from Trackserver_Admin::load_your_profile, and that function actually checks whether $POST['ts_user_meta'] is set.

Thank you for the report!