Skip to content

Commit

Permalink
code cleanup + minor style changes + docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
naxvog committed Aug 12, 2019
1 parent 918ec49 commit 8a78d81
Show file tree
Hide file tree
Showing 20 changed files with 455 additions and 386 deletions.
21 changes: 15 additions & 6 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
input[type="number"] {
text-align: right;
}
.pill {
border-radius: 5px;
background-color: #000;
padding: 2px 3px;
color: #fff;
display: inline-block;
padding: .25em .4em;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25rem;
}
.pill.pill-active {
background-color: darkgreen;
color: #fff;
background-color: #28a745;
}
.pill.pill-inactive {
background-color: darkred;
color: #fff;
background-color: #dc3545;
}
4 changes: 2 additions & 2 deletions includes/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ public function register_settings() {
* @return void
*/
public function trigger_save() {
static $once = false;
if ( ! $once ) {
static $once;
if ( ! isset( $once ) ) {
$once = true;
add_action( 'shutdown', [ Config::class, 'save' ] );
}
Expand Down
4 changes: 4 additions & 0 deletions includes/class-redis-connection-params.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
/**
* @author naxvog <naxvog@users.noreply.github.com>
* @version 1.0.0
*/

namespace WPR_Redis;

Expand Down
5 changes: 5 additions & 0 deletions includes/class-redis.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
/**
* @author naxvog <naxvog@users.noreply.github.com>
* @version 1.0.0
*/

namespace WPR_Redis;

Expand Down Expand Up @@ -336,6 +340,7 @@ protected static function lua_flush_closure(
/**
* Retrieved set WP Rocket expiry time
*
* @since 1.0.0
* @return int
*/
protected static function expiry_time() {
Expand Down
21 changes: 20 additions & 1 deletion includes/class-update-checker.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
/**
* @author naxvog <naxvog@users.noreply.github.com>
* @version 1.0.1
*/

namespace WPR_Redis;

Expand All @@ -17,12 +21,27 @@ class Update_Checker {
* @since 1.0.0
*/
public function __construct() {
$slug = 'wpr-redis';
add_filter(
"puc_manual_check_link-{$slug}",
[ $this, 'manual_check_link' ]
);
require_once WPR_REDIS_VENDOR_PATH . '/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
$update_checker = \Puc_v4_Factory::buildUpdateChecker(
self::GITHUB_REPO,
WPR_REDIS_FILE,
'wpr-redis'
$slug
);
}

/**
* Returns the translatable check for updates link label
*
* @since 1.0.1
* @return string
*/
public function manual_check_link() {
return __( 'Check for updates', 'wpr-redis' );
}

} // Update_Checker
4 changes: 2 additions & 2 deletions includes/class-wpr-redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function __construct() {
* @return string
*/
public static function meta( $key ) {
static $metadata = null;
if ( null === $metadata ) {
static $metadata;
if ( ! isset( $metadata ) ) {
$metadata = get_file_data(
WPR_REDIS_FILE,
array(
Expand Down
4 changes: 4 additions & 0 deletions includes/config-template.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
/**
* @author naxvog <naxvog@users.noreply.github.com>
* @version 1.0.0
*/

defined( '\\ABSPATH' ) || exit;

Expand Down
Binary file modified languages/wpr-redis-de_AT.mo
Binary file not shown.
136 changes: 70 additions & 66 deletions languages/wpr-redis-de_AT.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Rocket Redis\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-12 17:26+0000\n"
"PO-Revision-Date: 2019-08-12 18:05+0000\n"
"Last-Translator: admin <admin@sergio-sanchez.com>\n"
"Language-Team: \n"
"POT-Creation-Date: 2019-08-12 22:01+0000\n"
"PO-Revision-Date: 2019-08-12 22:04+0000\n"
"Last-Translator: naxvog <naxvog@users.noreply.github.com>\n"
"Language-Team: Deutsch (Österreich)\n"
"Language: de_AT\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"MIME-Version: 1.0\n"
Expand All @@ -15,92 +15,96 @@ msgstr ""
"X-Loco-Version: 2.3.0; wp-5.2.2\n"
"X-Loco-Template: languages/wpr-redis-de_DE.po"

#. Description of the plugin
msgid "Addon to WP Rocket that allows storage of cache files in Redis."
msgstr ""
"Erweiterung für WP Rocket die es erlaubt Redis als Speicherort für Cache-"
"Dateien zu verwenden."

#: views/admin-settings.php:31
msgid "Connected"
msgstr "Verbunden"
#: views/admin-settings.php:19 includes/class-config.php:79
msgid "WP Rocket Redis Settings"
msgstr "WP Rocket Redis Einstellungen"

#: includes/class-config.php:242
msgid "Database"
msgstr "Datenbank"
#: views/admin-settings.php:23
msgid "Remove WPR Redis Caching Integration"
msgstr "WPR Redis Cache Integration entfernen"

#: views/admin-settings.php:35
msgid "Disconnected"
msgstr "Getrennt"
#: views/admin-settings.php:28
msgid "Integrate WPR Redis Caching"
msgstr "WPR Redis Caching integrieren"

#: includes/class-config.php:234
msgid "Host"
msgstr "Host"
#: views/admin-settings.php:32
msgid "Status"
msgstr "Status"

#. Author URI of the plugin
msgid "https://github.com/naxvog/"
msgstr "https://github.com/naxvog/"
#: views/admin-settings.php:35
msgid "Redis Connection Status:"
msgstr "Redis Verbindungsstatus:"

#. URI of the plugin
msgid "https://github.com/naxvog/wpr-redis/"
msgstr "https://github.com/naxvog/wpr-redis/"
#: views/admin-settings.php:39
msgid "Connected"
msgstr "Verbunden"

#: views/admin-settings.php:20
msgid "Integrate WPR Redis Caching"
msgstr "WPR Redis Caching integrieren"
#: views/admin-settings.php:43
msgid "Disconnected"
msgstr "Getrennt"

#: views/admin-settings.php:45
#: views/admin-settings.php:53
msgid "Integrated"
msgstr "Eingebunden"

#. Author of the plugin
msgid "naxvog <naxvog@users.noreply.github.com>"
msgstr "naxvog <naxvog@users.noreply.github.com>"

#: includes/class-config.php:246
msgid "Password"
msgstr "Passwort"

#: views/admin-settings.php:49
#: views/admin-settings.php:57
msgid "Pending Integration"
msgstr "Nicht Eingebunden"

#: includes/class-config.php:238
msgid "Port"
msgstr "Port"
#: includes/class-update-checker.php:44
msgid "Check for updates"
msgstr "Auf Updates prüfen"

#: views/admin-settings.php:27
msgid "Redis Connection Status:"
msgstr "Redis Verbindungsstatus:"

#: views/admin-settings.php:16
msgid "Remove WPR Redis Caching Integration"
msgstr "WPR Redis Cache Integration entfernen"

#: includes/class-config.php:230
msgid "Scheme"
msgstr "Schema"
#: includes/class-wpr-redis.php:187
msgid "WP Rocket Redis:"
msgstr "WP Rocket Redis:"

#: includes/class-config.php:55
#: includes/class-config.php:66
msgid "Settings"
msgstr "Einstellungen"

#: includes/class-config.php:138
#: includes/class-config.php:147
msgid "Setup your Redis connection"
msgstr "Konfiguriere deine Redis Verbindung"

#: views/admin-settings.php:24
msgid "Status"
msgstr "Status"
#: includes/class-config.php:237
msgid "Scheme"
msgstr "Schema"

#: includes/class-config.php:241
msgid "Host"
msgstr "Host"

#: includes/class-config.php:245
msgid "Port"
msgstr "Port"

#: includes/class-config.php:249
msgid "Database"
msgstr "Datenbank"

#: includes/class-config.php:253
msgid "Password"
msgstr "Passwort"

#. Name of the plugin
msgid "WP Rocket Redis"
msgstr "WP Rocket Redis"

#: includes/class-config.php:68
msgid "WP Rocket Redis Settings"
msgstr "WP Rocket Redis Einstellungen"
#. Description of the plugin
msgid "Addon to WP Rocket that allows storage of cache files in Redis."
msgstr ""
"Erweiterung für WP Rocket die es erlaubt Redis als Speicherort für Cache-"
"Dateien zu verwenden."

#: includes/class-wpr-redis.php:141
msgid "WP Rocket Redis:"
msgstr "WP Rocket Redis:"
#. URI of the plugin
msgid "https://github.com/naxvog/wpr-redis/"
msgstr "https://github.com/naxvog/wpr-redis/"

#. Author of the plugin
msgid "naxvog <naxvog@users.noreply.github.com>"
msgstr "naxvog <naxvog@users.noreply.github.com>"

#. Author URI of the plugin
msgid "https://github.com/naxvog/"
msgstr "https://github.com/naxvog/"
Binary file modified languages/wpr-redis-de_CH.mo
Binary file not shown.
Loading

0 comments on commit 8a78d81

Please sign in to comment.