Skip to content

Commit

Permalink
Merge pull request #282 from envato/dtbaker/2023-jan-updates
Browse files Browse the repository at this point in the history
2023-01 Maintenance
  • Loading branch information
dtbaker authored Jan 17, 2023
2 parents 55d7d70 + 5a60d80 commit c344ee0
Show file tree
Hide file tree
Showing 30 changed files with 3,263 additions and 4,248 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml

This file was deleted.

Empty file removed .david-dev
Empty file.
3 changes: 0 additions & 3 deletions .dev-lib

This file was deleted.

19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
env: {
browser: true,
es6: true
},
overrides: [
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
"indent": [2, "tab"],
"no-tabs": 0
},
globals: {
"jQuery": "readonly",
"wp": "readonly"
}
}
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

9 changes: 0 additions & 9 deletions .jscsrc

This file was deleted.

3 changes: 0 additions & 3 deletions .jshintignore

This file was deleted.

26 changes: 0 additions & 26 deletions .jshintrc

This file was deleted.

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

50 changes: 14 additions & 36 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* jshint node:true */
var sass = require('node-sass');

module.exports = function( grunt ) {
Expand All @@ -8,12 +7,9 @@ module.exports = function( grunt ) {

pkg: grunt.file.readJSON( 'package.json' ),

// JavaScript linting with JSHint.
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
// JavaScript linting with eslint.
eslint: {
target: [
'Gruntfile.js',
'js/*.js',
'!js/*.min.js'
Expand Down Expand Up @@ -43,7 +39,6 @@ module.exports = function( grunt ) {
sass: {
options: {
implementation: sass,
require: 'susy',
sourcemap: 'none',
includePaths: require( 'node-bourbon' ).includePaths
},
Expand Down Expand Up @@ -177,7 +172,6 @@ module.exports = function( grunt ) {
'!CodeSniffer.conf',
'!phpc*',
'!api-test/**',
'!dev-lib/**',
'!dist/**',
'!docs/**',
'!Gruntfile.js',
Expand Down Expand Up @@ -239,30 +233,24 @@ module.exports = function( grunt ) {
stdout: true,
stderr: true
},
readme: {
command: 'cd ./dev-lib && ./generate-markdown-readme' // Generate the readme.md
},
phpunit: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit"'
},
phpunit_c: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit --coverage-html <%= vvv.coverage %>"'
},
phpcs: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcs"'
},
phpcbf: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcbf"'
},
precommit: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && DEV_LIB_SKIP="xmllint" ./dev-lib/pre-commit"'
}
phpcs: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcs"'
},
phpcbf: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcbf"'
}
}

});

// Load tasks
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-sass' );
grunt.loadNpmTasks( 'grunt-rtlcss' );
Expand All @@ -277,7 +265,7 @@ module.exports = function( grunt ) {

// Register tasks
grunt.registerTask( 'default', [
'jshint',
'eslint',
'css',
'uglify'
] );
Expand All @@ -288,10 +276,6 @@ module.exports = function( grunt ) {
'cssmin'
] );

grunt.registerTask( 'readme', [
'shell:readme'
] );

grunt.registerTask( 'phpunit', [
'shell:phpunit'
] );
Expand All @@ -308,22 +292,16 @@ module.exports = function( grunt ) {
'shell:phpcbf'
] );

grunt.registerTask( 'precommit', [
'shell:precommit'
] );

grunt.registerTask( 'dev', [
'default',
'makepot',
'readme',
'phpunit'
] );

grunt.registerTask( 'deploy', [
'default',
'makepot',
'readme',
// 'phpunit'
'default',
'makepot',
// 'phpunit'
'copy',
'compress',
'clean'
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"php": ">=5.4.0"
},
"require-dev": {
"satooshi/php-coveralls": "^1.1"
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7"
}
}
6 changes: 2 additions & 4 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ We're really excited that you are interested in contributing to the Envato Marke
To lint:

``` bash
$ grunt jshint
$ grunt eslint
```

To compile Sass:
Expand All @@ -101,7 +101,7 @@ To create a pot file:
$ grunt makepot
```

The default task (simply running `grunt`) will do the following: `jshint -> css -> uglify`.
The default task (simply running `grunt`) will do the following: `eslint -> css -> uglify`.

## PHPUnit Testing

Expand All @@ -118,5 +118,3 @@ $ phpunit --coverage-html /tmp/report
```

To run the Envato API integration unit tests, you will need to create a `.token` file in the root of the plugin directory with your OAuth Personal Token saved to it. The `.token` file is added to `.gitignore` so it will not be tracked, and you should never try to commit it to the repository.

Travis CI will run the unit tests and perform sniffs against the WordPress Coding Standards whenever you push changes to your PR. Tests are required to pass successfully for a merge to be considered.
1 change: 0 additions & 1 deletion dev-lib
Submodule dev-lib deleted from 223f23
3 changes: 0 additions & 3 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ npm-debug.log
# API Token
.token

# Build tools
/dev-lib/

# Composer
composer.lock
/vendor/
Binary file modified docs/dist/envato-market.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/dist/update-check.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Envato Market",
"slug": "envato-market",
"version": "2.0.7",
"version": "2.0.8",
"author": "<a href=\"https://envato.com/market-plugin/\">Envato</a>",
"author_profile": "https://envato.com/market-plugin/",
"contributors": {
Expand All @@ -12,7 +12,7 @@
}
},
"requires": "5.1",
"tested": "5.9",
"tested": "6.1",
"compatibility": {},
"rating": 0,
"num_ratings": "0",
Expand All @@ -23,7 +23,7 @@
"homepage": "https://envato.com/market-plugin/",
"sections": {
"description": "WordPress Theme & Plugin management for the Envato Market.",
"changelog": "<h4>v2.0.7</h4><ul><li>Fix global notice hidden bug</li></ul><h4>v2.0.6</h4><ul><li>Add health check information to help diagnose common plugin issues</li></ul><h4>v2.0.5</h4><ul><li>Fix javascript compatibility with broken jQuery in 3rd party themes/plugins</li></ul>"
"changelog": "<h4>v2.0.8</h4><ul><li>Ensure compatibility with 6.1</li><li>Fix blank page bug when items had no reviews</li></ul><h4>v2.0.7</h4><ul><li>Fix global notice hidden bug</li></ul><h4>v2.0.6</h4><ul><li>Add health check information to help diagnose common plugin issues</li></ul><h4>v2.0.5</h4><ul><li>Fix javascript compatibility with broken jQuery in 3rd party themes/plugins</li></ul>"
},
"short_description": "WordPress Theme & Plugin management for the Envato Market.",
"download_link": "http://envato.github.io/wp-envato-market/dist/envato-market.zip",
Expand Down
6 changes: 3 additions & 3 deletions envato-market.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Plugin Name: Envato Market
* Plugin URI: https://envato.com/market-plugin/
* Description: WordPress Theme & Plugin management for the Envato Market.
* Version: 2.0.7
* Version: 2.0.8
* Author: Envato
* Author URI: https://envato.com
* Requires at least: 5.1
* Tested up to: 5.9
* Tested up to: 6.1
* Requires PHP: 7.0
* Text Domain: envato-market
* Domain Path: /languages/
Expand All @@ -21,7 +21,7 @@


/* Set plugin version constant. */
define( 'ENVATO_MARKET_VERSION', '2.0.7' );
define( 'ENVATO_MARKET_VERSION', '2.0.8' );

/* Debug output control. */
define( 'ENVATO_MARKET_DEBUG_OUTPUT', 0 );
Expand Down
8 changes: 5 additions & 3 deletions inc/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ function envato_market_themes_column( $group = 'install' ) {
<div class="column-rating">
<?php
if ( ! empty( $theme['rating'] ) ) {
if ( is_array( $theme['rating'] ) && ! empty( $theme['rating']['count'] ) ) {
if ( is_array( $theme['rating'] ) ) {
$count = ! empty( $theme['rating']['count'] ) ? $theme['rating']['count'] : 0;
$rating = ! empty( $theme['rating']['rating'] ) ? (int) $theme['rating']['rating'] : 0;
wp_star_rating(
array(
'rating' => $theme['rating']['count'] > 0 ? ( $theme['rating']['rating'] / 5 * 100 ) : 0,
'rating' => $count > 0 ? ( $rating / 5 * 100 ) : 0,
'type' => 'percent',
'number' => $theme['rating']['count'],
'number' => $count,
)
);
} else {
Expand Down
Loading

0 comments on commit c344ee0

Please sign in to comment.