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

Update instance switching feature #36

Merged
merged 2 commits into from
May 9, 2017
Merged

Conversation

mhaulo
Copy link
Contributor

@mhaulo mhaulo commented May 5, 2017

No description provided.


public static function load() {
// load textdomain for translations
add_action( 'plugins_loaded', array( 'Seravo\InstanceSwitcher', 'load_our_textdomain' ) );
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removed.

e.preventDefault();
var instance = e.target.getAttribute('href').substr(1);
if (instance === 'exit') {
document.cookie = "seravo_shadow=;path=/";
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

?>
<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>
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed.

* Load our textdomain
*/
public static function load_our_textdomain() {
load_plugin_textdomain( 'wp-safe-updates', false, dirname( plugin_basename(__FILE__) ) . '/languages/' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto textdomain

Copy link
Contributor Author

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.

}
}

$instances = InstanceSwitcher::load_shadow_list();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@mhaulo mhaulo force-pushed the update_instance_switching_feature branch from db127a5 to 48413cd Compare May 7, 2017 19:21
@mhaulo
Copy link
Contributor Author

mhaulo commented May 7, 2017

New changes pushed to this branch recently, ready for a new review.

@ottok ottok merged commit dfab5ac into master May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants