Skip to content

Commit

Permalink
Merge pull request #58 from JWardee/v1.3.0
Browse files Browse the repository at this point in the history
+Removed attempted multisite unit test for dropping tables
  • Loading branch information
JWardee authored Jul 6, 2019
2 parents 607e8f4 + 7639eda commit b8f40e5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 66 deletions.
17 changes: 0 additions & 17 deletions multisite.xml

This file was deleted.

6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ A fast, lightweight plugin that saves emails sent by your WordPress website (und

## Testing locally
1. Download the repo
2. cd into `testing` and run `composer install`
3. Run `bash ./bin/install-wp-tests.sh` from the `testing` directory
4. Run `phpunit` within the `testing` directory
2. Run `composer install`
3. Run `bash ./testing/bin/install-wp-tests.sh`
4. Run `phpunit`

## Found an issue, or have an idea on how we can improve?
Let us know in our [GitHub tracker!](https://github.com/JWardee/wp-mail-catcher/issues)
Expand Down
7 changes: 1 addition & 6 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class Bootstrap
{
/**
* FIXME: GitHub issues
* FIXME: Subject line in 'new message' modal isn't 100% width, does this matter?
* TODO: Add screen option help text to both screens
*/
private $screenOptions;

public function __construct()
Expand Down Expand Up @@ -82,7 +77,7 @@ public function registerPages()
$this->screenOptions->newOption($mainPageHook, 'per_page', [
'default' => GeneralHelper::$logsPerPage
]);
$this->screenOptions->newHelpTab($mainPageHook, 'General', '<strong>blah</strong> blah');
// $this->screenOptions->newHelpTab($mainPageHook, 'General', '<strong>blah</strong> blah');
}

public function route()
Expand Down
19 changes: 14 additions & 5 deletions src/Models/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ static public function get($args = [])
{
global $wpdb;

$cachedValue = Cache::get($args);
if (!isset($args['ignore_cache']) || $args['ignore_cache'] == false) {
$cachedValue = Cache::get($args);

if ($cachedValue != null) {
return $cachedValue;
if ($cachedValue != null) {
return $cachedValue;
}
}

/**
Expand Down Expand Up @@ -100,7 +102,13 @@ static public function get($args = [])
OFFSET " . ($args['posts_per_page'] * ($args['paged'] - 1));
}

return Cache::set($args, self::dbResultTransform($wpdb->get_results($sql, ARRAY_A), $args));
$results = self::dbResultTransform($wpdb->get_results($sql, ARRAY_A), $args);

if (!isset($args['ignore_cache']) || $args['ignore_cache'] == false) {
Cache::set($args, $results);
}

return $results;
}

static private function dbResultTransform($results, $args = [])
Expand Down Expand Up @@ -174,8 +182,9 @@ static private function getEmailFrom($logEntry)
$fullHeader = GeneralHelper::searchForSubStringInArray($logEntry['additional_headers'], 'From: ');

/**
* Need to replace "custom:" as well due to a bug in previous versions
* This cannot be removed because of a bug in previous versions
* that caused the header to save as "custom: from: [email protected]"
* @url https://github.com/JWardee/wp-mail-catcher/issues/56
*/
return str_replace(['custom:', 'From:', ' '], '', $fullHeader);
}
Expand Down
35 changes: 0 additions & 35 deletions testing/tests/TestMultiSite.php

This file was deleted.

0 comments on commit b8f40e5

Please sign in to comment.