Skip to content

Merge the "plugin boilerplate" branch containing WP VIP fixes and other things #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6166c15
working on boilerplate in subfolder
rclations Jun 22, 2017
3b95655
remove cmb2, rename options file/class
rclations Jun 22, 2017
27e5e28
wip on migrating options page
rclations Jun 22, 2017
cb1a869
finished options page conversion
rclations Jun 23, 2017
d7d1aac
migrate widget into new structure
rclations Jun 23, 2017
82d133b
re-run VIP code standards, fix whitespace
aschweigert Jul 10, 2017
94bf5cb
Merge pull request #47 from INN/fix-whitespace
rclations Jul 10, 2017
c0af412
remove spaces in size strings on save
aschweigert Jul 10, 2017
0e5d47a
fix broken callback
aschweigert Jul 10, 2017
f9cb6a7
fix invalid foreach warning when breakpoints are not yet defined
aschweigert Jul 10, 2017
a5f2c26
add some error conditions
aschweigert Jul 10, 2017
5c2c119
add settings link, closes #36
aschweigert Jul 10, 2017
d14d517
Merge pull request #50 from INN/36-add-settings-link
aschweigert Jul 11, 2017
912d8e8
Merge pull request #48 from INN/32-remove-spaces-on-save
aschweigert Jul 11, 2017
f099f05
merge plugin boilerplate
aschweigert Jul 12, 2017
ab2c6ef
remove debugging code
aschweigert Jul 12, 2017
98c6c87
do error handling more good
aschweigert Jul 12, 2017
3317929
Merge pull request #49 from INN/fix-options-save
aschweigert Jul 12, 2017
0756967
Implementing solution from #24
rclations Jul 12, 2017
b3f2961
little phpcs fixes
rclations Jul 12, 2017
5e6b6cc
add empty boilerplate include to migrate dfw-init.php into
rclations Jul 12, 2017
1003147
adding classes for breakpoint and ad slot
rclations Jul 12, 2017
22964a6
load the other files
aschweigert Jul 12, 2017
d0449d4
proper sanitization
aschweigert Jul 12, 2017
8e3e77f
put the ad slot class here
aschweigert Jul 12, 2017
905d978
put the ad-slot class here
aschweigert Jul 12, 2017
99f7ab7
ok this seems to work
aschweigert Jul 12, 2017
a714954
mostly working?
aschweigert Jul 12, 2017
e923a0a
fix most of the js stuff
aschweigert Jul 13, 2017
fc20eb4
actually load the js
aschweigert Jul 14, 2017
3f8ff8b
no abbreviation
aschweigert Jul 18, 2017
0edef92
use wp_json_encode here instead of esc_js
aschweigert Jul 19, 2017
1465789
prefix options + update function, closes #52
aschweigert Jul 19, 2017
48ebd3a
use filters for setting network_code and breakpoints from theme
aschweigert Jul 19, 2017
c1e268d
adding additional breakpoints when defined by the theme is a bad idea
aschweigert Jul 19, 2017
f453086
remove debugging code
aschweigert Jul 19, 2017
8b3981b
phpcs fixes
rclations Jul 19, 2017
e4de962
make widgets work
aschweigert Jul 20, 2017
41355dc
Merge branch 'plugin-boilerplate' of github.com:INN/DoubleClick-for-W…
aschweigert Jul 20, 2017
b39c12f
address VIP code review issues
aschweigert Jul 24, 2017
e5a2431
check for empty breakpoints array
rclations Jul 25, 2017
7b57574
bugfixes for network code check
rclations Jul 25, 2017
3098503
only disable inputs if filter is being used
rclations Jul 25, 2017
eb45126
updated message
rclations Jul 25, 2017
9e25f27
add option to not load default css, closes #54
aschweigert Jul 26, 2017
ea8e331
add support for out of page ad units
aschweigert Jul 31, 2017
d9cb07e
apply correct keywords to cat and tag archive pages, cleanup
aschweigert Aug 2, 2017
43f133f
Merge pull request #57 from INN/adjust-targeting
rclations Aug 3, 2017
4079568
Merge pull request #56 from INN/add-outofpage-support
aschweigert Aug 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "js/vendor"
}
"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']
}
}
171 changes: 171 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"globals": {
},

"env": {
"browser": true,
"commonjs": true,
"jquery": true
},

"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true
}
},

"rules": {
// Possible Errors
"comma-dangle": 2,
"no-cond-assign": 2,
"no-console": 1,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 1,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-jsdoc": 2,
"valid-typeof": 2,
"no-unexpected-multiline": 2,
// Best Practices
"accessor-pairs": 2,
"block-scoped-var": 2,
"complexity": 2,
"consistent-return": 2,
"curly": 2,
"default-case": 2,
"dot-notation": 2,
"dot-location": [2, "property"],
"eqeqeq": 2,
"guard-for-in": 2,
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-else-return": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": [2, { "exceptions": { "VariableDeclarator": true } }],
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-new": 2,
"no-octal-escape": 2,
"no-octal": 2,
"no-process-env": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-throw-literal": 2,
"no-unused-expressions": 2,
"no-useless-call": 2,
"no-useless-concat": 2,
"no-void": 2,
"no-warning-comments": 2,
"no-with": 2,
"radix": 2,
"vars-on-top": 2,
"wrap-iife": 2,
"yoda": [1, "always"],
// Strict Mode
"strict": 2,
// Variables
"no-catch-shadow": 2,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow-restricted-names": 2,
"no-shadow": 2,
"no-undef-init": 2,
"no-undef": 2,
"no-undefined": 2,
"no-unused-vars": 2,
"no-use-before-define": 2,
// Stylistic Issues
"array-bracket-spacing": [2, "always"],
"block-spacing": 2,
"brace-style": 2,
"camelcase": 2,
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"consistent-this": 2,
"eol-last": 2,
"func-style": 2,
"id-match": 2,
"indent": [2, "tab", {"SwitchCase": 1} ],
"key-spacing": [1, { "align": "value" }],
"lines-around-comment": [2, { "beforeBlockComment": true, "allowBlockStart": true , "allowObjectStart": true }],
"linebreak-style": 2,
"max-nested-callbacks": 2,
"new-cap": 2,
"new-parens": 2,
"newline-after-var": 2,
"no-array-constructor": 2,
"no-continue": 2,
"no-inline-comments": 2,
"no-lonely-if": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": 2,
"no-nested-ternary": 2,
"no-new-object": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-underscore-dangle": 2,
"no-unneeded-ternary": 2,
"object-curly-spacing": [2, "always"],
"one-var": 2,
"operator-assignment": 2,
"operator-linebreak": 2,
"padded-blocks": [2, "never"],
"quote-props": [2, "as-needed"],
"quotes": [2, "single"],
"semi-spacing": 2,
"semi": [2, "always"],
"keyword-spacing": 1,
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "always"],
"space-infix-ops": 2,
"space-unary-ops": [1, { "words": true, "nonwords": true }],
"spaced-comment": 2,
"wrap-regex": 2,
// Legacy
"max-depth": 2,
"max-len": [1, 100, 4],
"max-params": [2, 4],
"max-statements": 1,
"no-bitwise": 2,
"no-plusplus": 2
}
}
83 changes: 80 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
site/*
release/*
js/vendor/*
# Node/npm
node_modules/
npm-debug.log
.grunt
.sass-cache

# OSX
.DS_Store
.AppleDouble
.LSOverride
.Spotlight-V100
.Trashes
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Icon must end with two \r
Icon


# Thumbnails
._*


# Vim
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

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

# 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



# 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


# Other, add your own ignored things here.
.idea/
release
site
js/vendor
Loading