Skip to content

Commit

Permalink
Merge pull request #1 from LinkNacional/dev
Browse files Browse the repository at this point in the history
6.9.3  Plugin refactor with Link Nacional plugin updater and customizations
  • Loading branch information
emanuellopess authored Aug 10, 2023
2 parents 3d0d3b6 + 6cad143 commit c1042d4
Show file tree
Hide file tree
Showing 245 changed files with 25,120 additions and 19,812 deletions.
102 changes: 102 additions & 0 deletions .devcontainer/devcontainer.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "PHP",
"image": "mcr.microsoft.com/vscode/devcontainers/php:7.4",
"features": {
// https://github.com/devcontainers/features/tree/main/src/node
"ghcr.io/devcontainers/features/node:1": {
"version": "18.14.0",
"nvmVersion": "0.39.3"
}
},
"postCreateCommand": "npm install;composer install",
"mounts": [
{
// path in your local machine where WordPress is.
"source": "/home/{yourusername}/projects/_wordpress",
"target": "/home/vscode/_wordpress",
"type": "bind"
}
],
"customizations": {
"vscode": {
"extensions": [
"junstyle.php-cs-fixer",
"neilbrayfield.php-docblocker",
"bmewburn.vscode-intelephense-client"
],
"settings": {
"php-cs-fixer.config": ".php-cs-fixer.php",
"files.eol": "\n",
"files.encoding": "utf8",
"php.suggest.basic": false,
"[smarty]": {
"editor.tabSize": 2
},
"[php]": {
"editor.indentSize": "tabSize",
"editor.detectIndentation": false,
"editor.defaultFormatter": "junstyle.php-cs-fixer",
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.rulers": [
120
]
},
"php-cs-fixer.formatHtml": true,
"php-cs-fixer.onsave": true,
"php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
"php.validate.enable": false,
"php-docblocker.useShortNames": true,
"php-docblocker.qualifyClassNames": true,
"php-docblocker.paramDescription": true,
"php-docblocker.returnGap": true,
"php-docblocker.alignParams": true,
"php-docblocker.alignReturn": true,
"php-docblocker.gap": true,
"php-docblocker.defaultType": "string",
"php-docblocker.classTemplate": {
"message": {},
"since": {
"content": "@since 1.0.0",
"gapAfter": true,
"gapBefore": true
},
"link": {
"content": "@link "
}
},
"php-docblocker.functionTemplate": {
"message": {
"gapAfter": true
},
"since": {
"content": "@since 1.0.0"
},
"param": {
"gapBefore": true,
"gapAfter": true
},
"return": {}
},
"php-docblocker.propertyTemplate": {
"message": {
"gapAfter": true
},
"since": {
"content": "@since 1.0.0"
},
"var": {
"content": "@var ${1:mixed}"
},
"access": {
"access": "@access "
},
"link": {
"content": "@link "
}
}
}
}
}
}
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Descreva o bug
Uma descrição clara e concisa do que é o bug.

## Informação do sistema
- PHP: [ex. 8.1]
- WooCommerce: [ex. 7.8.0]
- WordPress: [ex. 6.1]

## Passos para reproduzir
Etapas para reproduzir o comportamento:
1. Vá para '...'
2. Clique em '....'
3. Role para baixo até '....'
4. Ver erro

## Comportamento esperado
Uma descrição clara e concisa do que você esperava que acontecesse.

## Capturas de tela
Se aplicável, adicione capturas de tela para ajudar a explicar seu problema.

## Critérios de Aceitação

<!-- Defina as condições que devem ser verdadeiras para encerrar o problema. -->

- [ ] Algo acontece quando uma ação é executada.
- [ ] Algo não acontece quando uma ação é executada.
- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Sua solicitação de recurso está relacionada a um problema? Por favor descreva
Uma descrição clara e concisa de qual é o problema. Ex. Eu sempre fico frustrado quando [...]

## Descreva a solução que você gostaria
Uma descrição clara e concisa do que você quer que aconteça.

## Descreva as alternativas que você considerou
Uma descrição clara e concisa de quaisquer soluções ou recursos alternativos que você considerou.

## Critérios de Aceitação

<!-- Defina as condições que devem ser verdadeiras para encerrar o problema. -->

- [ ] Algo acontece quando uma ação é executada.
- [ ] Algo não acontece quando uma ação é executada.
- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Generate new release for plugin

on:
pull_request:
types: [ closed ]
branches: [ main ]

env:
PLUGIN_NAME: lkn-mercadopago-woocommerce

jobs:
release-build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3

# Add plugin files to a root directory
- name: Make plugin root directory
run: "mkdir $PLUGIN_NAME && mv -t ./$PLUGIN_NAME ./assets ./i18n ./includes ./packages ./templates *.php && ls -lah"

# Compact plugin as .zip
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
path: '${{ env.PLUGIN_NAME }}'
directory: '.'
filename: '${{ env.PLUGIN_NAME }}.zip'
exclusions: '*.git* /*node_modules/* .editorconfig'

# Update version tag
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: "6.9.3"

# Generate new release
- name: Generate new Release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.PLUGIN_NAME }}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
commit: "main"
draft: true
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
36 changes: 0 additions & 36 deletions .github/workflows/phpcs.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
node_modules
.DS_Store
.vscode
.vscode/settings.json
.idea
.idea/
/vendor/
woocommerce-mercadopago.zip
.devcontainer/devcontainer.json
89 changes: 89 additions & 0 deletions .vscode/.php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

return (new PhpCsFixer\Config())
->setRules(array(
'short_scalar_cast' => true,
'visibility_required' => true,
'elseif' => true,
'no_superfluous_elseif' => true,
'align_multiline_comment' => array('comment_type' => 'phpdocs_like'),
'array_syntax' => array('syntax' => 'long'),
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => false,
'braces' => array(
'position_after_functions_and_oop_constructs' => 'same',
),
'cast_spaces' => true,
'class_attributes_separation' => array(
'elements' => array(
'const' => 'one',
'method' => 'one',
'property' => 'only_if_meta',
),
),
'class_definition' => array('single_line' => true),
'class_keyword_remove' => true,
'concat_space' => array('spacing' => 'one'),
'control_structure_continuation_position' => true,
'dir_constant' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => true,
'include' => true,
'list_syntax' => array('syntax' => 'long'),
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_chaining_indentation' => true,
'native_constant_invocation' => true,
'native_function_casing' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_alternative_syntax' => array('fix_non_monolithic_code' => false),
'no_blank_lines_after_class_opening' => false,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_extra_blank_lines' => array(
'tokens' => array(
'continue',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
),
),
'no_spaces_around_offset' => array('positions' => array('outside')),
'no_spaces_inside_parenthesis' => false,
'not_operator_with_space' => true,
// 'not_operator_with_successor_space' => true,
'phpdoc_tag_casing' => true,
'phpdoc_types_order' => array(
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
),
'single_line_throw' => true,
'strict_param' => true,
'trim_array_spaces' => true,
// WPCS 3.0 proposal, yoda style is optional
'yoda_style' => array(
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'always_move_variable' => true,
),
'modernize_types_casting' => true,
'void_return' => true,
'logical_operators' => true,
'array_indentation' => true,
'whitespace_after_comma_in_array' => array(
'ensure_single_space' => true,
),
'method_argument_space' => array(
'keep_multiple_spaces_after_comma' => false,
'on_multiline' => 'ensure_fully_multiline',
),
))
->setIndent(' ')
->setLineEnding("\n")
->setRiskyAllowed(true);
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"mehedidracula.php-namespace-resolver",
"eamodio.gitlens",
"vivaxy.vscode-conventional-commits",
"ms-vscode-remote.remote-containers",
"yzhang.markdown-all-in-one",
"standard.vscode-standard"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"intelephense.environment.phpVersion": "8.1",
// For autocomplete
"intelephense.environment.includePaths": [
"/home/vscode/_wordpress" // This path is a bind mount that comes from devcontainer.json.
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.9.3] - 2023-08-10
### Fixed
- Updated the link to obtain credentials on the developer site
- Resolved warning related to the missing return type of the function AbstractCollection::getIterator()
### Changed
- Improved default activation of Credits Gateway
- Removed sending of product details to Payment Gateway

## [6.9.2] - 2023-06-23
### Fixed
- Fixed bug that was causing the admin panel to become unresponsive or inaccessible
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<p align="center"><a href="https://www.mercadopago.com/"> <img src="https://http2.mlstatic.com/frontend-assets/ui-navigation/5.18.3/mercadopago/logo__large@2x.png" height="80" width="auto" alt="MercadoPago">
<p align="center"><a href="https://www.linknacional.com/"><img src="https://api.linknacional.com.br/assets/banner-1544x500.png" height="250" width="auto" alt="Link Nacional">
</a></p>

<p align="center">
<img src="https://img.shields.io/wordpress/plugin/v/woocommerce-mercadopago" alt="version">
<img src="https://img.shields.io/wordpress/plugin/dt/woocommerce-mercadopago" alt="download">
<img src="https://img.shields.io/github/license/mercadopago/cart-woocommerce" alt="license">
</p>
# This is a unnoficial plugin mantained by Link Nacional

The Mercado Pago payments for WooCommerce plugin allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.
The Link Nacional Mercado Pago payments for WooCommerce plugin allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.

<br/>

Expand Down
Loading

0 comments on commit c1042d4

Please sign in to comment.