Skip to content

Commit

Permalink
Merge branch 'develop' into postMessage-refactor
Browse files Browse the repository at this point in the history
* develop: (73 commits)
  fixes #1730
  fixes #1830
  GDPR: Load webfont-loader locally
  Update fonts
  fixes #1834
  Apply WordPress Coding Standards
  Update kirki-helper-class.md
  see #1797
  cleanup unused vars
  See #1807
  Additional fix for #1809
  fixes #1828
  fixes #1808
  fix #1814
  fix #1797
  fixes #1809
  Update sortable.md
  fixes #1787
  update webfonts & grunt
  changelog
  ...

# Conflicts:
#	modules/postmessage/class-kirki-modules-postmessage.php
  • Loading branch information
aristath committed Mar 17, 2018
2 parents 1442601 + 5b04091 commit f0182ea
Show file tree
Hide file tree
Showing 107 changed files with 4,422 additions and 1,302 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "wordpress",
"parserOptions": { "ecmaVersion": 6 },
"rules": {
"space-in-parens": ["error", "always"],
"camelcase": ["error", { "properties": "never" }]
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ _site
#######
.svn
svn

# PHPUNIT #
###########
build/logs
34 changes: 15 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ notifications:

php:
- 7.0
- 5.6

before_install:
- pip install --user codecov
Expand All @@ -20,24 +19,19 @@ before_script:
- composer install --dev
# After CodeSniffer install you should refresh your path.
- phpenv rehash
# Install JSCS: JavaScript Code Style checker.
# @link http://jscs.info/
- npm install -g jscs
# Install JSHint, a JavaScript Code Quality Tool.
# @link http://jshint.com/docs/
- npm install -g jshint
# Install ESLint.
- npm install -g eslint
- npm install -g eslint-config-wordpress

script:
- mkdir -p build/logs
# - phpunit # --coverage-clover=coverage.clover
- phpunit --coverage-clover=coverage.clover
# Search for PHP syntax errors.
# - find . \( -name '*kirki*.php' \) -exec php -lf {} \;
# - ./vendor/bin/phpunit --coverage-clover ./tests/logs/clover.xml
# Run the plugin through JSHint.
- jshint ./controls/js/src/*.js
- jshint ./modules/**/*.js
# Run the plugin through JavaScript Code Style checker.
- jscs ./controls/js/src/*.js
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
# Run the plugin through ESLint.
- eslint ./controls/js/src/*.js
- eslint ./modules/**/*.js
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
Expand All @@ -53,11 +47,13 @@ script:
- vendor/bin/phpcs -p -s -v -n ./**/**/**/*.php --standard=./phpcs.ruleset.xml --extensions=php

after_script:
# - php vendor/bin/coveralls
- php vendor/bin/coveralls
- wget https://scrutinizer-ci.com/ocular.phar
# - php ocular.phar code-coverage:upload --format=php-clover coverage.clove
- php ocular.phar code-coverage:upload --format=php-clover coverage.clove
- php vendor/bin/codacycoverage clover ./build/logs/clover.xml

after_success:
# - coveralls
# - codecov
# - bash <(curl -s https://codecov.io/bash)
- travis_retry php vendor/bin/php-coveralls
- coveralls
- codecov
- bash <(curl -s https://codecov.io/bash)
56 changes: 28 additions & 28 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
/* global module */
module.exports = function( grunt ) {

grunt.initConfig({
grunt.initConfig( {

// Get json file from the google-fonts API
curl: {
http: {
'google-fonts-alpha': {
src: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs',
options: { url: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs' },
dest: 'modules/webfonts/webfonts-alpha.json'
},
'google-fonts-popularity': {
src: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs',
options: { url: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs' },
dest: 'modules/webfonts/webfonts-popularity.json'
},
'google-fonts-trending': {
src: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=trending&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs',
options: { url: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=trending&key=AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs' },
dest: 'modules/webfonts/webfonts-trending.json'
}
// 'jshintrc': {
// src: 'https://develop.svn.wordpress.org/trunk/.jshintrc',
// dest: '.jshintrc'
// }
},

// Compile CSS
Expand Down Expand Up @@ -68,15 +64,15 @@ module.exports = function( grunt ) {
'controls/scss/*.scss',
'modules/**/*.scss'
],
tasks: ['sass']
tasks: [ 'sass' ]
},
scripts: {
files: [
'Gruntfile.js',
'controls/js/src/*.js',
'modules/**/*.js'
],
tasks: ['concat', 'uglify']
tasks: [ 'concat', 'uglify' ]
}
},

Expand Down Expand Up @@ -125,44 +121,45 @@ module.exports = function( grunt ) {
dev: {
options: {
mangle: {
reserved: ['jQuery', 'wp', '_']
reserved: [ 'jQuery', 'wp', '_' ]
}
},
files: [{
files: [ {
expand: true,
src: ['controls/js/*.js', '!controls/js/*.min.js'],
src: [ 'controls/js/*.js', '!controls/js/*.min.js' ],
dest: '.',
cwd: '.',
rename: function( dst, src ) {
return dst + '/' + src.replace( '.js', '.min.js' );
}
}]
} ]
}
}
});
} );

grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-curl' );
grunt.loadNpmTasks( 'grunt-http' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.loadNpmTasks( 'grunt-jscs' );

grunt.registerTask( 'dev', ['sass', 'jscs', 'watch'] );
grunt.registerTask( 'dev', [ 'sass', 'jscs', 'watch' ] );
grunt.registerTask( 'googlefontsProcess', function() {
var alphaFonts,
popularityFonts,
trendingFonts,
finalObject = {
popularityFonts,
trendingFonts,
finalObject = {
items: {},
order: {
popularity: [],
trending: []
}
},
finalJSON,
i;
},
finalJSON,
i,
fontNames = [];

// Get file contents.
alphaFonts = grunt.file.readJSON( 'modules/webfonts/webfonts-alpha.json' );
Expand All @@ -175,6 +172,7 @@ module.exports = function( grunt ) {
family: alphaFonts.items[ i ].family,
category: alphaFonts.items[ i ].category,
variants: alphaFonts.items[ i ].variants.sort()

/* Deprecated
subsets: alphaFonts.items[ i ].subsets.sort(),
files: alphaFonts.items[ i ].files
Expand All @@ -185,6 +183,7 @@ module.exports = function( grunt ) {
// Add the popularity order.
for ( i = 0; i < popularityFonts.items.length; i++ ) {
finalObject.order.popularity.push( popularityFonts.items[ i ].family );
fontNames.push( popularityFonts.items[ i ].family );
}

// Add the rrending order.
Expand All @@ -195,17 +194,18 @@ module.exports = function( grunt ) {
// Write the final object to json.
finalJSON = JSON.stringify( finalObject );
grunt.file.write( 'modules/webfonts/webfonts.json', finalJSON );
grunt.file.write( 'modules/webfonts/webfont-names.json', JSON.stringify( fontNames ) );

// Delete files no longer needed.
grunt.file.delete( 'modules/webfonts/webfonts-alpha.json' ); // jshint ignore:line
grunt.file.delete( 'modules/webfonts/webfonts-popularity.json' ); // jshint ignore:line
grunt.file.delete( 'modules/webfonts/webfonts-trending.json' ); // jshint ignore:line
} );
grunt.registerTask( 'googlefonts', function() {
grunt.task.run( 'curl' );
grunt.task.run( 'http' );
grunt.task.run( 'googlefontsProcess' );
} );
grunt.registerTask( 'default', ['sass:dist', 'concat', 'uglify'] );
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
grunt.registerTask( 'all', ['default', 'googlefonts', 'wp_readme_to_markdown'] );
grunt.registerTask( 'default', [ 'sass:dist', 'concat', 'uglify' ] );
grunt.registerTask( 'readme', [ 'wp_readme_to_markdown' ] );
grunt.registerTask( 'all', [ 'default', 'googlefonts', 'wp_readme_to_markdown' ] );
};
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Donate link:** https://aristath.github.io/donate
**Requires at least:** 4.9
**Tested up to:** 4.9.2
**Stable tag:** 3.0.22
**Stable tag:** 3.0.25
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -19,7 +19,7 @@ Using Kirki theme developers can create rich experiences for the WordPress Custo

Included are more than 30 custom control types ranging from simple sliders to complex typography controls with Google-Fonts integration, automatic CSS generation, `postMessage` scripts automatically generated, tooltips and a lot of extras that make developing themes a lot faster for developers and meaningful for users.

We advise you to familiarize yourself with the Customizer API before you start writing your theme using Kirki. An excellent handbook for the WordPress Customizer can be found on the [developer.wordpress.org](https://developer.wordpress.org/themes/customize-api/) website.
We advise you to familiarise yourself with the Customizer API before you start writing your theme using Kirki. An excellent handbook for the WordPress Customizer can be found on the [developer.wordpress.org](https://developer.wordpress.org/themes/customize-api/) website.

You can find detailed documentation on how to use Kirki on [https://aristath.github.io/kirki/](https://aristath.github.io/kirki/)

Expand All @@ -33,8 +33,43 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct

## Changelog ##

### 3.0.26

* Fix: Color Palette: material colors 'light-blue' doesn't work [#1783](https://github.com/aristath/kirki/issues/1783).
* Fix: Google Fonts switch error [#1791](https://github.com/aristath/kirki/issues/1791).
* Fix: FontAwesome JS is being loaded even if you don't need it on front end [#1786](https://github.com/aristath/kirki/issues/1786).
* Fix: Color Palette: Active color before section title [#1782](https://github.com/aristath/kirki/issues/1782).
* Fix: Removed version from the webfont script.
* Fix: Validation error for dimension fields.
* Fix: `button_label` argument for repeater fields (props @felipeelia).
* Fix: Allow html on radio-buttonset choices [#1818](https://github.com/aristath/kirki/issues/1818).
* Fix: `Kirki_Helper::compare_values` vs. `field-dependencies.js` boolean issue (props @CaptJiggly) [#1825](https://github.com/aristath/kirki/issues/1825).
* Fix: `active_callback` not working for checkboxes [#1809](https://github.com/aristath/kirki/issues/1809).
* Fix: Nested `active_callback` args not working properly (AND|OR relations) [#1809](https://github.com/aristath/kirki/issues/1809).
* Fix: Updated google-fonts.
* Fix: Display typography with no default values [#1797](https://github.com/aristath/kirki/issues/1797).
* Fix: Define "normal" as a valid css-value for sanitizations [#1814](https://github.com/aristath/kirki/issues/1814).
* Fix: `background` controls now output `background-color` as simply `background` if no `background-image` is defined in the value [#1808](https://github.com/aristath/kirki/issues/1808).
* New: Migrated `number` control to new structure.
###
### 3.0.25 ###

January 23 2018, dev time: 1 hour.

Please note that the typography controls since v3.0.23 no longer require subsets. This is not a bug or omission, subsets are simply no longer necessary because there's an implementation now that loads them properly without requiring the user to define it.

* Fix: partial reversion of webfontloader improvements in order to resolve an issue with incorect font-weights loading.

### 3.0.24 ###

January 23 2018, dev time: 10 minutes.

* Fix: Added back the `get_google_font_subsets()` method. Although it was always meant just to be used internally apparently a couple of themes out there use it and its removal caused a fatal error.

### 3.0.23 ###

January 22 2018, dev time: 23 hours.

* Fix: clear button on color controls [#1720](https://github.com/aristath/kirki/issues/1720)
* Fix: PHP mode in code controls.
* Fix: `active_callback` not working for upload fields [#1732](https://github.com/aristath/kirki/issues/1732)
Expand All @@ -46,6 +81,8 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct
* Fix: `active_callback` support when using serialized options [#1745](https://github.com/aristath/kirki/issues/1745)
* Fix: Remove timepicker from date control [#1750](https://github.com/aristath/kirki/issues/1750)
* Fix: WebfontLoader improvements.
* Fix: Now using a datepicker for the `date` control [#1767](https://github.com/aristath/kirki/issues/1767)
* New: Added "inherit" in the typography control's font-family option [w.org ticket](https://wordpress.org/support/topic/inherit-and-typography-control/)
* New: Added googlefonts resource hints. Props @aryaprakasa.
* New: Now loading fontawesome from a CDN. smaller footprint for the plugin and async loading will improve performance for everyone [#1763](https://github.com/aristath/kirki/issues/1763)
* Tweak: Removed legacy code.
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ rm .gitignore
rm .jscsrc
rm .jshintignore
rm .jshintrc
rm .jhintrc
rm .simplecov
rm .travis.yml
rm CODE_OF_CONDUCT.md
Expand All @@ -50,6 +51,7 @@ rm Gruntfile.js
rm package.json
rm phpcs.ruleset.xml
rm phpunit.xml
rm phpunit.xml.dist
rm README.md
rm *.sh
rm package-lock.json
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
"files": ["kirki.php"]
},
"require": {
"php": ">=5.2"
"php": ">=5.2",
"php-coveralls/php-coveralls": "^2.0",
"phpunit/phpunit": "*"
},
"require-dev": {
"composer/installers": "*",
"phpunit/phpunit": "*",
"dealerdirect/phpcodesniffer-composer-installer": "*",
"wimg/php-compatibility": "*",
"wp-coding-standards/wpcs": "*"
"wp-coding-standards/wpcs": "*",
"codacy/coverage": "dev-master"
}
}
1 change: 1 addition & 0 deletions controls/class-kirki-controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Kirki_Controls {
'code',
'color',
'generic',
'number',
'radio',
'select',
'textarea',
Expand Down
4 changes: 3 additions & 1 deletion controls/css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0182ea

Please sign in to comment.