@@ -128,6 +128,31 @@ public function enqueue_styles() {
128
128
}
129
129
wp_register_style ( $ this ->plugin_name , FEEDZY_ABSURL . 'css/feedzy-rss-feeds.css ' , array (), $ this ->version , 'all ' );
130
130
}
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
+ }
131
156
132
157
/**
133
158
* Register the stylesheets for the admin area.
@@ -207,19 +232,7 @@ public function enqueue_styles_admin() {
207
232
)
208
233
);
209
234
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 ();
223
236
}
224
237
225
238
$ 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() {
314
327
)
315
328
);
316
329
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 ();
330
331
331
332
wp_set_script_translations ( $ this ->plugin_name . '_feedback ' , 'feedzy-rss-feeds ' );
332
333
}
@@ -1019,7 +1020,7 @@ public function feedzy_menu_pages() {
1019
1020
}
1020
1021
1021
1022
/**
1022
- * Method to render the support page .
1023
+ * Handle the RSS to Social menu item .
1023
1024
*
1024
1025
* @access public
1025
1026
*/
0 commit comments