Skip to content

Commit

Permalink
bump 3.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
widoz committed Nov 23, 2018
1 parent 0293203 commit 8404fd2
Show file tree
Hide file tree
Showing 13 changed files with 260 additions and 79 deletions.
7 changes: 0 additions & 7 deletions assets/css/pro.css.map

This file was deleted.

15 changes: 13 additions & 2 deletions backwpup.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: WordPress Backup Plugin
* Author: Inpsyde GmbH
* Author URI: http://inpsyde.com
* Version: 3.6.4
* Version: 3.6.5
* Text Domain: backwpup
* Domain Path: /languages/
* Network: true
Expand Down Expand Up @@ -117,11 +117,22 @@ private function __construct() {
}

if ( ! self::$is_pro ) {
$promoter_updater = new \Inpsyde\BackWPup\Notice\PromoterUpdater();
$promoter = new \Inpsyde\BackWPup\Notice\Promoter(
new \Inpsyde\BackWPup\Notice\PromoterUpdater(),
$promoter_updater,
new \Inpsyde\BackWPup\Notice\PromoterView()
);
$promoter->init();
add_action( 'upgrader_process_complete', array( $promoter_updater, 'update' ) );
add_filter(
'pre_set_site_transient_update_plugins',
function ( $value ) use ( $promoter_updater ) {

$promoter_updater->update();

return $value;
}
);

$this->home_phone_client_init();
}
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
== Changelog ==
= Version 3.6.5 =
Release Date: Nov 23, 2018

* Fixed: Admin notice won’t update correctly

= Version 3.6.4 =
Release Date: Nov, 22, 2018

Expand Down
6 changes: 2 additions & 4 deletions inc/Notice/Promoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ private function message() {
? get_site_transient( self::OPTION_NAME )
: get_transient( self::OPTION_NAME );

$data_message = array_filter( (array) $data_message );

if ( ! $data_message ) {
add_action( 'shutdown', array( $this->updater, 'update' ) );
if ( false === $data_message ) {
$data_message = $this->updater->update();
}

if ( isset( $data_message[ $locale_code ] ) ) {
Expand Down
30 changes: 26 additions & 4 deletions inc/Notice/PromoterUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,58 @@ class PromoterUpdater {
*/
public function update() {

$api_response = wp_remote_get( self::URL );
$api_response = wp_remote_get( self::URL, array( 'timeout' => 3 ) );
if ( is_wp_error( $api_response ) ) {
return array();
}
if ( 200 !== $api_response['response']['code'] ) {
return array();
}

$messages = json_decode( wp_remote_retrieve_body( $api_response ), true );
$json = $this->clean_json( wp_remote_retrieve_body( $api_response ) );
$messages = json_decode( $json, true );
if ( json_last_error() !== JSON_ERROR_NONE ) {
return array();
}

$data = array();
foreach ( $messages as $language => $remote_data ) {
$data[ $language ] = wp_parse_args(
$remote_data,
PromoterMessage::defaults()
);
}

$expiration_time = DAY_IN_SECONDS / 2;

is_multisite() ?
set_site_transient(
Promoter::OPTION_NAME,
$data,
DAY_IN_SECONDS
$expiration_time
) :
set_transient(
Promoter::OPTION_NAME,
$data,
DAY_IN_SECONDS
$expiration_time
);

return $data;
}

/**
* @param $json
*
* @return mixed
*/
private function clean_json( $json ) {

$json = str_replace(
array( "\n", "\t", "\r" ),
'',
$json
);

return str_replace( '},}', '}}', $json );
}
}
84 changes: 42 additions & 42 deletions languages/backwpup.pot
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-11-14T12:29:29+00:00\n"
"PO-Revision-Date: 2018-11-14T12:29:29+00:00\n"
"POT-Creation-Date: 2018-11-23T14:39:13+00:00\n"
"PO-Revision-Date: 2018-11-23T14:39:13+00:00\n"
"X-Domain: backwpup\n"

#: inc/class-adminbar.php:51
Expand Down Expand Up @@ -921,8 +921,8 @@ msgid "Added XML export \"%1$s\" with %2$s to backup file list."
msgstr ""

#: inc/class-destination-s3.php:44
#: dist/backwpup.php:357
#: backwpup.php:357
#: dist/backwpup.php:368
#: backwpup.php:368
msgid "S3 Service"
msgstr ""

Expand Down Expand Up @@ -1298,8 +1298,8 @@ msgid "File"
msgstr ""

#: inc/class-page-backups.php:218
#: dist/backwpup.php:293
#: backwpup.php:293
#: dist/backwpup.php:304
#: backwpup.php:304
msgid "Folder"
msgstr ""

Expand Down Expand Up @@ -1675,8 +1675,8 @@ msgid "Error transfering backup to %s."
msgstr ""

#: inc/class-destination-dropbox.php:445
#: dist/backwpup.php:341
#: backwpup.php:341
#: dist/backwpup.php:352
#: backwpup.php:352
msgid "Dropbox"
msgstr ""

Expand Down Expand Up @@ -2383,14 +2383,14 @@ msgid "Backup to S3 services (Amazon, Google Storage, Hosteurope and more)"
msgstr ""

#: inc/class-page-about.php:508
#: dist/backwpup.php:342
#: backwpup.php:342
#: dist/backwpup.php:353
#: backwpup.php:353
msgid "Backup to Dropbox"
msgstr ""

#: inc/class-page-about.php:513
#: dist/backwpup.php:395
#: backwpup.php:395
#: dist/backwpup.php:406
#: backwpup.php:406
msgid "Backup to Rackspace Cloud Files"
msgstr ""

Expand All @@ -2403,8 +2403,8 @@ msgid "Backup to your web space"
msgstr ""

#: inc/class-page-about.php:528
#: dist/backwpup.php:415
#: backwpup.php:415
#: dist/backwpup.php:426
#: backwpup.php:426
msgid "Backup to SugarSync"
msgstr ""

Expand Down Expand Up @@ -4101,73 +4101,73 @@ msgstr[0] ""
msgid "SugarSync API: %s"
msgstr ""

#: dist/backwpup.php:294
#: backwpup.php:294
#: dist/backwpup.php:305
#: backwpup.php:305
msgid "Backup to Folder"
msgstr ""

#: dist/backwpup.php:309
#: backwpup.php:309
#: dist/backwpup.php:320
#: backwpup.php:320
msgid "Email"
msgstr ""

#: dist/backwpup.php:310
#: backwpup.php:310
#: dist/backwpup.php:321
#: backwpup.php:321
msgid "Backup sent via email"
msgstr ""

#: dist/backwpup.php:325
#: backwpup.php:325
#: dist/backwpup.php:336
#: backwpup.php:336
msgid "FTP"
msgstr ""

#: dist/backwpup.php:326
#: backwpup.php:326
#: dist/backwpup.php:337
#: backwpup.php:337
msgid "Backup to FTP"
msgstr ""

#: dist/backwpup.php:358
#: backwpup.php:358
#: dist/backwpup.php:369
#: backwpup.php:369
msgid "Backup to an S3 Service"
msgstr ""

#: dist/backwpup.php:378
#: backwpup.php:378
#: dist/backwpup.php:389
#: backwpup.php:389
msgid "MS Azure"
msgstr ""

#: dist/backwpup.php:379
#: backwpup.php:379
#: dist/backwpup.php:390
#: backwpup.php:390
msgid "Backup to Microsoft Azure (Blob)"
msgstr ""

#: dist/backwpup.php:394
#: backwpup.php:394
#: dist/backwpup.php:405
#: backwpup.php:405
msgid "RSC"
msgstr ""

#: dist/backwpup.php:414
#: backwpup.php:414
#: dist/backwpup.php:425
#: backwpup.php:425
msgid "SugarSync"
msgstr ""

#: dist/backwpup.php:443
#: backwpup.php:443
#: dist/backwpup.php:454
#: backwpup.php:454
msgid "PHP Version %1$s is to low, you need Version %2$s or above."
msgstr ""

#: dist/backwpup.php:455
#: backwpup.php:455
#: dist/backwpup.php:466
#: backwpup.php:466
msgid "Missing function \"%s\"."
msgstr ""

#: dist/backwpup.php:468
#: backwpup.php:468
#: dist/backwpup.php:479
#: backwpup.php:479
msgid "Missing class \"%s\"."
msgstr ""

#: dist/backwpup.php:589
#: backwpup.php:589
#: dist/backwpup.php:600
#: backwpup.php:600
msgid "BackWPup requires PHP version %$1s with spl extension or greater and WordPress %$2s or greater."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInita23585b901400be6b5d85b7b0e980aa9::getLoader();
return ComposerAutoloaderInite22f446265f3e2b8ba85031429865baf::getLoader();
1 change: 1 addition & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,7 @@
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/ContainerAwareEventDispatcher.php',
'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php',
'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php',
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInita23585b901400be6b5d85b7b0e980aa9
class ComposerAutoloaderInite22f446265f3e2b8ba85031429865baf
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInita23585b901400be6b5d85b7b0e980aa9', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite22f446265f3e2b8ba85031429865baf', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInita23585b901400be6b5d85b7b0e980aa9', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite22f446265f3e2b8ba85031429865baf', 'loadClassLoader'));

$includePaths = require __DIR__ . '/include_paths.php';
$includePaths[] = get_include_path();
Expand All @@ -31,7 +31,7 @@ public static function getLoader()
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInita23585b901400be6b5d85b7b0e980aa9::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite22f446265f3e2b8ba85031429865baf::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -52,19 +52,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInita23585b901400be6b5d85b7b0e980aa9::$files;
$includeFiles = Composer\Autoload\ComposerStaticInite22f446265f3e2b8ba85031429865baf::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirea23585b901400be6b5d85b7b0e980aa9($fileIdentifier, $file);
composerRequiree22f446265f3e2b8ba85031429865baf($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequirea23585b901400be6b5d85b7b0e980aa9($fileIdentifier, $file)
function composerRequiree22f446265f3e2b8ba85031429865baf($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
Loading

0 comments on commit 8404fd2

Please sign in to comment.