Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .distignore

This file was deleted.

11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore everything.
/* export-ignore

# Export white-listed production code only.
/src -export-ignore
/composer.json -export-ignore
/LICENSE -export-ignore
/README.md -export-ignore
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ vendor/
*.txt
*.log
composer.lock

### Codeception ###
/codeception.yml
/tests/*.suite.yml
/tests/_output/*
/tests/_support/_generated/

### PhpStorm ###
/.idea/
43 changes: 43 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
preset: recommended

finder:
exclude:
- "lib"

disabled:
- align_double_arrow
- concat_without_spaces
- new_with_braces
- no_blank_lines_after_phpdoc
- no_spaces_inside_offset
- phpdoc_no_package
- phpdoc_summary
- simplified_null_return
- trim_array_spaces

enabled:
- concat_with_spaces
- declare_strict_types
- dir_constant
- is_null
- linebreak_after_opening_tag
- modernize_types_casting
- no_empty_comment
- no_php4_constructor
- no_short_echo_tag
- no_useless_else
- not_operator_with_successor_space
- php_unit_construct
- php_unit_dedicate_assert
- phpdoc_link_to_see
- phpdoc_property
- phpdoc_return_self_reference
- pow_to_exponentiation
- random_api_migration
- return_type_declaration
- semicolon_after_instruction
- single_line_class_definition
- strict_comparison
- strict_param
- ternary_to_null_coalescing
- unalign_double_arrow
49 changes: 23 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
sudo: false
dist: trusty

language: php

branches:
only:
- master
- /^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/

cache:
directories:
- $HOME/.composer/cache/files

notifications:
email:
on_success: never
on_failure: change

branches:
only:
- master

cache:
directories:
- $HOME/.composer/cache

php:
- 7.1
- 7.2
- nightly

env:
global:
- COMPOSER_NO_INTERACTION=1
- PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH"
- WP_CLI_BIN_DIR="$TRAVIS_BUILD_DIR/vendor/bin"

matrix:
include:
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=3.7.11
- php: 5.6
env: WP_VERSION=trunk
- php: 5.3
dist: precise
env: WP_VERSION=latest
allow_failures:
- php: nightly
fast_finish: true

before_install:
- |
Expand All @@ -49,8 +43,11 @@ before_install:
fi

install:
- composer require wp-cli/wp-cli:dev-master
- composer install
- travis_retry composer install --prefer-dist --no-suggest

before_script:
- composer validate

script:
- composer test
- composer check-style
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 The contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ typisttech/image-optimize-command

Easily optimize images using WP CLI

[![Build Status](https://travis-ci.org/typisttech/image-optimize-command.svg?branch=master)](https://travis-ci.org/typisttech/image-optimize-command)
[![Latest Stable Version](https://poser.pugx.org/typisttech/image-optimize-command/v/stable)](https://packagist.org/packages/typisttech/image-optimize-command)
[![Total Downloads](https://poser.pugx.org/typisttech/image-optimize-command/downloads)](https://packagist.org/packages/typisttech/image-optimize-command)
[![Build Status](https://travis-ci.org/TypistTech/image-optimize-command.svg?branch=master)](https://travis-ci.org/TypistTech/image-optimize-command)
[![PHP Versions Tested](http://php-eye.com/badge/typisttech/image-optimize-command/tested.svg)](https://travis-ci.org/TypistTech/image-optimize-command)
[![StyleCI](https://styleci.io/repos/119003751/shield?branch=master)](https://styleci.io/repos/119003751)
[![Dependency Status](https://gemnasium.com/badges/github.com/TypistTech/image-optimize-command.svg)](https://gemnasium.com/github.com/TypistTech/image-optimize-command)
[![License](https://poser.pugx.org/typisttech/image-optimize-command/license)](https://packagist.org/packages/typisttech/image-optimize-command)
[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://typist.tech/donate/image-optimize-command/)
[![Hire Typist Tech](https://img.shields.io/badge/Hire-Typist%20Tech-ff69b4.svg)](https://typist.tech/contact/)


Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)

## Using

Expand All @@ -17,7 +25,7 @@ Installing this package requires WP-CLI v1.4.1 or greater. Update to the latest

Once you've done so, you can install this package with:

wp package install git@github.com:typisttech/image-optimize-command.git
wp package install https://github.com/TypistTech/image-optimize-command.git

## Contributing

Expand All @@ -40,10 +48,3 @@ Once you’ve done a bit of searching and discovered there isn’t an open or fi
Want to contribute a new feature? Please first [open a new issue](https://github.com/typisttech/image-optimize-command/issues/new) to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.

## Support

Github issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support


*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*
11 changes: 11 additions & 0 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace: TypistTech\ImageOptimizeCommand
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
actor_suffix: Tester
extensions:
enabled:
- Codeception\Extension\RunFailed
23 changes: 12 additions & 11 deletions command.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

if ( ! class_exists( 'WP_CLI' ) ) {
return;
declare(strict_types=1);

namespace TypistTech\ImageOptimizeCommand;

if (! class_exists('WP_CLI')) {
return;
}

$autoload = __DIR__ . '/vendor/autoload.php';
if (file_exists($autoload)) {
require_once $autoload;
}

/**
* Says "Hello World" to new users
*
* @when before_wp_load
*/
$hello_world_command = function() {
WP_CLI::success( "Hello world." );
};
WP_CLI::add_command( 'hello-world', $hello_world_command );
WP_CLI::add_command('image-optimize', __NAMESPACE__ . '\ImageOptimizeCommand');
75 changes: 62 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,67 @@
{
"name": "typisttech/image-optimize-command",
"description": "Easily optimize images using WP CLI",
"type": "wp-cli-package",
"homepage": "https://github.com/typisttech/image-optimize-command",
"license": "MIT",
"authors": [],
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"files": [ "command.php" ]
"name": "typisttech/image-optimize-command",
"description": "Easily optimize images using WP CLI",
"keywords": [
"wordpress",
"wp",
"wp-cli",
"image-optimizer"
],
"type": "wp-cli-package",
"homepage": "https://typist.tech/projects/image-optimize-command",
"license": "MIT",
"authors": [{
"name": "Typist Tech",
"email": "image-optimize-command@typist.tech",
"homepage": "https://typist.tech/"
},
"require": {
"wp-cli/wp-cli": "^1.4.1"
{
"name": "Tang Rufus",
"email": "tangrufus@gmail.com",
"homepage": "https://typist.tech/",
"role": "Developer"
}
],
"support": {
"email": "image-optimize-command@typist.tech",
"issues": "https://github.com/TypistTech/image-optimize-command/issues",
"source": "https://github.com/TypistTech/image-optimize-command"
},
"require": {
"php": "^7.1",
"wp-cli/wp-cli": "^1.4.1"
},
"require-dev": {
"codeception/base": "^2.3",
"neronmoon/scriptsdev": "^0.1.1",
"wp-coding-standards/wpcs": "^0.14.0"
},
"autoload": {
"files": [ "command.php" ],
"psr-4": {
"TypistTech\\ImageOptimizeCommand\\": "src/"
}
},
"scripts": {
"pre-tag": [
"composer update --no-suggest",
"yarn doctoc README.md",
"github_changelog_generator --no-verbose"
],
"check-style": "phpcs --standard=ruleset.xml --colors -p -s",
"fix-style": "phpcbf --standard=ruleset.xml -p --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1",
"test": "codecept run"
},
"config": {
"sort-packages": true
},
"extra": {
"imposter": {
"namespace": "TypistTech\\Sunny\\Vendor"
},
"require-dev": {
"scripts-dev": {
"post-install-cmd": "phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"post-update-cmd": "phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs"
}
}
}
Loading