| @@ -64,21 +64,21 @@ | ||
| 64 | 64 | */ |
| 65 | 65 | private static function get_options() { |
| 66 | 66 | $options = get_option( self::$option_name ); |
| 67 | 67 | |
| 68 | - if ( ! $options ) { | |
| 69 | - $default_options = array( | |
| 70 | - // Do not send email within 15 days after updating. | |
| 71 | - 'last_' . self::MONTHLY => self::get_date_from_today( '-' . self::DELAY_AFTER_UPGRADE . ' days' ), | |
| 72 | - 'last_' . self::YEARLY => '', | |
| 73 | - 'renewal_date' => '', | |
| 74 | - ); | |
| 68 | + if ( $options ) { | |
| 69 | + return $options; | |
| 70 | + } | |
| 75 | 71 | |
| 76 | - self::save_options( $default_options ); | |
| 77 | - return $default_options; | |
| 78 | - } | |
| 72 | + $default_options = array( | |
| 73 | + // Do not send email within 15 days after updating. | |
| 74 | + 'last_' . self::MONTHLY => self::get_date_from_today( '-' . self::DELAY_AFTER_UPGRADE . ' days' ), | |
| 75 | + 'last_' . self::YEARLY => '', | |
| 76 | + 'renewal_date' => '', | |
| 77 | + ); | |
| 79 | 78 | |
| 80 | - return $options; | |
| 79 | + self::save_options( $default_options ); | |
| 80 | + return $default_options; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Saves summary emails options. |
| @@ -528,9 +528,9 @@ | ||
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | // Add inline CSS for specific button types. |
| 531 | 531 | if ( str_contains( $button_html, 'frm-button-primary' ) ) { |
| 532 | - $button_html = str_replace( '<a', '<a style="' . self::get_button_style() . '"', $button_html ); | |
| 532 | + return str_replace( '<a', '<a style="' . self::get_button_style() . '"', $button_html ); | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | return $button_html; |
| 536 | 536 | } |