Coder Social home page Coder Social logo

ozinclouds / ozwpcli Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 1.14 MB

Simple Admin Panel for creating sandbox Wordpress and WP development plugs for altering admin settings using WP-CLI with PHP

License: MIT License

PHP 52.55% JavaScript 37.85% CSS 9.61%
wp-cli wordpress-development bootstrap4 jquery php sweetalert2 busy-load tablesorter fontawesome starter-template

ozwpcli's Introduction

OZwpCli

Simple Admin Panel for creating sandbox Wordpress and WP development plugs for altering admin settings using WP-CLI with PHP.

Features

  • WP-CLI with PHP
    • Find all WP installations in root
    • Update WP core and plugins
    • Create WP sandbox with your default settings
    • Edit WP with your default settings (config, options, plugins, themes and user)
  • Bootstrap 4 with Start Bootstrap - SB Admin Template
  • Jquery everywhere with ajax calls to WP-CLI
  • Fontawesome, Sweetalert2, busy-load, tablesorter
  • Bundled and browser-synced with Webpack
  • Composer for parsedown, phpdotenv and php-array-group-by

Installation

Clone or download from Github.

to build the webpack bundle:

$ npm run

to build with webpack and run in safari with BrowserSync + HotModuleReplacement (for chrome replace safari with chrome):

$ npm run safari 

assumptions

  • Localhost is the Root directory of all your WP installs
  • There is at least one WP installation in the Root
  • You will install all new WP sites in the Root directory
  • You have the pre-requisites as described below

pre-requisites:

This app runs only in Mac with cli commands executed by Terminal.app.

basically, you need to:

  1. Setup export $PATH variables, esp. if you're running MAMP.
  2. Install the latest version of npm and run install in the app directory.
  3. Install the latest version of composer (recommended globally) and run install in the app directory.
  4. Install the latest version of wp-cli (recommended globally).

MAMP setup

If you're running PHP on MAMP, a .bash_profile adjustment needed. Exporting Path as best practice is as below. You may copy and paste these settings in your file. I am running MAMP version 5.6.31. But any version is extracted by the script.

### MAMP version (5.6.31)
##  ls /Applications/MAMP/bin/php/ | sort -n | tail -2 | head -1
## /Applications/MAMP/bin/php/php5.6.31/bin
## export PATH=/Applications/MAMP/Library/bin:$PATH
PHP_VERSION=$(ls /Applications/MAMP/bin/php/ | sort -n | tail -2 | head -1)
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH

You can echo your PATH by $ echo $PATH in your Terminal window. This path info will be crucial for running wp-cli commands. Please copy and save this path info in your .env file.

npm

You need npm to install all dependencies, including composer. Since you're on a Mac environment, you have probably a version of npm + node installed in your system. For updating your versions and further upgrading options, please visit docs.nmpjs.com

For the dependencies listed in package.json, run $ npm install in your admin folder with Terminal.app


composer

Composer can be installed by the instructions in its site getcomposer.org and I highly recommend to install it Globally.

Composer dependencies are hooked in config.php. To install and create the vendor folder, in your Terminal.app (and of course in the install directory of the app) run $ composer install .


wp-cli

Installing wp-cli is well documented in its site: wp-cli. If you're lucky with previous installs of npm and composer, this will run like a charm.

wp-cli / packages

OZwpCli uses packages from wp-cli, which you may find the index of packages here: wp-cli/packages.

wp-cli/find-command

Find WordPress installations on the filesystem.

Installation:
$ wp package install wp-cli/find-command

You may encounter memory problems and you can find solutions here. Script below works for me:

$ php -d memory_limit=512M "$(which wp)" package install wp-cli/find-command

wp-cli/admin-command

Opens wp-admin in default browser

Installation:
$ wp package install wp-cli/admin-command

You may encounter memory problems and you can find solutions here. Script below works for me:

$ php -d memory_limit=650M "$(which wp)" package install wp-cli/admin-command

dotenv - site settings

  • config.php immediately creates a .env file in the root folder from a sample.env file.
    • EXPORT_PATH this environmental variable should be received from Terminal.app by typing $ echo $PATH which is the export path variable in your .bash_profile. Copy the output and paste in .env file directly.
    • mysql_PATH this is for 'env: mysql: No such file or directory' error, which occurs i.e. with WP Config command.
    • rooturl Where you run this app (Usually localhost)
    • DB parameters Database parameters: DB_HOST, DB_USER and DB_PASS.
    • WP admin user info Your admin credentials: admin_user, admin_mail, admin_password, display_name and description (Bio).

main idea

code is fun...

Written with StackEdit.

ozwpcli's People

Contributors

ozgurkalan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mobilemadman2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.