Skip to content

Commit

Permalink
initial commit, added options page and dashboard class
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kemme committed Feb 22, 2017
0 parents commit 189d49a
Show file tree
Hide file tree
Showing 26 changed files with 2,182 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "assets/bower"
}
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{html,js,php,css,scss}]
charset = utf-8

# 4 space indentation
[*.{html,js,php,css,scss}]
indent_style = tab
indent_size = 4

# Matches the exact files
[{package.json,bower.json,.bowerrc,.eslintrc,.travis.yml,.sass-lint.yml,phpcs.xml}]
indent_style = space
indent_size = 2
78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
module.exports = {
"env": {
"browser": true,
"jquery": true,
"es6": true,
},
"extends": "wordpress",
"installedESLint": true,
"plugins": [],
"rules": {
// Enforce spacing inside array brackets
'array-bracket-spacing': ['error', 'always'],
// Enforce one true brace style
'brace-style': 'error',
// Require camel case names
'camelcase': ['error', {
properties: 'always'
}],
// Disallow or enforce trailing commas
'comma-dangle': ['error', 'never'],
// Enforce spacing before and after comma
'comma-spacing': 'error',
// Enforce one true comma style
'comma-style': ['error', 'last'],
// Encourages use of dot notation whenever possible
'dot-notation': ['error', {
allowKeywords: true,
allowPattern: '^[a-z]+(_[a-z]+)+$'
}],
// Enforce newline at the end of file, with no multiple empty lines
'eol-last': 'error',
// Require or disallow spacing between function identifiers and their invocations
'func-call-spacing': 'off',
// Enforces spacing between keys and values in object literal properties
'key-spacing': ['error', {
beforeColon: false,
afterColon: true
}],
// Enforce spacing before and after keywords
'keyword-spacing': 'error',
// Disallow mixed "LF" and "CRLF" as linebreaks
'linebreak-style': ['error', 'unix'],
// Enforces empty lines around comments
'lines-around-comment': ['error', {
beforeLineComment: true
}],
// Disallow mixed spaces and tabs for indentation
'no-mixed-spaces-and-tabs': 'error',
// Disallow use of multiline strings
'no-multi-str': 'error',
// Disallow multiple empty lines
'no-multiple-empty-lines': 'error',
// Disallow use of the with statement
'no-with': 'error',
// Require or disallow an newline around variable declarations
'one-var-declaration-per-line': ['error', 'initializations'],
// Enforce operators to be placed before or after line breaks
'operator-linebreak': ['error', 'after'],
// Require or disallow use of semicolons instead of ASI
'semi': ['error', 'always'],
// Require or disallow space before blocks
'space-before-blocks': ['error', 'always'],
// Require or disallow space before function opening parenthesis
'space-before-function-paren': ['error', 'never'],
// Require or disallow space before blocks
'space-in-parens': ['error', 'always', {exceptions: ['{}', '[]']}],
// Require spaces around operators
'space-infix-ops': 'error',
// Require or disallow spaces before/after unary operators (words on by default, nonwords)
'space-unary-ops': ['error', {
overrides: {'!': true}
}],
// Requires to declare all vars on top of their containing scope
'vars-on-top': 'error',
// Require or disallow Yoda conditions
'yoda': ['error', 'always']
}
}
75 changes: 75 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Bower ###
bower_components
.bower-cache
.bower-registry
.bower-tmp


### Node ###
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules


### Composer ###
composer.phar
vendor/


# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### Sass ###
.sass-cache

release

142 changes: 142 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Sample Configs
# - https://github.com/sasstools/sass-lint/blob/develop/docs/sass-lint.yml
# - https://github.com/sasstools/gulp-sass-lint/blob/master/tests/.sass-lint.yml

# Sass Lint Rules
# - https://github.com/sasstools/sass-lint/tree/develop/docs/rules

# Severity
# - 0: turns rule off
# - 1: set as a warning
# - 2: set to error

# File Options
files:
ignore:
- 'sass/vendor/**/*.scss'
- 'sass/tests/**/*.scss'
- 'bourbon/app/**/*.scss'
- 'bourbon-neat/app/**/*.scss'

# Rule Configuration
rules:
# Extends
placeholder-in-extend: 0

# Mixins
mixins-before-declarations:
- 1
-
exclude: ['media'] # except @include media();

# Line Spacing
empty-line-between-blocks:
- 1
-
allow-single-line-rulesets: false

# Disallows
no-color-literals:
- 1
-
allow-rgba: true
no-debug: 0
no-ids: 0
no-mergeable-selectors: 0
no-qualifying-elements:
- 1
-
allow-element-with-attribute: true
allow-element-with-class: false
allow-element-with-id: false
no-vendor-prefixes: 0
no-warn: 0

# Nesting
force-attribute-nesting: 0
force-element-nesting: 0
force-pseudo-nesting: 0

# Name Formats
function-name-format:
- 1
-
convention-explanation: Please use hyphenated lowercase for function names. Also, you may use a leading underscore if you prefer.
mixin-name-format:
- 1
-
convention-explanation: Please use hyphenated lowercase for mixin names. Also, you may use a leading underscore if you prefer.
placeholder-name-format:
- 1
-
convention-explanation: Please use hyphenated lowercase for placeholder names. Also, you may use a leading underscore if you prefer.
variable-name-format:
- 1
-
allow-leading-underscore: false
convention-explanation: Please use hyphenated lowercase for variable names. No leading underscore is allowed.

# Style Guide
attribute-quotes: 1
border-zero: 0
brace-style:
- 1
-
style: 1tbs
allow-single-line: false
class-name-format:
- 1
-
allow-leading-underscore: false
convention-explanation: Please use hypenated lowercase for class names, and without a leading underscore. If you find a WordPress core condition that conflicts with this convention feel free to modify and extend the ignore option.
ignore: ['current_page_item', 'widget_search'] # ignore selectors declared by WordPress

empty-args: 0
hex-length: 1
hex-notation: 1
id-name-format:
- 1
-
convention-explanation: Please try to use hyphenated lowercase ID name format. If overriding a plugin that does not use this format then please ignore or extend the list of ignore option.
indentation:
- 1
-
size: tab
leading-zero:
- 1
-
include: true

nesting-depth:
- 1
-
max-depth: 3

property-units:
- 1
-
per-property: { width: ['rem', 'vw'], height: ['rem', 'vh'], margin: ['rem'], padding: ['rem'] }

quotes:
- 1
-
style: double

shorthand-values:
- 1
-
allowed-shorthands:
- 1
- 2

# Inner Spacing
space-between-parens: 0

# Final Items
final-newline: 0

no-misspelled-properties:
- 1
-
'extra-properties':
- '-webkit-overflow-scrolling'
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: php

notifications:
email:
on_success: never
on_failure: change

php:
- 5.3
- 5.5

env:
- WP_VERSION=latest WP_MULTISITE=0

matrix:
include:
- php: 5.3
env: WP_VERSION=latest WP_MULTISITE=1

before_script:
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION

script: phpunit
18 changes: 18 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"generator-plugin-wp": {
"name": "WP Cloudflare Dashboard",
"homepage": "https://wplove.io",
"description": "A Cloudflare Analytics Dashboard for Wordpress.",
"version": "0.0.0",
"author": "Tyler Kemme",
"authoremail": "[email protected]",
"authorurl": "https://tylerkemme.com",
"license": "MIT",
"slug": "wp-cloudflare-dashboard",
"classname": "WP_Cloudflare_Dashboard",
"classprefix": "WPCD_",
"prefix": "wpcd",
"year": 2017,
"currentVersionWP": "4.7.2"
}
}
Loading

0 comments on commit 189d49a

Please sign in to comment.