| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | -namespace PXLBSAdminify\Inc\Classes; | |
| 2 | +namespace WPAdminify\Inc\Classes; | |
| 3 | 3 | |
| 4 | -use PXLBSAdminify\Inc\Classes\Notifications\Base\User_Data; | |
| 4 | +use WPAdminify\Inc\Classes\Notifications\Base\User_Data; | |
| 5 | 5 | |
| 6 | 6 | // No, Direct access Sir !!! |
| 7 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 8 | exit; |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | */ |
| 26 | 26 | public function __construct() { |
| 27 | 27 | add_action( 'admin_enqueue_scripts', array( $this, 'admin_suvery_scripts' ) ); |
| 28 | 28 | add_action( 'admin_footer', array( $this, 'deactivation_footer' ) ); |
| 29 | - add_action( 'wp_ajax_pxlbsadminify_deactivation_survey', array( $this, 'deactivation_survey' ) ); | |
| 29 | + add_action( 'wp_ajax_jltwp_adminify_deactivation_survey', array( $this, 'jltwp_adminify_deactivation_survey' ) ); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function proceed() { |
| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function admin_suvery_scripts( $handle ) { |
| 48 | 48 | if ( 'plugins.php' === $handle ) { |
| 49 | - wp_enqueue_style( 'adminify-survey', PXLBSADMINIFY_ASSETS . 'css/plugin-survey.css', array(), PXLBSADMINIFY_VER ); | |
| 49 | + wp_enqueue_style( 'jltwp_adminify-survey', WP_ADMINIFY_ASSETS . 'css/plugin-survey.css' ); | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
| @@ -52,18 +52,11 @@ | ||
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Deactivation Survey |
| 55 | 55 | */ |
| 56 | - public function deactivation_survey() { | |
| 57 | - check_ajax_referer( 'pxlbsadminify_deactivation_survey_nonce' ); | |
| 56 | + public function jltwp_adminify_deactivation_survey() { | |
| 57 | + check_ajax_referer( 'jltwp_adminify_deactivation_nonce' ); | |
| 58 | 58 | |
| 59 | - // Only users who can deactivate plugins should be able to submit | |
| 60 | - // the deactivation survey, since it represents an action tied to | |
| 61 | - // the plugin lifecycle. | |
| 62 | - if ( ! current_user_can( 'deactivate_plugins' ) ) { | |
| 63 | - wp_send_json_error( array( 'mess' => __( 'You are not allowed to perform this action.', 'adminify' ) ), 403 ); | |
| 64 | - } | |
| 65 | - | |
| 66 | 59 | $deactivation_reason = ! empty( $_POST['deactivation_reason'] ) ? sanitize_text_field( wp_unslash( $_POST['deactivation_reason'] ) ) : ''; |
| 67 | 60 | |
| 68 | 61 | if ( empty( $deactivation_reason ) ) { |
| 69 | 62 | return; |
| @@ -105,14 +98,12 @@ | ||
| 105 | 98 | 'temporary_deactivation' => array( |
| 106 | 99 | 'title' => esc_html__( 'It\'s a temporary deactivation', 'adminify' ), |
| 107 | 100 | 'input_placeholder' => '', |
| 108 | 101 | ), |
| 109 | - 'pxlbsadminify_pro' => array( | |
| 110 | - /* translators: %1$s: Plugin name */ | |
| 111 | - 'title' => sprintf( esc_html__( 'I have %1$s Pro', 'adminify' ), PXLBSADMINIFY ), | |
| 102 | + 'jltwp_adminify_pro' => array( | |
| 103 | + 'title' => sprintf( esc_html__( 'I have %1$s Pro', 'adminify' ), WP_ADMINIFY ), | |
| 112 | 104 | 'input_placeholder' => '', |
| 113 | - /* translators: %1$s: Plugin name */ | |
| 114 | - 'alert' => sprintf( esc_html__( 'Wait! Don\'t deactivate %1$s. You have to activate both %1$s and %1$s Pro in order for the plugin to work.', 'adminify' ), PXLBSADMINIFY ), | |
| 105 | + 'alert' => sprintf( esc_html__( 'Wait! Don\'t deactivate %1$s. You have to activate both %1$s and %1$s Pro in order for the plugin to work.', 'adminify' ), WP_ADMINIFY ), | |
| 115 | 106 | ), |
| 116 | 107 | 'need_better_design' => array( |
| 117 | 108 | 'title' => esc_html__( 'I need better design and presets', 'adminify' ), |
| 118 | 109 | 'input_placeholder' => esc_html__( 'Let us know your thoughts', 'adminify' ), |
| @@ -138,20 +129,20 @@ | ||
| 138 | 129 | <div class="wp-adminify-deactivate-survey-overlay" id="wp-adminify-deactivate-survey-overlay"></div> |
| 139 | 130 | <div class="wp-adminify-deactivate-survey-modal" id="wp-adminify-deactivate-survey-modal"> |
| 140 | 131 | <header> |
| 141 | 132 | <div class="wp-adminify-deactivate-survey-header"> |
| 142 | - <img src="<?php echo esc_url( PXLBSADMINIFY_ASSETS_IMAGE . 'logos/menu-icon.svg' ); ?>" /> | |
| 143 | - <h3><?php echo wp_kses_post( wp_sprintf( '%1$s <strong>%2$s</strong>', PXLBSADMINIFY, __( '- Feedback', 'adminify' ) ) ); ?></h3> | |
| 133 | + <img src="<?php echo esc_url( WP_ADMINIFY_ASSETS_IMAGE . 'logos/menu-icon.svg' ); ?>" /> | |
| 134 | + <h3><?php echo wp_sprintf( '%1$s <strong>%2$s</strong>', WP_ADMINIFY, __( '- Feedback', 'adminify' ) ); ?></h3> | |
| 144 | 135 | </div> |
| 145 | 136 | </header> |
| 146 | 137 | <div class="wp-adminify-deactivate-info"> |
| 147 | - <?php echo esc_html( wp_sprintf( '%1$s %2$s', __( 'If you have a moment, please share why you are deactivating', 'adminify' ), PXLBSADMINIFY ) ); ?> | |
| 138 | + <?php echo wp_sprintf( '%1$s %2$s', __( 'If you have a moment, please share why you are deactivating', 'adminify' ), WP_ADMINIFY ); ?> | |
| 148 | 139 | </div> |
| 149 | 140 | <div class="wp-adminify-deactivate-content-wrapper"> |
| 150 | 141 | <form action="#" class="wp-adminify-deactivate-form-wrapper"> |
| 151 | 142 | <?php foreach ( $this->get_survey_questions() as $reason_key => $reason ) { ?> |
| 152 | 143 | <div class="wp-adminify-deactivate-input-wrapper"> |
| 153 | - <input id="wp-adminify-deactivate-feedback-<?php echo esc_attr( $reason_key ); ?>" class="wp-adminify-deactivate-feedback-dialog-input" type="radio" name="reason_key" value="<?php echo esc_attr( $reason_key ); ?>"> | |
| 144 | + <input id="wp-adminify-deactivate-feedback-<?php echo esc_attr( $reason_key ); ?>" class="wp-adminify-deactivate-feedback-dialog-input" type="radio" name="reason_key" value="<?php echo $reason_key; ?>"> | |
| 154 | 145 | <label for="wp-adminify-deactivate-feedback-<?php echo esc_attr( $reason_key ); ?>" class="wp-adminify-deactivate-feedback-dialog-label"><?php echo esc_html( $reason['title'] ); ?></label> |
| 155 | 146 | <?php if ( ! empty( $reason['input_placeholder'] ) ) : ?> |
| 156 | 147 | <input class="wp-adminify-deactivate-feedback-text" type="text" name="reason_<?php echo esc_attr( $reason_key ); ?>" placeholder="<?php echo esc_attr( $reason['input_placeholder'] ); ?>" /> |
| 157 | 148 | <?php endif; ?> |
| @@ -228,10 +219,10 @@ | ||
| 228 | 219 | // crossDomain: true, |
| 229 | 220 | async: true, |
| 230 | 221 | // dataType: 'jsonp', |
| 231 | 222 | data: { |
| 232 | - action: 'pxlbsadminify_deactivation_survey', | |
| 233 | - _wpnonce: '<?php echo esc_js( wp_create_nonce( 'pxlbsadminify_deactivation_survey_nonce' ) ); ?>', | |
| 223 | + action: 'jltwp_adminify_deactivation_survey', | |
| 224 | + _wpnonce: '<?php echo esc_js( wp_create_nonce( 'jltwp_adminify_deactivation_nonce' ) ); ?>', | |
| 234 | 225 | deactivation_reason: deactivation_reason |
| 235 | 226 | }, |
| 236 | 227 | success:function(response){ |
| 237 | 228 | window.location.replace(deactivate_url); |