surveyjs-wordpress icon indicating copy to clipboard operation
surveyjs-wordpress copied to clipboard

Back button returns user to potentially wrong admin URL.

Open plutotom opened this issue 3 years ago • 1 comments

The back button on pages, Edit, Results, and Clone returns the user to a URL that is hardcoded as <button onclick="window.location = '/wp-admin/admin.php?page=sjs-main-menu'">&lt&nbspBack</button>

Removing styling from button for readability.

I believe this would be a more dynamic way of returning the user to the admin page.

<button onclick="window.location = '<?php echo get_admin_url() ?>?page=sjs-main-menu'">&lt&nbspBack</button>

I bring this up because if a developer is working in a development environment then they may have a URL that looks like localhost/wordpress/site2/wp-admin/admin.php?page=sjs-main-menu as opposed to assuming the URL: localhost/wp-admin/admin.php?page=sjs-main-menu.

The problem is that in the current implementation of onclick="window.location = '/wp-admin/ will return the user to the URL localhost/wp-admin/ every time, even if it should return them to the URL localhost/wordpress/site2/wp-admin/.

plutotom avatar Feb 23 '22 15:02 plutotom

Thank you for the feedback. We'll take it in account during future plugin improvements.

tsv2013 avatar Feb 24 '22 09:02 tsv2013