Giter VIP home page Giter VIP logo

wp-plugins-fronity's Introduction

Frontity WP Plugins

How to collaborate

1. Fork this repo to your GitHub account.

2. Clone the fork in your computer.

3. Add the plugins to your WordPress installation.

You can add them using symlinks:

npm run sync ../../path/to/your/wordpress

If you work with Local by Flywheel you have to use their addon Volumes to add the plugins to the WordPress.

4. Make the modifications to the code.

5. Submit a Pull Request.

WordPress Code Standards and Unit Tests

Installation in macOS

1. Install PHP.

Our recommendation is to use Homebrew:

brew install php

2. Install Composer.

Our recommendation is to use Hombrew:

brew install composer

Then, install the dependencies:

composer install

3. Install MySQL (for unit tests only)

Our recommendation is to use DBngin.

Once you've installed DBngin, create a new MySQL database (v5.7) and click on "Start".

Then, click on the terminal icon and add the line it shows to your .bash_profile or .zshrc file:

# DBngin exports
export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH

Change 5.7.23 for your MySQL version.

4. Install Xdebug (for debugging of unit tests)

Our recommendation is to use pecl:

pecl install xdebug

After the installation, add an extension with the Xdebug configuration at /usr/local/etc/php/7.X/conf.d/ext-xdebug.ini:

[xdebug]
zend_extension=/usr/local/Cellar/php/7.X/pecl/YYYYYYYY/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000

Change 7.X for your PHP version and YYYYYY for the folder where pecl installed Xdebug.

You may need to clean your previous PHP installation first, then install it again with brew. This post explains the process. You can skip the Nginx section.

You may need to remove the first line that the pecl installation added to your php.ini file at /usr/local/etc/php/7.X/php.ini.

Run the code standards and beautifier

You can use these two commands to check that your code meets the WordPress standards:

npm run phpcs
npm run phpcbf

Run the unit tests

The first time, you need to install the database and download WordPress

npm run install-wp-tests

This will run bin/install-wp-tests.sh with the following parameters:

  • DB_NAME=frontity-tests
  • DB_USER=root
  • DB_PASS='' (blank)
  • DB_HOST=localhost
  • WP_VERSION=latest
  • SKIP_DB_CREATE=false

You can also run it manually if you prefer.

Then, use npm run phpunit to run the tests.

wp-plugins-fronity's People

Contributors

darerodz avatar luisherranz avatar santosguillamot avatar

Watchers

 avatar

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.