| @@ -20,10 +20,11 @@ | ||
| 20 | 20 | add_action( 'admin_enqueue_scripts', [ $this, 'wp_enqueue_scripts' ], 99 ); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | private function get_plugin_url() { |
| 24 | - if ( Helpers::is_yaymail_lite_and_yay_wp_pro_active() ) { | |
| 25 | - return YAYMAIL_WP_PLUGIN_URL; | |
| 24 | + $screen = get_current_screen(); | |
| 25 | + if ( $screen->id !== 'yaycommerce_page_yaymail-settings' && defined( 'YAYWP_PLUGIN_URL' ) ) { | |
| 26 | + return YAYWP_PLUGIN_URL; | |
| 26 | 27 | } |
| 27 | 28 | return YAYMAIL_PLUGIN_URL; |
| 28 | 29 | } |
| 29 | 30 | |
| @@ -102,9 +103,9 @@ | ||
| 102 | 103 | wp_register_script( "module/yaymail/$entry_key", "http://localhost:3000/$entry_key", $entry_opts['deps'], null, true );// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion |
| 103 | 104 | |
| 104 | 105 | } else { |
| 105 | 106 | $url = $this->get_plugin_url() . 'assets/dist/yaymail/' . $this->get_module_opts( $entry_key )['file']; |
| 106 | - wp_register_script( "module/yaymail/$entry_key", $url, $entry_opts['deps'], time(), true ); | |
| 107 | + wp_register_script( "module/yaymail/$entry_key", $url, $entry_opts['deps'], yaymail_version(), true ); | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | wp_enqueue_script( "module/yaymail/$entry_key" ); |
| 110 | 111 | } |
| @@ -144,12 +145,12 @@ | ||
| 144 | 145 | global $wp_filesystem; |
| 145 | 146 | require_once ABSPATH . '/wp-admin/includes/file.php'; |
| 146 | 147 | WP_Filesystem(); |
| 147 | 148 | |
| 148 | - if ( Helpers::is_yaymail_lite_and_yay_wp_pro_active() ) { | |
| 149 | - $plugin_path = YAYMAIL_WP_PLUGIN_PATH; | |
| 150 | - } else { | |
| 151 | - $plugin_path = YAYMAIL_PLUGIN_PATH; | |
| 149 | + $plugin_path = YAYMAIL_PLUGIN_PATH; | |
| 150 | + $screen = get_current_screen(); | |
| 151 | + if ( $screen->id !== 'yaycommerce_page_yaymail-settings' && defined( 'YAYWP_PLUGIN_PATH' ) ) { | |
| 152 | + $plugin_path = YAYWP_PLUGIN_PATH; | |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | 155 | $content = $wp_filesystem->get_contents( $plugin_path . 'assets/dist/yaymail/manifest.json' ); |
| 155 | 156 | |
| @@ -174,5 +175,5 @@ | ||
| 174 | 175 | $this->style_files[] = $file; |
| 175 | 176 | } |
| 176 | 177 | } |
| 177 | 178 | } |
| 178 | -} | |
| 179 | +} | |