-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update instance switching feature #36
Conversation
modules/instance_switcher.php
Outdated
|
||
public static function load() { | ||
// load textdomain for translations | ||
add_action( 'plugins_loaded', array( 'Seravo\InstanceSwitcher', 'load_our_textdomain' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to load a new text domain for this module of our plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removed.
js/instance_switcher.js
Outdated
e.preventDefault(); | ||
var instance = e.target.getAttribute('href').substr(1); | ||
if (instance === 'exit') { | ||
document.cookie = "seravo_shadow=;path=/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change cookie name, we have external dependencies on wpp_shadow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You asked me to rename all wpp_ -> seravo_ so I did. Anyway, changed them back now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I did ask to update the code and internally in the code it should use seravo_ in function names etc but in this one place there is an external dependency. Shadows don't work all if the cookie name is wrong, which you probably noticed when you tested the plugin and switching shadows with seravo_shadow cookie name.
modules/instance_switcher.php
Outdated
?> | ||
<style>#shadow-indicator { font-family: Arial, sans-serif; position: fixed; bottom: 0; left: 0; right: 0; width: 100%; color: #fff; background: #cc0000; z-index: 3000; font-size:16px; line-height: 1; text-align: center; padding: 5px } #shadow-indicator a.clearlink { text-decoration: underline; color: #fff; }</style> | ||
<div id="shadow-indicator"> | ||
<?php echo wp_sprintf( __('You are currently in %s.', 'seravo-instance-switcher'), getenv( 'WP_ENV' ) ); ?> <a class="clearlink" href="/?seravo_shadow=clear"><?php _e('Exit', 'seravo-instance-switcher'); ?></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no custom text domain here please. Use the seravo-plugin text domain everywhere in this plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, changed.
modules/instance_switcher.php
Outdated
* Load our textdomain | ||
*/ | ||
public static function load_our_textdomain() { | ||
load_plugin_textdomain( 'wp-safe-updates', false, dirname( plugin_basename(__FILE__) ) . '/languages/' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto textdomain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removed the whole function as unneeded.
modules/instance_switcher.php
Outdated
} | ||
} | ||
|
||
$instances = InstanceSwitcher::load_shadow_list(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
db127a5
to
48413cd
Compare
New changes pushed to this branch recently, ready for a new review. |
No description provided.