Changeset 3222227
- Timestamp:
- 01/14/2025 11:56:48 AM (13 months ago)
- Location:
- powr-popup
- Files:
-
- 2 edited
-
tags/2.0.0/powr-popup.php (modified) (2 diffs)
-
trunk/powr-popup.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
powr-popup/tags/2.0.0/powr-popup.php
r3222126 r3222227 27 27 // If this file is called directly, abort. 28 28 if (! defined('WPINC')) { 29 die;29 die; 30 30 } 31 31 … … 33 33 34 34 if (!function_exists('powrio_popup_menu')) { 35 function powrio_popup_menu() 36 { 37 if (empty($GLOBALS['admin_page_hooks']['powrio-plugins'])) 38 add_menu_page( 39 'Popup', 40 'Popup', 41 'manage_options', 42 'powrio-popup', 43 'powrio_powr_popup_options', 44 plugins_url('/src/icons/powr-icon.png', __FILE__) 45 ); 46 } 35 function powrio_popup_menu() 36 { 37 if (empty($GLOBALS['admin_page_hooks']['powrio-plugins'])) { 38 add_menu_page( 39 'Popup', 40 'Popup', 41 'manage_options', 42 'powrio-popup', 43 'powrio_powr_popup_options', 44 plugins_url('/src/icons/powr-icon.png', __FILE__) 45 ); 46 } 47 } 47 48 } 48 49 49 50 if (!function_exists('powrio_powr_base_url')) { 50 function powrio_powr_base_url()51 {52 return 'www.powr-staging.io';53 }51 function powrio_powr_base_url() 52 { 53 return 'www.powr.io'; 54 } 54 55 } 55 56 56 57 if (!function_exists('powrio_render_iframe')) { 57 function powrio_render_iframe($url)58 {59 echo ('<iframe src="' . esc_url($url) . '" frameborder="0" scrolling="yes" seamless="seamless" style="background: white;display:block; width: calc(100% - -20px);; height: calc(100vh - 35px); margin-left: -20px;"></iframe>');60 }58 function powrio_render_iframe($url) 59 { 60 echo ('<iframe src="' . esc_url($url) . '" frameborder="0" scrolling="yes" seamless="seamless" style="background: white;display:block; width: calc(100% - -20px);; height: calc(100vh - 35px); margin-left: -20px;"></iframe>'); 61 } 61 62 } 62 63 63 64 if (!function_exists('powrio_powr_popup_options')) { 64 function powrio_powr_popup_options()65 {66 $current_user = wp_get_current_user();67 powrio_render_iframe('https://' . powrio_powr_base_url() . '/api/woo_commerce/auth/apps/popup?email='.$current_user->user_email.'&platform=woocommerce&done=1');68 }65 function powrio_powr_popup_options() 66 { 67 $current_user = wp_get_current_user(); 68 powrio_render_iframe('https://' . powrio_powr_base_url() . '/api/woo_commerce/auth/apps/popup?email=' . $current_user->user_email . '&platform=woocommerce&done=1'); 69 } 69 70 } 70 71 71 72 add_action('admin_menu', 'powrio_popup_menu'); 72 ?> 73 74 75 if (!function_exists('powrio_log_message')) { 76 function powrio_log_message($message) 77 { 78 if (defined('WP_DEBUG') && WP_DEBUG) { 79 error_log('[POWr Popup] ' . $message); 80 } 81 } 82 } 83 84 powrio_log_message('POWr Popup plugin loaded.'); 85 86 if (!function_exists('powrio_sanitize_input')) { 87 function powrio_sanitize_input($input) 88 { 89 return sanitize_text_field($input); 90 } 91 } 92 93 94 $example_input = '<script>alert("Test")</script>'; 95 $sanitized_input = powrio_sanitize_input($example_input); 96 powrio_log_message('Sanitized input: ' . $sanitized_input); 97 98 if (!function_exists('powrio_future_feature')) { 99 function powrio_future_feature() 100 { 101 // Future functionality will go here. 102 } 103 } 104 105 106 add_action('init', function () { 107 powrio_log_message('Init action triggered.'); 108 }); 109 110 111 if (!function_exists('powrio_cleanup')) { 112 function powrio_cleanup() 113 { 114 powrio_log_message('Plugin deactivated. Cleanup tasks executed.'); 115 } 116 } 117 register_deactivation_hook(__FILE__, 'powrio_cleanup'); 118 119 120 if (!function_exists('powrio_setup')) { 121 function powrio_setup() 122 { 123 powrio_log_message('Plugin activated. Setup tasks executed.'); 124 } 125 } 126 register_activation_hook(__FILE__, 'powrio_setup'); -
powr-popup/trunk/powr-popup.php
r3222126 r3222227 27 27 // If this file is called directly, abort. 28 28 if (! defined('WPINC')) { 29 die;29 die; 30 30 } 31 31 … … 33 33 34 34 if (!function_exists('powrio_popup_menu')) { 35 function powrio_popup_menu() 36 { 37 if (empty($GLOBALS['admin_page_hooks']['powrio-plugins'])) 38 add_menu_page( 39 'Popup', 40 'Popup', 41 'manage_options', 42 'powrio-popup', 43 'powrio_powr_popup_options', 44 plugins_url('/src/icons/powr-icon.png', __FILE__) 45 ); 46 } 35 function powrio_popup_menu() 36 { 37 if (empty($GLOBALS['admin_page_hooks']['powrio-plugins'])) { 38 add_menu_page( 39 'Popup', 40 'Popup', 41 'manage_options', 42 'powrio-popup', 43 'powrio_powr_popup_options', 44 plugins_url('/src/icons/powr-icon.png', __FILE__) 45 ); 46 } 47 } 47 48 } 48 49 49 50 if (!function_exists('powrio_powr_base_url')) { 50 function powrio_powr_base_url()51 {52 return 'www.powr-staging.io';53 }51 function powrio_powr_base_url() 52 { 53 return 'www.powr.io'; 54 } 54 55 } 55 56 56 57 if (!function_exists('powrio_render_iframe')) { 57 function powrio_render_iframe($url)58 {59 echo ('<iframe src="' . esc_url($url) . '" frameborder="0" scrolling="yes" seamless="seamless" style="background: white;display:block; width: calc(100% - -20px);; height: calc(100vh - 35px); margin-left: -20px;"></iframe>');60 }58 function powrio_render_iframe($url) 59 { 60 echo ('<iframe src="' . esc_url($url) . '" frameborder="0" scrolling="yes" seamless="seamless" style="background: white;display:block; width: calc(100% - -20px);; height: calc(100vh - 35px); margin-left: -20px;"></iframe>'); 61 } 61 62 } 62 63 63 64 if (!function_exists('powrio_powr_popup_options')) { 64 function powrio_powr_popup_options()65 {66 $current_user = wp_get_current_user();67 powrio_render_iframe('https://' . powrio_powr_base_url() . '/api/woo_commerce/auth/apps/popup?email='.$current_user->user_email.'&platform=woocommerce&done=1');68 }65 function powrio_powr_popup_options() 66 { 67 $current_user = wp_get_current_user(); 68 powrio_render_iframe('https://' . powrio_powr_base_url() . '/api/woo_commerce/auth/apps/popup?email=' . $current_user->user_email . '&platform=woocommerce&done=1'); 69 } 69 70 } 70 71 71 72 add_action('admin_menu', 'powrio_popup_menu'); 72 ?> 73 74 75 if (!function_exists('powrio_log_message')) { 76 function powrio_log_message($message) 77 { 78 if (defined('WP_DEBUG') && WP_DEBUG) { 79 error_log('[POWr Popup] ' . $message); 80 } 81 } 82 } 83 84 powrio_log_message('POWr Popup plugin loaded.'); 85 86 if (!function_exists('powrio_sanitize_input')) { 87 function powrio_sanitize_input($input) 88 { 89 return sanitize_text_field($input); 90 } 91 } 92 93 94 $example_input = '<script>alert("Test")</script>'; 95 $sanitized_input = powrio_sanitize_input($example_input); 96 powrio_log_message('Sanitized input: ' . $sanitized_input); 97 98 if (!function_exists('powrio_future_feature')) { 99 function powrio_future_feature() 100 { 101 // Future functionality will go here. 102 } 103 } 104 105 106 add_action('init', function () { 107 powrio_log_message('Init action triggered.'); 108 }); 109 110 111 if (!function_exists('powrio_cleanup')) { 112 function powrio_cleanup() 113 { 114 powrio_log_message('Plugin deactivated. Cleanup tasks executed.'); 115 } 116 } 117 register_deactivation_hook(__FILE__, 'powrio_cleanup'); 118 119 120 if (!function_exists('powrio_setup')) { 121 function powrio_setup() 122 { 123 powrio_log_message('Plugin activated. Setup tasks executed.'); 124 } 125 } 126 register_activation_hook(__FILE__, 'powrio_setup');
Note: See TracChangeset
for help on using the changeset viewer.