From 27dd8e62e8d7ba9d1182cabd9a30bfc1212977ba Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Thu, 25 May 2017 21:36:33 +0200 Subject: [PATCH 01/25] DSW theme install --- wp-quick-install/assets/js/script.js | 12 +++++++++++- wp-quick-install/data.ini | 21 ++++++++++++--------- wp-quick-install/index.php | 7 ++++++- 3 files changed, 29 insertions(+), 11 deletions(-) mode change 100644 => 100755 wp-quick-install/assets/js/script.js mode change 100644 => 100755 wp-quick-install/data.ini diff --git a/wp-quick-install/assets/js/script.js b/wp-quick-install/assets/js/script.js old mode 100644 new mode 100755 index c29e7d3..6a16b3f --- a/wp-quick-install/assets/js/script.js +++ b/wp-quick-install/assets/js/script.js @@ -331,10 +331,20 @@ $(document).ready(function() { $('.progress-bar').animate({width: "82.5%"}); $.post(window.location.href + '?action=install_plugins', $('form').serialize(), function(data) { $response.html(data); - success(); + activate_dsw(); }); } + // Plugin + function activate_dsw() { + $response.html("

Instaluji šablonu Dobrý skautský web

"); + $('.progress-bar').animate({width: "82.5%"}); + $.post(window.location.href + '/wp-content/themes/dsw-oddil-master/install.php', $('form').serialize(), function(data) { + $response.html(data); + success(); + }); + } + // Remove the archive function success() { $response.html("

Successful installation completed

"); diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini old mode 100644 new mode 100755 index 7b5f8c8..e1e98b5 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -25,10 +25,10 @@ ;db['dbname'] = demo ;db['dbhost'] = localhost -;db['prefix'] = wp_ +db['prefix'] = dsw_ ;db['uname'] = root ;db['pwd'] = root -;db['default_content'] = 1 +db['default_content'] = 1 ;;;; @@ -45,7 +45,7 @@ ; 1 = Yes, 0 = No ;;;; -;seo = 0 +seo = 1 ;;;; @@ -53,7 +53,7 @@ ; 1 = Yes, 0 = No ;;;; -;activate_theme = 1 +activate_theme = 1 ;;;; @@ -68,8 +68,12 @@ ; List all plugin you want to install below (uncomment to use): ;;;; -;plugins[] = wordpress-seo - +;plugins[] = wordpress-seo +;plugins[] = rocket-lazy-load +plugins[] = image-widget +plugins[] = tiled-gallery-carousel-without-jetpack +plugins[] = wordfence +plugins[] = wp-super-cache ;;;; @@ -85,7 +89,7 @@ ; 1 = Yes, 0 = No ;;;; -;activate_plugins = 0 +activate_plugins = 1 ;;;; @@ -130,5 +134,4 @@ ; parent = Parent page Title ;;;; -;posts[0] = title::Legal - status::publish - content::Lorem ipsum dolor sit amet - type::page -;posts[1] = title::Contact - status::publish - content::Lorem ipsum dolor sit amet - type::page - parent::Legal \ No newline at end of file +posts[0] = title::Tvůj Dobrý skautský web je skoro připraven - status::publish - content::Ted už zbývá nastavit pár detailů... - type::post \ No newline at end of file diff --git a/wp-quick-install/index.php b/wp-quick-install/index.php index 89a0a9f..9bba420 100755 --- a/wp-quick-install/index.php +++ b/wp-quick-install/index.php @@ -422,6 +422,11 @@ /** Load WordPress Administration Upgrade API */ require_once( $directory . 'wp-admin/includes/upgrade.php' ); + // install DSW theme + + $dsw_data = file_get_contents("https://github.com/skaut/dsw-oddil/archive/master.zip"); + file_put_contents("theme.zip", $dsw_data); + /*--------------------------*/ /* We install the new theme /*--------------------------*/ @@ -469,7 +474,7 @@ case "install_plugins" : - /*--------------------------*/ + /*--------------------------*/ /* Let's retrieve the plugin folder /*--------------------------*/ From 50bd2c4181fc3367e112d3a0aae1886ac21b1dbd Mon Sep 17 00:00:00 2001 From: racinmat Date: Thu, 25 May 2017 21:38:06 +0200 Subject: [PATCH 02/25] Removed inc/functions.php Working installation from command service. --- wp-quick-install/WordpressService.php | 56 +++++++++++++++++++++++++++ wp-quick-install/data.ini | 26 ++++++------- wp-quick-install/inc/functions.php | 11 ------ wp-quick-install/index.php | 15 +++++-- wp-quick-install/run.php | 19 +++++++++ 5 files changed, 100 insertions(+), 27 deletions(-) create mode 100644 wp-quick-install/WordpressService.php delete mode 100644 wp-quick-install/inc/functions.php create mode 100644 wp-quick-install/run.php diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php new file mode 100644 index 0000000..ba882fd --- /dev/null +++ b/wp-quick-install/WordpressService.php @@ -0,0 +1,56 @@ +randomString(10); + $data['language'] = 'en_US'; + + $installAddress = 'http://localhost/wp-quick-install'; + + $client = new \GuzzleHttp\Client([ + // Base URI is used with relative requests + 'base_uri' => $installAddress, + // You can set any number of default request options. + 'timeout' => 120.0, + ]); + + $postData = [ + 'form_params' => $data + ]; + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=check_before_upload', $postData); + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=download_wp', $postData); + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=unzip_wp', $postData); + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=wp_config', $postData); + $response = $client->post($installAddress . '/wp-admin/install.php?action=install_wp', $postData); + $response = $client->post($installAddress . '/wp-admin/install.php?action=install_theme', $postData); + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=install_plugins', $postData); + $response = $client->post($installAddress . '/wp-quick-install/index.php?action=success', $postData); + } +} diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index 7b5f8c8..656cd56 100644 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -23,21 +23,21 @@ ; Enter below your database connection detail (uncomment to use): ;;;; -;db['dbname'] = demo -;db['dbhost'] = localhost -;db['prefix'] = wp_ -;db['uname'] = root -;db['pwd'] = root -;db['default_content'] = 1 +db['dbname'] = demo +db['dbhost'] = localhost +db['prefix'] = wp_ +db['uname'] = root +db['pwd'] = root +db['default_content'] = 1 ;;;; ; Enter below the admin username and password (uncomment to use): ;;;; -;admin['user_login'] = admin -;admin['password'] = demo -;admin['email'] = demo@example.com +admin['user_login'] = admin +admin['password'] = demo +admin['email'] = demo@example.com ;;;; @@ -45,7 +45,7 @@ ; 1 = Yes, 0 = No ;;;; -;seo = 0 +seo = 1 ;;;; @@ -53,7 +53,7 @@ ; 1 = Yes, 0 = No ;;;; -;activate_theme = 1 +activate_theme = 1 ;;;; @@ -61,14 +61,14 @@ ; 1 = Yes, 0 = No ;;;; -;delete_default_themes = 1 +delete_default_themes = 1 ;;;; ; List all plugin you want to install below (uncomment to use): ;;;; -;plugins[] = wordpress-seo +plugins[] = wordpress-seo diff --git a/wp-quick-install/inc/functions.php b/wp-quick-install/inc/functions.php deleted file mode 100644 index 9a198d2..0000000 --- a/wp-quick-install/inc/functions.php +++ /dev/null @@ -1,11 +0,0 @@ - - + - + diff --git a/wp-quick-install/run.php b/wp-quick-install/run.php new file mode 100644 index 0000000..59f07e7 --- /dev/null +++ b/wp-quick-install/run.php @@ -0,0 +1,19 @@ +installWordpress('wordpress', 'root', '', 'localhost'); + +$time_post = microtime(true); + +$exec_time = $time_post - $time_pre; +print($exec_time); \ No newline at end of file From e935db83cec09ee45befcc5cce7fafbc888455e1 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Thu, 25 May 2017 22:00:01 +0200 Subject: [PATCH 03/25] DSW theme install fix --- wp-quick-install/assets/js/script.js | 4 ++-- wp-quick-install/data.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-quick-install/assets/js/script.js b/wp-quick-install/assets/js/script.js index 6a16b3f..819ee67 100755 --- a/wp-quick-install/assets/js/script.js +++ b/wp-quick-install/assets/js/script.js @@ -339,8 +339,8 @@ $(document).ready(function() { function activate_dsw() { $response.html("

Instaluji šablonu Dobrý skautský web

"); $('.progress-bar').animate({width: "82.5%"}); - $.post(window.location.href + '/wp-content/themes/dsw-oddil-master/install.php', $('form').serialize(), function(data) { - $response.html(data); + $.post(window.location.href + '/../../wp-content/themes/dsw-oddil-master/install.php', $('form').serialize(), function(data) { + $response.hide(); success(); }); } diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index e1e98b5..7944523 100755 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -25,7 +25,7 @@ ;db['dbname'] = demo ;db['dbhost'] = localhost -db['prefix'] = dsw_ +db['prefix'] = wp_ ;db['uname'] = root ;db['pwd'] = root db['default_content'] = 1 From b43e74815bbcfa90ef93a9f58696162eca735303 Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 25 May 2017 22:27:44 +0200 Subject: [PATCH 04/25] added first draft of readme --- README.md | 142 +++++++++++++----------------------------------------- 1 file changed, 33 insertions(+), 109 deletions(-) mode change 100644 => 100755 README.md diff --git a/README.md b/README.md old mode 100644 new mode 100755 index b7aaee1..dca223e --- a/README.md +++ b/README.md @@ -1,132 +1,56 @@ -WP Quick Install 1.4.2 -================ +# Instalace skautského Wordpressu v Lebodě na jeden klik -WP Quick Install is the easiest way to install WordPress. +## Status: rozděláno, ještě nepoužívat -A lightweight script which automatically downloads and install WordPress, plugins and themes you want. +## Manuál na instalaci -Simply download the .zip archive et go to *wp-quick-install/index.php* +Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: -Changelog -================ +* Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (místní fork) +* **Nastavení** je v souboru `data.ini` (včetně instalovaných pluginů a všeho dalšího) +* Zrušili jsme GUI a JS z původního skriptu a všechno nasypali do `WordpressService.php` +* Chtěné **DSW téma** je třeba umístit vedle skriptu. Téma je třeba pojmenovat `theme.zip` +* Potřebné parametry pro instalaci jsou jako paramtery metody, return zatím nemáme žádný (vzhledem k tomu, že se skript bude provádět jindy (cronem) než ho uživatel zadává) +* Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword +* Pozor, skript běží dlouho (přeci jen stahuje, dekomprimuje a instaluje zaráz), takže je potřeba hlídat timeout chyb (na průměrném NB to běželo skoro minutu) -1.4.2 ------------ -* Delete Tweentyfifteen & Tweentysixteen themes +## TODO shortterm -1.4.1 ------------ -* Fix quote issue with WordPress.com API Key +#### automaticky přidat obrázky z theme -1.4 ------------ -* Fix database issue since WordPress 4.1 -* You can add your WordPress.com API Key +spočívá v poslání issue do DSW, aby byly obrázky includované dynamicky (teď si neporadí s subfolder v adresářové cestě) - https://github.com/skaut/dsw-oddil/issues/129 -1.3.3 ------------ -* Add SSL compatibility -* Remove SSL function (cause trouble with process installation) +#### v nových odkazech používat absolutní -1.3.2 ------------ +#### automaticky přidat menu z theme -* Add a script header -* Security improvement -1.3.1 ------------ +## TODO longterm -* Fix error for PHP > 5.5: Strict standards: Only variables should be passed by reference in ../wp-quick-install/index.php on line 10 +#### Přidat automaticky češtinu -1.3 ------------ +Postup pro execute: -* Possiblity to select WordPress language installation -* Permaling management +* je potřeba vytvořit ve složce `wp-content` složku `languages` +* do ní nakopírovat obsah s language soubory +* ve wp-config přepsat řádek na `define ('WPLANG', 'cs_CZ');` +Návod k tomuto postupu je na adrese http://www.cwordpress.cz/navody/instalace-cestiny-do-wordpressu.html -1.2.8.1 ------------ +#### Plugin pro bazar -* You can now declare articles to be generated via data.ini file -* Fix bug on new articles -* You can now select the revision by articles +na vyžádání includenout plugin pro bazar (https://wordpress.org/plugins/skaut-bazar/) -1.2.8 ------------ +#### Return užitečné info -* Media management +Vracet bychom mohli např. heslo pro admina nebo nějaký success message, to bude věcí další domluvy -1.2.7.2 ------------ +#### Umožnit instalaci i přes existující web -* Security : Forbiden access to data.ini from the browser +Inspired by literat v issue: -1.2.7.1 ------------ - -* noindex nofollow tag. - -1.2.7 ------------ - -* Premium extension by adding archives in plugins folder -* You can enable extension after installation -* Auto supression of Hello Dolly extension -* You can add a theme and enable it -* You can delete Twenty Elever and Twenty Ten - -1.2.6 ------------ - -* Fix a JS bug with data.ini - -1.2.5 ------------ - -* You can delete the default content added by WordPress -* You can add new pages with data.ini -* Data.ini update - -1.2.4 ------------ - -* Two new debug options : *Display errors* (WP_DEBUG_DISPLAY) and *Write errors in a log file* (WP_DEBUG_LOG) - -1.2.3 ------------ - -* SEO Fix bug -* Automatic deletion of licence.txt and readme.html - -1.2.2 ------------ - -* Deletion of all exec() fucntions -* Unzip WordPress and plugins with ZipArchive class -* Using scandir() and rename() to move WordPress files - -1.2.1 ------------ - -* Checking chmod on parent folder -* Adding a link to website and admin if success - -1.2 ------------ - -* You can now pre-configure the form with data.ini - - -1.1 ------------ - -* Code Optimisation - - -1.0 ------------ - -* Initial Commit +* na začátku se automatika pouze zeptá na login a heslo pro administrátorský účet +* musí proběhnout kontrola FTP a databáze, tj. pokud je zde nějaký obsah, bude smazán a uživatel na to musí být upozorněn a potvrdit to +* veškerý obsah před instalací bude z FTP i DB smazán +* jako základní šablona společně s Wordpressem bude instalována DSW Oddíl \ No newline at end of file From 5c2eb69c2db19e5a12567cd1efb63260814b57c4 Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 25 May 2017 22:32:46 +0200 Subject: [PATCH 05/25] fixed loading of DWS theme --- README.md | 2 +- wp-quick-install/.htaccess | 0 wp-quick-install/assets/css/buttons.min.css | 0 wp-quick-install/assets/css/style.min.css | 0 wp-quick-install/assets/images/wordpress-logo.svg | 0 wp-quick-install/assets/js/jquery-1.8.3.min.js | 0 wp-quick-install/data.ini | 0 7 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 wp-quick-install/.htaccess mode change 100644 => 100755 wp-quick-install/assets/css/buttons.min.css mode change 100644 => 100755 wp-quick-install/assets/css/style.min.css mode change 100644 => 100755 wp-quick-install/assets/images/wordpress-logo.svg mode change 100644 => 100755 wp-quick-install/assets/js/jquery-1.8.3.min.js mode change 100644 => 100755 wp-quick-install/data.ini diff --git a/README.md b/README.md index dca223e..81a613f 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: * Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (místní fork) * **Nastavení** je v souboru `data.ini` (včetně instalovaných pluginů a všeho dalšího) * Zrušili jsme GUI a JS z původního skriptu a všechno nasypali do `WordpressService.php` -* Chtěné **DSW téma** je třeba umístit vedle skriptu. Téma je třeba pojmenovat `theme.zip` +* Chtěné **DSW téma** se získá pomocí automatického stánutí z DWS githubu. Alternativně je možnost umístit soubor vedle skriptu a pojmenovat ho `theme.zip` * Potřebné parametry pro instalaci jsou jako paramtery metody, return zatím nemáme žádný (vzhledem k tomu, že se skript bude provádět jindy (cronem) než ho uživatel zadává) * Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword * Pozor, skript běží dlouho (přeci jen stahuje, dekomprimuje a instaluje zaráz), takže je potřeba hlídat timeout chyb (na průměrném NB to běželo skoro minutu) diff --git a/wp-quick-install/.htaccess b/wp-quick-install/.htaccess old mode 100644 new mode 100755 diff --git a/wp-quick-install/assets/css/buttons.min.css b/wp-quick-install/assets/css/buttons.min.css old mode 100644 new mode 100755 diff --git a/wp-quick-install/assets/css/style.min.css b/wp-quick-install/assets/css/style.min.css old mode 100644 new mode 100755 diff --git a/wp-quick-install/assets/images/wordpress-logo.svg b/wp-quick-install/assets/images/wordpress-logo.svg old mode 100644 new mode 100755 diff --git a/wp-quick-install/assets/js/jquery-1.8.3.min.js b/wp-quick-install/assets/js/jquery-1.8.3.min.js old mode 100644 new mode 100755 diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini old mode 100644 new mode 100755 From b6cb2f265a26bff77fd07e914b7efb9a90f79bef Mon Sep 17 00:00:00 2001 From: racinmat Date: Thu, 25 May 2017 22:36:29 +0200 Subject: [PATCH 06/25] Somehow working. Still not conecting to database. --- wp-quick-install/WordpressService.php | 71 +++++++++++++++++++++++---- wp-quick-install/data.ini | 2 +- wp-quick-install/run.php | 2 +- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index ba882fd..c34f433 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -22,15 +22,42 @@ private function randomString($length = 10) { return $string; } - public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost) + public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword, $adminEmail) { $data = parse_ini_file('data.ini'); $data['dbname'] = $dbName; $data['uname'] = $dbUserName; $data['pwd'] = $dbPassword; $data['dbhost'] = $dbHost; - $data['admin_password'] = $this->randomString(10); + $data['prefix'] = $data['db']['prefix']; + $data['default_content'] = $data['db']['default_content']; $data['language'] = 'en_US'; + $data['directory'] = ''; + $data['admin']['user_login'] = $userLogin; + $data['user_login'] = $data['admin']['user_login']; + $data['admin']['password'] = 'demo'; + $data['admin']['email'] = 'demo@example.com'; + $data['weblog_title'] = $websiteTitle; + $data['admin_password'] = $adminPassword; + $data['admin_email'] = $adminEmail; + $data['blog_public'] = 1; + $data['activate_theme'] = 1; + $data['plugins'] = 'image-widget;tiled-gallery-carousel-without-jetpack;wordfence;wp-super-cache'; + $data['activate_plugins'] = 1; + $data['permalink_structure'] = '/%postname%/'; + $data['thumbnail_size_w'] = 0; + $data['thumbnail_size_h'] = 0; + $data['thumbnail_crop'] = 1; + $data['medium_size_w'] = 0; + $data['medium_size_h'] = 0; + $data['large_size_w'] = 0; + $data['large_size_h'] = 0; + $data['upload_dir'] = ''; + $data['uploads_use_yearmonth_folders'] = 1; + $data['post_revisions'] = 0; + $data['disallow_file_edit'] = 1; + $data['autosave_interval'] = 7200; + $data['wpcom_api_key'] = ''; $installAddress = 'http://localhost/wp-quick-install'; @@ -44,13 +71,37 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost) $postData = [ 'form_params' => $data ]; - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=check_before_upload', $postData); - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=download_wp', $postData); - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=unzip_wp', $postData); - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=wp_config', $postData); - $response = $client->post($installAddress . '/wp-admin/install.php?action=install_wp', $postData); - $response = $client->post($installAddress . '/wp-admin/install.php?action=install_theme', $postData); - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=install_plugins', $postData); - $response = $client->post($installAddress . '/wp-quick-install/index.php?action=success', $postData); + $response = $client->request('POST', $installAddress . '/wp-quick-install/index.php?action=check_before_upload', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST', $installAddress . '/wp-quick-install/index.php?action=download_wp', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=unzip_wp', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=wp_config', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-admin/install.php?action=install_wp', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-admin/install.php?action=install_theme', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=install_plugins', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=success', $postData); + if ($response->getStatusCode() >= 300) { + echo $response->getBody()->getContents(); + } } } diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index e1e98b5..7944523 100644 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -25,7 +25,7 @@ ;db['dbname'] = demo ;db['dbhost'] = localhost -db['prefix'] = dsw_ +db['prefix'] = wp_ ;db['uname'] = root ;db['pwd'] = root db['default_content'] = 1 diff --git a/wp-quick-install/run.php b/wp-quick-install/run.php index 59f07e7..41e11a0 100644 --- a/wp-quick-install/run.php +++ b/wp-quick-install/run.php @@ -11,7 +11,7 @@ $time_pre = microtime(true); $service = new WordpressService(); -$service->installWordpress('wordpress', 'root', '', 'localhost'); +$service->installWordpress('wordpress', 'root', '', 'localhost', 'my wordpress', 'admin', 'admin', 'admin@admin.cz'); $time_post = microtime(true); From a608f38ff99dab155e8de9906b8dda1a8d9445c0 Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 25 May 2017 22:37:07 +0200 Subject: [PATCH 07/25] added todo shortterm task --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 81a613f..ea21383 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: ## TODO shortterm +#### stahovat češtinu napřímo + +https://cs.wordpress.org/ + #### automaticky přidat obrázky z theme spočívá v poslání issue do DSW, aby byly obrázky includované dynamicky (teď si neporadí s subfolder v adresářové cestě) - https://github.com/skaut/dsw-oddil/issues/129 From 611c8397d36e92f41a64832b9962c5d351ebd3eb Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 25 May 2017 22:38:12 +0200 Subject: [PATCH 08/25] added .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file From 8659eb6c70accb6b3ad2fb8f9ce31e36241ebee5 Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 25 May 2017 22:38:12 +0200 Subject: [PATCH 09/25] added .gitignore --- .gitignore | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md index ea21383..bf24374 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Instalace skautského Wordpressu v Lebodě na jeden klik +# Instalace skautského Wordpressu v Lebedě na jeden klik ## Status: rozděláno, ještě nepoužívat From ac63955869494197aa7af801ba2540250397cc5e Mon Sep 17 00:00:00 2001 From: Lung Date: Thu, 15 Jun 2017 20:11:22 +0200 Subject: [PATCH 10/25] added meet with @kalich5 --- README.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bf24374..c642e99 100755 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Instalace skautského Wordpressu v Lebedě na jeden klik -## Status: rozděláno, ještě nepoužívat +## Status: rozděláno, ještě nepoužívat! ## Manuál na instalaci Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: -* Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (místní fork) +* Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (fork) * **Nastavení** je v souboru `data.ini` (včetně instalovaných pluginů a všeho dalšího) * Zrušili jsme GUI a JS z původního skriptu a všechno nasypali do `WordpressService.php` * Chtěné **DSW téma** se získá pomocí automatického stánutí z DWS githubu. Alternativně je možnost umístit soubor vedle skriptu a pojmenovat ho `theme.zip` @@ -18,31 +18,20 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: #### stahovat češtinu napřímo -https://cs.wordpress.org/ +https://cs.wordpress.org/ - Kalich zkusí zprovoznit něco jako odkaz cs.wordpress.org/latest.zip (zatím není) #### automaticky přidat obrázky z theme spočívá v poslání issue do DSW, aby byly obrázky includované dynamicky (teď si neporadí s subfolder v adresářové cestě) - https://github.com/skaut/dsw-oddil/issues/129 - -#### v nových odkazech používat absolutní - #### automaticky přidat menu z theme +řešíme s Kalichem -## TODO longterm - -#### Přidat automaticky češtinu - -Postup pro execute: - -* je potřeba vytvořit ve složce `wp-content` složku `languages` -* do ní nakopírovat obsah s language soubory -* ve wp-config přepsat řádek na `define ('WPLANG', 'cs_CZ');` -Návod k tomuto postupu je na adrese http://www.cwordpress.cz/navody/instalace-cestiny-do-wordpressu.html +## TODO longterm -#### Plugin pro bazar +#### Volitelný plugin pro bazar na vyžádání includenout plugin pro bazar (https://wordpress.org/plugins/skaut-bazar/) @@ -52,6 +41,8 @@ Vracet bychom mohli např. heslo pro admina nebo nějaký success message, to bu #### Umožnit instalaci i přes existující web +@kalich5 - nevhodné dělat automaticky, protože se tím naseká moc problémů - lepší kontrolovat, zda je složka prázdná a pokud ne, rovnou to nepovolit (jak to dělá např. `git clone` nebo velcí hostingové) + Inspired by literat v issue: * na začátku se automatika pouze zeptá na login a heslo pro administrátorský účet From 6c8fcf4e475278e3dfd1dbf3973004f4fb6abd09 Mon Sep 17 00:00:00 2001 From: Michal Janata Date: Mon, 19 Jun 2017 10:13:34 +0200 Subject: [PATCH 11/25] =?UTF-8?q?Nov=C3=A9=20pluginy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugin pro kalendář a FB --- wp-quick-install/data.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index 7944523..1948270 100755 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -74,7 +74,8 @@ plugins[] = image-widget plugins[] = tiled-gallery-carousel-without-jetpack plugins[] = wordfence plugins[] = wp-super-cache - +plugins[] = google-calendar-events +plugins[] = easy-facebook-feed ;;;; ; Install extensions which are on the "wp-quick-install" "plugins" folder (uncomment to use): @@ -134,4 +135,4 @@ activate_plugins = 1 ; parent = Parent page Title ;;;; -posts[0] = title::Tvůj Dobrý skautský web je skoro připraven - status::publish - content::Ted už zbývá nastavit pár detailů... - type::post \ No newline at end of file +posts[0] = title::Tvůj Dobrý skautský web je skoro připraven - status::publish - content::Ted už zbývá nastavit pár detailů... - type::post From 800788c6bd229058be60f41854775aa3d085547c Mon Sep 17 00:00:00 2001 From: Michal Janata Date: Mon, 19 Jun 2017 10:18:51 +0200 Subject: [PATCH 12/25] Image widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bude z povinnosti vyhozen. WP 4.8 to zvládá samo --- wp-quick-install/data.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index 1948270..7fa25bc 100755 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -70,7 +70,7 @@ activate_theme = 1 ;plugins[] = wordpress-seo ;plugins[] = rocket-lazy-load -plugins[] = image-widget +;plugins[] = image-widget plugins[] = tiled-gallery-carousel-without-jetpack plugins[] = wordfence plugins[] = wp-super-cache From 074402ad8aaf6050f237a0e8a39a2a95c6bb48d1 Mon Sep 17 00:00:00 2001 From: racinmat Date: Sun, 25 Jun 2017 01:06:14 +0200 Subject: [PATCH 13/25] Added files generated before wp installation. Modified js script to be more usable. --- index.php | 17 + wp-activate.php | 162 +++++ wp-blog-header.php | 21 + wp-comments-post.php | 60 ++ wp-config-sample.php | 89 +++ wp-config.php | 102 +++ wp-cron.php | 129 ++++ wp-links-opml.php | 83 +++ wp-load.php | 93 +++ wp-login.php | 994 ++++++++++++++++++++++++++ wp-mail.php | 253 +++++++ wp-quick-install/WordpressService.php | 35 +- wp-quick-install/assets/js/script.js | 155 ++-- wp-quick-install/index.php | 8 +- wp-settings.php | 469 ++++++++++++ wp-signup.php | 919 ++++++++++++++++++++++++ wp-trackback.php | 141 ++++ xmlrpc.php | 101 +++ 18 files changed, 3753 insertions(+), 78 deletions(-) create mode 100644 index.php create mode 100644 wp-activate.php create mode 100644 wp-blog-header.php create mode 100644 wp-comments-post.php create mode 100644 wp-config-sample.php create mode 100644 wp-config.php create mode 100644 wp-cron.php create mode 100644 wp-links-opml.php create mode 100644 wp-load.php create mode 100644 wp-login.php create mode 100644 wp-mail.php create mode 100644 wp-settings.php create mode 100644 wp-signup.php create mode 100644 wp-trackback.php create mode 100644 xmlrpc.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..dd3d554 --- /dev/null +++ b/index.php @@ -0,0 +1,17 @@ +cache_enabled = false; + +// Fix for page title +$wp_query->is_404 = false; + +/** + * Fires before the Site Activation page is loaded. + * + * @since 3.0.0 + */ +do_action( 'activate_header' ); + +/** + * Adds an action hook specific to this page. + * + * Fires on {@see 'wp_head'}. + * + * @since MU + */ +function do_activate_header() { + /** + * Fires before the Site Activation page is loaded. + * + * Fires on the {@see 'wp_head'} action. + * + * @since 3.0.0 + */ + do_action( 'activate_wp_head' ); +} +add_action( 'wp_head', 'do_activate_header' ); + +/** + * Loads styles specific to this page. + * + * @since MU + */ +function wpmu_activate_stylesheet() { + ?> + + + +
+
+ + +

+
+

+ +
+

+

+ +

+
+ + get_error_code() || 'blog_taken' == $result->get_error_code() ) { + $signup = $result->get_error_data(); + ?> +

+ '; + if ( $signup->domain . $signup->path == '' ) { + printf( + /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */ + __( 'Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), + network_site_url( 'wp-login.php', 'login' ), + $signup->user_login, + $signup->user_email, + wp_lostpassword_url() + ); + } else { + printf( + /* translators: 1: site URL, 2: site domain, 3: username, 4: user email, 5: lost password URL */ + __( 'Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), + 'http://' . $signup->domain, + $signup->domain, + $signup->user_login, + $signup->user_email, + wp_lostpassword_url() + ); + } + echo '

'; + } else { + ?> +

+

get_error_message(); ?>

+ +

+ +
+

user_login ?>

+

+
+ + +

View your site or Log in' ), $url, esc_url( $login_url ) ); + ?>

+ +

Log in or go back to the homepage.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() ); + ?>

+ +
+
+ +get_error_data() ); + if ( ! empty( $data ) ) { + wp_die( '

' . $comment->get_error_message() . '

', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) ); + } else { + exit; + } +} + +$user = wp_get_current_user(); + +/** + * Perform other actions when comment cookies are set. + * + * @since 3.4.0 + * + * @param WP_Comment $comment Comment object. + * @param WP_User $user User object. The user may not exist. + */ +do_action( 'set_comment_cookies', $comment, $user ); + +$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID; + +/** + * Filters the location URI to send the commenter after posting. + * + * @since 2.0.5 + * + * @param string $location The 'redirect_to' URI sent via $_POST. + * @param WP_Comment $comment Comment object. + */ +$location = apply_filters( 'comment_post_redirect', $location, $comment ); + +wp_safe_redirect( $location ); +exit; diff --git a/wp-config-sample.php b/wp-config-sample.php new file mode 100644 index 0000000..02091c1 --- /dev/null +++ b/wp-config-sample.php @@ -0,0 +1,89 @@ +pVeO1}GRa'); +define('SECURE_AUTH_KEY', 'u9TjFsx*WA&]m:<3KSfC].RT +1Wb3?*!M6(_5So/OXA9]`/M +S$l2Z?jR$GVD9'); +define('LOGGED_IN_KEY', 'D*iT*1con6fh/~LX<#~(TAg=J-> 8|)--?gNV<.]1v[67:NvknP.:L>eMl-~AcvAN+hej!@fL=ox2AikW7)Y,)y@R^&vEsv<~'); +define('LOGGED_IN_SALT', 'qkQC?$?!m#D:]eiekruek]yk 6# FW;5#@f)]]ZCk=#stcrjb%)L%Rau{{assTJ^'); +define('NONCE_SALT', 'gNRwBA5g_?&VO}zv6xG7E=|!64s}2-*^l'); + +/**#@-*/ + +/** + * WordPress Database Table prefix. + * + * You can have multiple installations in one database if you give each + * a unique prefix. Only numbers, letters, and underscores please! + */ +$table_prefix = 'wp_'; + +/** + * For developers: WordPress debugging mode. + * + * Change this to true to enable the display of notices during development. + * It is strongly recommended that plugin and theme developers use WP_DEBUG + * in their development environments. + * + * For information on other constants that can be used for debugging, + * visit the Codex. + * + * @link https://codex.wordpress.org/Debugging_in_WordPress + */ +define('WP_DEBUG', false); + + + /** Désactivation des révisions d'articles */ +define('WP_POST_REVISIONS', 0); + + /** Désactivation de l'éditeur de thème et d'extension */ +define('DISALLOW_FILE_EDIT', true); + + /** Intervalle des sauvegardes automatique */ +define('AUTOSAVE_INTERVAL', 7200); + + /** On augmente la mémoire limite */ +define('WP_MEMORY_LIMIT', '96M'); + +/* That's all, stop editing! Happy blogging. */ + +/** Absolute path to the WordPress directory. */ +if ( !defined('ABSPATH') ) + define('ABSPATH', dirname(__FILE__) . '/'); + +/** Sets up WordPress vars and included files. */ +require_once(ABSPATH . 'wp-settings.php'); diff --git a/wp-cron.php b/wp-cron.php new file mode 100644 index 0000000..15c6676 --- /dev/null +++ b/wp-cron.php @@ -0,0 +1,129 @@ +get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) ); + if ( is_object( $row ) ) + $value = $row->option_value; + } + + return $value; +} + +if ( false === $crons = _get_cron_array() ) + die(); + +$keys = array_keys( $crons ); +$gmt_time = microtime( true ); + +if ( isset($keys[0]) && $keys[0] > $gmt_time ) + die(); + + +// The cron lock: a unix timestamp from when the cron was spawned. +$doing_cron_transient = get_transient( 'doing_cron' ); + +// Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock. +if ( empty( $doing_wp_cron ) ) { + if ( empty( $_GET[ 'doing_wp_cron' ] ) ) { + // Called from external script/job. Try setting a lock. + if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) + return; + $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); + set_transient( 'doing_cron', $doing_wp_cron ); + } else { + $doing_wp_cron = $_GET[ 'doing_wp_cron' ]; + } +} + +/* + * The cron lock (a unix timestamp set when the cron was spawned), + * must match $doing_wp_cron (the "key"). + */ +if ( $doing_cron_transient != $doing_wp_cron ) + return; + +foreach ( $crons as $timestamp => $cronhooks ) { + if ( $timestamp > $gmt_time ) + break; + + foreach ( $cronhooks as $hook => $keys ) { + + foreach ( $keys as $k => $v ) { + + $schedule = $v['schedule']; + + if ( $schedule != false ) { + $new_args = array($timestamp, $schedule, $hook, $v['args']); + call_user_func_array('wp_reschedule_event', $new_args); + } + + wp_unschedule_event( $timestamp, $hook, $v['args'] ); + + /** + * Fires scheduled events. + * + * @ignore + * @since 2.1.0 + * + * @param string $hook Name of the hook that was scheduled to be fired. + * @param array $args The arguments to be passed to the hook. + */ + do_action_ref_array( $hook, $v['args'] ); + + // If the hook ran too long and another cron process stole the lock, quit. + if ( _get_cron_lock() != $doing_wp_cron ) + return; + } + } +} + +if ( _get_cron_lock() == $doing_wp_cron ) + delete_transient( 'doing_cron' ); + +die(); diff --git a/wp-links-opml.php b/wp-links-opml.php new file mode 100644 index 0000000..42e8b24 --- /dev/null +++ b/wp-links-opml.php @@ -0,0 +1,83 @@ +\n"; +?> + + + <?php + /* translators: 1: Site name */ + printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); + ?> + GMT + + + + 'link_category', 'hierarchical' => 0)); +else + $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); + +foreach ( (array)$cats as $cat ) : + /** + * Filters the OPML outline link category name. + * + * @since 2.2.0 + * + * @param string $catname The OPML outline category name. + */ + $catname = apply_filters( 'link_category', $cat->name ); + +?> + + $cat->term_id)); + foreach ( (array)$bookmarks as $bookmark ) : + /** + * Filters the OPML outline link title text. + * + * @since 2.2.0 + * + * @param string $title The OPML outline title text. + */ + $title = apply_filters( 'link_title', $bookmark->link_name ); +?> + + + + + + diff --git a/wp-load.php b/wp-load.php new file mode 100644 index 0000000..a1a9ad6 --- /dev/null +++ b/wp-load.php @@ -0,0 +1,93 @@ +wp-config.php' + ) . '

'; + $die .= '

' . sprintf( + /* translators: %s: Codex URL */ + __( "Need more help? We got it." ), + __( 'https://codex.wordpress.org/Editing_wp-config.php' ) + ) . '

'; + $die .= '

' . sprintf( + /* translators: %s: wp-config.php */ + __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ), + 'wp-config.php' + ) . '

'; + $die .= '

' . __( "Create a Configuration File" ) . ''; + + wp_die( $die, __( 'WordPress › Error' ) ); +} diff --git a/wp-login.php b/wp-login.php new file mode 100644 index 0000000..8d73c65 --- /dev/null +++ b/wp-login.php @@ -0,0 +1,994 @@ +` element. + * Default 'Log In'. + * @param string $message Optional. Message to display in header. Default empty. + * @param WP_Error $wp_error Optional. The error to pass. Default empty. + */ +function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { + global $error, $interim_login, $action; + + // Don't index any of these forms + add_action( 'login_head', 'wp_no_robots' ); + + add_action( 'login_head', 'wp_login_viewport_meta' ); + + if ( empty($wp_error) ) + $wp_error = new WP_Error(); + + // Shake it! + $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); + /** + * Filters the error codes array for shaking the login form. + * + * @since 3.0.0 + * + * @param array $shake_error_codes Error codes that shake the login form. + */ + $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); + + if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) + add_action( 'login_head', 'wp_shake_js', 12 ); + + $separator = is_rtl() ? ' › ' : ' ‹ '; + + ?> + + + > + + + + <?php echo get_bloginfo( 'name', 'display' ) . $separator . $title; ?> + get_error_code() ) { + ?> + + site_name; + } else { + $login_header_url = __( 'https://wordpress.org/' ); + $login_header_title = __( 'Powered by WordPress' ); + } + + /** + * Filters link URL of the header logo above login form. + * + * @since 2.1.0 + * + * @param string $login_header_url Login header logo URL. + */ + $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); + + /** + * Filters the title attribute of the header logo above login form. + * + * @since 2.1.0 + * + * @param string $login_header_title Login header logo title attribute. + */ + $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); + + $classes = array( 'login-action-' . $action, 'wp-core-ui' ); + if ( is_rtl() ) + $classes[] = 'rtl'; + if ( $interim_login ) { + $classes[] = 'interim-login'; + ?> + + + + + +

+

+ add('error', $error); + unset($error); + } + + if ( $wp_error->get_error_code() ) { + $errors = ''; + $messages = ''; + foreach ( $wp_error->get_error_codes() as $code ) { + $severity = $wp_error->get_error_data( $code ); + foreach ( $wp_error->get_error_messages( $code ) as $error_message ) { + if ( 'message' == $severity ) + $messages .= ' ' . $error_message . "
\n"; + else + $errors .= ' ' . $error_message . "
\n"; + } + } + if ( ! empty( $errors ) ) { + /** + * Filters the error messages displayed above the login form. + * + * @since 2.1.0 + * + * @param string $errors Login error message. + */ + echo '
' . apply_filters( 'login_errors', $errors ) . "
\n"; + } + if ( ! empty( $messages ) ) { + /** + * Filters instructional messages displayed above the login form. + * + * @since 2.5.0 + * + * @param string $messages Login messages. + */ + echo '

' . apply_filters( 'login_messages', $messages ) . "

\n"; + } + } +} // End of login_header() + +/** + * Outputs the footer for the login page. + * + * @param string $input_id Which input to auto-focus + */ +function login_footer($input_id = '') { + global $interim_login; + + // Don't allow interim logins to navigate away from the page. + if ( ! $interim_login ): ?> +

+ + +
+ + + + + + +
+ + + + + + + add('empty_username', __('ERROR: Enter a username or email address.')); + } elseif ( strpos( $_POST['user_login'], '@' ) ) { + $user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) ); + if ( empty( $user_data ) ) + $errors->add('invalid_email', __('ERROR: There is no user registered with that email address.')); + } else { + $login = trim($_POST['user_login']); + $user_data = get_user_by('login', $login); + } + + /** + * Fires before errors are returned from a password reset request. + * + * @since 2.1.0 + * @since 4.4.0 Added the `$errors` parameter. + * + * @param WP_Error $errors A WP_Error object containing any errors generated + * by using invalid credentials. + */ + do_action( 'lostpassword_post', $errors ); + + if ( $errors->get_error_code() ) + return $errors; + + if ( !$user_data ) { + $errors->add('invalidcombo', __('ERROR: Invalid username or email.')); + return $errors; + } + + // Redefining user_login ensures we return the right case in the email. + $user_login = $user_data->user_login; + $user_email = $user_data->user_email; + $key = get_password_reset_key( $user_data ); + + if ( is_wp_error( $key ) ) { + return $key; + } + + $message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n"; + $message .= network_home_url( '/' ) . "\r\n\r\n"; + $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; + $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; + $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; + $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; + + if ( is_multisite() ) { + $blogname = get_network()->site_name; + } else { + /* + * The blogname option is escaped with esc_html on the way into the database + * in sanitize_option we want to reverse this for the plain text arena of emails. + */ + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + } + + /* translators: Password reset email subject. 1: Site name */ + $title = sprintf( __('[%s] Password Reset'), $blogname ); + + /** + * Filters the subject of the password reset email. + * + * @since 2.8.0 + * @since 4.4.0 Added the `$user_login` and `$user_data` parameters. + * + * @param string $title Default email title. + * @param string $user_login The username for the user. + * @param WP_User $user_data WP_User object. + */ + $title = apply_filters( 'retrieve_password_title', $title, $user_login, $user_data ); + + /** + * Filters the message body of the password reset mail. + * + * If the filtered message is empty, the password reset email will not be sent. + * + * @since 2.8.0 + * @since 4.1.0 Added `$user_login` and `$user_data` parameters. + * + * @param string $message Default mail message. + * @param string $key The activation key. + * @param string $user_login The username for the user. + * @param WP_User $user_data WP_User object. + */ + $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data ); + + if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) + wp_die( __('The email could not be sent.') . "
\n" . __('Possible reason: your host may have disabled the mail() function.') ); + + return true; +} + +// +// Main +// + +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; +$errors = new WP_Error(); + +if ( isset($_GET['key']) ) + $action = 'resetpass'; + +// validate action so as to default to the login screen +if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) + $action = 'login'; + +nocache_headers(); + +header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); + +if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set + if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) + $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); + + $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); + if ( $url != get_option( 'siteurl' ) ) + update_option( 'siteurl', $url ); +} + +//Set a cookie now to see if they are supported by the browser. +$secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) ); +setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure ); +if ( SITECOOKIEPATH != COOKIEPATH ) + setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure ); + +/** + * Fires when the login form is initialized. + * + * @since 3.2.0 + */ +do_action( 'login_init' ); +/** + * Fires before a specified login form action. + * + * The dynamic portion of the hook name, `$action`, refers to the action + * that brought the visitor to the login form. Actions include 'postpass', + * 'logout', 'lostpassword', etc. + * + * @since 2.8.0 + */ +do_action( "login_form_{$action}" ); + +$http_post = ('POST' == $_SERVER['REQUEST_METHOD']); +$interim_login = isset($_REQUEST['interim-login']); + +switch ($action) { + +case 'postpass' : + if ( ! array_key_exists( 'post_password', $_POST ) ) { + wp_safe_redirect( wp_get_referer() ); + exit(); + } + + require_once ABSPATH . WPINC . '/class-phpass.php'; + $hasher = new PasswordHash( 8, true ); + + /** + * Filters the life span of the post password cookie. + * + * By default, the cookie expires 10 days from creation. To turn this + * into a session cookie, return 0. + * + * @since 3.7.0 + * + * @param int $expires The expiry time, as passed to setcookie(). + */ + $expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS ); + $referer = wp_get_referer(); + if ( $referer ) { + $secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) ); + } else { + $secure = false; + } + setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure ); + + wp_safe_redirect( wp_get_referer() ); + exit(); + +case 'logout' : + check_admin_referer('log-out'); + + $user = wp_get_current_user(); + + wp_logout(); + + if ( ! empty( $_REQUEST['redirect_to'] ) ) { + $redirect_to = $requested_redirect_to = $_REQUEST['redirect_to']; + } else { + $redirect_to = 'wp-login.php?loggedout=true'; + $requested_redirect_to = ''; + } + + /** + * Filters the log out redirect URL. + * + * @since 4.2.0 + * + * @param string $redirect_to The redirect destination URL. + * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. + * @param WP_User $user The WP_User object for the user that's logging out. + */ + $redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user ); + wp_safe_redirect( $redirect_to ); + exit(); + +case 'lostpassword' : +case 'retrievepassword' : + + if ( $http_post ) { + $errors = retrieve_password(); + if ( !is_wp_error($errors) ) { + $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm'; + wp_safe_redirect( $redirect_to ); + exit(); + } + } + + if ( isset( $_GET['error'] ) ) { + if ( 'invalidkey' == $_GET['error'] ) { + $errors->add( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new link below.' ) ); + } elseif ( 'expiredkey' == $_GET['error'] ) { + $errors->add( 'expiredkey', __( 'Your password reset link has expired. Please request a new link below.' ) ); + } + } + + $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; + /** + * Filters the URL redirected to after submitting the lostpassword/retrievepassword form. + * + * @since 3.0.0 + * + * @param string $lostpassword_redirect The redirect destination URL. + */ + $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect ); + + /** + * Fires before the lost password form. + * + * @since 1.5.1 + */ + do_action( 'lost_password' ); + + login_header(__('Lost Password'), '

' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '

', $errors); + + $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : ''; + +?> + +
+

+ +

+ + +

+
+ + + +get_error_code() === 'expired_key' ) + wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) ); + else + wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) ); + exit; + } + + $errors = new WP_Error(); + + if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) + $errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) ); + + /** + * Fires before the password reset procedure is validated. + * + * @since 3.5.0 + * + * @param object $errors WP Error object. + * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise. + */ + do_action( 'validate_password_reset', $errors, $user ); + + if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) { + reset_password($user, $_POST['pass1']); + setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true ); + login_header( __( 'Password Reset' ), '

' . __( 'Your password has been reset.' ) . ' ' . __( 'Log in' ) . '

' ); + login_footer(); + exit; + } + + wp_enqueue_script('utils'); + wp_enqueue_script('user-profile'); + + login_header(__('Reset Password'), '

' . __('Enter your new password below.') . '

', $errors ); + +?> +
+ + +
+

+ +

+ +
+ + + +
+
+
+ +

+
+ +

+ +

+
+ + + +

+
+ + + +' . __('Register For This Site') . '

', $errors); +?> +
+

+ +

+

+ +

+ +

+
+ +

+
+ + + +ID) ) { + $secure_cookie = true; + force_ssl_admin(true); + } + } + } + + if ( isset( $_REQUEST['redirect_to'] ) ) { + $redirect_to = $_REQUEST['redirect_to']; + // Redirect to https if user wants ssl + if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') ) + $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); + } else { + $redirect_to = admin_url(); + } + + $reauth = empty($_REQUEST['reauth']) ? false : true; + + $user = wp_signon( array(), $secure_cookie ); + + if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { + if ( headers_sent() ) { + /* translators: 1: Browser cookie documentation URL, 2: Support forums URL */ + $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.' ), + __( 'https://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) ) ); + } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) { + // If cookies are disabled we can't log in even with a valid user+pass + /* translators: 1: Browser cookie documentation URL */ + $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.' ), + __( 'https://codex.wordpress.org/Cookies' ) ) ); + } + } + + $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; + /** + * Filters the login redirect URL. + * + * @since 3.0.0 + * + * @param string $redirect_to The redirect destination URL. + * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. + * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. + */ + $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user ); + + if ( !is_wp_error($user) && !$reauth ) { + if ( $interim_login ) { + $message = '

' . __('You have logged in successfully.') . '

'; + $interim_login = 'success'; + login_header( '', $message ); ?> + + + + + + +ID) && !is_super_admin( $user->ID ) ) + $redirect_to = user_admin_url(); + elseif ( is_multisite() && !$user->has_cap('read') ) + $redirect_to = get_dashboard_url( $user->ID ); + elseif ( !$user->has_cap('edit_posts') ) + $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url(); + + wp_redirect( $redirect_to ); + exit(); + } + wp_safe_redirect($redirect_to); + exit(); + } + + $errors = $user; + // Clear errors if loggedout is set. + if ( !empty($_GET['loggedout']) || $reauth ) + $errors = new WP_Error(); + + if ( $interim_login ) { + if ( ! $errors->get_error_code() ) + $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' ); + } else { + // Some parts of this script use the main login form to display a message + if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) + $errors->add('loggedout', __('You are now logged out.'), 'message'); + elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) + $errors->add('registerdisabled', __('User registration is currently not allowed.')); + elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) + $errors->add('confirm', __('Check your email for the confirmation link.'), 'message'); + elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) + $errors->add('newpass', __('Check your email for your new password.'), 'message'); + elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) + $errors->add('registered', __('Registration complete. Please check your email.'), 'message'); + elseif ( strpos( $redirect_to, 'about.php?updated' ) ) + $errors->add('updated', __( 'You have successfully updated WordPress! Please log back in to see what’s new.' ), 'message' ); + } + + /** + * Filters the login page errors. + * + * @since 3.6.0 + * + * @param object $errors WP Error object. + * @param string $redirect_to Redirect destination URL. + */ + $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to ); + + // Clear any stale cookies. + if ( $reauth ) + wp_clear_auth_cookie(); + + login_header(__('Log In'), '', $errors); + + if ( isset($_POST['log']) ) + $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : ''; + $rememberme = ! empty( $_POST['rememberme'] ); + + if ( ! empty( $errors->errors ) ) { + $aria_describedby_error = ' aria-describedby="login_error"'; + } else { + $aria_describedby_error = ''; + } +?> + +
+

+ +

+

+ +

+ +

+

+ + + + + + + + + + +

+
+ + + + + + + + Writing + * + * @package WordPress + */ + +/** Make sure that the WordPress bootstrap has run before continuing. */ +require(dirname(__FILE__) . '/wp-load.php'); + +/** This filter is documented in wp-admin/options.php */ +if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) + wp_die( __( 'This action has been disabled by the administrator.' ), 403 ); + +$mailserver_url = get_option( 'mailserver_url' ); + +if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) { + wp_die( __( 'This action has been disabled by the administrator.' ), 403 ); +} + +/** + * Fires to allow a plugin to do a complete takeover of Post by Email. + * + * @since 2.9.0 + */ +do_action( 'wp-mail.php' ); + +/** Get the POP3 class with which to access the mailbox. */ +require_once( ABSPATH . WPINC . '/class-pop3.php' ); + +/** Only check at this interval for new messages. */ +if ( !defined('WP_MAIL_INTERVAL') ) + define('WP_MAIL_INTERVAL', 300); // 5 minutes + +$last_checked = get_transient('mailserver_last_checked'); + +if ( $last_checked ) + wp_die(__('Slow down cowboy, no need to check for new mails so often!')); + +set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); + +$time_difference = get_option('gmt_offset') * HOUR_IN_SECONDS; + +$phone_delim = '::'; + +$pop3 = new POP3(); + +if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) + wp_die( esc_html( $pop3->ERROR ) ); + +$count = $pop3->pass( get_option('mailserver_pass') ); + +if( false === $count ) + wp_die( esc_html( $pop3->ERROR ) ); + +if( 0 === $count ) { + $pop3->quit(); + wp_die( __('There doesn’t seem to be any new mail.') ); +} + +for ( $i = 1; $i <= $count; $i++ ) { + + $message = $pop3->get($i); + + $bodysignal = false; + $boundary = ''; + $charset = ''; + $content = ''; + $content_type = ''; + $content_transfer_encoding = ''; + $post_author = 1; + $author_found = false; + foreach ($message as $line) { + // Body signal. + if ( strlen($line) < 3 ) + $bodysignal = true; + if ( $bodysignal ) { + $content .= $line; + } else { + if ( preg_match('/Content-Type: /i', $line) ) { + $content_type = trim($line); + $content_type = substr($content_type, 14, strlen($content_type) - 14); + $content_type = explode(';', $content_type); + if ( ! empty( $content_type[1] ) ) { + $charset = explode('=', $content_type[1]); + $charset = ( ! empty( $charset[1] ) ) ? trim($charset[1]) : ''; + } + $content_type = $content_type[0]; + } + if ( preg_match('/Content-Transfer-Encoding: /i', $line) ) { + $content_transfer_encoding = trim($line); + $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding) - 27); + $content_transfer_encoding = explode(';', $content_transfer_encoding); + $content_transfer_encoding = $content_transfer_encoding[0]; + } + if ( ( $content_type == 'multipart/alternative' ) && ( false !== strpos($line, 'boundary="') ) && ( '' == $boundary ) ) { + $boundary = trim($line); + $boundary = explode('"', $boundary); + $boundary = $boundary[1]; + } + if (preg_match('/Subject: /i', $line)) { + $subject = trim($line); + $subject = substr($subject, 9, strlen($subject) - 9); + // Captures any text in the subject before $phone_delim as the subject + if ( function_exists('iconv_mime_decode') ) { + $subject = iconv_mime_decode($subject, 2, get_option('blog_charset')); + } else { + $subject = wp_iso_descrambler($subject); + } + $subject = explode($phone_delim, $subject); + $subject = $subject[0]; + } + + /* + * Set the author using the email address (From or Reply-To, the last used) + * otherwise use the site admin. + */ + if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { + if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) + $author = $matches[0]; + else + $author = trim($line); + $author = sanitize_email($author); + if ( is_email($author) ) { + /* translators: Post author email address */ + echo '

' . sprintf(__('Author is %s'), $author) . '

'; + $userdata = get_user_by('email', $author); + if ( ! empty( $userdata ) ) { + $post_author = $userdata->ID; + $author_found = true; + } + } + } + + if ( preg_match( '/Date: /i', $line ) ) { // of the form '20 Mar 2002 20:32:37 +0100' + $ddate = str_replace( 'Date: ', '', trim( $line ) ); + $ddate = preg_replace( '!\s*\(.+\)\s*$!', '', $ddate ); // remove parenthesised timezone string if it exists, as this confuses strtotime + $ddate_U = strtotime( $ddate ); + $post_date = gmdate( 'Y-m-d H:i:s', $ddate_U + $time_difference ); + $post_date_gmt = gmdate( 'Y-m-d H:i:s', $ddate_U ); + } + } + } + + // Set $post_status based on $author_found and on author's publish_posts capability + if ( $author_found ) { + $user = new WP_User($post_author); + $post_status = ( $user->has_cap('publish_posts') ) ? 'publish' : 'pending'; + } else { + // Author not found in DB, set status to pending. Author already set to admin. + $post_status = 'pending'; + } + + $subject = trim($subject); + + if ( $content_type == 'multipart/alternative' ) { + $content = explode('--'.$boundary, $content); + $content = $content[2]; + + // Match case-insensitive content-transfer-encoding. + if ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim) ) { + $content = explode($delim[0], $content); + $content = $content[1]; + } + $content = strip_tags($content, '


'); + } + $content = trim($content); + + /** + * Filters the original content of the email. + * + * Give Post-By-Email extending plugins full access to the content, either + * the raw content, or the content of the last quoted-printable section. + * + * @since 2.8.0 + * + * @param string $content The original email content. + */ + $content = apply_filters( 'wp_mail_original_content', $content ); + + if ( false !== stripos($content_transfer_encoding, "quoted-printable") ) { + $content = quoted_printable_decode($content); + } + + if ( function_exists('iconv') && ! empty( $charset ) ) { + $content = iconv($charset, get_option('blog_charset'), $content); + } + + // Captures any text in the body after $phone_delim as the body + $content = explode($phone_delim, $content); + $content = empty( $content[1] ) ? $content[0] : $content[1]; + + $content = trim($content); + + /** + * Filters the content of the post submitted by email before saving. + * + * @since 1.2.0 + * + * @param string $content The email content. + */ + $post_content = apply_filters( 'phone_content', $content ); + + $post_title = xmlrpc_getposttitle($content); + + if ($post_title == '') $post_title = $subject; + + $post_category = array(get_option('default_email_category')); + + $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); + $post_data = wp_slash($post_data); + + $post_ID = wp_insert_post($post_data); + if ( is_wp_error( $post_ID ) ) + echo "\n" . $post_ID->get_error_message(); + + // We couldn't post, for whatever reason. Better move forward to the next email. + if ( empty( $post_ID ) ) + continue; + + /** + * Fires after a post submitted by email is published. + * + * @since 1.2.0 + * + * @param int $post_ID The post ID. + */ + do_action( 'publish_phone', $post_ID ); + + echo "\n

" . __( 'Author:' ) . ' ' . esc_html( $post_author ) . '

'; + echo "\n

" . __( 'Posted title:' ) . ' ' . esc_html( $post_title ) . '

'; + + if(!$pop3->delete($i)) { + echo '

' . sprintf( + /* translators: %s: POP3 error */ + __( 'Oops: %s' ), + esc_html( $pop3->ERROR ) + ) . '

'; + $pop3->reset(); + exit; + } else { + echo '

' . sprintf( + /* translators: %s: the message ID */ + __( 'Mission complete. Message %s deleted.' ), + '' . $i . '' + ) . '

'; + } + +} + +$pop3->quit(); diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index c34f433..955c1e1 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -42,7 +42,7 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we $data['admin_email'] = $adminEmail; $data['blog_public'] = 1; $data['activate_theme'] = 1; - $data['plugins'] = 'image-widget;tiled-gallery-carousel-without-jetpack;wordfence;wp-super-cache'; + $data['plugins'] = 'tiled-gallery-carousel-without-jetpack;wordfence;wp-super-cache;google-calendar-events;easy-facebook-feed'; $data['activate_plugins'] = 1; $data['permalink_structure'] = '/%postname%/'; $data['thumbnail_size_w'] = 0; @@ -105,3 +105,36 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we } } } + +/* +dbname:wordpress +uname:root +pwd: +dbhost:localhost +prefix:wp_ +default_content:1 +language:en_US +directory: +weblog_title:my wordpress +user_login:admin +admin_password:admin +admin_email:admin@admin.cz +blog_public:1 +activate_theme:1 +plugins:tiled-gallery-carousel-without-jetpack;wordfence;wp-super-cache;google-calendar-events;easy-facebook-feed +activate_plugins:1 +permalink_structure:/%postname%/ +thumbnail_size_w:0 +thumbnail_size_h:0 +thumbnail_crop:1 +medium_size_w:0 +medium_size_h:0 +large_size_w:0 +large_size_h:0 +upload_dir: +uploads_use_yearmonth_folders:1 +post_revisions:0 +disallow_file_edit:1 +autosave_interval:7200 +wpcom_api_key: +*/ \ No newline at end of file diff --git a/wp-quick-install/assets/js/script.js b/wp-quick-install/assets/js/script.js index 819ee67..c38e493 100755 --- a/wp-quick-install/assets/js/script.js +++ b/wp-quick-install/assets/js/script.js @@ -1,10 +1,12 @@ +var $debug, $debug_options, $debug_display, $debug_log, $response; + $(document).ready(function() { // Debug mode - var $debug = $('#debug'), - $debug_options = $('#debug_options'), - $debug_display = $debug_options.find('#debug_display'); - $debug_log = $debug_options.find('#debug_log'); + $debug = $('#debug'); + $debug_options = $('#debug_options'); + $debug_display = $debug_options.find('#debug_display'); + $debug_log = $debug_options.find('#debug_log'); $debug.change(function() { if ( $debug.is(':checked') ) { @@ -221,7 +223,7 @@ $(document).ready(function() { } - var $response = $('#response'); + $response = $('#response'); $('#submit').click( function() { @@ -289,72 +291,79 @@ $(document).ready(function() { return false; }); - // Let's unzip WordPress - function unzip_wp() { - $response.html("

Decompressing Files...

" ); - $('.progress-bar').animate({width: "16.5%"}); - $.post(window.location.href + '?action=unzip_wp', $('form').serialize(), function(data) { - wp_config(); - }); - } - - // Let's create the wp-config.php file - function wp_config() { - $response.html("

File Creation for wp-config...

"); - $('.progress-bar').animate({width: "33%"}); - $.post(window.location.href + '?action=wp_config', $('form').serialize(), function(data) { - install_wp(); - }); - } - - // CDatabase - function install_wp() { - $response.html("

Database Installation in Progress...

"); - $('.progress-bar').animate({width: "49.5%"}); - $.post(window.location.href + '/wp-admin/install.php?action=install_wp', $('form').serialize(), function(data) { - install_theme(); - }); - } - - // Theme - function install_theme() { - $response.html("

Theme Installation in Progress...

"); - $('.progress-bar').animate({width: "66%"}); - $.post(window.location.href + '/wp-admin/install.php?action=install_theme', $('form').serialize(), function(data) { - install_plugins(); - }); - } - - // Plugin - function install_plugins() { - $response.html("

Plugins Installation in Progress...

"); - $('.progress-bar').animate({width: "82.5%"}); - $.post(window.location.href + '?action=install_plugins', $('form').serialize(), function(data) { - $response.html(data); - activate_dsw(); - }); - } - - // Plugin - function activate_dsw() { - $response.html("

Instaluji šablonu Dobrý skautský web

"); - $('.progress-bar').animate({width: "82.5%"}); - $.post(window.location.href + '/../../wp-content/themes/dsw-oddil-master/install.php', $('form').serialize(), function(data) { - $response.hide(); - success(); - }); - } - - // Remove the archive - function success() { - $response.html("

Successful installation completed

"); - $('.progress-bar').animate({width: "100%"}); - $response.hide(); - $('.progress').delay(500).hide(); - $.post(window.location.href + '?action=success',$('form').serialize(), function(data) { - $('#success').show().append(data); - }); - $.get( 'http://wp-quick-install.com/inc/incr-counter.php' ); - } -}); \ No newline at end of file +}); + +// Let's unzip WordPress +function unzip_wp() { + $response.html("

Decompressing Files...

" ); + $('.progress-bar').animate({width: "16.5%"}); + $.post(window.location.href + '?action=unzip_wp', $('form').serialize(), function(data) { + console.log('unzip_wp done'); + wp_config(); + }); +} + +// Let's create the wp-config.php file +function wp_config() { + $response.html("

File Creation for wp-config...

"); + $('.progress-bar').animate({width: "33%"}); + $.post(window.location.href + '?action=wp_config', $('form').serialize(), function(data) { + console.log('wp_config done'); + // install_wp(); + }); +} + +// CDatabase +function install_wp() { + $response.html("

Database Installation in Progress...

"); + $('.progress-bar').animate({width: "49.5%"}); + $.post(window.location.href + '/wp-admin/install.php?action=install_wp', $('form').serialize(), function(data) { + console.log('install_wp done'); + install_theme(); + }); +} + +// Theme +function install_theme() { + $response.html("

Theme Installation in Progress...

"); + $('.progress-bar').animate({width: "66%"}); + $.post(window.location.href + '/wp-admin/install.php?action=install_theme', $('form').serialize(), function(data) { + console.log('install_theme done'); + install_plugins(); + }); +} + +// Plugin +function install_plugins() { + $response.html("

Plugins Installation in Progress...

"); + $('.progress-bar').animate({width: "82.5%"}); + $.post(window.location.href + '?action=install_plugins', $('form').serialize(), function(data) { + $response.html(data); + console.log('install_plugins done'); + activate_dsw(); + }); +} + +// Plugin +function activate_dsw() { + $response.html("

Instaluji šablonu Dobrý skautský web

"); + $('.progress-bar').animate({width: "82.5%"}); + $.post(window.location.href + '/../../wp-content/themes/dsw-oddil-master/install.php', $('form').serialize(), function(data) { + $response.hide(); + console.log('activate_dsw done'); + success(); + }); +} + +// Remove the archive +function success() { + $response.html("

Successful installation completed

"); + $('.progress-bar').animate({width: "100%"}); + $response.hide(); + $('.progress').delay(500).hide(); + $.post(window.location.href + '?action=success',$('form').serialize(), function(data) { + $('#success').show().append(data); + }); + $.get( 'http://wp-quick-install.com/inc/incr-counter.php' ); +} diff --git a/wp-quick-install/index.php b/wp-quick-install/index.php index f348029..13aae10 100755 --- a/wp-quick-install/index.php +++ b/wp-quick-install/index.php @@ -699,12 +699,12 @@ function sanit( $str ) { - + - +

@@ -714,13 +714,13 @@ function sanit( $str ) {

- +

.

- +

diff --git a/wp-settings.php b/wp-settings.php new file mode 100644 index 0000000..d1505c5 --- /dev/null +++ b/wp-settings.php @@ -0,0 +1,469 @@ +init(); + +// Load the functions for the active theme, for both parent and child theme if applicable. +if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) { + if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) + include( STYLESHEETPATH . '/functions.php' ); + if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) + include( TEMPLATEPATH . '/functions.php' ); +} + +/** + * Fires after the theme is loaded. + * + * @since 3.0.0 + */ +do_action( 'after_setup_theme' ); + +// Set up current user. +$GLOBALS['wp']->init(); + +/** + * Fires after WordPress has finished loading but before any headers are sent. + * + * Most of WP is loaded at this stage, and the user is authenticated. WP continues + * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate + * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). + * + * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below. + * + * @since 1.5.0 + */ +do_action( 'init' ); + +// Check site status +if ( is_multisite() ) { + if ( true !== ( $file = ms_site_check() ) ) { + require( $file ); + die(); + } + unset($file); +} + +/** + * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. + * + * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for + * users not logged in. + * + * @link https://codex.wordpress.org/AJAX_in_Plugins + * + * @since 3.0.0 + */ +do_action( 'wp_loaded' ); diff --git a/wp-signup.php b/wp-signup.php new file mode 100644 index 0000000..156de61 --- /dev/null +++ b/wp-signup.php @@ -0,0 +1,919 @@ +is_404 = false; + +/** + * Fires before the Site Signup page is loaded. + * + * @since 4.4.0 + */ +do_action( 'before_signup_header' ); + +/** + * Prints styles for front-end Multisite signup pages + * + * @since MU + */ +function wpmu_signup_stylesheet() { + ?> + + +
+'; +} + +$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; + +$current_user = wp_get_current_user(); +if ( $active_signup == 'none' ) { + _e( 'Registration has been disabled.' ); +} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { + $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); + /* translators: %s: login URL */ + printf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); +} else { + $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; + switch ( $stage ) { + case 'validate-user-signup' : + if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) + validate_user_signup(); + else + _e( 'User registration has been disabled.' ); + break; + case 'validate-blog-signup': + if ( $active_signup == 'all' || $active_signup == 'blog' ) + validate_blog_signup(); + else + _e( 'Site registration has been disabled.' ); + break; + case 'gimmeanotherblog': + validate_another_blog_signup(); + break; + case 'default': + default : + $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; + /** + * Fires when the site sign-up form is sent. + * + * @since 3.0.0 + */ + do_action( 'preprocess_signup_form' ); + if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) + signup_another_blog($newblogname); + elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) + signup_user( $newblogname, $user_email ); + elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) + _e( 'Sorry, new registrations are not allowed at this time.' ); + else + _e( 'You are logged in already. No need to register again!' ); + + if ( $newblogname ) { + $newblog = get_blogaddress_by_name( $newblogname ); + + if ( $active_signup == 'blog' || $active_signup == 'all' ) + /* translators: %s: site address */ + printf( '

' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '

', + '' . $newblog . '' + ); + else + /* translators: %s: site address */ + printf( '

' . __( 'The site you were looking for, %s, does not exist.' ) . '

', + '' . $newblog . '' + ); + } + break; + } +} +?> +
+
+ + + '1' ) ); +} + +/** + * Response to a trackback. + * + * Responds with an error or success XML message. + * + * @since 0.71 + * + * @param mixed $error Whether there was an error. + * Default '0'. Accepts '0' or '1', true or false. + * @param string $error_message Error message if an error occurred. + */ +function trackback_response($error = 0, $error_message = '') { + header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); + if ($error) { + echo '\n"; + echo "\n"; + echo "1\n"; + echo "$error_message\n"; + echo ""; + die(); + } else { + echo '\n"; + echo "\n"; + echo "0\n"; + echo ""; + } +} + +// Trackback is done by a POST. +$request_array = 'HTTP_POST_VARS'; + +if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) { + $tb_id = explode('/', $_SERVER['REQUEST_URI']); + $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); +} + +$tb_url = isset($_POST['url']) ? $_POST['url'] : ''; +$charset = isset($_POST['charset']) ? $_POST['charset'] : ''; + +// These three are stripslashed here so they can be properly escaped after mb_convert_encoding(). +$title = isset($_POST['title']) ? wp_unslash($_POST['title']) : ''; +$excerpt = isset($_POST['excerpt']) ? wp_unslash($_POST['excerpt']) : ''; +$blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name']) : ''; + +if ($charset) + $charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) ); +else + $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; + +// No valid uses for UTF-7. +if ( false !== strpos($charset, 'UTF-7') ) + die; + +// For international trackbacks. +if ( function_exists('mb_convert_encoding') ) { + $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); + $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); + $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); +} + +// Now that mb_convert_encoding() has been given a swing, we need to escape these three. +$title = wp_slash($title); +$excerpt = wp_slash($excerpt); +$blog_name = wp_slash($blog_name); + +if ( is_single() || is_page() ) + $tb_id = $posts[0]->ID; + +if ( !isset($tb_id) || !intval( $tb_id ) ) + trackback_response( 1, __( 'I really need an ID for this to work.' ) ); + +if (empty($title) && empty($tb_url) && empty($blog_name)) { + // If it doesn't look like a trackback at all. + wp_redirect(get_permalink($tb_id)); + exit; +} + +if ( !empty($tb_url) && !empty($title) ) { + /** + * Fires before the trackback is added to a post. + * + * @since 4.7.0 + * + * @param int $tb_id Post ID related to the trackback. + * @param string $tb_url Trackback URL. + * @param string $charset Character Set. + * @param string $title Trackback Title. + * @param string $excerpt Trackback Excerpt. + * @param string $blog_name Blog Name. + */ + do_action( 'pre_trackback_post', $tb_id, $tb_url, $charset, $title, $excerpt, $blog_name ); + + header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); + + if ( !pings_open($tb_id) ) + trackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) ); + + $title = wp_html_excerpt( $title, 250, '…' ); + $excerpt = wp_html_excerpt( $excerpt, 252, '…' ); + + $comment_post_ID = (int) $tb_id; + $comment_author = $blog_name; + $comment_author_email = ''; + $comment_author_url = $tb_url; + $comment_content = "$title\n\n$excerpt"; + $comment_type = 'trackback'; + + $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); + if ( $dupe ) + trackback_response( 1, __( 'We already have a ping from that URL for this post.' ) ); + + $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); + + wp_new_comment($commentdata); + $trackback_id = $wpdb->insert_id; + + /** + * Fires after a trackback is added to a post. + * + * @since 1.2.0 + * + * @param int $trackback_id Trackback ID. + */ + do_action( 'trackback_post', $trackback_id ); + trackback_response( 0 ); +} diff --git a/xmlrpc.php b/xmlrpc.php new file mode 100644 index 0000000..12da79b --- /dev/null +++ b/xmlrpc.php @@ -0,0 +1,101 @@ + +'; ?> + + + WordPress + https://wordpress.org/ + + + + + + + + + + +serve_request(); + +exit; + +/** + * logIO() - Writes logging info to a file. + * + * @deprecated 3.4.0 Use error_log() + * @see error_log() + * + * @param string $io Whether input or output + * @param string $msg Information describing logging reason. + */ +function logIO( $io, $msg ) { + _deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' ); + if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) + error_log( $io . ' - ' . $msg ); +} \ No newline at end of file From 4c668f6f71139b42d3c69e99652db0fdc143b61a Mon Sep 17 00:00:00 2001 From: racinmat Date: Sun, 25 Jun 2017 01:06:54 +0200 Subject: [PATCH 14/25] Added composer.json and .htaccess. --- .htaccess | 12 ++++++++++++ composer.json | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 .htaccess create mode 100644 composer.json diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..32b2ef3 --- /dev/null +++ b/.htaccess @@ -0,0 +1,12 @@ + +# BEGIN WordPress + +RewriteEngine On +RewriteBase /wp-quick-install/ +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . /wp-quick-install/index.php [L] + + +# END WordPress \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c512c49 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "guzzlehttp/guzzle": "^6.2" + } +} From 333903b993e7177a833b266efdb15a10ce080ee4 Mon Sep 17 00:00:00 2001 From: racinmat Date: Sun, 25 Jun 2017 01:18:01 +0200 Subject: [PATCH 15/25] Removed some wordpress files. --- index.php | 17 - wp-activate.php | 162 ----- wp-blog-header.php | 21 - wp-comments-post.php | 60 -- wp-config-sample.php | 89 --- wp-config.php | 102 --- wp-cron.php | 129 ---- wp-links-opml.php | 83 --- wp-load.php | 93 --- wp-login.php | 994 -------------------------- wp-mail.php | 253 ------- wp-quick-install/WordpressService.php | 41 +- wp-settings.php | 469 ------------ wp-signup.php | 919 ------------------------ wp-trackback.php | 141 ---- xmlrpc.php | 101 --- 16 files changed, 4 insertions(+), 3670 deletions(-) delete mode 100644 index.php delete mode 100644 wp-activate.php delete mode 100644 wp-blog-header.php delete mode 100644 wp-comments-post.php delete mode 100644 wp-config-sample.php delete mode 100644 wp-config.php delete mode 100644 wp-cron.php delete mode 100644 wp-links-opml.php delete mode 100644 wp-load.php delete mode 100644 wp-login.php delete mode 100644 wp-mail.php delete mode 100644 wp-settings.php delete mode 100644 wp-signup.php delete mode 100644 wp-trackback.php delete mode 100644 xmlrpc.php diff --git a/index.php b/index.php deleted file mode 100644 index dd3d554..0000000 --- a/index.php +++ /dev/null @@ -1,17 +0,0 @@ -cache_enabled = false; - -// Fix for page title -$wp_query->is_404 = false; - -/** - * Fires before the Site Activation page is loaded. - * - * @since 3.0.0 - */ -do_action( 'activate_header' ); - -/** - * Adds an action hook specific to this page. - * - * Fires on {@see 'wp_head'}. - * - * @since MU - */ -function do_activate_header() { - /** - * Fires before the Site Activation page is loaded. - * - * Fires on the {@see 'wp_head'} action. - * - * @since 3.0.0 - */ - do_action( 'activate_wp_head' ); -} -add_action( 'wp_head', 'do_activate_header' ); - -/** - * Loads styles specific to this page. - * - * @since MU - */ -function wpmu_activate_stylesheet() { - ?> - - - -
-
- - -

-
-

- -
-

-

- -

-
- - get_error_code() || 'blog_taken' == $result->get_error_code() ) { - $signup = $result->get_error_data(); - ?> -

- '; - if ( $signup->domain . $signup->path == '' ) { - printf( - /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */ - __( 'Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), - network_site_url( 'wp-login.php', 'login' ), - $signup->user_login, - $signup->user_email, - wp_lostpassword_url() - ); - } else { - printf( - /* translators: 1: site URL, 2: site domain, 3: username, 4: user email, 5: lost password URL */ - __( 'Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), - 'http://' . $signup->domain, - $signup->domain, - $signup->user_login, - $signup->user_email, - wp_lostpassword_url() - ); - } - echo '

'; - } else { - ?> -

-

get_error_message(); ?>

- -

- -
-

user_login ?>

-

-
- - -

View your site or Log in' ), $url, esc_url( $login_url ) ); - ?>

- -

Log in or go back to the homepage.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() ); - ?>

- -
-
- -get_error_data() ); - if ( ! empty( $data ) ) { - wp_die( '

' . $comment->get_error_message() . '

', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) ); - } else { - exit; - } -} - -$user = wp_get_current_user(); - -/** - * Perform other actions when comment cookies are set. - * - * @since 3.4.0 - * - * @param WP_Comment $comment Comment object. - * @param WP_User $user User object. The user may not exist. - */ -do_action( 'set_comment_cookies', $comment, $user ); - -$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID; - -/** - * Filters the location URI to send the commenter after posting. - * - * @since 2.0.5 - * - * @param string $location The 'redirect_to' URI sent via $_POST. - * @param WP_Comment $comment Comment object. - */ -$location = apply_filters( 'comment_post_redirect', $location, $comment ); - -wp_safe_redirect( $location ); -exit; diff --git a/wp-config-sample.php b/wp-config-sample.php deleted file mode 100644 index 02091c1..0000000 --- a/wp-config-sample.php +++ /dev/null @@ -1,89 +0,0 @@ -pVeO1}GRa'); -define('SECURE_AUTH_KEY', 'u9TjFsx*WA&]m:<3KSfC].RT +1Wb3?*!M6(_5So/OXA9]`/M +S$l2Z?jR$GVD9'); -define('LOGGED_IN_KEY', 'D*iT*1con6fh/~LX<#~(TAg=J-> 8|)--?gNV<.]1v[67:NvknP.:L>eMl-~AcvAN+hej!@fL=ox2AikW7)Y,)y@R^&vEsv<~'); -define('LOGGED_IN_SALT', 'qkQC?$?!m#D:]eiekruek]yk 6# FW;5#@f)]]ZCk=#stcrjb%)L%Rau{{assTJ^'); -define('NONCE_SALT', 'gNRwBA5g_?&VO}zv6xG7E=|!64s}2-*^l'); - -/**#@-*/ - -/** - * WordPress Database Table prefix. - * - * You can have multiple installations in one database if you give each - * a unique prefix. Only numbers, letters, and underscores please! - */ -$table_prefix = 'wp_'; - -/** - * For developers: WordPress debugging mode. - * - * Change this to true to enable the display of notices during development. - * It is strongly recommended that plugin and theme developers use WP_DEBUG - * in their development environments. - * - * For information on other constants that can be used for debugging, - * visit the Codex. - * - * @link https://codex.wordpress.org/Debugging_in_WordPress - */ -define('WP_DEBUG', false); - - - /** Désactivation des révisions d'articles */ -define('WP_POST_REVISIONS', 0); - - /** Désactivation de l'éditeur de thème et d'extension */ -define('DISALLOW_FILE_EDIT', true); - - /** Intervalle des sauvegardes automatique */ -define('AUTOSAVE_INTERVAL', 7200); - - /** On augmente la mémoire limite */ -define('WP_MEMORY_LIMIT', '96M'); - -/* That's all, stop editing! Happy blogging. */ - -/** Absolute path to the WordPress directory. */ -if ( !defined('ABSPATH') ) - define('ABSPATH', dirname(__FILE__) . '/'); - -/** Sets up WordPress vars and included files. */ -require_once(ABSPATH . 'wp-settings.php'); diff --git a/wp-cron.php b/wp-cron.php deleted file mode 100644 index 15c6676..0000000 --- a/wp-cron.php +++ /dev/null @@ -1,129 +0,0 @@ -get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) ); - if ( is_object( $row ) ) - $value = $row->option_value; - } - - return $value; -} - -if ( false === $crons = _get_cron_array() ) - die(); - -$keys = array_keys( $crons ); -$gmt_time = microtime( true ); - -if ( isset($keys[0]) && $keys[0] > $gmt_time ) - die(); - - -// The cron lock: a unix timestamp from when the cron was spawned. -$doing_cron_transient = get_transient( 'doing_cron' ); - -// Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock. -if ( empty( $doing_wp_cron ) ) { - if ( empty( $_GET[ 'doing_wp_cron' ] ) ) { - // Called from external script/job. Try setting a lock. - if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) - return; - $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); - set_transient( 'doing_cron', $doing_wp_cron ); - } else { - $doing_wp_cron = $_GET[ 'doing_wp_cron' ]; - } -} - -/* - * The cron lock (a unix timestamp set when the cron was spawned), - * must match $doing_wp_cron (the "key"). - */ -if ( $doing_cron_transient != $doing_wp_cron ) - return; - -foreach ( $crons as $timestamp => $cronhooks ) { - if ( $timestamp > $gmt_time ) - break; - - foreach ( $cronhooks as $hook => $keys ) { - - foreach ( $keys as $k => $v ) { - - $schedule = $v['schedule']; - - if ( $schedule != false ) { - $new_args = array($timestamp, $schedule, $hook, $v['args']); - call_user_func_array('wp_reschedule_event', $new_args); - } - - wp_unschedule_event( $timestamp, $hook, $v['args'] ); - - /** - * Fires scheduled events. - * - * @ignore - * @since 2.1.0 - * - * @param string $hook Name of the hook that was scheduled to be fired. - * @param array $args The arguments to be passed to the hook. - */ - do_action_ref_array( $hook, $v['args'] ); - - // If the hook ran too long and another cron process stole the lock, quit. - if ( _get_cron_lock() != $doing_wp_cron ) - return; - } - } -} - -if ( _get_cron_lock() == $doing_wp_cron ) - delete_transient( 'doing_cron' ); - -die(); diff --git a/wp-links-opml.php b/wp-links-opml.php deleted file mode 100644 index 42e8b24..0000000 --- a/wp-links-opml.php +++ /dev/null @@ -1,83 +0,0 @@ -\n"; -?> - - - <?php - /* translators: 1: Site name */ - printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); - ?> - GMT - - - - 'link_category', 'hierarchical' => 0)); -else - $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); - -foreach ( (array)$cats as $cat ) : - /** - * Filters the OPML outline link category name. - * - * @since 2.2.0 - * - * @param string $catname The OPML outline category name. - */ - $catname = apply_filters( 'link_category', $cat->name ); - -?> - - $cat->term_id)); - foreach ( (array)$bookmarks as $bookmark ) : - /** - * Filters the OPML outline link title text. - * - * @since 2.2.0 - * - * @param string $title The OPML outline title text. - */ - $title = apply_filters( 'link_title', $bookmark->link_name ); -?> - - - - - - diff --git a/wp-load.php b/wp-load.php deleted file mode 100644 index a1a9ad6..0000000 --- a/wp-load.php +++ /dev/null @@ -1,93 +0,0 @@ -wp-config.php' - ) . '

'; - $die .= '

' . sprintf( - /* translators: %s: Codex URL */ - __( "Need more help? We got it." ), - __( 'https://codex.wordpress.org/Editing_wp-config.php' ) - ) . '

'; - $die .= '

' . sprintf( - /* translators: %s: wp-config.php */ - __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ), - 'wp-config.php' - ) . '

'; - $die .= '

' . __( "Create a Configuration File" ) . ''; - - wp_die( $die, __( 'WordPress › Error' ) ); -} diff --git a/wp-login.php b/wp-login.php deleted file mode 100644 index 8d73c65..0000000 --- a/wp-login.php +++ /dev/null @@ -1,994 +0,0 @@ -` element. - * Default 'Log In'. - * @param string $message Optional. Message to display in header. Default empty. - * @param WP_Error $wp_error Optional. The error to pass. Default empty. - */ -function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { - global $error, $interim_login, $action; - - // Don't index any of these forms - add_action( 'login_head', 'wp_no_robots' ); - - add_action( 'login_head', 'wp_login_viewport_meta' ); - - if ( empty($wp_error) ) - $wp_error = new WP_Error(); - - // Shake it! - $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); - /** - * Filters the error codes array for shaking the login form. - * - * @since 3.0.0 - * - * @param array $shake_error_codes Error codes that shake the login form. - */ - $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); - - if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) - add_action( 'login_head', 'wp_shake_js', 12 ); - - $separator = is_rtl() ? ' › ' : ' ‹ '; - - ?> - - - > - - - - <?php echo get_bloginfo( 'name', 'display' ) . $separator . $title; ?> - get_error_code() ) { - ?> - - site_name; - } else { - $login_header_url = __( 'https://wordpress.org/' ); - $login_header_title = __( 'Powered by WordPress' ); - } - - /** - * Filters link URL of the header logo above login form. - * - * @since 2.1.0 - * - * @param string $login_header_url Login header logo URL. - */ - $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); - - /** - * Filters the title attribute of the header logo above login form. - * - * @since 2.1.0 - * - * @param string $login_header_title Login header logo title attribute. - */ - $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); - - $classes = array( 'login-action-' . $action, 'wp-core-ui' ); - if ( is_rtl() ) - $classes[] = 'rtl'; - if ( $interim_login ) { - $classes[] = 'interim-login'; - ?> - - - - - -

-

- add('error', $error); - unset($error); - } - - if ( $wp_error->get_error_code() ) { - $errors = ''; - $messages = ''; - foreach ( $wp_error->get_error_codes() as $code ) { - $severity = $wp_error->get_error_data( $code ); - foreach ( $wp_error->get_error_messages( $code ) as $error_message ) { - if ( 'message' == $severity ) - $messages .= ' ' . $error_message . "
\n"; - else - $errors .= ' ' . $error_message . "
\n"; - } - } - if ( ! empty( $errors ) ) { - /** - * Filters the error messages displayed above the login form. - * - * @since 2.1.0 - * - * @param string $errors Login error message. - */ - echo '
' . apply_filters( 'login_errors', $errors ) . "
\n"; - } - if ( ! empty( $messages ) ) { - /** - * Filters instructional messages displayed above the login form. - * - * @since 2.5.0 - * - * @param string $messages Login messages. - */ - echo '

' . apply_filters( 'login_messages', $messages ) . "

\n"; - } - } -} // End of login_header() - -/** - * Outputs the footer for the login page. - * - * @param string $input_id Which input to auto-focus - */ -function login_footer($input_id = '') { - global $interim_login; - - // Don't allow interim logins to navigate away from the page. - if ( ! $interim_login ): ?> -

- - -
- - - - - - -
- - - - - - - add('empty_username', __('ERROR: Enter a username or email address.')); - } elseif ( strpos( $_POST['user_login'], '@' ) ) { - $user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) ); - if ( empty( $user_data ) ) - $errors->add('invalid_email', __('ERROR: There is no user registered with that email address.')); - } else { - $login = trim($_POST['user_login']); - $user_data = get_user_by('login', $login); - } - - /** - * Fires before errors are returned from a password reset request. - * - * @since 2.1.0 - * @since 4.4.0 Added the `$errors` parameter. - * - * @param WP_Error $errors A WP_Error object containing any errors generated - * by using invalid credentials. - */ - do_action( 'lostpassword_post', $errors ); - - if ( $errors->get_error_code() ) - return $errors; - - if ( !$user_data ) { - $errors->add('invalidcombo', __('ERROR: Invalid username or email.')); - return $errors; - } - - // Redefining user_login ensures we return the right case in the email. - $user_login = $user_data->user_login; - $user_email = $user_data->user_email; - $key = get_password_reset_key( $user_data ); - - if ( is_wp_error( $key ) ) { - return $key; - } - - $message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n"; - $message .= network_home_url( '/' ) . "\r\n\r\n"; - $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; - $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; - $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; - $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; - - if ( is_multisite() ) { - $blogname = get_network()->site_name; - } else { - /* - * The blogname option is escaped with esc_html on the way into the database - * in sanitize_option we want to reverse this for the plain text arena of emails. - */ - $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); - } - - /* translators: Password reset email subject. 1: Site name */ - $title = sprintf( __('[%s] Password Reset'), $blogname ); - - /** - * Filters the subject of the password reset email. - * - * @since 2.8.0 - * @since 4.4.0 Added the `$user_login` and `$user_data` parameters. - * - * @param string $title Default email title. - * @param string $user_login The username for the user. - * @param WP_User $user_data WP_User object. - */ - $title = apply_filters( 'retrieve_password_title', $title, $user_login, $user_data ); - - /** - * Filters the message body of the password reset mail. - * - * If the filtered message is empty, the password reset email will not be sent. - * - * @since 2.8.0 - * @since 4.1.0 Added `$user_login` and `$user_data` parameters. - * - * @param string $message Default mail message. - * @param string $key The activation key. - * @param string $user_login The username for the user. - * @param WP_User $user_data WP_User object. - */ - $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data ); - - if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) - wp_die( __('The email could not be sent.') . "
\n" . __('Possible reason: your host may have disabled the mail() function.') ); - - return true; -} - -// -// Main -// - -$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; -$errors = new WP_Error(); - -if ( isset($_GET['key']) ) - $action = 'resetpass'; - -// validate action so as to default to the login screen -if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) - $action = 'login'; - -nocache_headers(); - -header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); - -if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set - if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) - $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); - - $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); - if ( $url != get_option( 'siteurl' ) ) - update_option( 'siteurl', $url ); -} - -//Set a cookie now to see if they are supported by the browser. -$secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) ); -setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure ); -if ( SITECOOKIEPATH != COOKIEPATH ) - setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure ); - -/** - * Fires when the login form is initialized. - * - * @since 3.2.0 - */ -do_action( 'login_init' ); -/** - * Fires before a specified login form action. - * - * The dynamic portion of the hook name, `$action`, refers to the action - * that brought the visitor to the login form. Actions include 'postpass', - * 'logout', 'lostpassword', etc. - * - * @since 2.8.0 - */ -do_action( "login_form_{$action}" ); - -$http_post = ('POST' == $_SERVER['REQUEST_METHOD']); -$interim_login = isset($_REQUEST['interim-login']); - -switch ($action) { - -case 'postpass' : - if ( ! array_key_exists( 'post_password', $_POST ) ) { - wp_safe_redirect( wp_get_referer() ); - exit(); - } - - require_once ABSPATH . WPINC . '/class-phpass.php'; - $hasher = new PasswordHash( 8, true ); - - /** - * Filters the life span of the post password cookie. - * - * By default, the cookie expires 10 days from creation. To turn this - * into a session cookie, return 0. - * - * @since 3.7.0 - * - * @param int $expires The expiry time, as passed to setcookie(). - */ - $expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS ); - $referer = wp_get_referer(); - if ( $referer ) { - $secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) ); - } else { - $secure = false; - } - setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure ); - - wp_safe_redirect( wp_get_referer() ); - exit(); - -case 'logout' : - check_admin_referer('log-out'); - - $user = wp_get_current_user(); - - wp_logout(); - - if ( ! empty( $_REQUEST['redirect_to'] ) ) { - $redirect_to = $requested_redirect_to = $_REQUEST['redirect_to']; - } else { - $redirect_to = 'wp-login.php?loggedout=true'; - $requested_redirect_to = ''; - } - - /** - * Filters the log out redirect URL. - * - * @since 4.2.0 - * - * @param string $redirect_to The redirect destination URL. - * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. - * @param WP_User $user The WP_User object for the user that's logging out. - */ - $redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user ); - wp_safe_redirect( $redirect_to ); - exit(); - -case 'lostpassword' : -case 'retrievepassword' : - - if ( $http_post ) { - $errors = retrieve_password(); - if ( !is_wp_error($errors) ) { - $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm'; - wp_safe_redirect( $redirect_to ); - exit(); - } - } - - if ( isset( $_GET['error'] ) ) { - if ( 'invalidkey' == $_GET['error'] ) { - $errors->add( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new link below.' ) ); - } elseif ( 'expiredkey' == $_GET['error'] ) { - $errors->add( 'expiredkey', __( 'Your password reset link has expired. Please request a new link below.' ) ); - } - } - - $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; - /** - * Filters the URL redirected to after submitting the lostpassword/retrievepassword form. - * - * @since 3.0.0 - * - * @param string $lostpassword_redirect The redirect destination URL. - */ - $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect ); - - /** - * Fires before the lost password form. - * - * @since 1.5.1 - */ - do_action( 'lost_password' ); - - login_header(__('Lost Password'), '

' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '

', $errors); - - $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : ''; - -?> - -
-

- -

- - -

-
- - - -get_error_code() === 'expired_key' ) - wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) ); - else - wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) ); - exit; - } - - $errors = new WP_Error(); - - if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) - $errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) ); - - /** - * Fires before the password reset procedure is validated. - * - * @since 3.5.0 - * - * @param object $errors WP Error object. - * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise. - */ - do_action( 'validate_password_reset', $errors, $user ); - - if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) { - reset_password($user, $_POST['pass1']); - setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true ); - login_header( __( 'Password Reset' ), '

' . __( 'Your password has been reset.' ) . ' ' . __( 'Log in' ) . '

' ); - login_footer(); - exit; - } - - wp_enqueue_script('utils'); - wp_enqueue_script('user-profile'); - - login_header(__('Reset Password'), '

' . __('Enter your new password below.') . '

', $errors ); - -?> -
- - -
-

- -

- -
- - - -
-
-
- -

-
- -

- -

-
- - - -

-
- - - -' . __('Register For This Site') . '

', $errors); -?> -
-

- -

-

- -

- -

-
- -

-
- - - -ID) ) { - $secure_cookie = true; - force_ssl_admin(true); - } - } - } - - if ( isset( $_REQUEST['redirect_to'] ) ) { - $redirect_to = $_REQUEST['redirect_to']; - // Redirect to https if user wants ssl - if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') ) - $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); - } else { - $redirect_to = admin_url(); - } - - $reauth = empty($_REQUEST['reauth']) ? false : true; - - $user = wp_signon( array(), $secure_cookie ); - - if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { - if ( headers_sent() ) { - /* translators: 1: Browser cookie documentation URL, 2: Support forums URL */ - $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.' ), - __( 'https://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) ) ); - } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) { - // If cookies are disabled we can't log in even with a valid user+pass - /* translators: 1: Browser cookie documentation URL */ - $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.' ), - __( 'https://codex.wordpress.org/Cookies' ) ) ); - } - } - - $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; - /** - * Filters the login redirect URL. - * - * @since 3.0.0 - * - * @param string $redirect_to The redirect destination URL. - * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. - * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. - */ - $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user ); - - if ( !is_wp_error($user) && !$reauth ) { - if ( $interim_login ) { - $message = '

' . __('You have logged in successfully.') . '

'; - $interim_login = 'success'; - login_header( '', $message ); ?> - - - - - - -ID) && !is_super_admin( $user->ID ) ) - $redirect_to = user_admin_url(); - elseif ( is_multisite() && !$user->has_cap('read') ) - $redirect_to = get_dashboard_url( $user->ID ); - elseif ( !$user->has_cap('edit_posts') ) - $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url(); - - wp_redirect( $redirect_to ); - exit(); - } - wp_safe_redirect($redirect_to); - exit(); - } - - $errors = $user; - // Clear errors if loggedout is set. - if ( !empty($_GET['loggedout']) || $reauth ) - $errors = new WP_Error(); - - if ( $interim_login ) { - if ( ! $errors->get_error_code() ) - $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' ); - } else { - // Some parts of this script use the main login form to display a message - if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) - $errors->add('loggedout', __('You are now logged out.'), 'message'); - elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) - $errors->add('registerdisabled', __('User registration is currently not allowed.')); - elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) - $errors->add('confirm', __('Check your email for the confirmation link.'), 'message'); - elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) - $errors->add('newpass', __('Check your email for your new password.'), 'message'); - elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) - $errors->add('registered', __('Registration complete. Please check your email.'), 'message'); - elseif ( strpos( $redirect_to, 'about.php?updated' ) ) - $errors->add('updated', __( 'You have successfully updated WordPress! Please log back in to see what’s new.' ), 'message' ); - } - - /** - * Filters the login page errors. - * - * @since 3.6.0 - * - * @param object $errors WP Error object. - * @param string $redirect_to Redirect destination URL. - */ - $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to ); - - // Clear any stale cookies. - if ( $reauth ) - wp_clear_auth_cookie(); - - login_header(__('Log In'), '', $errors); - - if ( isset($_POST['log']) ) - $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : ''; - $rememberme = ! empty( $_POST['rememberme'] ); - - if ( ! empty( $errors->errors ) ) { - $aria_describedby_error = ' aria-describedby="login_error"'; - } else { - $aria_describedby_error = ''; - } -?> - -
-

- -

-

- -

- -

-

- - - - - - - - - - -

-
- - - - - - - - Writing - * - * @package WordPress - */ - -/** Make sure that the WordPress bootstrap has run before continuing. */ -require(dirname(__FILE__) . '/wp-load.php'); - -/** This filter is documented in wp-admin/options.php */ -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) - wp_die( __( 'This action has been disabled by the administrator.' ), 403 ); - -$mailserver_url = get_option( 'mailserver_url' ); - -if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) { - wp_die( __( 'This action has been disabled by the administrator.' ), 403 ); -} - -/** - * Fires to allow a plugin to do a complete takeover of Post by Email. - * - * @since 2.9.0 - */ -do_action( 'wp-mail.php' ); - -/** Get the POP3 class with which to access the mailbox. */ -require_once( ABSPATH . WPINC . '/class-pop3.php' ); - -/** Only check at this interval for new messages. */ -if ( !defined('WP_MAIL_INTERVAL') ) - define('WP_MAIL_INTERVAL', 300); // 5 minutes - -$last_checked = get_transient('mailserver_last_checked'); - -if ( $last_checked ) - wp_die(__('Slow down cowboy, no need to check for new mails so often!')); - -set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); - -$time_difference = get_option('gmt_offset') * HOUR_IN_SECONDS; - -$phone_delim = '::'; - -$pop3 = new POP3(); - -if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) - wp_die( esc_html( $pop3->ERROR ) ); - -$count = $pop3->pass( get_option('mailserver_pass') ); - -if( false === $count ) - wp_die( esc_html( $pop3->ERROR ) ); - -if( 0 === $count ) { - $pop3->quit(); - wp_die( __('There doesn’t seem to be any new mail.') ); -} - -for ( $i = 1; $i <= $count; $i++ ) { - - $message = $pop3->get($i); - - $bodysignal = false; - $boundary = ''; - $charset = ''; - $content = ''; - $content_type = ''; - $content_transfer_encoding = ''; - $post_author = 1; - $author_found = false; - foreach ($message as $line) { - // Body signal. - if ( strlen($line) < 3 ) - $bodysignal = true; - if ( $bodysignal ) { - $content .= $line; - } else { - if ( preg_match('/Content-Type: /i', $line) ) { - $content_type = trim($line); - $content_type = substr($content_type, 14, strlen($content_type) - 14); - $content_type = explode(';', $content_type); - if ( ! empty( $content_type[1] ) ) { - $charset = explode('=', $content_type[1]); - $charset = ( ! empty( $charset[1] ) ) ? trim($charset[1]) : ''; - } - $content_type = $content_type[0]; - } - if ( preg_match('/Content-Transfer-Encoding: /i', $line) ) { - $content_transfer_encoding = trim($line); - $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding) - 27); - $content_transfer_encoding = explode(';', $content_transfer_encoding); - $content_transfer_encoding = $content_transfer_encoding[0]; - } - if ( ( $content_type == 'multipart/alternative' ) && ( false !== strpos($line, 'boundary="') ) && ( '' == $boundary ) ) { - $boundary = trim($line); - $boundary = explode('"', $boundary); - $boundary = $boundary[1]; - } - if (preg_match('/Subject: /i', $line)) { - $subject = trim($line); - $subject = substr($subject, 9, strlen($subject) - 9); - // Captures any text in the subject before $phone_delim as the subject - if ( function_exists('iconv_mime_decode') ) { - $subject = iconv_mime_decode($subject, 2, get_option('blog_charset')); - } else { - $subject = wp_iso_descrambler($subject); - } - $subject = explode($phone_delim, $subject); - $subject = $subject[0]; - } - - /* - * Set the author using the email address (From or Reply-To, the last used) - * otherwise use the site admin. - */ - if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { - if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) - $author = $matches[0]; - else - $author = trim($line); - $author = sanitize_email($author); - if ( is_email($author) ) { - /* translators: Post author email address */ - echo '

' . sprintf(__('Author is %s'), $author) . '

'; - $userdata = get_user_by('email', $author); - if ( ! empty( $userdata ) ) { - $post_author = $userdata->ID; - $author_found = true; - } - } - } - - if ( preg_match( '/Date: /i', $line ) ) { // of the form '20 Mar 2002 20:32:37 +0100' - $ddate = str_replace( 'Date: ', '', trim( $line ) ); - $ddate = preg_replace( '!\s*\(.+\)\s*$!', '', $ddate ); // remove parenthesised timezone string if it exists, as this confuses strtotime - $ddate_U = strtotime( $ddate ); - $post_date = gmdate( 'Y-m-d H:i:s', $ddate_U + $time_difference ); - $post_date_gmt = gmdate( 'Y-m-d H:i:s', $ddate_U ); - } - } - } - - // Set $post_status based on $author_found and on author's publish_posts capability - if ( $author_found ) { - $user = new WP_User($post_author); - $post_status = ( $user->has_cap('publish_posts') ) ? 'publish' : 'pending'; - } else { - // Author not found in DB, set status to pending. Author already set to admin. - $post_status = 'pending'; - } - - $subject = trim($subject); - - if ( $content_type == 'multipart/alternative' ) { - $content = explode('--'.$boundary, $content); - $content = $content[2]; - - // Match case-insensitive content-transfer-encoding. - if ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim) ) { - $content = explode($delim[0], $content); - $content = $content[1]; - } - $content = strip_tags($content, '


'); - } - $content = trim($content); - - /** - * Filters the original content of the email. - * - * Give Post-By-Email extending plugins full access to the content, either - * the raw content, or the content of the last quoted-printable section. - * - * @since 2.8.0 - * - * @param string $content The original email content. - */ - $content = apply_filters( 'wp_mail_original_content', $content ); - - if ( false !== stripos($content_transfer_encoding, "quoted-printable") ) { - $content = quoted_printable_decode($content); - } - - if ( function_exists('iconv') && ! empty( $charset ) ) { - $content = iconv($charset, get_option('blog_charset'), $content); - } - - // Captures any text in the body after $phone_delim as the body - $content = explode($phone_delim, $content); - $content = empty( $content[1] ) ? $content[0] : $content[1]; - - $content = trim($content); - - /** - * Filters the content of the post submitted by email before saving. - * - * @since 1.2.0 - * - * @param string $content The email content. - */ - $post_content = apply_filters( 'phone_content', $content ); - - $post_title = xmlrpc_getposttitle($content); - - if ($post_title == '') $post_title = $subject; - - $post_category = array(get_option('default_email_category')); - - $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); - $post_data = wp_slash($post_data); - - $post_ID = wp_insert_post($post_data); - if ( is_wp_error( $post_ID ) ) - echo "\n" . $post_ID->get_error_message(); - - // We couldn't post, for whatever reason. Better move forward to the next email. - if ( empty( $post_ID ) ) - continue; - - /** - * Fires after a post submitted by email is published. - * - * @since 1.2.0 - * - * @param int $post_ID The post ID. - */ - do_action( 'publish_phone', $post_ID ); - - echo "\n

" . __( 'Author:' ) . ' ' . esc_html( $post_author ) . '

'; - echo "\n

" . __( 'Posted title:' ) . ' ' . esc_html( $post_title ) . '

'; - - if(!$pop3->delete($i)) { - echo '

' . sprintf( - /* translators: %s: POP3 error */ - __( 'Oops: %s' ), - esc_html( $pop3->ERROR ) - ) . '

'; - $pop3->reset(); - exit; - } else { - echo '

' . sprintf( - /* translators: %s: the message ID */ - __( 'Mission complete. Message %s deleted.' ), - '' . $i . '' - ) . '

'; - } - -} - -$pop3->quit(); diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index 955c1e1..77933f6 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -87,54 +87,21 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we if ($response->getStatusCode() >= 300) { echo $response->getBody()->getContents(); } - $response = $client->request('POST',$installAddress . '/wp-admin/install.php?action=install_wp', $postData); + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php/wp-admin/install.php?action=install_wp', $postData); if ($response->getStatusCode() >= 300) { echo $response->getBody()->getContents(); } - $response = $client->request('POST',$installAddress . '/wp-admin/install.php?action=install_theme', $postData); + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php/wp-admin/install.php?action=install_theme', $postData); if ($response->getStatusCode() >= 300) { echo $response->getBody()->getContents(); } - $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=install_plugins', $postData); + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php/wp-quick-install/index.php?action=install_plugins', $postData); if ($response->getStatusCode() >= 300) { echo $response->getBody()->getContents(); } - $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php?action=success', $postData); + $response = $client->request('POST',$installAddress . '/wp-quick-install/index.php/wp-quick-install/index.php?action=success', $postData); if ($response->getStatusCode() >= 300) { echo $response->getBody()->getContents(); } } } - -/* -dbname:wordpress -uname:root -pwd: -dbhost:localhost -prefix:wp_ -default_content:1 -language:en_US -directory: -weblog_title:my wordpress -user_login:admin -admin_password:admin -admin_email:admin@admin.cz -blog_public:1 -activate_theme:1 -plugins:tiled-gallery-carousel-without-jetpack;wordfence;wp-super-cache;google-calendar-events;easy-facebook-feed -activate_plugins:1 -permalink_structure:/%postname%/ -thumbnail_size_w:0 -thumbnail_size_h:0 -thumbnail_crop:1 -medium_size_w:0 -medium_size_h:0 -large_size_w:0 -large_size_h:0 -upload_dir: -uploads_use_yearmonth_folders:1 -post_revisions:0 -disallow_file_edit:1 -autosave_interval:7200 -wpcom_api_key: -*/ \ No newline at end of file diff --git a/wp-settings.php b/wp-settings.php deleted file mode 100644 index d1505c5..0000000 --- a/wp-settings.php +++ /dev/null @@ -1,469 +0,0 @@ -init(); - -// Load the functions for the active theme, for both parent and child theme if applicable. -if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) { - if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) - include( STYLESHEETPATH . '/functions.php' ); - if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) - include( TEMPLATEPATH . '/functions.php' ); -} - -/** - * Fires after the theme is loaded. - * - * @since 3.0.0 - */ -do_action( 'after_setup_theme' ); - -// Set up current user. -$GLOBALS['wp']->init(); - -/** - * Fires after WordPress has finished loading but before any headers are sent. - * - * Most of WP is loaded at this stage, and the user is authenticated. WP continues - * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate - * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). - * - * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below. - * - * @since 1.5.0 - */ -do_action( 'init' ); - -// Check site status -if ( is_multisite() ) { - if ( true !== ( $file = ms_site_check() ) ) { - require( $file ); - die(); - } - unset($file); -} - -/** - * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. - * - * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for - * users not logged in. - * - * @link https://codex.wordpress.org/AJAX_in_Plugins - * - * @since 3.0.0 - */ -do_action( 'wp_loaded' ); diff --git a/wp-signup.php b/wp-signup.php deleted file mode 100644 index 156de61..0000000 --- a/wp-signup.php +++ /dev/null @@ -1,919 +0,0 @@ -is_404 = false; - -/** - * Fires before the Site Signup page is loaded. - * - * @since 4.4.0 - */ -do_action( 'before_signup_header' ); - -/** - * Prints styles for front-end Multisite signup pages - * - * @since MU - */ -function wpmu_signup_stylesheet() { - ?> - - -
-'; -} - -$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; - -$current_user = wp_get_current_user(); -if ( $active_signup == 'none' ) { - _e( 'Registration has been disabled.' ); -} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { - $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); - /* translators: %s: login URL */ - printf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); -} else { - $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; - switch ( $stage ) { - case 'validate-user-signup' : - if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) - validate_user_signup(); - else - _e( 'User registration has been disabled.' ); - break; - case 'validate-blog-signup': - if ( $active_signup == 'all' || $active_signup == 'blog' ) - validate_blog_signup(); - else - _e( 'Site registration has been disabled.' ); - break; - case 'gimmeanotherblog': - validate_another_blog_signup(); - break; - case 'default': - default : - $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; - /** - * Fires when the site sign-up form is sent. - * - * @since 3.0.0 - */ - do_action( 'preprocess_signup_form' ); - if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) - signup_another_blog($newblogname); - elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) - signup_user( $newblogname, $user_email ); - elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) - _e( 'Sorry, new registrations are not allowed at this time.' ); - else - _e( 'You are logged in already. No need to register again!' ); - - if ( $newblogname ) { - $newblog = get_blogaddress_by_name( $newblogname ); - - if ( $active_signup == 'blog' || $active_signup == 'all' ) - /* translators: %s: site address */ - printf( '

' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '

', - '' . $newblog . '' - ); - else - /* translators: %s: site address */ - printf( '

' . __( 'The site you were looking for, %s, does not exist.' ) . '

', - '' . $newblog . '' - ); - } - break; - } -} -?> -
-
- - - '1' ) ); -} - -/** - * Response to a trackback. - * - * Responds with an error or success XML message. - * - * @since 0.71 - * - * @param mixed $error Whether there was an error. - * Default '0'. Accepts '0' or '1', true or false. - * @param string $error_message Error message if an error occurred. - */ -function trackback_response($error = 0, $error_message = '') { - header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); - if ($error) { - echo '\n"; - echo "\n"; - echo "1\n"; - echo "$error_message\n"; - echo ""; - die(); - } else { - echo '\n"; - echo "\n"; - echo "0\n"; - echo ""; - } -} - -// Trackback is done by a POST. -$request_array = 'HTTP_POST_VARS'; - -if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) { - $tb_id = explode('/', $_SERVER['REQUEST_URI']); - $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); -} - -$tb_url = isset($_POST['url']) ? $_POST['url'] : ''; -$charset = isset($_POST['charset']) ? $_POST['charset'] : ''; - -// These three are stripslashed here so they can be properly escaped after mb_convert_encoding(). -$title = isset($_POST['title']) ? wp_unslash($_POST['title']) : ''; -$excerpt = isset($_POST['excerpt']) ? wp_unslash($_POST['excerpt']) : ''; -$blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name']) : ''; - -if ($charset) - $charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) ); -else - $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; - -// No valid uses for UTF-7. -if ( false !== strpos($charset, 'UTF-7') ) - die; - -// For international trackbacks. -if ( function_exists('mb_convert_encoding') ) { - $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); - $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); - $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); -} - -// Now that mb_convert_encoding() has been given a swing, we need to escape these three. -$title = wp_slash($title); -$excerpt = wp_slash($excerpt); -$blog_name = wp_slash($blog_name); - -if ( is_single() || is_page() ) - $tb_id = $posts[0]->ID; - -if ( !isset($tb_id) || !intval( $tb_id ) ) - trackback_response( 1, __( 'I really need an ID for this to work.' ) ); - -if (empty($title) && empty($tb_url) && empty($blog_name)) { - // If it doesn't look like a trackback at all. - wp_redirect(get_permalink($tb_id)); - exit; -} - -if ( !empty($tb_url) && !empty($title) ) { - /** - * Fires before the trackback is added to a post. - * - * @since 4.7.0 - * - * @param int $tb_id Post ID related to the trackback. - * @param string $tb_url Trackback URL. - * @param string $charset Character Set. - * @param string $title Trackback Title. - * @param string $excerpt Trackback Excerpt. - * @param string $blog_name Blog Name. - */ - do_action( 'pre_trackback_post', $tb_id, $tb_url, $charset, $title, $excerpt, $blog_name ); - - header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); - - if ( !pings_open($tb_id) ) - trackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) ); - - $title = wp_html_excerpt( $title, 250, '…' ); - $excerpt = wp_html_excerpt( $excerpt, 252, '…' ); - - $comment_post_ID = (int) $tb_id; - $comment_author = $blog_name; - $comment_author_email = ''; - $comment_author_url = $tb_url; - $comment_content = "$title\n\n$excerpt"; - $comment_type = 'trackback'; - - $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); - if ( $dupe ) - trackback_response( 1, __( 'We already have a ping from that URL for this post.' ) ); - - $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); - - wp_new_comment($commentdata); - $trackback_id = $wpdb->insert_id; - - /** - * Fires after a trackback is added to a post. - * - * @since 1.2.0 - * - * @param int $trackback_id Trackback ID. - */ - do_action( 'trackback_post', $trackback_id ); - trackback_response( 0 ); -} diff --git a/xmlrpc.php b/xmlrpc.php deleted file mode 100644 index 12da79b..0000000 --- a/xmlrpc.php +++ /dev/null @@ -1,101 +0,0 @@ - -'; ?> - - - WordPress - https://wordpress.org/ - - - - - - - - - - -serve_request(); - -exit; - -/** - * logIO() - Writes logging info to a file. - * - * @deprecated 3.4.0 Use error_log() - * @see error_log() - * - * @param string $io Whether input or output - * @param string $msg Information describing logging reason. - */ -function logIO( $io, $msg ) { - _deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' ); - if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) - error_log( $io . ' - ' . $msg ); -} \ No newline at end of file From 40deef2d85275cccbe6836728bd6e92a85165702 Mon Sep 17 00:00:00 2001 From: Lung Date: Sun, 25 Jun 2017 11:38:48 +0200 Subject: [PATCH 16/25] actualized README for finals --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c642e99..0fac0de 100755 --- a/README.md +++ b/README.md @@ -9,16 +9,17 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: * Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (fork) * **Nastavení** je v souboru `data.ini` (včetně instalovaných pluginů a všeho dalšího) * Zrušili jsme GUI a JS z původního skriptu a všechno nasypali do `WordpressService.php` +* **Requirement** je v composer.json, stačí spustit `composer update` * Chtěné **DSW téma** se získá pomocí automatického stánutí z DWS githubu. Alternativně je možnost umístit soubor vedle skriptu a pojmenovat ho `theme.zip` * Potřebné parametry pro instalaci jsou jako paramtery metody, return zatím nemáme žádný (vzhledem k tomu, že se skript bude provádět jindy (cronem) než ho uživatel zadává) -* Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword +* Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword, $adminEmail * Pozor, skript běží dlouho (přeci jen stahuje, dekomprimuje a instaluje zaráz), takže je potřeba hlídat timeout chyb (na průměrném NB to běželo skoro minutu) ## TODO shortterm #### stahovat češtinu napřímo -https://cs.wordpress.org/ - Kalich zkusí zprovoznit něco jako odkaz cs.wordpress.org/latest.zip (zatím není) +https://cs.wordpress.org/ - Kalich zkusí zprovoznit něco jako odkaz cs.wordpress.org/latest.zip (zatím není) a potom můžeme pokračovat #### automaticky přidat obrázky z theme @@ -35,10 +36,6 @@ spočívá v poslání issue do DSW, aby byly obrázky includované dynamicky (t na vyžádání includenout plugin pro bazar (https://wordpress.org/plugins/skaut-bazar/) -#### Return užitečné info - -Vracet bychom mohli např. heslo pro admina nebo nějaký success message, to bude věcí další domluvy - #### Umožnit instalaci i přes existující web @kalich5 - nevhodné dělat automaticky, protože se tím naseká moc problémů - lepší kontrolovat, zda je složka prázdná a pokud ne, rovnou to nepovolit (jak to dělá např. `git clone` nebo velcí hostingové) From 08953953cc4eacd110bae3c4d78b29cc9fa82edb Mon Sep 17 00:00:00 2001 From: Lung Date: Sun, 25 Jun 2017 11:38:48 +0200 Subject: [PATCH 17/25] actualized README for finals --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fac0de..876aaf0 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Instalace skautského Wordpressu v Lebedě na jeden klik +# Instalace skautské Wordpress šablony DSW v Lebedě na jeden klik -## Status: rozděláno, ještě nepoužívat! +## Status: v1.0 ## Manuál na instalaci From 3cf3920015582859fb87b6fdbe593076d2c180e3 Mon Sep 17 00:00:00 2001 From: Michal Janata Date: Wed, 28 Jun 2017 16:11:19 +0200 Subject: [PATCH 18/25] =?UTF-8?q?Stahov=C3=A1n=C3=AD=20posledn=C3=AD=20?= =?UTF-8?q?=C4=8Desk=C3=A9=20verze=20WP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 876aaf0..bd3bcbc 100755 --- a/README.md +++ b/README.md @@ -15,11 +15,10 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: * Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword, $adminEmail * Pozor, skript běží dlouho (přeci jen stahuje, dekomprimuje a instaluje zaráz), takže je potřeba hlídat timeout chyb (na průměrném NB to běželo skoro minutu) -## TODO shortterm - -#### stahovat češtinu napřímo +#### stahování češtiny napřímo +https://cs.wordpress.org/latest-cs_CZ.zip -https://cs.wordpress.org/ - Kalich zkusí zprovoznit něco jako odkaz cs.wordpress.org/latest.zip (zatím není) a potom můžeme pokračovat +## TODO shortterm #### automaticky přidat obrázky z theme @@ -45,4 +44,4 @@ Inspired by literat v issue: * na začátku se automatika pouze zeptá na login a heslo pro administrátorský účet * musí proběhnout kontrola FTP a databáze, tj. pokud je zde nějaký obsah, bude smazán a uživatel na to musí být upozorněn a potvrdit to * veškerý obsah před instalací bude z FTP i DB smazán -* jako základní šablona společně s Wordpressem bude instalována DSW Oddíl \ No newline at end of file +* jako základní šablona společně s Wordpressem bude instalována DSW Oddíl From d470814f23511b048eeb7890ed6fb0b21a369160 Mon Sep 17 00:00:00 2001 From: Michal Janata Date: Thu, 29 Jun 2017 08:52:45 +0200 Subject: [PATCH 19/25] =?UTF-8?q?Zm=C4=9Bna=20prefixu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-quick-install/data.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index 7fa25bc..8640500 100755 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -25,7 +25,7 @@ ;db['dbname'] = demo ;db['dbhost'] = localhost -db['prefix'] = wp_ +db['prefix'] = skautwp_ ;db['uname'] = root ;db['pwd'] = root db['default_content'] = 1 From 9aae36994fea34edba0705f8695a46c18ba0335a Mon Sep 17 00:00:00 2001 From: Michal Janata Date: Fri, 30 Jun 2017 09:31:56 +0200 Subject: [PATCH 20/25] =?UTF-8?q?Dopln=C4=9Bn=C3=AD=20plugin=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-quick-install/data.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-quick-install/data.ini b/wp-quick-install/data.ini index 8640500..1674c7e 100755 --- a/wp-quick-install/data.ini +++ b/wp-quick-install/data.ini @@ -76,6 +76,8 @@ plugins[] = wordfence plugins[] = wp-super-cache plugins[] = google-calendar-events plugins[] = easy-facebook-feed +plugins[] = skautis-integration +plugins[] = mainwp-child ;;;; ; Install extensions which are on the "wp-quick-install" "plugins" folder (uncomment to use): From 760e1be460272716070ea15b52b30cc42e045aca Mon Sep 17 00:00:00 2001 From: racinmat Date: Tue, 11 Jul 2017 18:47:02 +0200 Subject: [PATCH 21/25] Db prefix is random. --- wp-quick-install/WordpressService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index 77933f6..5cbc51a 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -29,7 +29,7 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we $data['uname'] = $dbUserName; $data['pwd'] = $dbPassword; $data['dbhost'] = $dbHost; - $data['prefix'] = $data['db']['prefix']; + $data['prefix'] = $data['db']['prefix'] . $this->randomString(6) . '_'; $data['default_content'] = $data['db']['default_content']; $data['language'] = 'en_US'; $data['directory'] = ''; From 8f869023d3b489afb68c3fc957e2f5305c7d8984 Mon Sep 17 00:00:00 2001 From: racinmat Date: Wed, 12 Jul 2017 13:05:02 +0200 Subject: [PATCH 22/25] Db prefix is random. --- wp-quick-install/WordpressService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index 5cbc51a..9312f47 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -29,7 +29,7 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we $data['uname'] = $dbUserName; $data['pwd'] = $dbPassword; $data['dbhost'] = $dbHost; - $data['prefix'] = $data['db']['prefix'] . $this->randomString(6) . '_'; + $data['prefix'] = $this->randomString(6) . '_'; $data['default_content'] = $data['db']['default_content']; $data['language'] = 'en_US'; $data['directory'] = ''; From 1756017e2b59cfcea87d51e287bce32e1d4f5a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20H=C3=A1na?= Date: Sat, 9 Sep 2017 09:35:41 +0200 Subject: [PATCH 23/25] use composer install insted of update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd3bcbc..6e567fe 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Jak zpřístupnit na Lebedě autoinstalaci Wordpressu: * Jako základ používáme https://github.com/GeekPress/WP-Quick-Install (fork) * **Nastavení** je v souboru `data.ini` (včetně instalovaných pluginů a všeho dalšího) * Zrušili jsme GUI a JS z původního skriptu a všechno nasypali do `WordpressService.php` -* **Requirement** je v composer.json, stačí spustit `composer update` +* **Requirement** je v composer.json, stačí spustit `composer install` * Chtěné **DSW téma** se získá pomocí automatického stánutí z DWS githubu. Alternativně je možnost umístit soubor vedle skriptu a pojmenovat ho `theme.zip` * Potřebné parametry pro instalaci jsou jako paramtery metody, return zatím nemáme žádný (vzhledem k tomu, že se skript bude provádět jindy (cronem) než ho uživatel zadává) * Potřebné **parametry** pro service: $dbName, $dbUserName, $dbPassword, $dbHost, $websiteTitle, $userLogin, $adminPassword, $adminEmail From a38fdb997fab53d0c9373fc7738b77999193a40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frantis=CC=8Cek=20Ha=CC=81na?= Date: Sat, 9 Sep 2017 09:55:03 +0200 Subject: [PATCH 24/25] udpate composer.json --- composer.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c512c49..69d2387 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,12 @@ { + "name": "skaut/wp-instalator-lebeda", + "type": "library", + "description": "Word press instalation package", + "keywords": ["skaut"], + "homepage": "https://github.com/skaut/WordPress-Lebeda-instalator", "require": { + "php": ">=7.0", "guzzlehttp/guzzle": "^6.2" - } + }, + "minimum-stability": "stable" } From f7834a1c97b3f86d4417b9eae519394dd17de5da Mon Sep 17 00:00:00 2001 From: racinmat Date: Fri, 15 Sep 2017 00:44:25 +0200 Subject: [PATCH 25/25] Fixed admin credentials. --- wp-quick-install/WordpressService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-quick-install/WordpressService.php b/wp-quick-install/WordpressService.php index 9312f47..1dd314d 100644 --- a/wp-quick-install/WordpressService.php +++ b/wp-quick-install/WordpressService.php @@ -35,8 +35,8 @@ public function installWordpress($dbName, $dbUserName, $dbPassword, $dbHost, $we $data['directory'] = ''; $data['admin']['user_login'] = $userLogin; $data['user_login'] = $data['admin']['user_login']; - $data['admin']['password'] = 'demo'; - $data['admin']['email'] = 'demo@example.com'; + $data['admin']['password'] = $adminPassword; + $data['admin']['email'] = $adminEmail; $data['weblog_title'] = $websiteTitle; $data['admin_password'] = $adminPassword; $data['admin_email'] = $adminEmail;