Giter VIP home page Giter VIP logo

wordpress.skeleton's Introduction

WordPress.Skeleton

image

Latest Stable Version Total Downloads

WordPress project skeleton to focus only your own source codes because of composer-friendly design. Inspired by markjaquith/WordPress-Skeleton.

Advantages compared to WordPress-Skeleton:

  • You can install via composer create-project.
  • You can add plugins via composer require/install.
  • You don't need to do git submodule init/update. (so installing is very fast)
  • You can set /wp/ as DocumentRoot. (in other words, you can hide "/wp/" from url)
  • It works even on descendant directory of DocumentRoot. (you can get it to work casually ,without vhost settings, for local development)
  • All languages will be installed by default.

Requirements

  • PHP 5.3+

Installation

$ composer create-project wordpress/skeleton {project-name}
$ cd {project-name}
$ cp local-config-sample.php local-config.php
$ vi local-config.php # tailor to your environment

You can use Japanese or English environment as you like.

Note: For Windows

On Windows environment, maybe you need to use console (like cmd.exe) as an administrator user for creating symlink.

If you still have any symlink related problem, please create-project in following way ๐Ÿ™‡

$ composer create-project wordpress/skeleton {project-name} --no-scripts
$ cd {project-name}
$ mklink /D wp\wp-content\my-themes ..\..\wp-content\themes # or create symlink in some way
$ mklink /D wp\wp-content\uploads ..\..\wp-content\uploads # or create symlink in some way
$ rm -rf wp/wp-content/plugins
$ mklink /D wp\wp-content\plugins ..\..\wp-content\plugins # or create symlink in some way
$ cp local-config-sample.php local-config.php
$ vi local-config.php # tailor to your environment

Usage

WordPress core will be installed in /wp/ so root directory of your website will be /wp/. (e.g. "http://example.com/project-name/wp/")

If you want to hide /wp/ from URL you should set DocumentRoot to /path/to/project/wp/.

Now you can create your own theme in /wp-content/themes/ and install some plugins into /wp-content/plugins/ via composer (as described in the next chapter). And your git repository doesn't manage /wp/ so you can focus only your own source codes in /wp-content/themes.

Installing plugins via composer

Using WordPress Packagist

You can use WordPress Packagist to install plugins (or themes) via composer like below:

{
    "require": {
        "wpackagist-plugin/akismet": "dev-trunk",
        "wpackagist-plugin/captcha": ">=3.9",
        "wpackagist-theme/hueman": "*"
    }
}

Installing plugins form GitHub or zip file

You can also install some plugins (which isn't on WordPress.org) from GitHub repository, zip file, and so on. To do that you should add package with "type": "wordpress-plugin" and require it like below:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "something-on-github",
                "type": "wordpress-plugin",
                "version": "dev-master",
                "source": {
                    "type": "git",
                    "url": "[email protected]:someone/something.git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "something-of-zip",
                "type": "wordpress-plugin",
                "version": "1.0",
                "dist": {
                    "type": "zip",
                    "url": "http://something.com/download/1.0.zip"
                }
            }
        }
    ],
    "require": {
        "something-on-github": "dev-master",
        "something-of-zip": "1.0"
    }
}

Backing up database and uploaded files

/backup/ directory is just for saving (and version-managing) database and uploaded files. If you need, you can save them here like below:

$ mysqldump -u[user] -p [database] > backup/dump.sql
$ zip -r backup/uploads.zip wp/wp-content/uploads

Mechanism, FYI

After install/update "wordpress" package, a symlink will be created in /wp/ environment as shown below:

  • /wp/wp-content/my-themes -> /wp-content/themes

And on WordPress's booting process, /wp/wp-content/my-theme will be enabled as an additional theme directory by following process:

  1. WPMU_PLUGIN_DIR points /wp-content/mu-plugins because of customizing in /wp-config.php.
  2. In /wp-content/mu-plugins/add-skeleton-theme-directory.php, theme directory is added with register_theme_directory() function.

Just to tell you, /wp-config.php (and /local-config.php) need not be symlinked into /wp/ because they will loaded from /wp/wp-load.php during WordPress' normal booting process.

Commonly-used plugins

wordpress.skeleton's People

Contributors

gelbehexe avatar kouhei-fuji avatar solidpeat avatar ttskch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordpress.skeleton's Issues

Problem with package wpackagist-plugin/wp-i18n

During the installation, the following error occurs:

Installing wordpress/skeleton (0.5.2)
  - Installing wordpress/skeleton (0.5.2): Downloading (100%)
Created project in SGB
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package wpackagist-plugin/wp-i18n could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Cannot create-project on Windows 7

php 5.3+ is ready to use symlink() on windows, but following error occurs on my windows 7 64bit environment...
refs. https://bugs.php.net/bug.php?id=48975 ?

$ composer install --no-dev
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing johnpbloch/wordpress (4.3.1)
    Loading from cache

Script Installer::postPackageInstall handling the post-package-install event terminated with an exception



  [ErrorException]
  symlink(): Could not fetch file information(error 3)



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

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.