Skip to content

Commit

Permalink
Plugin refactoring. Version updated
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-mykhailenko committed Aug 18, 2022
1 parent dbebeba commit 97c12c2
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 112 deletions.
14 changes: 7 additions & 7 deletions includes/lists-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
$api_key = (defined('MAILGUN_APIKEY') && MAILGUN_APIKEY) ? MAILGUN_APIKEY : $this->get_option('apiKey');
$mailgun_domain = (defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : $this->get_option('domain');


if ($api_key != ''):
if ($mailgun_domain == ''):
if ($api_key != '') {
if ($mailgun_domain == '') {
$missing_error = '<strong style="color:red;">Missing or invalid Mailgun Domain</strong>. ';
endif;
else:
}
} else {
$missing_error = '<strong style="color:red;">Missing or invalid API Key</strong>. ';
endif;
}

// import available lists
$lists_arr = $mailgun->get_lists();
$icon = $mailgun->getAssetsPath() . 'icon-128x128.png';

?>

Expand All @@ -46,7 +46,7 @@

<span class="alignright">
<a target="_blank" href="http://www.mailgun.com/">
<img src="https://assets.mailgun.com/img/mailgun.svg" alt="Mailgun" style="width: 10em;"/>
<img src="<?php echo $icon?>" alt="Mailgun" style="width: 50px;"/>
</a>
</span>

Expand Down
6 changes: 4 additions & 2 deletions includes/options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

global $mailgun;

$mailgun_domain_const = ((defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : null);
$mailgun_domain = $mailgun_domain_const ? $mailgun_domain_const : $this->get_option('domain');

Expand Down Expand Up @@ -48,14 +50,14 @@

$mailgun_use_api_const = (defined('MAILGUN_USEAPI') ? MAILGUN_USEAPI : null);
$mailgun_use_api = !is_null($mailgun_use_api_const) ? ((string)(1 * $mailgun_use_api_const)) : $this->get_option('useAPI');

$icon = $mailgun->getAssetsPath() . 'icon-128x128.png';

?>
<div class="wrap">
<div id="icon-options-general" class="icon32"><br/></div>
<span class="alignright">
<a target="_blank" href="http://www.mailgun.com/">
<img src="https://assets.mailgun.com/img/mailgun.svg" alt="Mailgun" style="width:10em;"/>
<img src="<?php echo $icon?>" alt="Mailgun" style="width:50px;"/>
</a>
</span>
<h2><?php _e('Mailgun', 'mailgun'); ?></h2>
Expand Down
Loading

0 comments on commit 97c12c2

Please sign in to comment.