Changeset 3418780
- Timestamp:
- 12/13/2025 08:08:46 AM (4 months ago)
- Location:
- uniqselprotb
- Files:
-
- 6 added
- 6 edited
- 19 copied
-
tags/1.7.0 (copied) (copied from uniqselprotb/trunk)
-
tags/1.7.0/assets/css/uniqselprotb-admin.css (copied) (copied from uniqselprotb/trunk/assets/css/uniqselprotb-admin.css)
-
tags/1.7.0/assets/css/uniqselprotb-deactivation-feedback.css (added)
-
tags/1.7.0/assets/css/uniqselprotb.css (copied) (copied from uniqselprotb/trunk/assets/css/uniqselprotb.css)
-
tags/1.7.0/assets/js/uniqselprotb-admin.js (copied) (copied from uniqselprotb/trunk/assets/js/uniqselprotb-admin.js) (1 diff)
-
tags/1.7.0/assets/js/uniqselprotb-deactivation-feedback.js (added)
-
tags/1.7.0/assets/js/uniqselprotb-frontend.js (copied) (copied from uniqselprotb/trunk/assets/js/uniqselprotb-frontend.js)
-
tags/1.7.0/includes/class-uniqselprotb-loader.php (copied) (copied from uniqselprotb/trunk/includes/class-uniqselprotb-loader.php)
-
tags/1.7.0/includes/class-uniqselprotb-plugin.php (copied) (copied from uniqselprotb/trunk/includes/class-uniqselprotb-plugin.php) (2 diffs)
-
tags/1.7.0/includes/class-uniqselprotb-router.php (copied) (copied from uniqselprotb/trunk/includes/class-uniqselprotb-router.php)
-
tags/1.7.0/includes/constants/class-uniqselprotb-font-awesome-constant.php (copied) (copied from uniqselprotb/trunk/includes/constants/class-uniqselprotb-font-awesome-constant.php)
-
tags/1.7.0/includes/constants/class-uniqselprotb-options-constant.php (copied) (copied from uniqselprotb/trunk/includes/constants/class-uniqselprotb-options-constant.php)
-
tags/1.7.0/includes/constants/class-uniqselprotb-plugin-constant.php (copied) (copied from uniqselprotb/trunk/includes/constants/class-uniqselprotb-plugin-constant.php) (1 diff)
-
tags/1.7.0/includes/controllers/class-uniqselprotb-admin-controller.php (copied) (copied from uniqselprotb/trunk/includes/controllers/class-uniqselprotb-admin-controller.php) (4 diffs)
-
tags/1.7.0/includes/controllers/class-uniqselprotb-frontend-controller.php (copied) (copied from uniqselprotb/trunk/includes/controllers/class-uniqselprotb-frontend-controller.php)
-
tags/1.7.0/includes/views/uniqselprotb-admin-nav-settings.php (copied) (copied from uniqselprotb/trunk/includes/views/uniqselprotb-admin-nav-settings.php)
-
tags/1.7.0/includes/views/uniqselprotb-deactivate-feedback.php (added)
-
tags/1.7.0/includes/views/uniqselprotb-form-settings.php (copied) (copied from uniqselprotb/trunk/includes/views/uniqselprotb-form-settings.php)
-
tags/1.7.0/includes/views/uniqselprotb-form-style.php (copied) (copied from uniqselprotb/trunk/includes/views/uniqselprotb-form-style.php)
-
tags/1.7.0/readme.txt (copied) (copied from uniqselprotb/trunk/readme.txt) (2 diffs)
-
tags/1.7.0/uninstall.php (copied) (copied from uniqselprotb/trunk/uninstall.php)
-
tags/1.7.0/uniqselprotb.php (copied) (copied from uniqselprotb/trunk/uniqselprotb.php) (1 diff)
-
trunk/assets/css/uniqselprotb-deactivation-feedback.css (added)
-
trunk/assets/js/uniqselprotb-admin.js (modified) (1 diff)
-
trunk/assets/js/uniqselprotb-deactivation-feedback.js (added)
-
trunk/includes/class-uniqselprotb-plugin.php (modified) (2 diffs)
-
trunk/includes/constants/class-uniqselprotb-plugin-constant.php (modified) (1 diff)
-
trunk/includes/controllers/class-uniqselprotb-admin-controller.php (modified) (4 diffs)
-
trunk/includes/views/uniqselprotb-deactivate-feedback.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uniqselprotb.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uniqselprotb/tags/1.7.0/assets/js/uniqselprotb-admin.js
r3411326 r3418780 1 1 /** 2 * Handles frontendinteractions for the UNIQSELPROTB plugin admin panel.2 * Handles admin interactions for the UNIQSELPROTB plugin admin panel. 3 3 * 4 4 * @package UNIQSELPROTB -
uniqselprotb/tags/1.7.0/includes/class-uniqselprotb-plugin.php
r3357146 r3418780 53 53 */ 54 54 public function __construct() { 55 56 55 $this->uniqselprotb_load_dependencies(); 57 56 $this->define_hooks(); … … 88 87 private function define_hooks() { 89 88 if ( is_admin() ) { 89 90 90 $this->loader->add_action( 'admin_enqueue_scripts', $this->admin_controller, 'uniqselprotb_enqueue_styles' ); 91 91 $this->loader->add_action( 'admin_enqueue_scripts', $this->admin_controller, 'uniqselprotb_enqueue_scripts' ); 92 92 $this->loader->add_action( 'admin_menu', $this->admin_controller, 'uniqselprotb_register_menu' ); 93 $this->loader->add_action( 'admin_footer', $this->admin_controller, 'uniqselprotb_render_feedback_model' ); 94 $this->loader->add_action( 'wp_ajax_send_feedback', $this->admin_controller, 'uniqselprotb_send_feedback' ); 95 93 96 } else { 94 97 $this->loader->add_action( 'wp_enqueue_scripts', $this->frontend_controller, 'uniqselprotb_register_frontend_assets' ); -
uniqselprotb/tags/1.7.0/includes/constants/class-uniqselprotb-plugin-constant.php
r3388203 r3418780 22 22 */ 23 23 class UNIQSELPROTB_Plugin_Constant { 24 25 24 const PLUGIN_PREFIX = 'uniqselprotb'; 26 25 -
uniqselprotb/tags/1.7.0/includes/controllers/class-uniqselprotb-admin-controller.php
r3411326 r3418780 52 52 * @return void 53 53 */ 54 public function uniqselprotb_enqueue_styles( ) {54 public function uniqselprotb_enqueue_styles(string $hook) { 55 55 if ( ! is_admin() ) { 56 56 return; … … 75 75 76 76 wp_enqueue_style( 'wp-color-picker' ); 77 78 if ( 'plugins.php' === $hook ) { 79 wp_enqueue_style( 80 'uniqselprotb-deactivation-feedback', 81 plugin_dir_url( __FILE__ ) . '../../assets/css/uniqselprotb-deactivation-feedback.css', 82 array(), 83 '1.0.0' 84 ); 85 } 77 86 } 78 87 … … 87 96 public function uniqselprotb_enqueue_scripts( string $hook_suffix ): void { 88 97 89 if ( 'toplevel_page_' . UNIQSELPROTB_Plugin_Constant::PLUGIN_SLUG === $hook_suffix ) { 98 if ($hook_suffix === 'plugins.php') { 99 100 wp_enqueue_script( 101 'uniqselprotb-deactivation-feedback', 102 UNIQSELPROTB_PLUGIN_URL . 'assets/js/uniqselprotb-deactivation-feedback.js', 103 ['jquery'], 104 '1.7.0', 105 true 106 ); 107 108 wp_localize_script('uniqselprotb-deactivation-feedback', 'UNIQSELPROTBFeedbackAJAX', [ 109 'ajax_url' => admin_url('admin-ajax.php'), 110 'nonce' => wp_create_nonce('uniqselprotb_feedback_nonce'), 111 'plugin_slug' => plugin_basename(__FILE__), 112 ]); 113 114 } else if ( 'toplevel_page_' . UNIQSELPROTB_Plugin_Constant::PLUGIN_SLUG === $hook_suffix ) { 90 115 if ( version_compare( get_bloginfo( 'version' ), '6.3', '>=' ) ) { 91 116 wp_enqueue_script( … … 113 138 114 139 /** 140 * @since 1.7.0 141 * 142 * @return void 143 */ 144 public function uniqselprotb_render_feedback_model() { 145 $screen = get_current_screen(); 146 147 // Only on Plugins page 148 if ( ! $screen || $screen->id !== 'plugins' ) { 149 return; 150 } 151 152 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 153 154 $plugin_file = WP_PLUGIN_DIR . '/uniqselprotb/uniqselprotb.php'; 155 $plugin_data = get_plugin_data( $plugin_file ); 156 157 require plugin_dir_path( __DIR__ ) . 'views/uniqselprotb-deactivate-feedback.php'; 158 ?> 159 <?php 160 } 161 162 /** 163 * @since 1.7.0 164 * 165 * @return void 166 */ 167 public function uniqselprotb_send_feedback() 168 { 169 // Nonce validation prevents CSRF attacks 170 check_ajax_referer('uniqselprotb_feedback_nonce', 'nonce'); 171 172 $reason = isset($_POST['reason']) ? sanitize_text_field( wp_unslash( $_POST['reason'] ) ) : ''; 173 $details = isset($_POST['details']) ? sanitize_text_field( wp_unslash( $_POST['details'] ) ) : ''; 174 175 if (empty($details)) { 176 $details = null; 177 } 178 179 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 180 181 $plugin_file = WP_PLUGIN_DIR . '/uniqselprotb/uniqselprotb.php'; 182 $plugin_data = get_plugin_data( $plugin_file ); 183 184 $payload = [ 185 'plugin' => 'uniqselprotb', 186 'feedback' => $reason, 187 'details' => $details, 188 'domain' => esc_url( home_url() ), 189 'wp_version' => get_bloginfo('version'), 190 'version' => sanitize_text_field( $plugin_data['Version'] ), 191 ]; 192 193 $api_url = 'https://collect.iomitroulaki.dev/api/plugin/feedback'; 194 195 $response = wp_remote_post($api_url, [ 196 'headers' => [ 197 'Content-Type' => 'application/json' 198 ], 199 'body' => wp_json_encode($payload), 200 'method' => 'POST', 201 'timeout' => 20, 202 ]); 203 204 wp_send_json_success(); 205 } 206 207 /** 115 208 * Adds the 'defer' attribute to a specific admin script for WordPress < 6.3. 116 209 * -
uniqselprotb/tags/1.7.0/readme.txt
r3411326 r3418780 6 6 Tested up to: 6.9 7 7 Requires PHP: 8.0 8 Stable tag: 1. 6.08 Stable tag: 1.7.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 95 95 == Changelog == 96 96 97 = 1.7.0 = 98 * Added feedback modalbox 99 97 100 = 1.6.0 = 98 101 * Updated for WP 6.9 -
uniqselprotb/tags/1.7.0/uniqselprotb.php
r3411326 r3418780 20 20 * Description: Unique Selling Propositions Top Banner for WordPress 21 21 * with configurable USPs and icons. 22 * Version: 1. 6.022 * Version: 1.7.0 23 23 * Requires at least: 6.0 24 24 * Requires PHP: 8.0 -
uniqselprotb/trunk/assets/js/uniqselprotb-admin.js
r3411326 r3418780 1 1 /** 2 * Handles frontendinteractions for the UNIQSELPROTB plugin admin panel.2 * Handles admin interactions for the UNIQSELPROTB plugin admin panel. 3 3 * 4 4 * @package UNIQSELPROTB -
uniqselprotb/trunk/includes/class-uniqselprotb-plugin.php
r3357146 r3418780 53 53 */ 54 54 public function __construct() { 55 56 55 $this->uniqselprotb_load_dependencies(); 57 56 $this->define_hooks(); … … 88 87 private function define_hooks() { 89 88 if ( is_admin() ) { 89 90 90 $this->loader->add_action( 'admin_enqueue_scripts', $this->admin_controller, 'uniqselprotb_enqueue_styles' ); 91 91 $this->loader->add_action( 'admin_enqueue_scripts', $this->admin_controller, 'uniqselprotb_enqueue_scripts' ); 92 92 $this->loader->add_action( 'admin_menu', $this->admin_controller, 'uniqselprotb_register_menu' ); 93 $this->loader->add_action( 'admin_footer', $this->admin_controller, 'uniqselprotb_render_feedback_model' ); 94 $this->loader->add_action( 'wp_ajax_send_feedback', $this->admin_controller, 'uniqselprotb_send_feedback' ); 95 93 96 } else { 94 97 $this->loader->add_action( 'wp_enqueue_scripts', $this->frontend_controller, 'uniqselprotb_register_frontend_assets' ); -
uniqselprotb/trunk/includes/constants/class-uniqselprotb-plugin-constant.php
r3388203 r3418780 22 22 */ 23 23 class UNIQSELPROTB_Plugin_Constant { 24 25 24 const PLUGIN_PREFIX = 'uniqselprotb'; 26 25 -
uniqselprotb/trunk/includes/controllers/class-uniqselprotb-admin-controller.php
r3411326 r3418780 52 52 * @return void 53 53 */ 54 public function uniqselprotb_enqueue_styles( ) {54 public function uniqselprotb_enqueue_styles(string $hook) { 55 55 if ( ! is_admin() ) { 56 56 return; … … 75 75 76 76 wp_enqueue_style( 'wp-color-picker' ); 77 78 if ( 'plugins.php' === $hook ) { 79 wp_enqueue_style( 80 'uniqselprotb-deactivation-feedback', 81 plugin_dir_url( __FILE__ ) . '../../assets/css/uniqselprotb-deactivation-feedback.css', 82 array(), 83 '1.0.0' 84 ); 85 } 77 86 } 78 87 … … 87 96 public function uniqselprotb_enqueue_scripts( string $hook_suffix ): void { 88 97 89 if ( 'toplevel_page_' . UNIQSELPROTB_Plugin_Constant::PLUGIN_SLUG === $hook_suffix ) { 98 if ($hook_suffix === 'plugins.php') { 99 100 wp_enqueue_script( 101 'uniqselprotb-deactivation-feedback', 102 UNIQSELPROTB_PLUGIN_URL . 'assets/js/uniqselprotb-deactivation-feedback.js', 103 ['jquery'], 104 '1.7.0', 105 true 106 ); 107 108 wp_localize_script('uniqselprotb-deactivation-feedback', 'UNIQSELPROTBFeedbackAJAX', [ 109 'ajax_url' => admin_url('admin-ajax.php'), 110 'nonce' => wp_create_nonce('uniqselprotb_feedback_nonce'), 111 'plugin_slug' => plugin_basename(__FILE__), 112 ]); 113 114 } else if ( 'toplevel_page_' . UNIQSELPROTB_Plugin_Constant::PLUGIN_SLUG === $hook_suffix ) { 90 115 if ( version_compare( get_bloginfo( 'version' ), '6.3', '>=' ) ) { 91 116 wp_enqueue_script( … … 113 138 114 139 /** 140 * @since 1.7.0 141 * 142 * @return void 143 */ 144 public function uniqselprotb_render_feedback_model() { 145 $screen = get_current_screen(); 146 147 // Only on Plugins page 148 if ( ! $screen || $screen->id !== 'plugins' ) { 149 return; 150 } 151 152 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 153 154 $plugin_file = WP_PLUGIN_DIR . '/uniqselprotb/uniqselprotb.php'; 155 $plugin_data = get_plugin_data( $plugin_file ); 156 157 require plugin_dir_path( __DIR__ ) . 'views/uniqselprotb-deactivate-feedback.php'; 158 ?> 159 <?php 160 } 161 162 /** 163 * @since 1.7.0 164 * 165 * @return void 166 */ 167 public function uniqselprotb_send_feedback() 168 { 169 // Nonce validation prevents CSRF attacks 170 check_ajax_referer('uniqselprotb_feedback_nonce', 'nonce'); 171 172 $reason = isset($_POST['reason']) ? sanitize_text_field( wp_unslash( $_POST['reason'] ) ) : ''; 173 $details = isset($_POST['details']) ? sanitize_text_field( wp_unslash( $_POST['details'] ) ) : ''; 174 175 if (empty($details)) { 176 $details = null; 177 } 178 179 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 180 181 $plugin_file = WP_PLUGIN_DIR . '/uniqselprotb/uniqselprotb.php'; 182 $plugin_data = get_plugin_data( $plugin_file ); 183 184 $payload = [ 185 'plugin' => 'uniqselprotb', 186 'feedback' => $reason, 187 'details' => $details, 188 'domain' => esc_url( home_url() ), 189 'wp_version' => get_bloginfo('version'), 190 'version' => sanitize_text_field( $plugin_data['Version'] ), 191 ]; 192 193 $api_url = 'https://collect.iomitroulaki.dev/api/plugin/feedback'; 194 195 $response = wp_remote_post($api_url, [ 196 'headers' => [ 197 'Content-Type' => 'application/json' 198 ], 199 'body' => wp_json_encode($payload), 200 'method' => 'POST', 201 'timeout' => 20, 202 ]); 203 204 wp_send_json_success(); 205 } 206 207 /** 115 208 * Adds the 'defer' attribute to a specific admin script for WordPress < 6.3. 116 209 * -
uniqselprotb/trunk/readme.txt
r3411326 r3418780 6 6 Tested up to: 6.9 7 7 Requires PHP: 8.0 8 Stable tag: 1. 6.08 Stable tag: 1.7.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 95 95 == Changelog == 96 96 97 = 1.7.0 = 98 * Added feedback modalbox 99 97 100 = 1.6.0 = 98 101 * Updated for WP 6.9 -
uniqselprotb/trunk/uniqselprotb.php
r3411326 r3418780 20 20 * Description: Unique Selling Propositions Top Banner for WordPress 21 21 * with configurable USPs and icons. 22 * Version: 1. 6.022 * Version: 1.7.0 23 23 * Requires at least: 6.0 24 24 * Requires PHP: 8.0
Note: See TracChangeset
for help on using the changeset viewer.