PluginProbe
Elementor Website Builder – more than just a page builder / 3.6.6
Elementor Website Builder – more than just a page builder v3.6.6
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/admin/feedback.php +19 -10 4.1.13.6.6 View file →
@@ -4,9 +4,8 @@
4 4 use Elementor\Api;
5 5 use Elementor\Core\Base\Module;
6 6 use Elementor\Plugin;
7 7 use Elementor\Tracker;
8 -use Elementor\Utils;
9 8
10 9 if ( ! defined( 'ABSPATH' ) ) {
11 10 exit; // Exit if accessed directly.
12 11 }
@@ -54,9 +53,9 @@
54 53 */
55 54 public function enqueue_feedback_dialog_scripts() {
56 55 add_action( 'admin_footer', [ $this, 'print_deactivate_feedback_dialog' ] );
57 56
58 - $suffix = Utils::is_script_debug() ? '' : '.min';
57 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
59 58
60 59 wp_register_script(
61 60 'elementor-admin-feedback',
62 61 ELEMENTOR_ASSETS_URL . 'js/admin-feedback' . $suffix . '.js',
@@ -61,9 +60,8 @@
61 60 'elementor-admin-feedback',
62 61 ELEMENTOR_ASSETS_URL . 'js/admin-feedback' . $suffix . '.js',
63 62 [
64 63 'elementor-common',
65 - 'wp-i18n',
66 64 ],
67 65 ELEMENTOR_VERSION,
68 66 true
69 67 );
@@ -68,10 +66,18 @@
68 66 true
69 67 );
70 68
71 69 wp_enqueue_script( 'elementor-admin-feedback' );
70 + }
72 71
73 - wp_set_script_translations( 'elementor-admin-feedback', 'elementor' );
72 + /**
73 + * @since 2.3.0
74 + * @deprecated 3.1.0
75 + */
76 + public function localize_feedback_dialog_settings() {
77 + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0' );
78 +
79 + return [];
74 80 }
75 81
76 82 /**
77 83 * Print deactivate feedback dialog.
@@ -154,19 +160,22 @@
154 160 * @since 1.0.0
155 161 * @access public
156 162 */
157 163 public function ajax_elementor_deactivate_feedback() {
158 - $wpnonce = Utils::get_super_global_value( $_POST, '_wpnonce' ); // phpcs:ignore -- Nonce verification is made in `wp_verify_nonce()`.
159 - if ( ! wp_verify_nonce( $wpnonce, '_elementor_deactivate_feedback_nonce' ) ) {
164 + if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], '_elementor_deactivate_feedback_nonce' ) ) {
160 165 wp_send_json_error();
161 166 }
162 167
163 - if ( ! current_user_can( 'activate_plugins' ) ) {
164 - wp_send_json_error( 'Permission denied' );
168 + $reason_text = '';
169 + $reason_key = '';
170 +
171 + if ( ! empty( $_POST['reason_key'] ) ) {
172 + $reason_key = $_POST['reason_key'];
165 173 }
166 174
167 - $reason_key = Utils::get_super_global_value( $_POST, 'reason_key' ) ?? '';
168 - $reason_text = Utils::get_super_global_value( $_POST, "reason_{$reason_key}" ) ?? '';
175 + if ( ! empty( $_POST[ "reason_{$reason_key}" ] ) ) {
176 + $reason_text = $_POST[ "reason_{$reason_key}" ];
177 + }
169 178
170 179 Api::send_feedback( $reason_key, $reason_text );
171 180
172 181 wp_send_json_success();