-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from LinkNacional/dev
2.0.1 Alteração em plugin para manter as normativas do wordpress
- Loading branch information
Showing
22 changed files
with
784 additions
and
874 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
- name: Make plugin root directory | ||
run: | | ||
mkdir ${{env.PLUGIN_NAME}} && | ||
cp -r ./admin ./includes ./languages ./public *.php *.txt composer.json composer.lock ./${{env.PLUGIN_NAME}}/ && | ||
cp -r ./Admin ./Includes ./languages ./Public *.php *.txt composer.json composer.lock ./${{env.PLUGIN_NAME}}/ && | ||
find ./${{env.PLUGIN_NAME}} -type f -exec chmod 0644 {} + && | ||
find ./${{env.PLUGIN_NAME}} -type d -exec chmod 0755 {} + && | ||
ls -lah | ||
|
@@ -50,7 +50,7 @@ jobs: | |
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: "1.0.0" # This tag will be updated by the action // TODO Update this value | ||
custom_tag: "2.0.1" # This tag will be updated by the action // TODO Update this value | ||
|
||
# Generate new release | ||
- name: Generate new Release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,5 +98,4 @@ | |
)) | ||
->setIndent(' ') | ||
->setLineEnding("\n") | ||
->setRiskyAllowed(true) | ||
; | ||
->setRiskyAllowed(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?php | ||
|
||
namespace Lkn\PGPFGForGivewp\Admin; | ||
namespace Pgpfg\PGPFGForGivewp\Admin; | ||
|
||
use Lkn\PGPFGForGivewp\Includes\PGPFGHelperClass; | ||
use Pgpfg\PGPFGForGivewp\Includes\PGPFGHelperClass; | ||
use WP_Error; | ||
|
||
/** | ||
|
@@ -25,8 +25,7 @@ | |
* @subpackage PGPFGForGivewp/admin | ||
* @author Link Nacional <[email protected]> | ||
*/ | ||
final class PGPFGForGivewpAdmin | ||
{ | ||
final class PGPFGForGivewpAdmin { | ||
/** | ||
* The ID of this plugin. | ||
* | ||
|
@@ -52,8 +51,7 @@ final class PGPFGForGivewpAdmin | |
* @param string $plugin_name The name of this plugin. | ||
* @param string $version The version of this plugin. | ||
*/ | ||
public function __construct($plugin_name, $version) | ||
{ | ||
public function __construct($plugin_name, $version) { | ||
$this->plugin_name = $plugin_name . '-admin'; | ||
$this->version = $version; | ||
} | ||
|
@@ -65,21 +63,20 @@ public function __construct($plugin_name, $version) | |
* | ||
* @return array | ||
*/ | ||
public function add_setting_into_new_section($settings) | ||
{ | ||
public function add_setting_into_new_section($settings) { | ||
switch (give_get_current_setting_section()) { | ||
case 'lkn-payment-pix': | ||
// Verifique se a configuração específica já está no array | ||
$exists = false; | ||
foreach ($settings as $setting) { | ||
if (isset($setting['id']) && $setting['id'] === 'lkn-payment-pix-type-setting') { | ||
if (isset($setting['id']) && 'lkn-payment-pix-type-setting' === $setting['id']) { | ||
$exists = true; | ||
break; | ||
} | ||
} | ||
|
||
// Adicione as configurações apenas se ainda não existirem | ||
if (!$exists) { | ||
if ( ! $exists) { | ||
$settings[] = array( | ||
'type' => 'title', | ||
'id' => 'lkn-payment-pix' | ||
|
@@ -170,8 +167,7 @@ public function add_setting_into_new_section($settings) | |
* | ||
* @return array | ||
*/ | ||
public function add_new_setting_section($sections) | ||
{ | ||
public function add_new_setting_section($sections) { | ||
// Separar palavras com travessão no atributo $sections | ||
$sections['lkn-payment-pix'] = __('Pix QR Code', 'payment-gateway-pix-for-givewp'); | ||
|
||
|
@@ -183,8 +179,7 @@ public function add_new_setting_section($sections) | |
* | ||
* @since 1.0.0 | ||
*/ | ||
public function enqueue_styles(): void | ||
{ | ||
public function enqueue_styles(): void { | ||
/** | ||
* This function is provided for demonstration purposes only. | ||
* | ||
|
@@ -204,8 +199,7 @@ public function enqueue_styles(): void | |
* | ||
* @since 1.0.0 | ||
*/ | ||
public function enqueue_scripts(): void | ||
{ | ||
public function enqueue_scripts(): void { | ||
/** | ||
* This function is provided for demonstration purposes only. | ||
* | ||
|
@@ -223,10 +217,10 @@ public function enqueue_scripts(): void | |
$logPath = give_get_option('pgpfg_for_givewp_last_log_url'); | ||
$wp_error = false; | ||
$remote = null; | ||
if ($logPath !== false) { | ||
if (false !== $logPath) { | ||
$remote = wp_remote_get($logPath); | ||
|
||
if(gettype($remote) === gettype(new WP_Error())) { | ||
if (gettype($remote) === gettype(new WP_Error())) { | ||
PGPFGHelperClass::log(wp_json_encode(array( | ||
'Remote Response' => $remote, | ||
'log url' => $logPath, | ||
|
@@ -235,18 +229,17 @@ public function enqueue_scripts(): void | |
|
||
$wp_error = $remote; | ||
} | ||
|
||
} | ||
$logContents = wp_remote_retrieve_body($remote); | ||
|
||
wp_localize_script( | ||
$this->plugin_name, | ||
'lknAttr', | ||
[ | ||
array( | ||
'logContents' => ($wp_error ? wp_json_encode(array( | ||
'Error' => 'Error retrieving log' | ||
), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) : $logContents) | ||
] | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.