Skip to content

Commit 7cb0a80

Browse files
committed
daily
1 parent 6d5f98a commit 7cb0a80

4 files changed

Lines changed: 44 additions & 38 deletions

File tree

mu-disable-updates/disable-updates.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
Plugin Name: Disable Updates and Update HTTP Requests (MU)
4-
Version: 0.5.3
4+
Version: 0.5.4
55
Description: Disable core, theme and plugin updates plus the browser nag
66
Plugin URI: https://github.com/szepeviktor/wordpress-plugin-construction
77
License: The MIT License (MIT)
@@ -181,7 +181,7 @@ public function disable_admin_bar_updates_menu() {
181181
/**
182182
* Return the current time and core version
183183
*/
184-
public function last_checked_core() {
184+
public function last_checked_core( $transient ) {
185185

186186
return (object) array(
187187
'last_checked' => time(),
@@ -193,7 +193,7 @@ public function last_checked_core() {
193193
/**
194194
* Return the current time and theme versions
195195
*/
196-
public function last_checked_themes() {
196+
public function last_checked_themes( $transient ) {
197197

198198
$current = array();
199199
$installed_themes = wp_get_themes();
@@ -211,7 +211,7 @@ public function last_checked_themes() {
211211
/**
212212
* Return the current time and plugin versions
213213
*/
214-
public function last_checked_plugins() {
214+
public function last_checked_plugins( $transient ) {
215215

216216
$current = array();
217217
$plugins = get_plugins();

shared-hosting-aid/Malware.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ See: webserver/Production-website.md
202202

203203
See: shared-hosting-aid/remote-log-watch.sh
204204

205+
### Tail remote log with lftp
206+
207+
```
208+
repeat 2s "cat ../log/error.log | tail"
209+
```
210+
205211
### Tripwire from cron job
206212

207213
```bash
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
<?php
22
/*
33
Snippet Name: Create a user from hardcoded data and log in to WordPress.
4-
Snippet URI: https://github.com/szepeviktor/wordpress-plugin-construction
4+
Version: 0.2.3
55
Description: Unzip WordPress instead of uploading it file-by-file
6-
Version: 0.2.2
6+
Snippet URI: https://github.com/szepeviktor/wordpress-plugin-construction
77
License: The MIT License (MIT)
88
Author: Viktor Szépe
99
*/
1010

1111
/**
1212
* Usage
1313
*
14-
* 1. Fill in your user details below.
14+
* 1. Fill in your user details below
1515
* 2. Set a strong password! (user_pass)
16-
* 3. Upload this file to your WordPress directory.
17-
* 4. Load it in your browser: <YOURSITE.NET/WP-DIR>/wp-create-user.php
16+
* 3. Upload this file to your WordPress directory
17+
* 4. Load it in your browser: https://www.example.com/wordpress/wp-create-user.php
1818
*/
1919

20-
$wcu_userdata = (object)array(
21-
'user_login' => "viktor",
22-
'nickname' => "v",
23-
'role' => "administrator",
24-
'user_email' => "viktor@szepe.net",
25-
'user_url' => "http://www.online1.hu/",
26-
'first_name' => "Viktor",
27-
'last_name' => "Szépe",
28-
'comment_shortcuts' => "",
20+
$wcu_userdata = (object) array(
21+
'user_login' => 'viktor',
22+
'nickname' => 'v',
23+
'role' => 'administrator',
24+
'user_email' => 'viktor@szepe.net',
25+
'user_url' => 'https://github.com/szepeviktor',
26+
'first_name' => 'Viktor',
27+
'last_name' => 'Szépe',
28+
'comment_shortcuts' => '',
2929
'use_ssl' => 0,
30-
'user_pass' => "12345"
30+
'user_pass' => '12345',
3131
);
3232

33+
@ini_set( 'display_errors', 1 );
34+
@error_reporting( E_ALL );
35+
3336
$wcu_html = '<!DOCTYPE html>
3437
<html>
3538
<meta charset="UTF-8">
@@ -39,36 +42,33 @@
3942
</body>
4043
</html>
4144
';
45+
4246
$wcu_html_ok = '
4347
New user ID = %s
4448
<script type="text/javascript">setTimeout(function () { window.location.href="%s"; }, 3000);</script>
4549
';
4650

47-
@ini_set( 'display_errors', 1 );
48-
@error_reporting( E_ALL );
49-
5051
$wcu_wpload_path = dirname( __FILE__ ) . '/wp-load.php';
5152

52-
if ( ! file_exists( $wcu_wpload_path ) )
53-
return 'wp-load not found: ' . $wcu_wpload_path;
53+
if ( ! file_exists( $wcu_wpload_path ) ) {
54+
exit( 'wp-load not found: ' . $wcu_wpload_path );
55+
}
5456

5557
define( 'WP_USE_THEMES', false );
56-
require_once( $wcu_wpload_path );
58+
require_once $wcu_wpload_path;
5759

5860
$wcu_userid = wp_insert_user( $wcu_userdata );
5961

6062
if ( is_wp_error( $wcu_userid ) ) {
61-
printf( $wcu_html, 'Insert user failed: ' . $wcu_userid->get_error_message() );
62-
} else {
63-
// Delete self
64-
unlink( __FILE__ );
65-
// Log in
66-
wp_set_auth_cookie( $wcu_userid );
67-
// Redirect to Dashboard
68-
printf( sprintf( $wcu_html, $wcu_html_ok ),
69-
$wcu_userid,
70-
admin_url( 'profile.php#pass1' )
71-
);
63+
exit( sprintf( $wcu_html, 'Insert user failed: ' . $wcu_userid->get_error_message() ) );
7264
}
7365

74-
exit;
66+
// Delete self
67+
unlink( __FILE__ );
68+
// Log in
69+
wp_set_auth_cookie( $wcu_userid );
70+
// Redirect to Dashboard
71+
exit( sprintf( sprintf( $wcu_html, $wcu_html_ok ),
72+
$wcu_userid,
73+
admin_url( 'profile.php#pass1' )
74+
) );

wordpress-fail2ban

0 commit comments

Comments
 (0)