Skip to content

Commit

Permalink
Indicate default username and password on wp-login.php (#136)
Browse files Browse the repository at this point in the history
* Indicate default username and password on `wp-login.php`

* Use a named file instead of `my-hacks.php`
  • Loading branch information
danielbachhuber authored Feb 21, 2023
1 parent 583a02b commit b84dfee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Add a notice to wp-login.php offering the username and password.
*/

add_action(
'login_message',
function() {
return <<<EOT
<div class="message info">
<strong>username:</strong> <code>admin</code><br /><strong>password</strong>: <code>password</code>
</div>
EOT;
}
);
5 changes: 5 additions & 0 deletions src/wordpress-playground/worker-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ class WordPressPatcher {
`${DOCROOT}/wp-content/mu-plugins/add_requests_transport.php`,
require('./mu-plugins/add_requests_transport.php')
);
// Various tweaks
this.#php.writeFile(
`${DOCROOT}/wp-content/mu-plugins/1-show-admin-credentials-on-wp-login.php`,
require('./mu-plugins/1-show-admin-credentials-on-wp-login.php')
);
}
#patchFile(path, callback) {
this.#php.writeFile(path, callback(this.#php.readFileAsText(path)));
Expand Down

0 comments on commit b84dfee

Please sign in to comment.