Skip to content

Commit

Permalink
Merge pull request #95 from omnisend/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
Gabiermi authored Apr 15, 2024
2 parents dca6d01 + 8b7f5af commit a91651e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 404 deletions.
4 changes: 4 additions & 0 deletions omnisend/class-omnisend-core-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ function ( $user_login, $user ) {


public static function omnisend_app_market() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
}

?>
<div id="omnisend-app-market"></div>
<?php
Expand Down
13 changes: 13 additions & 0 deletions omnisend/includes/Internal/class-connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
class Connection {

public static function display(): void {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
}

Options::set_landing_page_visited();

if ( self::show_connected_store_view() ) {
Expand Down Expand Up @@ -146,6 +150,15 @@ public static function omnisend_post_connection() {
// phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInText
$wordpress_platform = 'wordpress'; // WordPress is lowercase as it's required by integration.

if ( ! current_user_can( 'manage_options' ) ) {
return rest_ensure_response(
array(
'success' => false,
'error' => 'You do not have sufficient permissions to perform this action.',
)
);
}

if ( ! isset( $_POST['action_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['action_nonce'] ) ), 'connect' ) ) {
return rest_ensure_response(
array(
Expand Down
246 changes: 2 additions & 244 deletions omnisend/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,6 @@
margin-bottom: 24px;
}

.omnisend-paragraph-16 {
margin: 0;
font-weight: 400;
color: #1e2423;
font-family: Roboto;
font-size: 16px;
font-stretch: normal;
font-style: normal;
letter-spacing: normal;
line-height: 24px;
}

.omnisend-landing-h1 {
margin: 0;
color: #1e2423;
Expand Down Expand Up @@ -139,30 +127,6 @@
line-height: 40px;
}

.omnisend-h2 {
margin: 0;
color: #1e2423;
font-family: Roboto;
font-stretch: normal;
font-style: normal;
font-weight: 500;
letter-spacing: normal;
font-size: 32px;
line-height: 40px;
}

.omnisend-h3 {
margin: 0;
font-size: 24px;
color: #1e2423;
font-family: Roboto;
font-stretch: normal;
font-style: normal;
font-weight: 500;
letter-spacing: normal;
line-height: 32px;
}

.omnisend-paragraph-14 {
margin: 0;
font-weight: 300;
Expand All @@ -175,64 +139,6 @@
line-height: 24px;
}

.omnisend-grid-column {
box-sizing: border-box;
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
display: flex;
flex-direction: column;
padding: 0;
}

.omnisend-flex-row {
display: flex;
}

.omnisend-row-input-button {
box-sizing: border-box;
display: flex;
flex: 0 1 auto;
flex-flow: wrap;
flex-direction: row;
margin: 0 auto;
width: 100%;
gap: 16px;
align-items: flex-end;
}

.omnisend-link-button {
background: none;
font: inherit;
align-items: center;
border-radius: 8px;
box-sizing: border-box;
cursor: pointer;
display: flex;
flex-wrap: nowrap;
font-family: Roboto;
font-size: 14px;
font-stretch: normal;
font-style: normal;
font-weight: 400;
gap: 8px;
height: 40px;
justify-content: center;
letter-spacing: normal;
line-height: 24px;
outline: none;
padding: 8px 16px;
position: relative;
text-decoration: none;
transition:
background-color 0.1s ease-in-out,
color 0.1s ease-in-out;
white-space: nowrap;
border: 1px solid #35938f;
color: #35938f;
width: fit-content;
}

.omnisend-text-body {
font-family: Roboto;
font-size: 22px;
Expand Down Expand Up @@ -347,133 +253,11 @@
height: auto;
}

.omnisend-link-button {
background: none;
font: inherit;
align-items: center;
border-radius: 8px;
box-sizing: border-box;
cursor: pointer;
display: flex;
flex-wrap: nowrap;
font-family: Roboto;
font-size: 14px;
font-stretch: normal;
font-style: normal;
font-weight: 400;
gap: 8px;
height: 40px;
justify-content: center;
letter-spacing: normal;
line-height: 24px;
outline: none;
padding: 8px 16px;
position: relative;
text-decoration: none;
transition:
background-color 0.1s ease-in-out,
color 0.1s ease-in-out;
white-space: nowrap;
border: 1px solid #35938f;
color: #35938f;
width: fit-content;
}

.omnisend-step-number {
align-items: center;
background: #35938f;
border-radius: 50%;
color: #fff;
display: flex;
font-family: Roboto;
font-size: 16px;
height: 32px;
justify-content: center;
min-width: 32px;
width: 32px;
}

.omnisend-divider {
border: 0;
border-bottom: 1px solid #b6b6b6;
}

.omnisend-form-input {
appearance: none;
background-color: white;
border: 1px solid #b6b6b6;
border-radius: 8px;
box-sizing: border-box;
color: #1e2423;
display: flex;
font-family: Roboto;
font-size: 14px;
font-stretch: normal;
font-style: normal;
font-weight: 400;
height: 40px;
letter-spacing: normal;
line-height: 24px;
outline: none;
padding: 8px 16px;
position: relative;
transition: border-color 0.1s linear;
width: 100%;
}

.omnisend-form-field {
display: flex;
flex-grow: 8;
flex-direction: column;
max-width: 100%;
}

.omnisend-form-field > input {
border-radius: 8px;
border: 1px solid #b6b6b6;
background: #fff;
}

.omnisend-form-field-button {
box-sizing: border-box;
max-width: 100%;
flex: 0 1;
display: flex;
flex-direction: column;
padding: 0;
}

.omnisend-form-button-primary {
background: none;
font: inherit;
align-items: center;
border-radius: 8px;
box-sizing: border-box;
cursor: pointer;
display: flex;
flex-wrap: nowrap;
font-family: Roboto;
font-size: 14px;
font-stretch: normal;
font-style: normal;
font-weight: 400;
gap: 8px;
height: 40px;
justify-content: center;
letter-spacing: normal;
line-height: 24px;
outline: none;
padding: 8px 16px;
position: relative;
transition:
background-color 0.1s ease-in-out,
color 0.1s ease-in-out;
white-space: nowrap;
background-color: #35938f;
border: 1px solid #35938f;
color: #fff;
}

.omnisend-landing-text-microcopy {
font-family: Roboto;
font-size: 13px;
Expand All @@ -495,7 +279,7 @@
}

.omnisend-bullet-list li:before {
content: "";
content: '';
width: 5px;
height: 5px;
border-radius: 50%;
Expand All @@ -522,32 +306,6 @@
align-items: center;
}

.omnisend-help-wrapper {
box-sizing: border-box;
display: flex;
flex: 0 1 auto;
flex-flow: wrap;
flex-direction: row;
margin: 0 auto;
width: 100%;
}

.omnisend-a {
outline: none;
text-decoration: none;
transition: color 0.1s;
align-items: center;
gap: 8px;
color: #35938f;
font-family: Roboto;
font-stretch: normal;
font-style: normal;
letter-spacing: normal;
line-height: 24px;
font-size: 14px;
font-weight: 400;
}

.omnisend-landing-page-text {
max-width: 880px;
}
Expand All @@ -571,7 +329,7 @@

@media only screen and (max-width: 1300px) {
.omnisend-landing-page-banner-sticker {
display: none;
display: none;
}
}

Expand Down
Loading

0 comments on commit a91651e

Please sign in to comment.