Skip to content

Commit

Permalink
Merge pull request #45 from studiopress/feature/circleci_integration
Browse files Browse the repository at this point in the history
CircleCI Integration & Cleanup
  • Loading branch information
rfmeier authored Jun 25, 2019
2 parents 090333b + 77568fa commit a7b8c04
Show file tree
Hide file tree
Showing 24 changed files with 1,802 additions and 986 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2

jobs:
test:
docker:
- image: circleci/php:7.3-stretch
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
- v1-dependencies-
- run:
name: "Install composer dependencies."
command: composer install --no-interaction --prefer-dist --no-suggest
- save_cache:
key: composer-v1-{{ checksum "composer.lock" }}
paths:
- vendor
- run:
name: "Run PHPCS"
command: composer sniff

workflows:
version: 2
check-wp-cs:
jobs:
- test
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# http://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
Thumbs.db
.svn
node_modules/
Thumbs.db
node_modules/
vendor/
7 changes: 6 additions & 1 deletion .svnignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.editorconfig
.git
.gitignore
.gitattributes
.svnignore
node_modules
composer.json
composer.lock
node_modules
phpcs.xml.dist
vendor
23 changes: 20 additions & 3 deletions admin/notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,32 @@
/**
* Callbacks for `admin_notices` action to load HTML notices.
*
* @package genesis_connect_woocommerce
* @version 1.0
* @package Genesis_Connect_WooCommerce
* @since 1.0
*/
defined( 'ABSPATH' ) || exit;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Display notice message if WooCommerce is not active.
*
* Callback for WordPress 'admin_notices' action.
*
* @since 1.0
*/
function gencwooc_woocommerce_notice() {
include GCW_ADMIN_DIR . '/views/html-notice-needs-woocommerce.php';
}

/**
* Display notice message if Genesis is not active.
*
* Callback for WordPress 'admin_notices' action.
*
* @since 1.0
*/
function gencwooc_genesis_notice() {
include GCW_ADMIN_DIR . '/views/html-notice-needs-genesis.php';
}
13 changes: 10 additions & 3 deletions admin/views/html-notice-needs-genesis.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php
/**
* Admin View: Notice - needs Genesis.
* View for WordPress `admin_notice` if Genesis is not active.
*
* @package Genesis_Connect_WooCommerce
* @since 1.0.0
*/

defined( 'ABSPATH' ) || exit;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

?>
<div id="message" class="error notice">
<p><?php _e( '<i>Genesis Connect for WooCommerce</i> requires a Genesis child theme. <strong>Please activate a Genesis theme or disable Genesis Connect.</strong>', 'gencwooc' ); ?></p>
<p>
<?php esc_html_e( 'Genesis Connect for WooCommerce requires a Genesis child theme. Please activate a Genesis theme or disable Genesis Connect.', 'gencwooc' ); ?>
</p>
</div>
13 changes: 10 additions & 3 deletions admin/views/html-notice-needs-woocommerce.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php
/**
* Admin View: Notice - needs WooCommerce.
* View for WordPress `admin_notice` if WooCommerce is not active.
*
* @package Genesis_Connect_WooCommerce
* @since 1.0.0
*/

defined( 'ABSPATH' ) || exit;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

?>
<div id="message" class="error notice">
<p><?php _e( '<i>Genesis Connect for WooCommerce</i> requires WooCommerce. <strong>Please activate WooCommerce or disable Genesis Connect.</strong>', 'gencwooc' ); ?></p>
<p>
<?php esc_html_e( 'Genesis Connect for WooCommerce requires WooCommerce. Please activate WooCommerce or disable Genesis Connect.', 'gencwooc' ); ?>
</p>
</div>
36 changes: 36 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "studiopress/genesis-connect-woocommerce",
"description": "Core plugin for developing WooCommerce integration.",
"type": "wordpress-plugin",
"homepage": "https://github.com/studiopress/genesis-connect-woocommerce",
"license": "GPL-2.0-or-later",
"require": {
"php": "^5.6 || ^7",
"composer/installers": "^1"
},
"require-dev": {
"php": "^5.6 || ^7",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
"squizlabs/php_codesniffer": "^3.4.2",
"phpcompatibility/phpcompatibility-wp": "^2",
"wp-coding-standards/wpcs": "^2.1"
},
"scripts": {
"phpcs": "phpcs -p ./",
"php-compat": "phpcs --standard=PHPCompatibilityWP --ignore=/vendor --runtime-set testVersion 5.6- -p ./",
"sniff": [
"@php-compat",
"@phpcs"
],
"phpcbf": "phpcbf -p ./"
},
"support": {
"issues": "https://github.com/studiopress/genesis-connect-woocommerce/issues",
"source": "https://github.com/studiopress/genesis-connect-woocommerce"
},
"config": {
"sort-order": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit a7b8c04

Please sign in to comment.