Skip to content

Commit

Permalink
Merge pull request #36 from jakobbouchard/develop
Browse files Browse the repository at this point in the history
Release v2.3.0
  • Loading branch information
jakobbouchard authored Jun 24, 2024
2 parents 3c5ae50 + 303a14a commit 30f38ee
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 88 deletions.
11 changes: 6 additions & 5 deletions hestia-nginx-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @wordpress-plugin
* Plugin Name: Hestia Nginx Cache
* Description: Hestia Nginx Cache Integration for WordPress. Auto-purges the Nginx cache when needed.
* Plugin URI: https://github.com/jakobbouchard/hestia-nginx-cache
* Version: 2.2.5
* Plugin URI: https://github.com/jakobbouchard/hestia-nginx-cache
* Version: 2.3.0
* Requires at least: 4.8
* Requires PHP: 5.4
* Author: Jakob Bouchard
Expand All @@ -28,7 +28,7 @@
class Hestia_Nginx_Cache
{
public const NAME = 'hestia-nginx-cache';
public const VERSION = '2.2.4';
public const VERSION = '2.3.0';

private static $instance = null;
public static $plugin_basename = null;
Expand All @@ -52,13 +52,11 @@ class Hestia_Nginx_Cache
'attachment_updated',
'publish_phone',
'clean_post_cache',
'pingback_post',
'comment_post',
'edit_comment',
'delete_comment',
'wp_insert_comment',
'wp_set_comment_status',
'trackback_post',
'transition_post_status',
'transition_comment_status',
'wp_update_nav_menu',
Expand Down Expand Up @@ -122,6 +120,9 @@ public function purge($force = false)
}

$options = get_option(self::NAME);
if(key_exists('disable_automatic_purge', $options) && $options['disable_automatic_purge'] && !$force){
return false;
}

// Server credentials
$hostname = $options['host'];
Expand Down
20 changes: 19 additions & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function register_settings()
add_settings_section('plugin_settings', esc_html__('Plugin Settings', 'hestia-nginx-cache'), [$this, 'plugin_settings_text'], 'hestia-nginx-cache');
add_settings_field('plugin_setting_show_purge_button', esc_html__('Show button in the admin bar', 'hestia-nginx-cache'), [$this, 'plugin_setting_show_purge_button'], $this->plugin::NAME, 'plugin_settings');
add_settings_field('plugin_setting_purge_button_text', esc_html__('Admin bar button text', 'hestia-nginx-cache'), [$this, 'plugin_setting_purge_button_text'], $this->plugin::NAME, 'plugin_settings');
add_settings_field('plugin_setting_automatic_purge', esc_html__('Disable Automatic Purge', 'hestia-nginx-cache'), [$this, 'plugin_setting_automatic_purge'], $this->plugin::NAME, 'plugin_settings');
}

public function validate_options($input)
Expand Down Expand Up @@ -158,7 +159,13 @@ public function plugin_settings_text()
public function plugin_setting_show_purge_button()
{
$options = get_option($this->plugin::NAME);
$show_adminbar_button = $this->plugin::$is_configured ? $options["show_adminbar_button"] : false;
$show_adminbar_button = false;
if( $this->plugin::$is_configured ){
if(key_exists('show_adminbar_button', $options)){
$show_adminbar_button = $options["show_adminbar_button"];
}
}
$show_adminbar_button = $this->plugin::$is_configured ? : false;
echo '<input id="plugin_setting_show_purge_button" name="' . $this->plugin::NAME . '[show_adminbar_button]" type="checkbox" value="1" ' . checked(1, $show_adminbar_button, false) . ' />';
}

Expand All @@ -169,6 +176,17 @@ public function plugin_setting_purge_button_text()
echo '<input id="plugin_setting_purge_button_text" placeholder="' . esc_html__('Leave empty for default', 'hestia-nginx-cache') . '" name="' . $this->plugin::NAME . '[adminbar_button_text]" type="text" value="' . $adminbar_button_text . '" />';
}

function plugin_setting_automatic_purge(){
$options = get_option($this->plugin::NAME);
$disable_automatic_purge = false;
if( $this->plugin::$is_configured ){
if(key_exists('disable_automatic_purge', $options)){
$disable_automatic_purge = $options["disable_automatic_purge"];
}
}
echo '<input id="plugin_setting_automatic_purge" name="' . $this->plugin::NAME . '[disable_automatic_purge]" type="checkbox" value="1" ' . checked(1, $disable_automatic_purge, false) . ' />';
}

public function add_settings_page()
{
add_options_page(
Expand Down
Binary file modified languages/hestia-nginx-cache-fr_CA.mo
Binary file not shown.
61 changes: 32 additions & 29 deletions languages/hestia-nginx-cache-fr_CA.po
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
# Copyright (C) 2024 Jakob Bouchard
# This file is distributed under the GPL v3.
msgid ""
msgstr ""
"Project-Id-Version: Hestia Nginx Cache 2.2.4\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/hestia-nginx-"
"cache\n"
"Project-Id-Version: Hestia Nginx Cache 2.3.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/hestia-nginx-cache\n"
"Last-Translator: Jakob Bouchard <[email protected]>\n"
"Language-Team: Unknown\n"
"Language: fr_CA\n"
"Plural-Forms: nplurals=2; plural=n!=1;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Loco-Source-Locale: en_CA\n"
"POT-Creation-Date: 2024-02-14T03:00:09+00:00\n"
"PO-Revision-Date: 2024-02-14 02:53+0000\n"
"Language: fr_CA\n"
"Plural-Forms: nplurals=2; plural=n!=1;\n"
"X-Loco-Source-Locale: en_CA\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Domain: hestia-nginx-cache\n"

#. Plugin Name of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: includes/admin.php:175 includes/admin.php:176 includes/admin.php:190
#: includes/site_health.php:45
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
#: includes/admin.php:193
#: includes/admin.php:194
#: includes/admin.php:208
#: includes/site_health.php:44
msgid "Hestia Nginx Cache"
msgstr "Cache Nginx de Hestia"

#. Plugin URI of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "https://github.com/jakobbouchard/hestia-nginx-cache"
msgstr ""

#. Description of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
msgid ""
"Hestia Nginx Cache Integration for WordPress. Auto-purges the Nginx cache "
"when needed."
msgstr ""
"Intégration du cache Nginx de Hestia pour WordPress. Vide automatiquement le "
"cache de Nginx lorsque nécessaire."
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "Hestia Nginx Cache Integration for WordPress. Auto-purges the Nginx cache when needed."
msgstr "Intégration du cache Nginx de Hestia pour WordPress. Vide automatiquement le cache de Nginx lorsque nécessaire."

#. Author of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "Jakob Bouchard"
msgstr ""

#. Author URI of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "https://jakobbouchard.dev"
msgstr ""

Expand All @@ -57,11 +52,13 @@ msgstr "Réglages"
msgid "API Settings"
msgstr "Options d'API"

#: includes/admin.php:73 includes/site_health.php:62
#: includes/admin.php:73
#: includes/site_health.php:61
msgid "Server hostname"
msgstr "Nom d'hôte du serveur"

#: includes/admin.php:74 includes/site_health.php:66
#: includes/admin.php:74
#: includes/site_health.php:65
msgid "Server port"
msgstr "Port du serveur"

Expand Down Expand Up @@ -93,27 +90,33 @@ msgstr "Afficher le bouton dans la barre d'administration"
msgid "Admin bar button text"
msgstr "Texte du bouton de la barre d'administration"

#: includes/admin.php:106
#: includes/admin.php:83
msgid "Disable Automatic Purge"
msgstr "Désactiver le vidage automatique"

#: includes/admin.php:107
msgid "Please refer to the plugin's installation guide for information on how to generate an API key."
msgstr "Veuillez vous référer au guide d'installation de l'extension pour plus d'informations sur la façon de générer une clé API."

#: includes/admin.php:155
#: includes/admin.php:156
msgid "Settings for the plugin."
msgstr "Options pour l'extension."

#: includes/admin.php:169
#: includes/admin.php:176
msgid "Leave empty for default"
msgstr "Laisser vide pour le texte par défaut"

#: includes/admin.php:197 includes/admin.php:231
#: includes/admin.php:215
#: includes/admin.php:249
msgid "Purge Nginx Cache"
msgstr "Vider le cache Nginx"

#: includes/admin.php:214 includes/admin.php:255
#: includes/admin.php:232
#: includes/admin.php:273
msgid "The Hestia Nginx Cache could not be purged!"
msgstr "Le cache Nginx de Hestia n'a pas pu être vidé!"

#: includes/admin.php:268
#: includes/admin.php:286
msgid "The Hestia Nginx Cache was purged successfully."
msgstr "Le cache Nginx de Hestia a été vidé avec succès."

Expand Down
Binary file modified languages/hestia-nginx-cache-pt_BR.mo
Binary file not shown.
137 changes: 104 additions & 33 deletions languages/hestia-nginx-cache-pt_BR.po
Original file line number Diff line number Diff line change
@@ -1,66 +1,137 @@
# Copyright (C) 2021 Jakob Bouchard
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: Hestia Nginx Cache 2.2.4\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/hestia-nginx-"
"cache\n"
"Project-Id-Version: Hestia Nginx Cache 2.3.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/hestia-nginx-cache\n"
"Last-Translator: Maison da Silva\n"
"Language-Team: Português do Brasil\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2021-09-17T15:33:57-04:00\n"
"PO-Revision-Date: 2024-01-27 14:41+0000\n"
"POT-Creation-Date: 2024-02-14T03:00:09+00:00\n"
"PO-Revision-Date: 2024-02-17 04:04+0000\n"
"Language: pt-BR\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Loco-Source-Locale: en_CA\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Domain: hestia-nginx-cache\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Loco-Version: 2.6.6; wp-6.4.2"

#. Plugin Name of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: includes/admin.php:175
#: includes/admin.php:176
#: includes/admin.php:190
#: includes/site_health.php:45
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
#: includes/admin.php:193
#: includes/admin.php:194
#: includes/admin.php:208
#: includes/site_health.php:44
msgid "Hestia Nginx Cache"
msgstr "Hestia Nginx Cache"

#. Plugin URI of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "https://github.com/jakobbouchard/hestia-nginx-cache"
msgstr "https://github.com/jakobbouchard/hestia-nginx-cache"

#. Description of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
msgid ""
"Hestia Nginx Cache Integration for WordPress. Auto-purges the Nginx cache "
"when needed."
msgstr ""
"Integração de Hestia Nginx Cache para WordPress. Limpa automaticamente o "
"cache Nginx quando necessário."
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "Hestia Nginx Cache Integration for WordPress. Auto-purges the Nginx cache when needed."
msgstr "Integração de Hestia Nginx Cache para WordPress. Limpa automaticamente o cache Nginx quando necessário."

#. Author of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "Jakob Bouchard"
msgstr "Jakob Bouchard"

#. Author URI of the plugin
#: C:\Users\Jakob\Dev\hestia-nginx-cache\hestia-nginx-cache.php
#: C:\Users\Jakob\Dev\jaap-hst-nginx-cache\hestia-nginx-cache.php
msgid "https://jakobbouchard.dev"
msgstr "https://jakobbouchard.dev"

#: includes/admin.php:214
#: includes/admin.php:255
#: includes/admin.php:60
msgid "Settings"
msgstr "Configuração"

#: includes/admin.php:72
msgid "API Settings"
msgstr "Configurações da API"

#: includes/admin.php:73
#: includes/site_health.php:61
msgid "Server hostname"
msgstr "Hostname do servidor"

#: includes/admin.php:74
#: includes/site_health.php:65
msgid "Server port"
msgstr "Porta do servidor"

#: includes/admin.php:75
msgid "Access key"
msgstr "Chave de acesso"

#: includes/admin.php:76
msgid "Secret key"
msgstr "Chave secreta"

#: includes/admin.php:77
msgid "Hestia username"
msgstr "Usuário do Hestia"

#: includes/admin.php:78
msgid "Domain to purge"
msgstr "Domínio a limpar"

#: includes/admin.php:80
msgid "Plugin Settings"
msgstr "Configurações do Plugin"

#: includes/admin.php:81
msgid "Show button in the admin bar"
msgstr "Exibir botão na barra de administração"

#: includes/admin.php:82
msgid "Admin bar button text"
msgstr "Texto do botão na barra de administração"

#: includes/admin.php:107
msgid "Please refer to the plugin's installation guide for information on how to generate an API key."
msgstr "Por favor, consulte o guia de instalação do plugin para obter informações sobre como gerar uma chave de API."

#: includes/admin.php:156
msgid "Settings for the plugin."
msgstr "Configurações para o plugin"

#: includes/admin.php:176
msgid "Leave empty for default"
msgstr "Padrão em branco"

#: includes/admin.php:215
#: includes/admin.php:249
msgid "Purge Nginx Cache"
msgstr "Limpar Cache do Nginx Hestia Cache"
msgstr "Limpar Cache do Nginx"

#: includes/admin.php:232
#: includes/admin.php:273
msgid "The Hestia Nginx Cache could not be purged!"
msgstr "Não foi possível limpar o Cache do Nginx Hestia Cache!"

#: includes/admin.php:268
#: includes/admin.php:286
msgid "The Hestia Nginx Cache was purged successfully."
msgstr "O Cache do Hestia Nginx Cache foi limpo com sucesso."

#: includes/admin.php:214
#: includes/admin.php:255
msgid "The Hestia Nginx Cache could not be purged!"
msgstr "Não foi possível limpar o Cache do Nginx Hestia Cache!"
#: includes/site_health.php:47
msgid "Version"
msgstr "Versão"

#: includes/site_health.php:51
msgid "Configuration"
msgstr "Configurações"

#: includes/site_health.php:52
msgid "The plugin has been configured"
msgstr "O plugin foi configurado"

#: includes/site_health.php:52
msgid "The plugin has not been configured"
msgstr "O plugin não foi configurado"

#: includes/admin.php:83
msgid "Disable Automatic Purge"
msgstr ""
Loading

0 comments on commit 30f38ee

Please sign in to comment.