| @@ -20,8 +20,10 @@ | ||
| 20 | 20 | |
| 21 | 21 | add_action( 'admin_init', array( $this, 'store_ready_message_logic' ), 0 ); |
| 22 | 22 | add_action( 'admin_notices', array( $this, 'show_store_ready_message' ), 0 ); |
| 23 | 23 | add_action( 'admin_head', array( $this, 'force_woo_notices' ) ); |
| 24 | + | |
| 25 | + add_action( 'requests-curl.before_request', array( $this, 'session_write_close' ), 9999 ); | |
| 24 | 26 | } |
| 25 | 27 | |
| 26 | 28 | public function enable_woo_onboarding(): bool { |
| 27 | 29 | |
| @@ -66,11 +68,11 @@ | ||
| 66 | 68 | |
| 67 | 69 | public function omnisend_discount_notice(): void { |
| 68 | 70 | $omnisend_notice_hidden = filter_var( isset( $_SESSION['hts_omnisend_notice_hidden'] ) ? $_SESSION['hts_omnisend_notice_hidden'] : false, FILTER_VALIDATE_BOOLEAN ); |
| 69 | 71 | |
| 70 | - if ( ! $omnisend_notice_hidden && ( $this->helper->is_hostinger_admin_page() || $this->helper->is_this_page( '/wp-admin/admin.php?page=omnisend' ) ) && ( Hostinger_Helper::is_plugin_active( 'class-omnisend-core-bootstrap' ) || Hostinger_Helper::is_plugin_active( 'omnisend-woocommerce' ) ) ) : ?> | |
| 72 | + if ( ! $omnisend_notice_hidden && ( $this->helper->is_this_page( '/wp-admin/admin.php?page=omnisend' ) ) && ( Hostinger_Helper::is_plugin_active( 'class-omnisend-core-bootstrap' ) || Hostinger_Helper::is_plugin_active( 'omnisend-woocommerce' ) ) ) : ?> | |
| 71 | 73 | <div class="notice notice-info hts-admin-notice hts-omnisend"> |
| 72 | - <p><?php echo wp_kses( __( 'Use special discount code <b>ONLYHOSTINGER30</b> to get 30% off for 6 months when you upgrade.', 'hostinger' ), array( 'b' => array() ) ); ?></p> | |
| 74 | + <p><?php echo wp_kses( __( 'Use the special discount code <b>ONLYHOSTINGER30</b> to get 30% off on Omnisend for 6 months when you upgrade.', 'hostinger' ), array( 'b' => array() ) ); ?></p> | |
| 73 | 75 | <div> |
| 74 | 76 | <a class="button button-primary" |
| 75 | 77 | href="https://your.omnisend.com/LXqyZ0" |
| 76 | 78 | target="_blank"><?= esc_html__( 'Get Discount', 'hostinger' ); ?></a> |
| @@ -161,8 +163,19 @@ | ||
| 161 | 163 | </style> |
| 162 | 164 | <?php |
| 163 | 165 | |
| 164 | 166 | return ''; |
| 167 | + } | |
| 168 | + | |
| 169 | + /** | |
| 170 | + * Session start REST API fix | |
| 171 | + * | |
| 172 | + * @param $curlhandle | |
| 173 | + * | |
| 174 | + * @return void | |
| 175 | + */ | |
| 176 | + public function session_write_close( $curlhandle ): void { | |
| 177 | + session_write_close(); | |
| 165 | 178 | } |
| 166 | 179 | } |
| 167 | 180 | |
| 168 | 181 | $hostinger_admin_hooks = new Hostinger_Admin_Hooks(); |