Giter Club home page Giter Club logo

magic-login's Introduction

Support Level Release Version WordPress tested up to version Required PHP Version

Welcome to our GitHub Repository

Passwordless login for WordPress.

More information can be found at handyplugins.co.

Installation

For detailed setup instructions, visit the official Documentation page.

Support

This is a developer's portal for Magic Login and should not be used for support. Please visit the support forums if you need to submit a support request.

Credits

magic-login's People

Contributors

dependabot[bot] avatar emreerkan avatar maartenhunink avatar mustafauysal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

magic-login's Issues

Change error message when forcing magic login

It could be better to say Invalid magic login token, try to create <a href="%s">a new login link</a>? instead Invalid magic login token. <a href="%s">Try signing in instead</a>? when forcing magic login as the default login method.

A Better UI for default Login Button

The default login button seems to be a secondary action when having magic login enabled. Add the default login button in the same way we inject "Send me the login link"

html email tpl translates into line breaks

if ( false !== stripos( $header, 'text/html' ) ) {
// convert line breaks to br
$login_email = nl2br( $login_email );

Is this desired?

Shouldn't it be the other way around, only add line breaks when there is no HTML markup in the mail?

Otherwise, each line break in the markup adds a visual line break, which adds a lot of empty space into the email and the layout breaks.

Comments for translators

When using parameters/placeholders in translations strings it would be best that using translation comments to convey the context to the translators.

For example;

Login link will expire in %1$s %2$s.

As a translator, I can guess what are these parameters but I can't be sure. If they are definitive date values or relative values, or one of them maybe a number and the other one maybe the unit.

Using a comment just above the code helps translators when they see it on GlotPress (and even some other software like PoEdit that supports this convention)

/* translators: 1: TTL value (number) 2: Unit (minute(s), hour(s), days(s)) */  
$login_message .= sprintf( __( 'Login link will expire in %1$s %2$s.', 'magic-login' ), $token_ttl, $selected_interval_str );

Thanks in advance,
Cheers

Shortcode Support

Ideally, the login form could be placed anywhere on the site. A shortcode would be handy to achieve this.

Fire: "wp_login" hook

It's popular the usage of "wp_login" hook by 3rd party plugins. We should fire this on the login process.

sending multiple emails

It's a weird case, but when a page has more than one magic login form, it sends multiple emails simultaneously. This should be avoided.

Login form block

Shortcode is ok, but a customizable login form would be better

ajaxify

Ajaxify process for better UX

Untranslatable/Hard to translate strings

There is at least one instance that there is a string scattered to pieces instead of using placeholders for variables. Every language has it's own structure and partial strings like this are very hard to translate and sometimes even impossible.

The strings loses the context, the overall meaning of the translation gets hideous. Even if a translator checks the code and tries to construct a good translation, when those string parts are used in other areas of the code, it'll create more conflicts.

This is the part that I'm referencing:

<?php esc_html_e( 'Block the IP address for', 'magic-login' ); ?>
<input
    id="brute_force_bantime"
    name="brute_force_bantime"
    min="1"
    max="1440"
    type="number"
    class="sui-form-control sui-field-has-suffix"
    value="<?php echo absint( $settings['brute_force_bantime'] ); ?>"
>
<?php esc_html_e( 'minutes when it fails to login ', 'magic-login' ); ?>
<input
    id="brute_force_login_attempt"
    name="brute_force_login_attempt"
    min="1"
    max="100"
    type="number"
    class="sui-form-control sui-field-has-suffix"
    value="<?php echo absint( $settings['brute_force_login_attempt'] ); ?>"
>
<?php esc_html_e( 'times in', 'magic-login' ); ?>
<input
    id="brute_force_login_time"
    name="brute_force_login_time"
    min="1"
    max="600"
    type="number"
    class="sui-form-control sui-field-has-suffix"
    value="<?php echo absint( $settings['brute_force_login_time'] ); ?>"
>
<?php esc_html_e( 'minutes.', 'magic-login' ); ?>

The string should be like this;

/* translators: 1: Ban duration input 2: Trial count input 3: Interval input */
printf( __( 'Block the IP address for %1$s minutes when it fails to login %2$s times in %3$s minutes.', 'magic-login' ),
  $brute_force_bantime_input,
  $brute_force_login_attempt_input,
  $brute_force_login_time_input
); // WPCS: XSS ok.

And of course you have to fill those variables. :)

For example, if you construct the string the way I propose then it's translation would be like this;

%3$s dakika içinde %2$s kere başarısız giriş olursa IP adresini %1$s dakika engelle.

As you can see, the placeholders are all reversed because of the language structure.

At the end, it's best to avoid this kind of strings and use placeholders (and of course translator comments) as much as possible.

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.