Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Náhodné generování prefixů - ideální #47

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
27dd8e6
DSW theme install
peci1 May 25, 2017
50bd2c4
Removed inc/functions.php
May 25, 2017
5555a24
Merge remote-tracking branch 'origin/master'
May 25, 2017
e935db8
DSW theme install fix
peci1 May 25, 2017
aacfb56
Merge remote-tracking branch 'origin/master'
peci1 May 25, 2017
b43e748
added first draft of readme
May 25, 2017
5c2eb69
fixed loading of DWS theme
May 25, 2017
b6cb2f2
Somehow working. Still not conecting to database.
May 25, 2017
6b5058d
Merge remote-tracking branch 'origin/master'
May 25, 2017
a608f38
added todo shortterm task
May 25, 2017
f513210
Merge remote-tracking branch 'origin/master'
May 25, 2017
611c839
added .gitignore
May 25, 2017
8659eb6
added .gitignore
May 25, 2017
4fb71ab
Merge remote-tracking branch 'origin/master'
May 25, 2017
ac63955
added meet with @kalich5
Jun 15, 2017
6c8fcf4
Nové pluginy
kalich5 Jun 19, 2017
800788c
Image widget
kalich5 Jun 19, 2017
074402a
Added files generated before wp installation.
Jun 24, 2017
4c668f6
Added composer.json and .htaccess.
Jun 24, 2017
333903b
Removed some wordpress files.
Jun 24, 2017
40deef2
actualized README for finals
Jun 25, 2017
0895395
actualized README for finals
Jun 25, 2017
3cf3920
Stahování poslední české verze WP
kalich5 Jun 28, 2017
d470814
Změna prefixu
kalich5 Jun 29, 2017
9aae369
Doplnění pluginů
kalich5 Jun 30, 2017
760e1be
Db prefix is random.
Jul 11, 2017
77360bb
Merge branch 'master' of https://github.com/SkautDevs/WP-Quick-Install
Jul 11, 2017
8f86902
Db prefix is random.
Jul 12, 2017
1756017
use composer install insted of update
sinacek Sep 9, 2017
a38fdb9
udpate composer.json
sinacek Sep 9, 2017
f7834a1
Fixed admin credentials.
Sep 14, 2017
17ea7e3
Merge remote-tracking branch 'origin/master'
Sep 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
12 changes: 12 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>

# END WordPress
143 changes: 29 additions & 114 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,132 +1,47 @@
WP Quick Install 1.4.2
================
# Instalace skautské Wordpress šablony DSW v Lebedě na jeden klik

WP Quick Install is the easiest way to install WordPress.
## Status: v1.0

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 (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 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
* 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
#### stahování češtiny napřímo
https://cs.wordpress.org/latest-cs_CZ.zip

1.4.1
-----------
* Fix quote issue with WordPress.com API Key
## TODO shortterm

1.4
-----------
* Fix database issue since WordPress 4.1
* You can add your WordPress.com API Key
#### automaticky přidat obrázky z theme

1.3.3
-----------
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

* Add SSL compatibility
* Remove SSL function (cause trouble with process installation)
#### automaticky přidat menu z theme

1.3.2
-----------
řešíme s Kalichem

* 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
#### Volitelný plugin pro bazar

1.3
-----------
na vyžádání includenout plugin pro bazar (https://wordpress.org/plugins/skaut-bazar/)

* Possiblity to select WordPress language installation
* Permaling management
#### 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é)

1.2.8.1
-----------
Inspired by literat v issue:

* 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

1.2.8
-----------

* Media management

1.2.7.2
-----------

* Security : Forbiden access to data.ini from the browser

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
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +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"
}
Empty file modified wp-quick-install/.htaccess
100644 → 100755
Empty file.
107 changes: 107 additions & 0 deletions wp-quick-install/WordpressService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

require_once '../vendor/autoload.php';

/**
* Created by PhpStorm.
* User: Azathoth
* Date: 2017-05-25
* Time: 18:58
*/
class WordpressService
{


private function randomString($length = 10) {
$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
$string = '';
$max = strlen($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$string .= $characters[mt_rand(0, $max)];
}
return $string;
}

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['prefix'] = $this->randomString(6) . '_';
$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'] = $adminPassword;
$data['admin']['email'] = $adminEmail;
$data['weblog_title'] = $websiteTitle;
$data['admin_password'] = $adminPassword;
$data['admin_email'] = $adminEmail;
$data['blog_public'] = 1;
$data['activate_theme'] = 1;
$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;
$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';

$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->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-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-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/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/wp-quick-install/index.php?action=success', $postData);
if ($response->getStatusCode() >= 300) {
echo $response->getBody()->getContents();
}
}
}
Empty file modified wp-quick-install/assets/css/buttons.min.css
100644 → 100755
Empty file.
Empty file modified wp-quick-install/assets/css/style.min.css
100644 → 100755
Empty file.
Empty file modified wp-quick-install/assets/images/wordpress-logo.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified wp-quick-install/assets/js/jquery-1.8.3.min.js
100644 → 100755
Empty file.
Loading