Changeset 3440031
- Timestamp:
- 01/15/2026 06:04:07 AM (3 months ago)
- Location:
- make-section-column-clickable-elementor
- Files:
-
- 42 added
- 2 edited
-
tags/2.4.1 (added)
-
tags/2.4.1/assets (added)
-
tags/2.4.1/assets/js (added)
-
tags/2.4.1/assets/js/ra-clickable.js (added)
-
tags/2.4.1/composer.json (added)
-
tags/2.4.1/composer.lock (added)
-
tags/2.4.1/license.txt (added)
-
tags/2.4.1/make-section-clickable-elementor.php (added)
-
tags/2.4.1/readme.txt (added)
-
tags/2.4.1/vendor (added)
-
tags/2.4.1/vendor/appsero (added)
-
tags/2.4.1/vendor/appsero/client (added)
-
tags/2.4.1/vendor/appsero/client/.editorconfig (added)
-
tags/2.4.1/vendor/appsero/client/.github (added)
-
tags/2.4.1/vendor/appsero/client/.github/workflows (added)
-
tags/2.4.1/vendor/appsero/client/.github/workflows/wpcs.yml (added)
-
tags/2.4.1/vendor/appsero/client/.gitignore (added)
-
tags/2.4.1/vendor/appsero/client/.php-cs-fixer.dist.php (added)
-
tags/2.4.1/vendor/appsero/client/composer.json (added)
-
tags/2.4.1/vendor/appsero/client/composer.lock (added)
-
tags/2.4.1/vendor/appsero/client/phpcs.xml.dist (added)
-
tags/2.4.1/vendor/appsero/client/readme.md (added)
-
tags/2.4.1/vendor/appsero/client/src (added)
-
tags/2.4.1/vendor/appsero/client/src/Client.php (added)
-
tags/2.4.1/vendor/appsero/client/src/Insights.php (added)
-
tags/2.4.1/vendor/appsero/client/src/License.php (added)
-
tags/2.4.1/vendor/autoload.php (added)
-
tags/2.4.1/vendor/composer (added)
-
tags/2.4.1/vendor/composer/ClassLoader.php (added)
-
tags/2.4.1/vendor/composer/InstalledVersions.php (added)
-
tags/2.4.1/vendor/composer/LICENSE (added)
-
tags/2.4.1/vendor/composer/autoload_classmap.php (added)
-
tags/2.4.1/vendor/composer/autoload_namespaces.php (added)
-
tags/2.4.1/vendor/composer/autoload_psr4.php (added)
-
tags/2.4.1/vendor/composer/autoload_real.php (added)
-
tags/2.4.1/vendor/composer/autoload_static.php (added)
-
tags/2.4.1/vendor/composer/installed.json (added)
-
tags/2.4.1/vendor/composer/installed.php (added)
-
tags/2.4.1/vendor/composer/platform_check.php (added)
-
trunk/assets (added)
-
trunk/assets/js (added)
-
trunk/assets/js/ra-clickable.js (added)
-
trunk/make-section-clickable-elementor.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
make-section-column-clickable-elementor/trunk/make-section-clickable-elementor.php
r3410552 r3440031 6 6 * Author: Riyadh Ahmed 7 7 * Author URI: http://sajuahmed.epizy.com/ 8 * Version: 2.4 8 * Version: 2.4.1 9 9 * License: GPL2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 */ 14 14 15 /** 16 * Prevent direct access and load dependencies 17 */ 18 if ( ! defined( 'ABSPATH' ) ) { 19 exit; // Exit if accessed directly 20 } 15 21 require __DIR__ . '/vendor/autoload.php'; 16 17 //don't call the file directly18 if (!defined('ABSPATH')) exit;19 22 20 23 use Elementor\Controls_Manager; 21 24 use Elementor\Element_Base; 22 23 defined('ABSPATH') || die();24 25 25 26 … … 56 57 add_action('elementor/element/common/_section_style/after_section_end', [__CLASS__, 'add_controls_section'], 1); 57 58 add_action('elementor/frontend/before_render', [__CLASS__, 'before_section_render'], 1); 59 add_action('wp_enqueue_scripts',[ __CLASS__, 'enqueue_scripts' ] ); 58 60 } 59 61 /** … … 65 67 */ 66 68 public static function add_controls_section(Element_Base $element) { 69 67 70 $tabs = Controls_Manager::TAB_CONTENT; 68 69 if ('section' === $element->get_name() || 'column' === $element->get_name()) { 71 if ( in_array( $element->get_name(), [ 'section', 'column' ], true ) ) { 70 72 $tabs = Controls_Manager::TAB_LAYOUT; 71 73 } … … 85 87 'type' => Controls_Manager::URL, 86 88 'placeholder' => 'https://example.com', 89 'show_external' => true, 87 90 ] 88 91 ); … … 98 101 99 102 $link_settings = $element->get_settings_for_display('ra_element_link'); 100 //$blank = $link_settings['is_external'] != '' ? '_blank' : '_self'; 101 $blank = isset($link_settings['is_external']) && $link_settings['is_external'] != '' ? '_blank' : '_self'; 103 104 if ( empty( $link_settings['url'] ) ) { 105 return; 106 } 102 107 103 if ($link_settings && !empty($link_settings['url'])) { 104 $element->add_render_attribute( 105 '_wrapper', 106 [ 107 'data-ra-element-link' => json_encode($link_settings), 108 'style' => 'cursor: pointer', 109 'target' => $blank, 110 'onClick' => 'window.open(\'' . $link_settings['url'] . '\', \'' . $blank . '\')', 111 ] 112 ); 113 } 108 $url = esc_url_raw( $link_settings['url'] ); 109 110 if ( ! wp_http_validate_url( $url ) ) { 111 return; 112 } 113 114 $target = ! empty( $link_settings['is_external'] ) ? '_blank' : '_self'; 115 116 $element->add_render_attribute( 117 '_wrapper', 118 [ 119 'data-ra-url' => esc_url( $url ), 120 'data-ra-target' => esc_attr( $target ), 121 'class' => 'ra-clickable-wrapper', 122 'style' => 'cursor:pointer;', 123 ] 124 ); 114 125 } 126 127 /** 128 * Enqueue safe JS handler 129 */ 130 public static function enqueue_scripts() { 131 132 wp_register_script( 133 'ra-make-section-clickable', 134 plugins_url( 'assets/js/ra-clickable.js', __FILE__ ),[],'2.4.1',true ); 135 136 wp_enqueue_script( 'ra-make-section-clickable' ); 137 } 115 138 } 116 139 /** -
make-section-column-clickable-elementor/trunk/readme.txt
r3410572 r3440031 7 7 Requires at least: 5.2 8 8 Tested up to: 6.9 9 Elementor tested up to: 3.3 210 Stable tag: 2.4 9 Elementor tested up to: 3.34 10 Stable tag: 2.4.1 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 132 132 * Compatible with WordPress version 133 133 134 = 2.4.1 = 135 136 * Compatible with WordPress version 137 * Compatible with Elementor version 138 139 * 🔐 Security 140 * Fixed a stored XSS vulnerability caused by inline JavaScript usage 141 * Removed inline onclick handlers from frontend rendering 142 * Implemented secure click handling using external JavaScript 143 * Sanitized and escaped all user-provided URLs and attributes 144 * Improved compatibility with WordPress Multisite security restrictions 145 146 * 🛠️ Improvements 147 * Cleaner frontend markup 148 * CSP-friendly implementation 149 * Improved long-term security hardening 150 134 151 == Upgrade notice == 135 152 N/A.
Note: See TracChangeset
for help on using the changeset viewer.