Add BitBucket version

This commit is contained in:
Tim Brugman 2021-05-11 00:31:41 +02:00
parent dd61880da7
commit 2761cadec9
32 changed files with 38294 additions and 0 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
node_modules/*
public_html/assets/*
!public_html/assets/vendor/

*.sublime-*

View file

@ -0,0 +1,9 @@
<script src="/assets/vendor/vue-2.6.12.js"></script>
<script src="/assets/app.min.js"></script>

<?php if ( in_array( substr( $_SERVER['SERVER_ADDR'], 0, 3 ), array( '127', '192', '172', '10.' ) ) ): ?>
<script src="http://<?=$_SERVER['HTTP_HOST'];?>:35729/livereload.js"></script>
<?php endif; // Livereload ?>

</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>

<!-- meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex, nofollow">

<!-- title -->
<title>WP-CLI GUI</title>

<!-- link css -->
<link rel="stylesheet" href="/assets/app.min.css">

</head>
<body>

View file

@ -0,0 +1,180 @@
<?php

function d( $var )
{
echo "<pre style=\"max-height: 800px; z-index: 9999; position: relative; overflow-y: scroll; white-space: pre-wrap; word-wrap: break-word; padding: 10px 15px; border: 1px solid #fff; background-color: #161616; text-align: left; line-height: 1.5; font-family: Courier; font-size: 16px; color: #fff; \">";
print_r( $var );
echo "</pre>";
}

function download_languages_list()
{
return [
'' => 'English (United States)',
'en_GB' => 'English (UK)',
'en_CA' => 'English (Canada)',
'en_AU' => 'English (Australia)',
'en_NZ' => 'English (New Zealand)',
'en_ZA' => 'English (South Africa)',
'af' => 'Afrikaans',
'ar' => 'العربية',
'ary' => 'العربية المغربية',
'as' => 'অসমীয়া',
'azb' => 'گؤنئی آذربایجان',
'az' => 'Azərbaycan dili',
'bel' => 'Беларуская мова',
'bg_BG' => 'Български',
'bn_BD' => 'বাংলা',
'bo' => 'བོད་ཡིག',
'bs_BA' => 'Bosanski',
'ca' => 'Català',
'ceb' => 'Cebuano',
'cs_CZ' => 'Čeština',
'cy' => 'Cymraeg',
'da_DK' => 'Dansk',
'de_DE' => 'Deutsch',
'de_CH' => 'Deutsch (Schweiz)',
'de_AT' => 'Deutsch (Österreich)',
'de_CH_informal' => 'Deutsch (Schweiz, Du)',
'de_DE_formal' => 'Deutsch (Sie)',
'dzo' => 'རྫོང་ཁ',
'el' => 'Ελληνικά',
'eo' => 'Esperanto',
'es_ES' => 'Español',
'es_CO' => 'Español de Colombia',
'es_AR' => 'Español de Argentina',
'es_CL' => 'Español de Chile',
'es_PE' => 'Español de Perú',
'es_UY' => 'Español de Uruguay',
'es_CR' => 'Español de Costa Rica',
'es_GT' => 'Español de Guatemala',
'es_VE' => 'Español de Venezuela',
'es_MX' => 'Español de México',
'et' => 'Eesti',
'eu' => 'Euskara',
'fa_IR' => 'فارسی',
'fi' => 'Suomi',
'fr_FR' => 'Français',
'fr_BE' => 'Français de Belgique',
'fr_CA' => 'Français du Canada',
'fur' => 'Friulian',
'gd' => 'Gàidhlig',
'gl_ES' => 'Galego',
'gu' => 'ગુજરાતી',
'haz' => 'هزاره گی',
'he_IL' => 'עִבְרִית',
'hi_IN' => 'हिन्दी',
'hr' => 'Hrvatski',
'hsb' => 'Hornjoserbšćina',
'hu_HU' => 'Magyar',
'hy' => 'Հայերեն',
'id_ID' => 'Bahasa Indonesia',
'is_IS' => 'Íslenska',
'it_IT' => 'Italiano',
'ja' => '日本語',
'jv_ID' => 'Basa Jawa',
'ka_GE' => 'ქართული',
'kab' => 'Taqbaylit',
'kk' => 'Қазақ тілі',
'km' => 'ភាសាខ្មែរ',
'kn' => 'ಕನ್ನಡ',
'ko_KR' => '한국어',
'ckb' => 'كوردی‎',
'lo' => 'ພາສາລາວ',
'lt_LT' => 'Lietuvių kalba',
'lv' => 'Latviešu valoda',
'mk_MK' => 'Македонски јазик',
'ml_IN' => 'മലയാളം',
'mn' => 'Монгол',
'mr' => 'मराठी',
'ms_MY' => 'Bahasa Melayu',
'my_MM' => 'ဗမာစာ',
'nb_NO' => 'Norsk bokmål',
'ne_NP' => 'नेपाली',
'nl_NL' => 'Nederlands',
'nl_NL_formal' => 'Nederlands (Formeel)',
'nl_BE' => 'Nederlands (België)',
'nn_NO' => 'Norsk nynorsk',
'oci' => 'Occitan',
'pa_IN' => 'ਪੰਜਾਬੀ',
'pl_PL' => 'Polski',
'ps' => 'پښتو',
'pt_PT' => 'Português',
'pt_PT_ao90' => 'Português (AO90)',
'pt_BR' => 'Português do Brasil',
'pt_AO' => 'Português de Angola',
'rhg' => 'Ruáinga',
'ro_RO' => 'Română',
'ru_RU' => 'Русский',
'sah' => 'Сахалыы',
'snd' => 'سنڌي',
'si_LK' => 'සිංහල',
'sk_SK' => 'Slovenčina',
'skr' => 'سرائیکی',
'sl_SI' => 'Slovenščina',
'sq' => 'Shqip',
'sr_RS' => 'Српски језик',
'sv_SE' => 'Svenska',
'sw' => 'Kiswahili',
'szl' => 'Ślōnskŏ gŏdka',
'ta_IN' => 'தமிழ்',
'te' => 'తెలుగు',
'th' => 'ไทย',
'tl' => 'Tagalog',
'tr_TR' => 'Türkçe',
'tt_RU' => 'Татар теле',
'tah' => 'Reo Tahiti',
'ug_CN' => 'ئۇيغۇرچە',
'uk' => 'Українська',
'ur' => 'اردو',
'uz_UZ' => 'Ozbekcha',
'vi' => 'Tiếng Việt',
'zh_TW' => '繁體中文',
'zh_CN' => '简体中文',
'zh_HK' => '香港中文版 ',
];
}

function default_plugins_list()
{
return [
'akismet' => 'Akismet',
'hello' => 'Hello Dolly',
];
}

function default_posts_list()
{
return [
1 => 'Post: Hello World',
2 => 'Page: Sample Page',
3 => 'Page: Privacy Policy',
];
}

function weekdays_list()
{
return [
0 => 'Sunday',
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
];
}

function permalink_structure_list()
{
return [
'Default' => 'default',
'Plain' => '',
'Day and name' => '/%year%/%monthnum%/%day%/%postname%/',
'Month and name' => '/%year%/%monthnum%/%postname%/',
'Numeric' => '/archives/%post_id%',
'Post name' => '/%postname%/',
'Blog / Post name' => '/blog/%postname%/',
];
}

37
app/components/main.php Normal file
View file

@ -0,0 +1,37 @@
<?php

$tabs = [
'install' => 'Installation',
'config' => 'Configuration',
'content' => 'Content',
'plugins' => 'Plugins',
'presets' => 'Presets',
'allcode' => 'All Code',
];

?>

<div id="app">

<nav class="tabs-nav">
<div class="container">
<ul>
<?php foreach ( $tabs as $key => $name ): ?>
<li data-tab="<?=$key;?>" @click="set_active_tab" :class="{ 'active': is_tab_active('<?=$key;?>') }"><?=$name;?></li>
<?php endforeach; // $tabs ?>
</ul>
</div><!-- container -->
</nav><!-- tabs-nav -->

<div class="tabs">
<div class="container">
<?php foreach ( $tabs as $key => $name ): ?>
<div class="tab" data-tab="<?=$key;?>" :class="{ 'active': is_tab_active('<?=$key;?>') }">
<?php include 'tab-'.$key.'.php'; ?>
</div><!-- tab -->
<?php endforeach; // $tabs ?>
</div><!-- container -->
</div><!-- tabs -->

</div><!-- #app -->

View file

@ -0,0 +1,6 @@
<h1>All Code</h1>

<div class="form-element">
<pre v-text="all_code"></pre>
</div>

View file

@ -0,0 +1,72 @@
<h1>Site configuration</h1>

<h2>Settings</h2>

<div class="cc">
<div class="control">

<div class="form-element">
<label>
<input type="checkbox" v-model="blank_tagline">
Blank Tagline
</label>
</div>

<p>(( Timezone ))</p>
<p>(( Date Format ))</p>
<p>(( Time Format ))</p>

<div class="form-element">
<label>Week Starts On</label>
<select v-model="start_of_week">
<?php foreach ( weekdays_list() as $key => $value ): ?>
<option value="<?=$key;?>"><?=$value;?></option>
<?php endforeach; ?>
</select>
</div>

<div class="form-element">
<label>
<input type="checkbox" v-model="search_engine_visibility">
Discourage search engines
</label>
</div>

<div class="form-element">
<label>
<input type="checkbox" v-model="allow_comments_new_posts">
Allow comments on new posts
</label>
</div>

<div class="form-element">
<label>
<input type="checkbox" v-model="show_avatars">
Show Avatars
</label>
</div>

<div class="form-element">
<label>
<input type="checkbox" v-model="uploads_in_folders">
Uploads in year/month folders
</label>
</div>

<div class="form-element">
<label>Permalink Structure</label>
<select v-model="permalink_structure">
<?php foreach ( permalink_structure_list() as $label => $structure ): ?>
<option value="<?=$structure;?>"><?=$label;?></option>
<?php endforeach; ?>
</select>
</div>

</div><!-- control -->
<div class="code">

<pre v-show="code_t2_settings" v-text="code_t2_settings"></pre>

</div><!-- code -->
</div><!-- cc -->

View file

@ -0,0 +1,38 @@
<h1>Content</h1>

<div class="cc">
<div class="control">

<div class="form-element">
<label>
<input type="checkbox" v-model="remove_example_comment">
Remove example comment
</label>
</div>

<div class="form-element">
<p>Remove default posts</p>
<?php foreach ( default_posts_list() as $post_id => $post_name ): ?>
<label>
<input type="checkbox" v-model="remove_default_posts" value="<?=$post_id;?>">
<?=$post_name;?>
</label>
<?php endforeach; ?>
</div>

<div class="form-element">
<p>Create pages</p>
<ul>
<li v-for="( page, index ) in create_pages">{{ page }}<span class="remove" @click="create_pages_remove( index )">x</span></li>
</ul>
<input v-model="create_pages_new" @keyup.enter="create_pages_add">
</div>

</div><!-- control -->
<div class="code">

<pre v-show="code_t3_content" v-text="code_t3_content"></pre>

</div><!-- code -->
</div><!-- cc -->

View file

@ -0,0 +1,125 @@
<h1>Site creation</h1>

<h2>Download WordPress</h2>

<div class="cc">
<div class="control">

<div class="form-element">
<label>Locale</label>
<select v-model="download_language">
<?php foreach ( download_languages_list() as $code => $label ): ?>
<option value="<?=$code;?>"><?=$label;?></option>
<?php endforeach; ?>
</select>
</div>

</div><!-- control -->
<div class="code">

<pre v-text="code_t1_download"></pre>

</div><!-- code -->
</div><!-- cc -->

<h2>Configure wp-config</h2>

<div class="cc">
<div class="control">

<div class="form-element">
<label>Database host</label>
<input v-model="database_host">
</div>

<div class="form-element">
<label>Database name</label>
<input v-model="database_name">
</div>

<div class="form-element">
<label>Database prefix</label>
<input v-model="database_prefix">
</div>

<div class="form-element">
<label>Database user</label>
<input v-model="database_user">
</div>

<div class="form-element">
<label>Database pass</label>
<input v-model="database_pass">
</div>

</div><!-- control -->
<div class="code">

<pre v-text="code_t1_config"></pre>

</div><!-- code -->
</div><!-- cc -->

<h2>Database creation</h2>

<div class="cc">
<div class="control">

<div class="form-element">
<label>
<input type="checkbox" v-model="create_database">
Create database
</label>
</div>

</div><!-- control -->
<div class="code">

<pre v-show="code_t1_database" v-text="code_t1_database"></pre>

</div><!-- code -->
</div><!-- cc -->

<h2>Install WordPress</h2>

<div class="cc">
<div class="control">

<h3>Site</h3>

<div class="form-element">
<label>Name</label>
<input v-model="site_name">
</div>

<div class="form-element">
<label>URL</label>
<input v-model="site_url">
</div>

<h3>Account</h3>

<div class="form-element">
<label>Username</label>
<input v-model="account_username">
</div>

<div class="form-element">
<label>Password</label>
<input v-model="account_password">
<p @click="password_generate">regenerate</p>
</div>

<div class="form-element">
<label>Email address</label>
<input v-model="account_email">
</div>

</div><!-- control -->
<div class="code">

<pre v-text="code_t1_install"></pre>

</div><!-- code -->
</div><!-- cc -->

View file

@ -0,0 +1,31 @@
<h1>Plugins</h1>

<div class="cc">
<div class="control">

<div class="form-element">
<p>Remove default plugins</p>
<?php foreach ( default_plugins_list() as $plugin_slug => $plugin_name ): ?>
<label>
<input type="checkbox" v-model="remove_default_plugins" value="<?=$plugin_slug;?>">
<?=$plugin_name;?>
</label>
<?php endforeach; ?>
</div>

<div class="form-element">
<p>Install plugins</p>
<ul>
<li v-for="( plugin, index ) in install_plugins">{{ plugin }}<span class="remove" @click="install_plugins_remove( index )">x</span></li>
</ul>
<input v-model="install_plugins_new" @keyup.enter="install_plugins_add">
</div>

</div><!-- control -->
<div class="code">

<pre v-show="code_t4_plugins" v-text="code_t4_plugins"></pre>

</div><!-- code -->
</div><!-- cc -->

View file

@ -0,0 +1,7 @@
<h1>Presets</h1>

<p><a href="#" @click="save_default">save as default</a></p>
<p><a href="#" @click="clear_default">clear default</a></p>

<br><br>
<p><a href="/">reload</a></p>

7
app/index.php Normal file
View file

@ -0,0 +1,7 @@
<?php

include 'components/functions.php';
include 'components/core-head.php';
include 'components/main.php';
include 'components/core-foot.php';

207
gulpfile.js Normal file
View file

@ -0,0 +1,207 @@
/**
* Gulp 4 gulpfile template.
*
* Template last updated: 2020-12-24.
* File last updated: 2021-05-08.
*/

/**
* Directories.
*/
var dir = {
php: 'app',
input: {
js: 'js',
less: 'less',
},
output: {
js: 'public_html/assets',
less: 'public_html/assets',
},
};

/**
* Packages.
*/
var gulp = require( 'gulp' );
var autoprefixer = require( 'gulp-autoprefixer' );
var cleancss = require( 'gulp-clean-css' );
var filter = require( 'gulp-filter' );
var gulpif = require( 'gulp-if' );
var livereload = require( 'gulp-livereload' );
var notify = require( 'gulp-notify' );
var plumber = require( 'gulp-plumber' );
var rename = require( 'gulp-rename' );
var sourcemaps = require( 'gulp-sourcemaps' );
var argv = require( 'minimist' )( process.argv.slice( 2 ) );
// js
var concat = require( 'gulp-concat' );
var uglify = require( 'gulp-uglify' );
var babel = require( 'gulp-babel' );
// less
var less = require( 'gulp-less' );

/**
* Environment.
*/
var env = ( argv.env ? argv.env : 'dev' );

/**
* Config.
*/
var config = {
run_sourcemaps: ( env == 'dev' ? true : false ),
run_minification: ( env == 'dev' ? false : true ),
};

/**
* Feedback.
*/
console.log( '' );
console.log( 'Environment: '+( env == 'dev' ? 'Development' : 'Production' ) );
console.log( '' );
console.log( 'Sourcemaps: '+( config.run_sourcemaps ? 'Yes' : 'No' ) );
console.log( 'Minification: '+( config.run_minification ? 'Yes' : 'No' ) );
console.log( '' );

/**
* Plumber notification.
*/
var onError = function ( error ) {

notify.onError({
title: "Error in "+error.filename.replace( /^.*[\\\/]/, '' )+" on line "+error.line,
message: "-\n"+error.extract,
appID: "Gulp",
})( error );

this.emit('end');
};

/**
* Procedures.
*/
var app = [];

app.processJS = function ( args ) {
// use all the files
return gulp.src( args.inputFiles )
// catch errors
.pipe( plumber( { errorHandler: onError } ) )
// start the sourcemap
.pipe( gulpif( config.run_sourcemaps, sourcemaps.init() ) )
// compile
.pipe( babel( { presets: ['@babel/env'] } ) )
// concat the js
.pipe( concat( args.outputFile ) )
// minify the js
.pipe( gulpif( config.run_minification, uglify() ) )
// finish the sourcemap
.pipe( gulpif( config.run_sourcemaps, sourcemaps.write( '.' ) ) )
// place the output file
.pipe( gulp.dest( args.outputDir ) )
// remove the sourcemap from the stream
.pipe( gulpif( config.run_sourcemaps, filter( [ '**/*.js' ] ) ) )
// notify
.pipe( notify({
title: "Processed",
message: args.name,
appID: "Gulp",
}))
// reload the site
.pipe( livereload() );
};

app.processLess = function ( args ) {
// use all the files
return gulp.src( args.inputFiles )
// catch errors
.pipe( plumber( { errorHandler: onError } ) )
// start the sourcemap
.pipe( gulpif( config.run_sourcemaps, sourcemaps.init() ) )
// compile the less to css
.pipe( less() )
// autoprefix the css
.pipe( autoprefixer( 'last 10 versions' ) )
// minify the css
.pipe( gulpif( config.run_minification, cleancss( { keepSpecialComments: 0 } ) ) )
// name the output file
.pipe( rename( args.outputFile ) )
// finish the sourcemap
.pipe( gulpif( config.run_sourcemaps, sourcemaps.write( '.' ) ) )
// place the output file
.pipe( gulp.dest( args.outputDir ) )
// remove the sourcemap from the stream
.pipe( gulpif( config.run_sourcemaps, filter( [ '**/*.css' ] ) ) )
// notify
.pipe( notify({
title: "Processed",
message: args.name,
appID: "Gulp",
}))
// reload the site
.pipe( livereload() );
};

/**
* Tasks: JS.
*/
gulp.task( 'js_app', function ( done ) {
app.processJS({
'name' : 'app js',
'inputFiles' : [ dir.input.js+'/app.js' ],
'outputDir' : dir.output.js,
'outputFile' : 'app.min.js',
});
done();
});

/**
* Tasks: Less.
*/
gulp.task( 'less_app', function ( done ) {
app.processLess({
'name' : 'app less',
'inputFiles' : [ dir.input.less+'/app.less' ],
'outputDir' : dir.output.less,
'outputFile' : 'app.min.css',
});
done();
});

/**
* Task: Livereload.
*/
gulp.task( 'livereload', function ( done ) {
livereload.reload();
done();
});

/**
* Task: Watch.
*/
gulp.task( 'watch', function () {
// start livereload
livereload.listen();
// JavaScript
gulp.watch( dir.input.js+'/app.js', gulp.parallel( 'js_app' ) );
// Less
gulp.watch( dir.input.less+'/**/*.less', gulp.parallel( 'less_app' ) );
// PHP
gulp.watch( dir.php+'/**/*.php', gulp.parallel( 'livereload' ) );
// notify
gulp.src( 'node_modules/gulp-notify/test/fixtures/1.txt' ).pipe( notify({
title: "Gulp watch is ready.",
message: " ",
appID: "Gulp",
}));
});

/**
* Task: Default.
*/
gulp.task( 'default', gulp.parallel(
'js_app',
'less_app'
));

257
js/app.js Normal file
View file

@ -0,0 +1,257 @@
var app = new Vue({
el: '#app',

data: {

// tabs
active_tab: 'install',

// # site creation
// ## download wordpress
download_language: '',

// ## configure wp-config
database_host: 'localhost',
database_name: '',
database_prefix: 'wp21_',
database_user: '',
database_pass: '',

// ## database creation
create_database: true,

// ## install wordpress
site_name: '',
site_url: '',
account_username: '',
account_password: '',
account_email: '',

// # site configuration
// ## settings
blank_tagline: true,
start_of_week: 1,
search_engine_visibility: true,
allow_comments_new_posts: true,
show_avatars: true,
uploads_in_folders: true,
permalink_structure: 'default',

// ## content
remove_example_comment: true,
remove_default_posts: [ 1, 2, 3 ],
create_pages: [],
create_pages_new: '',

// ## plugins
remove_default_plugins: [
'akismet',
'hello',
],
install_plugins: [
'classic-editor',
'advanced-custom-fields',
'wordpress-seo',
],
install_plugins_new: '',
},

created: function () {
this.password_generate();
},

mounted() {
if ( localStorage.getItem('data_preset_1') ) {
var data_preset_1 = JSON.parse( localStorage.getItem('data_preset_1') );
Object.assign( this.$data, data_preset_1 );

// console.log( 'data_preset_1:' );
// console.log( data_preset_1 );
} else {
// console.log( 'data_preset_1 is empty' );
}

// console.log( 'localStorage:' );
// console.log( localStorage );
},

methods: {

// tabs
set_active_tab() {
this.active_tab = event.target.getAttribute('data-tab');
},
is_tab_active( tab_id ) {
return this.active_tab == tab_id;
},

// # site creation
// ## install wordpress
password_generate() {
let password = '';
let password_length = 16;
let chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
for ( let i = 0; i < password_length; i++ ) {
let random_index = Math.floor( Math.random() * chars.length );
password += chars.substring( random_index, random_index+1 );
}
this.account_password = password;
},
// # site configuration
// ## content
create_pages_add() {
this.create_pages.push( this.create_pages_new );
this.create_pages_new = '';
},
create_pages_remove( index ) {
Vue.delete( this.create_pages, index );
},
// ## plugins
install_plugins_add() {
this.install_plugins.push( this.install_plugins_new );
this.install_plugins_new = '';
},
install_plugins_remove( index ) {
Vue.delete( this.install_plugins, index );
},
// # presets
save_default() {
localStorage.setItem(
'data_preset_1',
JSON.stringify( this.$data )
);
console.log( 'saved data as data_preset_1' );
},
clear_default() {
localStorage.removeItem('data_preset_1');

console.log( 'cleared data_preset_1' );
},
},

computed: {
code_t1_download() {
// # site creation
// ## download wordpress
let cmd = '';

cmd += 'wp core download';

if ( this.download_language )
cmd += ' --locale='+this.download_language;

return cmd;
},
code_t1_config() {
// ## configure wp-config
let cmd = '';

cmd += 'wp core config';

if ( this.database_host )
cmd += ' --dbhost='+this.database_host;
if ( this.database_name )
cmd += ' --dbname='+this.database_name;
if ( this.database_prefix )
cmd += ' --dbprefix='+this.database_prefix;
if ( this.database_user )
cmd += ' --dbuser='+this.database_user;
if ( this.database_pass )
cmd += ' --dbpass='+this.database_pass;

return cmd;
},
code_t1_database() {
// ## database creation
let cmd = '';

if ( this.create_database )
cmd += 'wp db create';

return cmd;
},
code_t1_install() {
// ## install wordpress
let cmd = '';

cmd += 'wp core install';

if ( this.site_name )
cmd += ' --title="'+this.site_name+'"';
if ( this.site_url )
cmd += ' --url='+this.site_url;
if ( this.account_username )
cmd += ' --admin_user='+this.account_username;
if ( this.account_password )
cmd += ' --admin_password="'+this.account_password+'"';
if ( this.account_email )
cmd += ' --admin_email='+this.account_email;

return cmd;
},
code_t2_settings() {
// # site configuration
// ## settings
let cmds = [];

if ( this.blank_tagline )
cmds.push( 'wp option update blogdescription ""' );
if ( this.start_of_week )
cmds.push( 'wp option update start_of_week '+this.start_of_week );
if ( this.search_engine_visibility )
cmds.push( 'wp option update blog_public 0' );
if ( !this.allow_comments_new_posts )
cmds.push( 'wp option update default_comment_status 0' );
if ( !this.show_avatars )
cmds.push( 'wp option update show_avatars 0' );
if ( !this.uploads_in_folders )
cmds.push( 'wp option update uploads_use_yearmonth_folders 0' );
if ( this.permalink_structure != 'default' )
cmds.push( 'wp option update permalink_structure "'+this.permalink_structure+'"' );

return cmds.join('\r\n');
},
code_t3_content() {
// ## content
let cmds = [];

if ( this.remove_example_comment )
cmds.push( 'wp comment delete 1 --force' );
if ( this.remove_default_posts.length > 0 )
cmds.push( 'wp post delete '+this.remove_default_posts.join(' ')+' --force' );
if ( this.create_pages.length > 0 )
{
this.create_pages.forEach( page_name => {
cmds.push( 'wp post create --post_type=page --post_status=publish --post_title="'+page_name+'"' );
});
}

return cmds.join('\r\n');
},
code_t4_plugins() {
// ## plugins
let cmds = [];

if ( this.remove_default_plugins.length > 0 )
cmds.push( 'wp plugin delete '+this.remove_default_plugins.join(' ') );
if ( this.install_plugins.length > 0 )
cmds.push( 'wp plugin install '+this.install_plugins.join(' ') );

return cmds.join('\r\n');
},
all_code() {
let cmds = [];

cmds.push( this.code_t1_download );
cmds.push( this.code_t1_config );
cmds.push( this.code_t1_database );
cmds.push( this.code_t1_install );
cmds.push( this.code_t2_settings );
cmds.push( this.code_t3_content );
cmds.push( this.code_t4_plugins );

return cmds.join('\r\n\r\n');
},
},
});

174
less/app.less Normal file
View file

@ -0,0 +1,174 @@
/* pre reset vendor */

/* variables */

@import 'variables/breakpoints';
@import 'variables/colors';

/* reset */

@import 'partials/reset';

/* post reset vendor */

/* mixins */

@import 'mixins/font-stacks';
@import 'mixins/developer-tools';
@import 'mixins/mixins';
@import 'mixins/containers';

/* partials */

// @import 'partials/buttons';
// @import 'partials/pagination';
// @import 'partials/share';
// @import 'partials/user-content';

/* components */

// @import 'components/off-canvas';
// @import 'components/header';
// @import 'components/footer';



body {
background-color: @color-black;
line-height: 2;
font-family: Arial;
font-size: 18px;
color: @color-white;
}
h1, h2, h3 {
font-size: 18px;
}
div + h1,
div + h2,
div + h3 {
margin-top: 50px;
}
label {
display: block;
cursor: pointer;
user-select: none;
&:hover {
background-color: #333;
}
}
select,
input {
background-color: @color-black;
padding: 7px 10px;
border: 1px solid @color-white;
font-size: 18px;
color: @color-white;
}
li {
font-size: 18px;
}
ul li {
list-style-type: disc;
margin-left: 20px;
}
button {
background-color: @color-white;
border: 1px solid @color-white;
padding: 7px 10px;
font-size: 18px;
color: @color-black;
}
.remove {
display: inline-block;
width: 16px;
height: 16px;

margin-left: 5px;

border-radius: 3px;
background-color: @color-white;
line-height: .8;
text-align: center;
font-size: 15px;
font-weight: bold;
color: @color-black;
cursor: pointer;
}
#app {
// height: 100vh;
}
.row {
display: grid;
grid-template-columns: 1fr 1fr;
}
.col {
padding: 30px;
overflow-y: scroll;
}



.cc {
display: grid;
grid-gap: 50px;
grid-template-columns: 1fr 1fr;
grid-template-areas:
"control code";
.control {
grid-area: control;
background-color: #f092;
}
.code {
grid-area: code;
background-color: #f902;
}
}




.tabs-nav {
background-color: #111;
ul {
display: flex;
}
li {
margin: 0;
padding: 10px 20px;
border-top: 2px solid transparent;
list-style-type: none;
cursor: pointer;
user-select: none;
&.active {
background-color: @color-black;
border-top-color: orange;
}
}
}
.tabs {
// max-height: calc( 100vh - 200px );
// overflow-y: scroll;
.tab {
display: none;
padding-top: 30px;
padding-bottom: 30px;
&.active {
display: block;
}
}
}

pre {
// top: 0;
// position: sticky;
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
overflow: auto;
line-height: 1.4;
font-family: Courier;
vertical-align: top;
background-color: #111;
border-radius: 5px;
padding: 6px 10px 6px 10px;
}

View file

@ -0,0 +1,24 @@
.container {
@media @bp-xs {
width: 100%;
padding-left: 15px;
padding-right: 15px;
}
@media @bp-sm-up {
margin-left: auto;
margin-right: auto;
}
@media @bp-sm {
width: 540px;
}
@media @bp-md {
width: 720px;
}
@media @bp-lg {
width: 960px;
}
@media @bp-xl {
width: 1140px;
}
}

View file

@ -0,0 +1,67 @@
// fancy colors
@c1: #E74C3C;
@c2: #2ECC71;
@c3: #3498DB;
@c4: #F1C40F;
@c5: #E67E22;
@c6: #9B59B6;
@c7: #95A5A6;
@c8: #34495E;
@c9: #1ABC9C;
@c0: #ECF0F1;

// fancy background colors
.bgc1 { background-color: @c1; }
.bgc2 { background-color: @c2; }
.bgc3 { background-color: @c3; }
.bgc4 { background-color: @c4; }
.bgc5 { background-color: @c5; }
.bgc6 { background-color: @c6; }
.bgc7 { background-color: @c7; }
.bgc8 { background-color: @c8; }
.bgc9 { background-color: @c9; }
.bgc0 { background-color: @c0; }

// background darker lighter
.bgc-darker { background-color: rgba( 0, 0, 0, 0.1 ); }
.bgc-lighter { background-color: rgba( 255, 255, 255, 0.1 ); }

// add the colorloop mixin to an element
// to easily spot all elements inside it
.colorloop {
// make each one a little darker
// .bgc-darker
// rainbow effect!
&:nth-child(10n+1) { .bgc1; }
&:nth-child(10n+2) { .bgc2; }
&:nth-child(10n+3) { .bgc3; }
&:nth-child(10n+4) { .bgc4; }
&:nth-child(10n+5) { .bgc5; }
&:nth-child(10n+6) { .bgc6; }
&:nth-child(10n+7) { .bgc7; }
&:nth-child(10n+8) { .bgc8; }
&:nth-child(10n+9) { .bgc9; }
&:nth-child(10n+0) { .bgc0; }
}

.breakpoint-info {
z-index: 9999;
position: fixed;
right: 0;
bottom: 32px;
& > div {
padding: 10px 15px;
display: none;
color: #333;
font-family: sans-serif;
font-size: 20px;
font-weight: bold;
}
}

@media @bp-xs { .breakpoint-info .bp-xs { display: block; .bgc1; } }
@media @bp-sm { .breakpoint-info .bp-sm { display: block; .bgc2; } }
@media @bp-md { .breakpoint-info .bp-md { display: block; .bgc3; } }
@media @bp-lg { .breakpoint-info .bp-lg { display: block; .bgc4; } }
@media @bp-xl { .breakpoint-info .bp-xl { display: block; .bgc5; } }

View file

@ -0,0 +1,17 @@
/* descriptive stacks */

.font-arial-regular {
font-family: Arial, sans-serif;
font-weight: 400;
font-style: normal;
}

/* functional stacks */

.font-body {
.font-arial-regular;
}
.font-title {
.font-arial-regular;
}

0
less/mixins/mixins.less Normal file
View file

72
less/partials/reset.less Normal file
View file

@ -0,0 +1,72 @@
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary {
margin: 0;
padding: 0;
border: 0;
// font-size: 100%;
// font-weight: normal;
// vertical-align: baseline;
// background: transparent;
}

html {
box-sizing: border-box;
overflow-y: scroll;
}

// [canvas=container] {
// overflow-y: scroll;
// }
body, [canvas=container] {
// height: auto;
// overflow: visible;
}

*, *:before, *:after {
box-sizing: inherit;
}

ol, ul {
list-style-type: none;
font-size: 0;
}

input, select {
vertical-align: middle;
}

pre {
white-space: pre; /* CSS2 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
word-wrap: break-word; /* IE */
}

button, input, select, textarea {
margin: 0;
}

a,
a:link,
a:hover,
a:focus,
a:active,
a:visited {
outline: 0;
text-decoration: none;
}

// hr {
// margin: 0;
// border: 0;
// }

li, a {
color: inherit;
}

img, figure, object, embed, iframe, audio, video {
height: auto;
max-width: 100%;
max-height: 100%;
}

View file

@ -0,0 +1,47 @@
/**
* Breakpoints.
*/

@screen-xs-max: @screen-sm-min - 1;
@screen-sm-min: 576px;
@screen-sm-max: @screen-md-min - 1;
@screen-md-min: 768px;
@screen-md-max: @screen-lg-min - 1;
@screen-lg-min: 992px;
@screen-lg-max: @screen-xl-min - 1;
@screen-xl-min: 1200px;

/**
* Media queries.
*/

// all
@bp-all: ~"only screen";

// single
@bp-xs: ~"only screen and ( max-width: @{screen-xs-max} )";
@bp-sm: ~"only screen and ( min-width: @{screen-sm-min} ) and ( max-width: @{screen-sm-max} )";
@bp-md: ~"only screen and ( min-width: @{screen-md-min} ) and ( max-width: @{screen-md-max} )";
@bp-lg: ~"only screen and ( min-width: @{screen-lg-min} ) and ( max-width: @{screen-lg-max} )";
@bp-xl: ~"only screen and ( min-width: @{screen-xl-min} )";

// this and up
@bp-sm-up: ~"only screen and ( min-width: @{screen-sm-min} )";
@bp-md-up: ~"only screen and ( min-width: @{screen-md-min} )";
@bp-lg-up: ~"only screen and ( min-width: @{screen-lg-min} )";

// this and down
@bp-sm-down: ~"only screen and ( max-width: @{screen-sm-max} )";
@bp-md-down: ~"only screen and ( max-width: @{screen-md-max} )";
@bp-lg-down: ~"only screen and ( max-width: @{screen-lg-max} )";

// ranges
@bp-xs-sm: @bp-sm-down;
@bp-xs-md: @bp-md-down;
@bp-xs-lg: @bp-lg-down;
@bp-sm-md: ~"only screen and ( min-width: @{screen-sm-min} ) and ( max-width: @{screen-md-max} )";
@bp-sm-lg: ~"only screen and ( min-width: @{screen-sm-min} ) and ( max-width: @{screen-lg-max} )";
@bp-sm-xl: @bp-sm-up;
@bp-md-lg: ~"only screen and ( min-width: @{screen-md-min} ) and ( max-width: @{screen-lg-max} )";
@bp-md-xl: @bp-md-up;

View file

@ -0,0 +1,11 @@
/* descriptive */

@color-white: #ffffff;
@color-black: #202020;

/* functional */

// @color-primary: #90f;
// @color-secondary: #84D455;
// @color-tertiary: @color-black-1;

7
misc/cli-code.txt Normal file
View file

@ -0,0 +1,7 @@
wp option update timezone_string "Europe/Amsterdam"
wp option update date_format "Y-m-d"
wp option update time_format "H:i"

wp option update default_pingback_flag 0
wp option update default_ping_status 0

33
misc/todo.txt Normal file
View file

@ -0,0 +1,33 @@
multiple presets
preset availability indicators

labels left of form fields
link labels to fields with ids

pretty checkboxes

code copy buttons

add code to pre tags?

install plugins, list of suggestions





# old notes

input, blogdescription, Tagline
select, timezone_string, Timezone
select with input, date_format, Date Format
select with input, time_format, Time Format

checkbox, Disable pingbacks/trackbacks, default_ping_status
checkbox, Disable comments, default_comment_status

manageable list with default, Create menus
checkbox, show_on_front, Homepage Static pages
checkbox, page_on_front, Front Page
checkbox, page_for_posts, Blog

12869
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

26
package.json Normal file
View file

@ -0,0 +1,26 @@
{
"name": "wpcligui",
"version": "2.0.0",
"scripts": {
"postinstall": "npx gulp --env=prod"
},
"devDependencies": {
"@babel/core": "^7.14.0",
"@babel/preset-env": "^7.14.1",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-filter": "^7.0.0",
"gulp-if": "^3.0.0",
"gulp-less": "^4.0.1",
"gulp-livereload": "^4.0.2",
"gulp-notify": "^4.0.0",
"gulp-plumber": "^1.2.1",
"gulp-rename": "^2.0.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2",
"minimist": "^1.2.5"
}
}

11965
public_html/assets/vendor/vue-2.6.11.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

11965
public_html/assets/vendor/vue-2.6.12.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

BIN
public_html/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

4
public_html/index.php Normal file
View file

@ -0,0 +1,4 @@
<?php

include '../app/index.php';