| @@ -1,14 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | -namespace PXLBSAdminify\Inc\Classes\Notifications; | |
| 2 | +namespace WPAdminify\Inc\Classes\Notifications; | |
| 3 | 3 | |
| 4 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | - exit; // Exit if accessed directly. | |
| 6 | -} | |
| 4 | +use WPAdminify\Inc\Classes\Notifications\Base\User_Data; | |
| 5 | +use WPAdminify\Inc\Classes\Notifications\Model\Notice; | |
| 7 | 6 | |
| 8 | -use PXLBSAdminify\Inc\Classes\Notifications\Base\User_Data; | |
| 9 | -use PXLBSAdminify\Inc\Classes\Notifications\Model\Notice; | |
| 10 | - | |
| 11 | 7 | if ( ! class_exists( 'Subscribe' ) ) { |
| 12 | 8 | /** |
| 13 | 9 | * Subscribe Class |
| 14 | 10 | * |
| @@ -26,9 +22,9 @@ | ||
| 26 | 22 | * @author Jewel Theme <support@jeweltheme.com> |
| 27 | 23 | */ |
| 28 | 24 | public function __construct() { |
| 29 | 25 | parent::__construct(); |
| 30 | - add_action( 'wp_ajax_pxlbsadminify_subscribe', array( $this, 'pxlbsadminify_subscribe' ) ); | |
| 26 | + add_action( 'wp_ajax_jltwp_adminify_subscribe', array( $this, 'jltwp_adminify_subscribe' ) ); | |
| 31 | 27 | } |
| 32 | 28 | |
| 33 | 29 | /** |
| 34 | 30 | * Subscribe method |
| @@ -34,17 +30,11 @@ | ||
| 34 | 30 | * Subscribe method |
| 35 | 31 | * |
| 36 | 32 | * @author Jewel Theme <support@jeweltheme.com> |
| 37 | 33 | */ |
| 38 | - public function pxlbsadminify_subscribe() { | |
| 39 | - check_ajax_referer( 'pxlbsadminify_subscribe_nonce' ); | |
| 34 | + public function jltwp_adminify_subscribe() { | |
| 35 | + check_ajax_referer( 'jltwp_adminify_subscribe_nonce' ); | |
| 40 | 36 | |
| 41 | - // Subscribing the site contact email to a third-party list is | |
| 42 | - // a site-wide action and must only be performed by an admin. | |
| 43 | - if ( ! current_user_can( 'manage_options' ) ) { | |
| 44 | - wp_send_json_error( array( 'mess' => __( 'You are not allowed to perform this action.', 'adminify' ) ), 403 ); | |
| 45 | - } | |
| 46 | - | |
| 47 | 37 | $name = ! empty( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : ''; |
| 48 | 38 | $email = ! empty( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : ''; |
| 49 | 39 | |
| 50 | 40 | if ( ! is_email( $email ) ) { |
| @@ -98,9 +88,9 @@ | ||
| 98 | 88 | */ |
| 99 | 89 | public function set_title() { |
| 100 | 90 | printf( |
| 101 | 91 | '<h4>Wanna get some discount for %1$s? No Worries!! We got you!! Enter your email, we will send you the discount code?</h4>', |
| 102 | - esc_html__( 'Adminify', 'adminify' ) | |
| 92 | + esc_html__( 'WP Adminify', 'adminify' ) | |
| 103 | 93 | ); |
| 104 | 94 | } |
| 105 | 95 | |
| 106 | 96 | /** |
| @@ -112,9 +102,9 @@ | ||
| 112 | 102 | $userdata = \wp_get_current_user(); |
| 113 | 103 | ?> |
| 114 | 104 | <div class="notice notice-wp-adminify is-dismissible notice-plugin-review notice-<?php echo esc_attr( $this->color ); ?> wp-adminify-notice-<?php echo esc_attr( $this->get_id() ); ?>"> |
| 115 | 105 | <button type="button" class="notice-dismiss wp-adminify-notice-dismiss"></button> |
| 116 | - <img width="70" height="70" src="<?php echo esc_url( PXLBSADMINIFY_ASSETS_IMAGE . 'logos/menu-icon.svg' ); ?>" alt="<?php esc_attr_e( 'Logo', 'adminify' ); ?>"> | |
| 106 | + <img width="70" height="70" src="<?php echo esc_url( WP_ADMINIFY_ASSETS_IMAGE . 'logos/menu-icon.svg' ); ?>" alt="<?php esc_attr_e( 'Logo', 'adminify' ); ?>"> | |
| 117 | 107 | <div class="wp-adminify-subscribe-content"> |
| 118 | 108 | <?php $this->set_title(); ?> |
| 119 | 109 | <form style="display:flex"> |
| 120 | 110 | <div class="wp-adminify-plugin-subscribe-input"> |
| @@ -135,9 +125,9 @@ | ||
| 135 | 125 | * |
| 136 | 126 | * @author Jewel Theme <support@jeweltheme.com> |
| 137 | 127 | */ |
| 138 | 128 | public function plugin_rate_url() { |
| 139 | - return 'https://wordpress.org/plugins/' . PXLBSADMINIFY_SLUG; | |
| 129 | + return 'https://wordpress.org/plugins/' . WP_ADMINIFY_SLUG; | |
| 140 | 130 | } |
| 141 | 131 | |
| 142 | 132 | /** |
| 143 | 133 | * Footer content |
| @@ -195,10 +185,10 @@ | ||
| 195 | 185 | url: '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', |
| 196 | 186 | method: 'POST', |
| 197 | 187 | crossDomain: true, |
| 198 | 188 | data: { |
| 199 | - action: 'pxlbsadminify_subscribe', | |
| 200 | - _wpnonce: '<?php echo esc_js( wp_create_nonce( 'pxlbsadminify_subscribe_nonce' ) ); ?>', | |
| 189 | + action: 'jltwp_adminify_subscribe', | |
| 190 | + _wpnonce: '<?php echo esc_js( wp_create_nonce( 'jltwp_adminify_subscribe_nonce' ) ); ?>', | |
| 201 | 191 | name: name, |
| 202 | 192 | email: email, |
| 203 | 193 | } |
| 204 | 194 | }) |
| @@ -204,9 +194,9 @@ | ||
| 204 | 194 | }) |
| 205 | 195 | .done(function(response) { |
| 206 | 196 | formWrapper.hide().after('<p class="wp-adminify--notice-message"><strong>' + response.data + '</strong><p>'); |
| 207 | 197 | let subsTimeout = setTimeout(function() { |
| 208 | - pxlbsadminify_notice_action(null, form, 'disable'); | |
| 198 | + jltwp_adminify_notice_action(null, form, 'disable'); | |
| 209 | 199 | clearTimeout(subsTimeout); |
| 210 | 200 | }, 1500); |
| 211 | 201 | }) |
| 212 | 202 | .always(function() { |