Giter Site home page Giter Site logo

hiwelo / raccoon-plugin Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 4.0 1.04 MB

With Raccoon, use a JSON or YAML file to manage WordPress theme features

License: GNU General Public License v3.0

PHP 100.00%
wordpress wordpress-plugin wordpress-configuration wordpress-admin wordpress-development yaml json

raccoon-plugin's Introduction

Raccoon WordPress plugin

Raccoon Plugin is a WordPress plugin which allows you to easily manage WordPress theme features with a JSON or YAML configuration file.

Build Status

Summary

Dev requirements

For its development, Raccoon Plugin requires:

  • PHP >= 5.6
  • Composer
  • WordPress >= 4.4

Installation

To install the Raccoon Plugin in your WordPress project, you can :

  1. Clone the repository in your WordPress plugin directory : git clone https://github.com/hiwelo/raccoon-plugin.git

  2. If your using Composer and an environment like Bedrock : composer require hiwelo/raccoon-plugin

If you want to install this plugin directly in your WordPress without Composer, I suggest you to install it in the Must-Use Plugins mu-plugins/ directory.

If you want to install this plugin with Composer, note that this package has a specific type (wordpress-muplugin) for a direct installation into the mu-plugins/ directory (like in Bedrock).

After installation

If the plugin is in the WordPress mu-plugins/ directory, you do not need to do something special to activate it. You just need to create a manifest.json file in your theme's root directory to use it.

If the plugin is in the WordPress plugins/ directory, do not forget to activate it in the WordPress admin panel and create the manifest.json file in your theme's root directory.

Manifest JSON or YAML file

Once you created the JSON or YAML file in your theme's root directory, you can use in this file all features described in this project's wiki.

Third-part features

Raccoon loves Bedrock

Bedrock is a WordPress boilerplate which create a better projet structure mainly with a new wp-content/ folder renamed app/. Bedrock use Composer and environments variables.

By example, Raccoon can use environments variables from Bedrocks to know the environment status (development, production, staging) and manage which debug informations has to be returned by the theme. If you don't use Bedrock, you can manually set environment status in the manifest.json file like this :

{
  "environment-status": "development"
}

raccoon-plugin's People

Contributors

blupdew avatar hiwelo avatar lilobase avatar

Stargazers

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

Watchers

 avatar  avatar

raccoon-plugin's Issues

Fatal error when deploying to production

I'm not sure if this is an issue with Raccoon itself, or my manifest file. But when I deploy a site with Raccoon (loaded as an mu-plugin) to production, WordPress crashes and PHP logs the following error:

PHP Fatal error: Uncaught Error: Cannot use object of type Hiwelo\Raccoon\Manifest as array in /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php:156 Stack trace: #0 /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php(72): Hiwelo\Raccoon\Raccoon->loadEnvironmentStatus() #1 /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/raccoon.php(38): Hiwelo\Raccoon\Raccoon->__construct() #2 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-includes/plugin.php(524): Roots\Bedrock\Autoloader::Hiwelo\Raccoon{closure}('') #3 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-settings.php(395): do_action('after_setup_the...') #4 /srv/users/serverpilot/apps/phmass-org-prod/web/wp-config.php(9): require_once('/srv/users/serv...') #5 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-load.php(44): require_once('/srv/users/serv...') #6 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-blog-header.php(13): require_once('/ in /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php on line 156

Theme namespace

Once the namespace is processed by the plugin, it would be better to declare a constant rather than a global variable.

Taxonomy registration

Would it be possible to add this as a module? I see in the post type specification that you can attach existing taxonomies to a post type, but creating the taxonomy still needs to be done via standard WP functions. It would be great to have all of the taxonomy/post type stuff in the same place.

Upload de SVG dans l'éditeur de médias

Il serait intéressant de mettre en place une option dans theme-features permettant l'upload de SVG dans l'éditeur de médias WordPress.

/* Enable SVG upload */
add_filter('upload_mimes', function ($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    return $mimes;
});

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.