Skip to content

Commit

Permalink
Merge (#311)
Browse files Browse the repository at this point in the history
* adding helper for media image
* small corrections on media, adding columns for webp and new helper check
* optimizations and fixing transparent png
* fixing tests
* finishing webP
  • Loading branch information
iruzevic authored Jul 12, 2022
1 parent 585e4dc commit 2152c14
Show file tree
Hide file tree
Showing 222 changed files with 10,953 additions and 5,583 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ latest_dump.tar.gz

# Editor settings
.vscode/settings.json
.vscode/launch.json
.idea/*
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [6.0.0] - 2022-07-11

### Removed
- Bin cli command.
- Ei-exclude cli command.
- Build cli command.

### Changed
- Updated packages.
- Updated tests.
- Refactored all cli commands for better usability and output.
- Most of the cli command names and prefixes.
- Internal way of moving blocks and files to the project to be faster.

### Added
- Descriptions for all cli commands with examples and links to repos.
- New service class for Geolocation.
- New service class for WebP and helpers.

## [5.1.0] - 2022-05-09

### Added:
Expand Down Expand Up @@ -327,6 +346,7 @@ Init setup

[Unreleased]: https://github.com/infinum/eightshift-libs/compare/main...HEAD

[6.0.0]: https://github.com/infinum/eightshift-libs/compare/5.1.0...v6.0.0
[5.1.0]: https://github.com/infinum/eightshift-libs/compare/5.0.2...v5.1.0
[5.0.2]: https://github.com/infinum/eightshift-libs/compare/5.0.1...v5.0.2
[5.0.1]: https://github.com/infinum/eightshift-libs/compare/5.0.0...v5.0.1
Expand Down
23 changes: 0 additions & 23 deletions bin/cli.php

This file was deleted.

68 changes: 68 additions & 0 deletions captainhook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
"options": {
"subjectLength": 50,
"bodyLineLength": 72
},
"conditions": []
}
]
},
"pre-push": {
"enabled": false,
"actions": []
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting",
"options": [],
"conditions": []
},
{
"action": "vendor/bin/pest",
"options": [],
"conditions": []
},
{
"action": "vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 7.4-",
"options": [],
"conditions": []
},
{
"action": "vendor/bin/phpstan analyze",
"options": [],
"conditions": []
}
]
},
"prepare-commit-msg": {
"enabled": false,
"actions": []
},
"post-commit": {
"enabled": false,
"actions": []
},
"post-merge": {
"enabled": false,
"actions": []
},
"post-checkout": {
"enabled": false,
"actions": []
},
"post-rewrite": {
"enabled": false,
"actions": []
},
"post-change": {
"enabled": false,
"actions": []
}
}
17 changes: 14 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
},
"require-dev": {
"brain/monkey": "^2.6",
"captainhook/captainhook": "^5.10",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"infinum/eightshift-coding-standards": "^1.5",
"infinum/eightshift-coding-standards": "^1.6",
"pestphp/pest": "^1.2",
"php-stubs/wordpress-stubs": "^5.9",
"phpunit/phpunit": "^9.5",
Expand All @@ -60,20 +61,30 @@
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"lock": false,
"sort-packages": true,
"optimize-autoloader": true,
"process-timeout": 2000,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"composer/installers": true
}
},
"scripts": {
"post-autoload-dump": [
"vendor/bin/captainhook install -f -s"
],
"analyze": "@php ./vendor/bin/phpstan analyze",
"standards:check": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 7.4-",
"standards:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --runtime-set testVersion 7.4-",
"test:unit": "@php ./vendor/bin/pest",
"test:unit-report": "@php ./vendor/bin/pest --log-junit tests/coverage/report.xml",
"test:coverage": "@php ./vendor/bin/pest --coverage"
"test:coverage": "@php ./vendor/bin/pest --coverage",
"check-all": [
"@standards:check",
"@analyze",
"@test:unit"
]
}
}
39 changes: 0 additions & 39 deletions package.json

This file was deleted.

18 changes: 18 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,22 @@
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
</rule>

<rule ref="Generic.Files.LineLength">
<exclude-pattern>*/src/**/*Cli.php</exclude-pattern>
<properties>
<property name="lineLimit" value="180" />
<property name="ignoreComments" value="true" />
</properties>
</rule>

<!-- Add additional extending CLI classes. -->
<rule ref="Eightshift.Commenting.FunctionComment">
<properties>
<property name="allowedExtendedClasses" type="array">
<element value="AbstractCli"/>
<element value="AbstractBlocksCli"/>
</property>
</properties>
</rule>
</ruleset>
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</testsuite>
</testsuites>
<php>
<env name="ES_TEST" value="true" force="true" />
</php>
<env name="ES_TEST" value="true" force="true" />
</php>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
Expand Down
41 changes: 28 additions & 13 deletions src/AdminMenus/AbstractAdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,37 @@ abstract class AbstractAdminMenu implements ServiceInterface, RenderableBlockInt
*/
public function register(): void
{
\add_action(
'admin_menu',
function () {
\add_menu_page(
$this->getTitle(),
$this->getMenuTitle(),
$this->getCapability(),
$this->getMenuSlug(),
[$this, 'processAdminMenu'],
$this->getIcon(),
$this->getPosition()
);
}
\add_action('admin_menu', [$this, 'callback'], $this->getPriorityOrder());
}

/**
* Return action callback method.
*
* @return void
*/
public function callback(): void
{
\add_menu_page(
$this->getTitle(),
$this->getMenuTitle(),
$this->getCapability(),
$this->getMenuSlug(),
[$this, 'processAdminMenu'],
$this->getIcon(),
$this->getPosition()
);
}

/**
* Return hook priority order.
*
* @return integer
*/
public function getPriorityOrder(): int
{
return 10;
}

/**
* Process the admin menu attributes and prepare rendering.
*
Expand Down
Loading

0 comments on commit 2152c14

Please sign in to comment.