| @@ -54,9 +54,9 @@ | ||
| 54 | 54 | */ |
| 55 | 55 | public function enqueue_feedback_dialog_scripts() { |
| 56 | 56 | add_action( 'admin_footer', [ $this, 'print_deactivate_feedback_dialog' ] ); |
| 57 | 57 | |
| 58 | - $suffix = Utils::is_script_debug() ? '' : '.min'; | |
| 58 | + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
| 59 | 59 | |
| 60 | 60 | wp_register_script( |
| 61 | 61 | 'elementor-admin-feedback', |
| 62 | 62 | ELEMENTOR_ASSETS_URL . 'js/admin-feedback' . $suffix . '.js', |
| @@ -61,9 +61,8 @@ | ||
| 61 | 61 | 'elementor-admin-feedback', |
| 62 | 62 | ELEMENTOR_ASSETS_URL . 'js/admin-feedback' . $suffix . '.js', |
| 63 | 63 | [ |
| 64 | 64 | 'elementor-common', |
| 65 | - 'wp-i18n', | |
| 66 | 65 | ], |
| 67 | 66 | ELEMENTOR_VERSION, |
| 68 | 67 | true |
| 69 | 68 | ); |
| @@ -68,10 +67,18 @@ | ||
| 68 | 67 | true |
| 69 | 68 | ); |
| 70 | 69 | |
| 71 | 70 | wp_enqueue_script( 'elementor-admin-feedback' ); |
| 71 | + } | |
| 72 | 72 | |
| 73 | - wp_set_script_translations( 'elementor-admin-feedback', 'elementor' ); | |
| 73 | + /** | |
| 74 | + * @since 2.3.0 | |
| 75 | + * @deprecated 3.1.0 | |
| 76 | + */ | |
| 77 | + public function localize_feedback_dialog_settings() { | |
| 78 | + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0' ); | |
| 79 | + | |
| 80 | + return []; | |
| 74 | 81 | } |
| 75 | 82 | |
| 76 | 83 | /** |
| 77 | 84 | * Print deactivate feedback dialog. |
| @@ -157,12 +164,8 @@ | ||
| 157 | 164 | public function ajax_elementor_deactivate_feedback() { |
| 158 | 165 | $wpnonce = Utils::get_super_global_value( $_POST, '_wpnonce' ); // phpcs:ignore -- Nonce verification is made in `wp_verify_nonce()`. |
| 159 | 166 | if ( ! wp_verify_nonce( $wpnonce, '_elementor_deactivate_feedback_nonce' ) ) { |
| 160 | 167 | wp_send_json_error(); |
| 161 | - } | |
| 162 | - | |
| 163 | - if ( ! current_user_can( 'activate_plugins' ) ) { | |
| 164 | - wp_send_json_error( 'Permission denied' ); | |
| 165 | 168 | } |
| 166 | 169 | |
| 167 | 170 | $reason_key = Utils::get_super_global_value( $_POST, 'reason_key' ) ?? ''; |
| 168 | 171 | $reason_text = Utils::get_super_global_value( $_POST, "reason_{$reason_key}" ) ?? ''; |