Skip to content

Instantly share code, notes, and snippets.

@ozh
Created April 7, 2021 16:37
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ozh/3fa3382eb83d26449daab4b70cd3b299 to your computer and use it in GitHub Desktop.
YOURLS plugin : automatically login with yourls/yourls (for test installs)
<?php
/*
Plugin Name: login yourls password yourls
Description: Just as the name says
Version: 0.1
Author: Ozh
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_action( 'login_form_bottom', 'ozh_login_yourls' );
function ozh_login_yourls( $context ) {
echo <<<EOD
<script>
$('#username').val("yourls");
$('#password').val("yourls");
document.write('<span class="error">( ☠ login/password auto fill ☠ )</span>');
</script>
EOD;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment