| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace PXLBSAdminify\Inc\Admin\Frames; | |
| 3 | +namespace WPAdminify\Inc\Admin\Frames; | |
| 4 | 4 | |
| 5 | -use PXLBSAdminify\Inc\Utils; | |
| 5 | +use WPAdminify\Inc\Utils; | |
| 6 | 6 | |
| 7 | 7 | // no direct access allowed |
| 8 | 8 | if (!defined('ABSPATH')) { |
| 9 | 9 | exit; |
| @@ -28,34 +28,33 @@ | ||
| 28 | 28 | add_filter("language_attributes", [$this, "page_attribute"]); |
| 29 | 29 | add_action('admin_enqueue_scripts', [$this, 'load_scripts']); |
| 30 | 30 | |
| 31 | 31 | // Reload the page after plugin activation/deactivation |
| 32 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check, no state change. | |
| 33 | 32 | if ( isset( $_GET['activate'] ) || isset( $_GET['activate-multi'] ) || isset( $_GET['deactivate'] ) || isset( $_GET['deactivate-multi'] ) ) { |
| 34 | - add_action('admin_footer', [$this, 'render_reload_script']); | |
| 33 | + self::custom_plugin_change_reload(); | |
| 35 | 34 | } |
| 36 | 35 | } |
| 36 | + | |
| 37 | + static function custom_plugin_change_reload($actual_link = null) { | |
| 38 | + // if (shortcode_exists('ssa_booking')) { | |
| 39 | + // return; | |
| 40 | + // } Commented out to avoid issues with shortcode existence check as this plugin using iframe inside it. | |
| 37 | 41 | |
| 38 | - static function render_reload_script() { | |
| 39 | - self::custom_plugin_change_reload(); | |
| 40 | - } | |
| 41 | - | |
| 42 | - static function custom_plugin_change_reload($actual_link = null) { | |
| 43 | 42 | if (!is_null($actual_link)) { |
| 44 | - $safe_link = esc_url_raw($actual_link); | |
| 45 | 43 | echo "<script type='text/javascript'> |
| 46 | - parent.location.replace('" . esc_js($safe_link) . "'); | |
| 44 | + parent.location.replace('$actual_link'); | |
| 47 | 45 | </script>"; |
| 46 | + return; | |
| 47 | + }else{ | |
| 48 | + echo '<script type="text/javascript"> | |
| 49 | + parent.location.reload(); | |
| 50 | + </script>'; | |
| 48 | 51 | } |
| 49 | - | |
| 50 | - echo '<script type="text/javascript"> | |
| 51 | - parent.location.reload(); | |
| 52 | - </script>'; | |
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | public function load_scripts() |
| 56 | 55 | { |
| 57 | - wp_enqueue_style('frame-adminify--frame', PXLBSADMINIFY_ASSETS . 'admin/css/frame' . Utils::assets_ext('.css'), [], PXLBSADMINIFY_VER); | |
| 56 | + wp_enqueue_style('frame-adminify--frame', WP_ADMINIFY_ASSETS . 'admin/css/frame' . Utils::assets_ext('.css'), [], WP_ADMINIFY_VER); | |
| 58 | 57 | } |
| 59 | 58 | |
| 60 | 59 | public function page_attribute($attr) |
| 61 | 60 | { |