@@ -128,6 +128,31 @@ public function enqueue_styles() {
128128 }
129129 wp_register_style ( $ this ->plugin_name , FEEDZY_ABSURL . 'css/feedzy-rss-feeds.css ' , array (), $ this ->version , 'all ' );
130130 }
131+
132+ /**
133+ * Helper function to enqueue the license script with localization
134+ */
135+ private function enqueue_license_script () {
136+ wp_enqueue_script (
137+ $ this ->plugin_name . '_license ' ,
138+ FEEDZY_ABSURL . 'js/feedzy-license.js ' ,
139+ array ( 'jquery ' ),
140+ $ this ->version ,
141+ true
142+ );
143+
144+ wp_localize_script (
145+ $ this ->plugin_name . '_license ' ,
146+ 'feedzyLicense ' ,
147+ array (
148+ 'l10n ' => array (
149+ 'licenseKey ' => __ ( 'License Key ' , 'feedzy-rss-feeds ' ),
150+ 'checkBtn ' => __ ( 'Check License ' , 'feedzy-rss-feeds ' ),
151+ 'errorMsg ' => __ ( 'An error occurred while checking the license. Please try again. ' , 'feedzy-rss-feeds ' ),
152+ ),
153+ )
154+ );
155+ }
131156
132157 /**
133158 * Register the stylesheets for the admin area.
@@ -207,19 +232,7 @@ public function enqueue_styles_admin() {
207232 )
208233 );
209234
210- wp_enqueue_script ( $ this ->plugin_name . '_license ' , FEEDZY_ABSURL . 'js/feedzy-license.js ' , array ( 'jquery ' ), $ this ->version , true );
211-
212- wp_localize_script (
213- $ this ->plugin_name . '_license ' ,
214- 'feedzyLicense ' ,
215- array (
216- 'l10n ' => array (
217- 'licenseKey ' => __ ( 'License Key ' , 'feedzy-rss-feeds ' ),
218- 'checkBtn ' => __ ( 'Check License ' , 'feedzy-rss-feeds ' ),
219- 'errorMsg ' => __ ( 'An error occurred while checking the license. Please try again. ' , 'feedzy-rss-feeds ' ),
220- ),
221- )
222- );
235+ $ this ->enqueue_license_script ();
223236 }
224237
225238 $ upsell_screens = array ( 'feedzy-rss_page_feedzy-settings ' , 'feedzy-rss_page_feedzy-admin-menu-pro-upsell ' );
@@ -314,19 +327,7 @@ public function enqueue_styles_admin() {
314327 )
315328 );
316329
317- wp_enqueue_script ( $ this ->plugin_name . '_license ' , FEEDZY_ABSURL . 'js/feedzy-license.js ' , array ( 'jquery ' ), $ this ->version , true );
318-
319- wp_localize_script (
320- $ this ->plugin_name . '_license ' ,
321- 'feedzyLicense ' ,
322- array (
323- 'l10n ' => array (
324- 'licenseKey ' => __ ( 'License Key ' , 'feedzy-rss-feeds ' ),
325- 'checkBtn ' => __ ( 'Check License ' , 'feedzy-rss-feeds ' ),
326- 'errorMsg ' => __ ( 'An error occurred while checking the license. Please try again. ' , 'feedzy-rss-feeds ' ),
327- ),
328- )
329- );
330+ $ this ->enqueue_license_script ();
330331
331332 wp_set_script_translations ( $ this ->plugin_name . '_feedback ' , 'feedzy-rss-feeds ' );
332333 }
@@ -1019,7 +1020,7 @@ public function feedzy_menu_pages() {
10191020 }
10201021
10211022 /**
1022- * Method to render the support page .
1023+ * Handle the RSS to Social menu item .
10231024 *
10241025 * @access public
10251026 */
0 commit comments