Livemesh SiteOrigin Widgets - Version 2.5.1

Version Description

  • Fixed - The posts grid widget won't show up with the free version of the plugin
Download this release

Release Info

Developer livemesh
Plugin Icon 128x128 Livemesh SiteOrigin Widgets
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.3 to 2.5.1

Files changed (68) hide show
  1. admin/admin-init.php +22 -0
  2. admin/views/documentation.php +70 -8
  3. admin/views/settings.php +5 -9
  4. assets/js/lsow-frontend.js +16 -16
  5. assets/js/lsow-frontend.min.js +1 -1
  6. freemius/.codeclimate.yml +19 -0
  7. freemius/.travis.yml +11 -0
  8. freemius/assets/img/addons-for-beaver-builder.png +0 -0
  9. freemius/assets/js/postmessage.min.js +1 -0
  10. freemius/composer.json +10 -0
  11. freemius/gulpfile.js +167 -0
  12. freemius/gulpfile.min.js +1 -0
  13. freemius/includes/class-freemius.php +104 -23
  14. freemius/includes/class-fs-plugin-updater.php +2 -2
  15. freemius/includes/entities/class-fs-site.php +4 -1
  16. freemius/includes/fs-plugin-info-dialog.php +1 -1
  17. freemius/package.json +1 -1
  18. freemius/start.php +1 -1
  19. freemius/templates/connect.php +11 -0
  20. freemius/templates/debug.php +10 -0
  21. freemius/templates/forms/deactivation/form.php +1 -1
  22. includes/helper-functions.php +132 -83
  23. includes/widgets/lsow-accordion-widget/lsow-accordion-widget.php +4 -2
  24. includes/widgets/lsow-accordion-widget/tpl/default.php +16 -40
  25. includes/widgets/lsow-button-widget/lsow-button-widget.php +8 -13
  26. includes/widgets/lsow-button-widget/tpl/default.php +26 -36
  27. includes/widgets/lsow-carousel-widget/lsow-carousel-widget.php +11 -12
  28. includes/widgets/lsow-carousel-widget/tpl/default.php +14 -17
  29. includes/widgets/lsow-clients-widget/lsow-clients-widget.php +7 -3
  30. includes/widgets/lsow-clients-widget/tpl/default.php +28 -27
  31. includes/widgets/lsow-heading-widget/lsow-heading-widget.php +19 -10
  32. includes/widgets/lsow-heading-widget/tpl/default.php +13 -16
  33. includes/widgets/lsow-hero-image-widget/lsow-hero-image-widget.php +7 -3
  34. includes/widgets/lsow-hero-image-widget/tpl/default.php +25 -27
  35. includes/widgets/lsow-icon-list-widget/lsow-icon-list-widget.php +7 -4
  36. includes/widgets/lsow-icon-list-widget/tpl/default.php +38 -36
  37. includes/widgets/lsow-odometers-widget/lsow-odometers-widget.php +6 -3
  38. includes/widgets/lsow-odometers-widget/tpl/default.php +33 -28
  39. includes/widgets/lsow-piecharts-widget/lsow-piecharts-widget.php +7 -4
  40. includes/widgets/lsow-piecharts-widget/tpl/default.php +17 -17
  41. includes/widgets/lsow-portfolio-widget/js/portfolio.js +6 -6
  42. includes/widgets/lsow-portfolio-widget/js/portfolio.min.js +1 -1
  43. includes/widgets/lsow-portfolio-widget/lsow-portfolio-widget.php +11 -2
  44. includes/widgets/lsow-portfolio-widget/tpl/default.php +123 -97
  45. includes/widgets/lsow-posts-carousel-widget/lsow-posts-carousel-widget.php +13 -11
  46. includes/widgets/lsow-posts-carousel-widget/tpl/default.php +97 -69
  47. includes/widgets/lsow-pricing-table-widget/lsow-pricing-table-widget.php +7 -4
  48. includes/widgets/lsow-pricing-table-widget/tpl/default.php +58 -74
  49. includes/widgets/lsow-services-widget/lsow-services-widget.php +7 -4
  50. includes/widgets/lsow-services-widget/tpl/default.php +57 -50
  51. includes/widgets/lsow-stats-bar-widget/lsow-stats-bar-widget.php +3 -1
  52. includes/widgets/lsow-stats-bar-widget/tpl/default.php +27 -24
  53. includes/widgets/lsow-tabs-widget/css/style.css +3 -6
  54. includes/widgets/lsow-tabs-widget/css/style.css.map +1 -1
  55. includes/widgets/lsow-tabs-widget/css/style.scss +2 -5
  56. includes/widgets/lsow-tabs-widget/lsow-tabs-widget.php +4 -1
  57. includes/widgets/lsow-tabs-widget/tpl/default.php +32 -43
  58. includes/widgets/lsow-team-members-widget/lsow-team-members-widget.php +48 -3
  59. includes/widgets/lsow-team-members-widget/tpl/default.php +46 -38
  60. includes/widgets/lsow-testimonials-slider-widget/js/testimonials.js +9 -19
  61. includes/widgets/lsow-testimonials-slider-widget/js/testimonials.min.js +1 -1
  62. includes/widgets/lsow-testimonials-slider-widget/lsow-testimonials-slider-widget.php +16 -4
  63. includes/widgets/lsow-testimonials-slider-widget/tpl/default.php +52 -31
  64. includes/widgets/lsow-testimonials-widget/lsow-testimonials-widget.php +5 -3
  65. includes/widgets/lsow-testimonials-widget/tpl/default.php +39 -23
  66. livemesh-siteorigin-widgets.php +2 -2
  67. plugin.php +42 -2
  68. readme.txt +16 -2
admin/admin-init.php CHANGED
@@ -22,6 +22,16 @@ class LSOW_Admin {
22
// load class admin ajax function
23
require_once(LSOW_PLUGIN_DIR . '/admin/admin-ajax.php');
24
25
}
26
27
public function init_hooks() {
@@ -34,6 +44,18 @@ class LSOW_Admin {
34
35
add_action('current_screen', array($this, 'remove_admin_notices'));
36
37
}
38
39
public function remove_admin_notices($screen) {
22
// load class admin ajax function
23
require_once(LSOW_PLUGIN_DIR . '/admin/admin-ajax.php');
24
25
+ /**
26
+ * Classes responsible for displaying admin notices.
27
+ */
28
+ if (lsow_fs()->is_not_paying()) {
29
+
30
+ require_once LSOW_PLUGIN_DIR . 'admin/notices/admin-notice.php';
31
+
32
+ require_once LSOW_PLUGIN_DIR . 'admin/notices/admin-notice-rate.php';
33
+ }
34
+
35
}
36
37
public function init_hooks() {
44
45
add_action('current_screen', array($this, 'remove_admin_notices'));
46
47
+
48
+ /**
49
+ * Notice: Rate plugin
50
+ */
51
+ if (lsow_fs()->is_not_paying()) {
52
+ $rate = new LSOW_Notice_Rate('rate', LSOW_PLUGIN_DIR . 'admin/notices/templates/rate.php');
53
+
54
+ add_action('load-plugins.php', array($rate, 'defer_first_time'));
55
+ add_action('admin_notices', array($rate, 'display_notice'));
56
+ add_action('admin_post_lsow_dismiss_notice', array($rate, 'dismiss_notice'));
57
+ }
58
+
59
}
60
61
public function remove_admin_notices($screen) {
admin/views/documentation.php CHANGED
@@ -70,6 +70,7 @@ else {
70
<li><a href="#install-plugins">Installing Recommended/Required Plugins</a></li>
71
<li><a href="#demo-data">Installing Demo Data</a></li>
72
<li><a href="#plugin-widgets">Working with plugin widgets</a></li>
73
74
<li><a href="#heading-widget">Heading Widget</a></li>
75
<li><a href="#services-widget">Services Widget</a></li>
@@ -284,6 +285,48 @@ else {
284
</ul>
285
286
287
<p>The below sections provide help on each of the widgets built as part of Livemesh SiteOrigin Widgets
288
plugin.</p>
289
@@ -1146,7 +1189,7 @@ else {
1146
1147
<hr>
1148
<h3 id="plugin-support">Plugin Support</span><a class="back-to-top" href="#panel"> Back to top</a></h3>
1149
- <p>If you have queries or issues to report related to the plugin, feel free to contact us via our dedicated support forum.</p>
1150
1151
</div>
1152
@@ -1279,10 +1322,28 @@ else {
1279
1280
<h2>Change Log for the Premium Version</h2>
1281
<br>
1282
<h3>2.3</h3>
1283
<ul>
1284
<li>Fixed - Incompatibility with certain themes due to different versions of waypoints scripts being used.</li>
1285
<li>Fixed - Leaving tags empty in the gallery lead to addition of an empty filter in the filter list</li>
1286
</ul>
1287
<h3>2.2.1</h3>
1288
<ul>
@@ -1317,7 +1378,7 @@ else {
1317
<li>Added – Advanced features like touch/swipe controls, pinch out/in, double tap, keyboard navigation, full screen, thumbnails, social media sharing, hardware accelerated animations, direct linking now supported with lightbox.</li>
1318
<li>Added - Support for creating stunning masonry gallery layouts using flexible widths and heights for images.</li>
1319
<li>Added - Ability to specify wide width for images in masonry layout of gallery.</li>
1320
- <li>Added - Options to enable/disable display of image/video titles and image/video tags in gallery and gallery carousel addons.</li>
1321
<li>Added – HTML5 video support in video gallery and video carousel modules. Support for MP4 and WebM formats.</li>
1322
<li>Fixed - Posts Grid excerpt would not display shortcodes or HTML content</li>
1323
<li>Fixed - Livemesh Gallery styling controls not taking effect for thumbnail hover and titles</li>
@@ -1357,9 +1418,9 @@ else {
1357
1358
<h3>1.7.5</h3>
1359
<ul>
1360
- <li>Added – Image size option for all major addons including grid, gallery and carousels.</li>
1361
<li>Added - The lightbox now opens on clicking anywhere on the image if no destination URL is specified for gallery item</li>
1362
- <li>Added - The link target option for all major addons like grid, gallery and carousels</li>
1363
<li>Fixed – The gallery image was not clickable to the link specified</li>
1364
<li>Fixed – The gallery filters would not center when a heading was not specified.</li>
1365
<li>Fixed – The gallery filters will not display multi-line on devices of lower resolutions like mobile devices.</li>
@@ -1548,7 +1609,7 @@ else {
1548
<!-- Knowledge base -->
1549
<div class="panel-aside">
1550
<h4><?php _e('Why upgrade to Premium version?', 'livemesh-so-widgets'); ?></h4>
1551
- <p><?php _e('Premium version offers multiple benefits - more widgets, advanced features for widgets including those part of the free plugin and priority support through a dedicated support forum.', 'livemesh-so-widgets'); ?></p>
1552
1553
<a class="button button-primary"
1554
href="https://www.livemeshthemes.com/siteorigin-widgets/widgets-demo/#why-upgrade"
@@ -1560,11 +1621,12 @@ else {
1560
<!-- Knowledge base -->
1561
<div class="panel-aside">
1562
<h4>Need support for the plugin?</h4>
1563
- <p>Support for premium version is provided through our <a href="https://support.livemeshthemes.com/forums/forum/livemesh-siteorigin-widgets-support/" title="Livemesh SiteOrigin Widgets Support forum">dedicated support forum</a>.</p>
1564
- <p>To register with support, pls send us your purchase details along with desired forum username through our <a href="https://www.livemeshthemes.com/contact-us/" title="Livemesh Contact form">contact form</a> and we will create a support account and email you the forum access details.</p>
1565
1566
<a class="button button-primary"
1567
- href="https://www.livemeshthemes.com/contact-us/"
1568
title="<?php esc_attr_e('Contact Us', 'livemesh-so-widgets'); ?>"><?php _e('Contact Us', 'livemesh-so-widgets'); ?></a>
1569
</div><!-- .panel-aside knowledge base -->
1570
70
<li><a href="#install-plugins">Installing Recommended/Required Plugins</a></li>
71
<li><a href="#demo-data">Installing Demo Data</a></li>
72
<li><a href="#plugin-widgets">Working with plugin widgets</a></li>
73
+ <li><a href="#customization">How to customize widgets output</a></li>
74
75
<li><a href="#heading-widget">Heading Widget</a></li>
76
<li><a href="#services-widget">Services Widget</a></li>
285
</ul>
286
287
288
+ <hr>
289
+ <h3 id="customization">How to customize output generated by widgets<a class="back-to-top" href="#panel"><span
290
+ class="dashicons dashicons-arrow-up-alt2"></span> Back to top</a></h3>
291
+ <p>The strength of this plugin over many others is that this plugin lets you customize almost any piece of HTML
292
+ generated by an widget part of the plugin. You can move around or modify the output elements to suit your
293
+ needs - change HTML tags, change sequence of information (e.g., place image at the bottom of the post in a
294
+ grid), add new CSS classes of your own, add branding material, delete unneeded output element (e.g. remove
295
+ post meta information), modify information (e.g., truncate description or excerpt generated) etc. with the
296
+ help of templates and filters provided by the plugin. </p>
297
+ <p>Following are the two ways to customize the output of an widget part of the plugin.</p>
298
+ <ul>
299
+ <li><p><strong>Filters</strong> are hooks that are provided at almost every customization opportunity that presents itself
300
+ as the widget renders the widgets by parsing the settings input by the user in the SiteOrigin editor. <strong>About 200+ filters have been
301
+ provided</strong> to help users customize almost any information output by the widgets of this plugin.</p>
302
+ <p>To locate the filters, the users are encouraged to have a look at the PHP code located in the <code>tpl/default.php</code> file of
303
+ the respective widget folder located in <code>includes/widgets/</code> folder.</p>
304
+
305
+ <p><a href="https://docs.presscustomizr.com/article/26-wordpress-actions-filters-and-hooks-a-guide-for-non-developers"
306
+ target="_blank">More about Filters - a guide for non-developers →</a></p>
307
+ </li>
308
+ <li><p><strong>Templates</strong> let you modify the HTML generated by an widget by placing an appropriately
309
+ named PHP file in a folder named 'siteorigin-widgets' in your child theme (or parent theme).</p>
310
+ <p>Following are the names of the files that plugin looks for to customize the <i>respective</i> widget
311
+ rendering - <code> clients.php, carousel.php, heading.php, odometers.php, piecharts.php, posts-grid.php,
312
+ posts-carousel.php, pricing-table.php, services.php, stats-bars.php, team-members.php, testimonials.php,
313
+ testimonials-slider.php, accordion.php, button.php, faq.php, features.php, gallery.php, gallery-carousel.php,
314
+ icon-list.php, image-slider.php, posts-block.php, services-carousel.php, slider.php, tabs.php. </code></p>
315
+ <p>Once a particular template file is found in the theme folder, the corresponding widget rendering code is
316
+ replaced with that in the template PHP file. The template files are provided with <code>$settings</code> variable to
317
+ help read the widget settings and then display the output. The current output generated by the plugin widget can
318
+ be seen in the <code>tpl/default.php</code> file of the widgets folder located in <code>includes/widgets/</code> folder.<strong> In
319
+ most cases, it is recommended to copy over the rendering code from the <code>tpl/default.php</code> file to the template
320
+ file and modify the same to achieve the desired customization</strong>. A basic knowledge of PHP and HTML is all that is
321
+ required to customize an widget.</p>
322
+ <li><strong>Module Templates </strong>(<span class="pro-feature">Pro Feature</span>) are PHP files which can be placed in the <code>siteorigin-widgets/modules/</code> of
323
+ the child theme to customize the posts grid item information part of posts grid/block widgets output by module files located in <code>includes/blocks/modules/</code> folder
324
+ of the premium version of the plugin. The template files should be named as <code>module-1.php, module-2.php .... , module-12.php, module-13.php</code> to
325
+ match the corresponding files located in the <code>includes/blocks/modules</code> folder. Only HTML part of <code>render()</code> function needs to
326
+ be customized in the module template files. The users are recommended to copy over the rendering code part of this function to the corresponding
327
+ template file and then customize it to their needs. </code>
328
+ </li>
329
+ </ul>
330
<p>The below sections provide help on each of the widgets built as part of Livemesh SiteOrigin Widgets
331
plugin.</p>
332
1189
1190
<hr>
1191
<h3 id="plugin-support">Plugin Support</span><a class="back-to-top" href="#panel"> Back to top</a></h3>
1192
+ <p>If you have queries or issues to report related to the plugin, feel free to contact us via our dedicated support portal.</p>
1193
1194
</div>
1195
1322
1323
<h2>Change Log for the Premium Version</h2>
1324
<br>
1325
+ <h3>2.5.1</h3>
1326
+ <ul>
1327
+ <li>Fixed - The posts grid widget won't show up with the free version of the plugin.</li>
1328
+ </ul>
1329
+ <h3>2.5</h3>
1330
+ <ul>
1331
+
1332
+ <li>Added - Major release of the plugin with extensive support for filters and templates to enable users to customize the output generated by the widgets. You can now create a template file in siteorigin-widgets folder in your child theme to customize the widgets html or use filters to customize output generated by the widgets. </li>
1333
+ <li>Updated - Documentation providing information on how to use templates and filters to customize the plugin widgets.</li>
1334
+ <li>Added - Filters for settings object employed for rendering the widgets.</li>
1335
+ <li>Fixed - Gallery pagination would break when number of items crosses 140.</li>
1336
+ <li>Added - Pagination with dotted navigation for galleries when number of pages exceeds 5.</li>
1337
+ <li>Added - Responsive pagination controls for gallery.</li>
1338
+ <li>Fixed - The fancybox lightbox would not display share, thumbnail, slideshow options for image/video gallery, posts grid and posts blocks.</li>
1339
+ <li>Added - Read More link/button options for posts blocks.</li>
1340
+ <li>Added - Block style 8 in Posts Block now much more responsive.</li>
1341
+ </ul>
1342
<h3>2.3</h3>
1343
<ul>
1344
<li>Fixed - Incompatibility with certain themes due to different versions of waypoints scripts being used.</li>
1345
<li>Fixed - Leaving tags empty in the gallery lead to addition of an empty filter in the filter list</li>
1346
+ <li>Fixed - Misplaced HTML5 video background hero header video tags information</li>
1347
</ul>
1348
<h3>2.2.1</h3>
1349
<ul>
1378
<li>Added – Advanced features like touch/swipe controls, pinch out/in, double tap, keyboard navigation, full screen, thumbnails, social media sharing, hardware accelerated animations, direct linking now supported with lightbox.</li>
1379
<li>Added - Support for creating stunning masonry gallery layouts using flexible widths and heights for images.</li>
1380
<li>Added - Ability to specify wide width for images in masonry layout of gallery.</li>
1381
+ <li>Added - Options to enable/disable display of image/video titles and image/video tags in gallery and gallery carousel widgets.</li>
1382
<li>Added – HTML5 video support in video gallery and video carousel modules. Support for MP4 and WebM formats.</li>
1383
<li>Fixed - Posts Grid excerpt would not display shortcodes or HTML content</li>
1384
<li>Fixed - Livemesh Gallery styling controls not taking effect for thumbnail hover and titles</li>
1418
1419
<h3>1.7.5</h3>
1420
<ul>
1421
+ <li>Added – Image size option for all major widgets including grid, gallery and carousels.</li>
1422
<li>Added - The lightbox now opens on clicking anywhere on the image if no destination URL is specified for gallery item</li>
1423
+ <li>Added - The link target option for all major widgets like grid, gallery and carousels</li>
1424
<li>Fixed – The gallery image was not clickable to the link specified</li>
1425
<li>Fixed – The gallery filters would not center when a heading was not specified.</li>
1426
<li>Fixed – The gallery filters will not display multi-line on devices of lower resolutions like mobile devices.</li>
1609
<!-- Knowledge base -->
1610
<div class="panel-aside">
1611
<h4><?php _e('Why upgrade to Premium version?', 'livemesh-so-widgets'); ?></h4>
1612
+ <p><?php _e('Premium version offers multiple benefits - more widgets, advanced features for widgets including those part of the free plugin and priority support through a dedicated support portal.', 'livemesh-so-widgets'); ?></p>
1613
1614
<a class="button button-primary"
1615
href="https://www.livemeshthemes.com/siteorigin-widgets/widgets-demo/#why-upgrade"
1621
<!-- Knowledge base -->
1622
<div class="panel-aside">
1623
<h4>Need support for the plugin?</h4>
1624
+ <p>The premium version of the plugin entitles you to quick support with replies posted within 24 hours (on week days). </p>
1625
+
1626
+ <p>Please submit your support query through our <a href="https://www.livemeshthemes.com/siteorigin-widgets/contact-us/" title="Livemesh Contact form">website contact form</a>. This will create a support ticket in our support portal.</p>
1627
1628
<a class="button button-primary"
1629
+ href="https://www.livemeshthemes.com/siteorigin-widgets/contact-us/"
1630
title="<?php esc_attr_e('Contact Us', 'livemesh-so-widgets'); ?>"><?php _e('Contact Us', 'livemesh-so-widgets'); ?></a>
1631
</div><!-- .panel-aside knowledge base -->
1632
admin/views/settings.php CHANGED
@@ -288,25 +288,21 @@ $custom_css = lsow_get_option('lsow_custom_css', '');
288
<p>We offer premium support for our paid customers with following benefits - </p>
289
290
<ul>
291
- <li><strong>Dedicated Forum</strong> - The customers will be provided access to a
292
- dedicated support forum.
293
</li>
294
- <li><strong>Public and Private Tickets</strong> - Private tickets help you work with us
295
directly regarding the issues you are facing in your site by sharing the details of
296
your site securely.
297
</li>
298
- <li><strong>Searchable Topics</strong> - The support forum is searchable for public
299
- topics helping you look for resolution of similar issues reported by other
300
- customers.
301
- </li>
302
</li>
303
<li><strong>Faster turnaround</strong> - The threads opened by paid customers will be
304
attended to within 24 hours of opening a ticket.
305
</li>
306
<li><strong>Bug fixes and Enhancements</strong> - Any fixes and enhancements made to the
307
- widgets will be prioritized to arrive quicker on the premium version.
308
</li>
309
- <li><strong>Proven Expertize</strong> - Having served over <strong>11,000+
310
customers</strong> of our themes over past 3 years, the support provided by us
311
is proven in competence and commitment.
312
</li>
288
<p>We offer premium support for our paid customers with following benefits - </p>
289
290
<ul>
291
+ <li><strong>Dedicated Support Portal</strong> - The customers will be provided access to a
292
+ dedicated support portal powered by Freshdesk.
293
</li>
294
+ <li><strong>Private Tickets</strong> - Private tickets help you work with us
295
directly regarding the issues you are facing in your site by sharing the details of
296
your site securely.
297
</li>
298
</li>
299
<li><strong>Faster turnaround</strong> - The threads opened by paid customers will be
300
attended to within 24 hours of opening a ticket.
301
</li>
302
<li><strong>Bug fixes and Enhancements</strong> - Any fixes and enhancements made to the
303
+ elements will be prioritized to arrive quicker on the premium version.
304
</li>
305
+ <li><strong>Proven Expertize</strong> - Having served over <strong>12,280+
306
customers</strong> of our themes over past 3 years, the support provided by us
307
is proven in competence and commitment.
308
</li>
assets/js/lsow-frontend.js CHANGED
@@ -83,37 +83,37 @@ if (typeof (jQuery) != 'undefined') {
83
84
var carousel_elem = $(this);
85
86
- var arrows = carousel_elem.data('arrows') ? true : false;
87
88
- var dots = carousel_elem.data('dots') ? true : false;
89
90
- var autoplay = carousel_elem.data('autoplay') ? true : false;
91
92
- var autoplay_speed = carousel_elem.data('autoplay_speed') || 3000;
93
94
- var animation_speed = carousel_elem.data('animation_speed') || 300;
95
96
- var fade = carousel_elem.data('fade') ? true : false;
97
98
- var pause_on_hover = carousel_elem.data('pause_on_hover') ? true : false;
99
100
- var display_columns = carousel_elem.data('display_columns') || 4;
101
102
- var scroll_columns = carousel_elem.data('scroll_columns') || 4;
103
104
- var gutter = carousel_elem.data('gutter') || 10;
105
106
- var tablet_width = carousel_elem.data('tablet_width') || 800;
107
108
- var tablet_display_columns = carousel_elem.data('tablet_display_columns') || 2;
109
110
- var tablet_scroll_columns = carousel_elem.data('tablet_scroll_columns') || 2;
111
112
- var mobile_width = carousel_elem.data('mobile_width') || 480;
113
114
- var mobile_display_columns = carousel_elem.data('mobile_display_columns') || 1;
115
116
- var mobile_scroll_columns = carousel_elem.data('mobile_scroll_columns') || 1;
117
118
carousel_elem.slick({
119
arrows: arrows,
83
84
var carousel_elem = $(this);
85
86
+ var settings = carousel_elem.data('settings');
87
88
+ var arrows = settings['arrows'];
89
90
+ var dots = settings['dots'];
91
92
+ var autoplay = settings['autoplay'];
93
94
+ var autoplay_speed = parseInt(settings['autoplay_speed']) || 3000;
95
96
+ var animation_speed = parseInt(settings['animation_speed']) || 300;
97
98
+ var fade = settings['fade'];
99
100
+ var pause_on_hover = settings['pause_on_hover'];
101
102
+ var display_columns = parseInt(settings['display_columns']) || 4;
103
104
+ var scroll_columns = parseInt(settings['scroll_columns']) || 4;
105
106
+ var tablet_width = parseInt(settings['tablet_width']) || 800;
107
108
+ var tablet_display_columns = parseInt(settings['tablet_display_columns']) || 2;
109
110
+ var tablet_scroll_columns = parseInt(settings['tablet_scroll_columns']) || 2;
111
112
+ var mobile_width = parseInt(settings['mobile_width']) || 480;
113
114
+ var mobile_display_columns = parseInt(settings['mobile_display_columns']) || 1;
115
116
+ var mobile_scroll_columns = parseInt(settings['mobile_scroll_columns']) || 1;
117
118
carousel_elem.slick({
119
arrows: arrows,
assets/js/lsow-frontend.min.js CHANGED
@@ -1 +1 @@
1
- if(typeof jQuery!="undefined"){jQuery.noConflict();(function($){"use strict";$(function(){var LSOW_Frontend={init:function(){this.output_custom_css();this.carousel();this.setup_parallax();this.setup_ytp();this.setup_animations()},setup_animations:function(){$(".lsow-visible-on-scroll:not(.animated)").css("opacity",0);"function"!=typeof window.lsow_animate_widgets&&(window.lsow_animate_widgets=function(){"undefined"!=typeof $.fn.livemeshWaypoint&&$(".lsow-animate-on-scroll:not(.animated)").livemeshWaypoint(function(){var animateClass=$(this.element).data("animation");$(this.element).addClass("animated "+animateClass).css("opacity",1)},{offset:"85%"})});window.setTimeout(lsow_animate_widgets,500)},output_custom_css:function(){var custom_css=lsow_settings["custom_css"];if(custom_css!==undefined&&custom_css!=""){custom_css='<style type="text/css">'+custom_css+"</style>";$("head").append(custom_css)}},isMobile:function(){"use strict";if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){return true}return false},vendor_prefix:function(){var prefix;function prefix(){var styles=window.getComputedStyle(document.documentElement,"");prefix=(Array.prototype.slice.call(styles).join("").match(/-(moz|webkit|ms)-/)||styles.OLink===""&&["","o"])[1];return prefix}prefix();return prefix},carousel:function(){if($().slick===undefined){return}var carousel_elements=$(".lsow-carousel, .lsow-posts-carousel, .lsow-gallery-carousel");carousel_elements.each(function(){var carousel_elem=$(this);var arrows=carousel_elem.data("arrows")?true:false;var dots=carousel_elem.data("dots")?true:false;var autoplay=carousel_elem.data("autoplay")?true:false;var autoplay_speed=carousel_elem.data("autoplay_speed")||3e3;var animation_speed=carousel_elem.data("animation_speed")||300;var fade=carousel_elem.data("fade")?true:false;var pause_on_hover=carousel_elem.data("pause_on_hover")?true:false;var display_columns=carousel_elem.data("display_columns")||4;var scroll_columns=carousel_elem.data("scroll_columns")||4;var gutter=carousel_elem.data("gutter")||10;var tablet_width=carousel_elem.data("tablet_width")||800;var tablet_display_columns=carousel_elem.data("tablet_display_columns")||2;var tablet_scroll_columns=carousel_elem.data("tablet_scroll_columns")||2;var mobile_width=carousel_elem.data("mobile_width")||480;var mobile_display_columns=carousel_elem.data("mobile_display_columns")||1;var mobile_scroll_columns=carousel_elem.data("mobile_scroll_columns")||1;carousel_elem.slick({arrows:arrows,dots:dots,infinite:true,autoplay:autoplay,autoplaySpeed:autoplay_speed,speed:animation_speed,fade:false,pauseOnHover:pause_on_hover,slidesToShow:display_columns,slidesToScroll:scroll_columns,responsive:[{breakpoint:tablet_width,settings:{slidesToShow:tablet_display_columns,slidesToScroll:tablet_scroll_columns}},{breakpoint:mobile_width,settings:{slidesToShow:mobile_display_columns,slidesToScroll:mobile_scroll_columns}}]})})},setup_parallax:function(){var scroll=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/600)};function init_parallax(){if(LSOW_Frontend.isMobile()===false){var windowHeight=$(window).height();$(".lsow-section-bg-parallax").each(function(){var segment=$(this);var elementHeight=segment.outerHeight(true);var boundingRect=segment[0].getBoundingClientRect();if(boundingRect.bottom>=0&&boundingRect.top<=windowHeight){var distanceToCover=windowHeight+elementHeight;var pixelsMoved=windowHeight-boundingRect.top;var toTransform=50;var transformPercent=toTransform*Math.abs(pixelsMoved/distanceToCover);transformPercent=-transformPercent.toFixed(2);segment.find(".lsow-parallax-bg").css("-"+LSOW_Frontend.vendor_prefix()+"-transform","translate3d(0px, "+transformPercent+"%, 0px)")}})}}if(this.isMobile()===false){scroll(init_parallax);$(window).on("scroll",function(){scroll(init_parallax)})}},setup_ytp:function(){if(this.isMobile()||$().mb_YTPlayer===undefined){return}$(".lsow-section-bg-youtube").mb_YTPlayer({startAt:0,showYTLogo:false,showControls:false,autoPlay:true,mute:true,containment:"self"})}};LSOW_Frontend.init()})})(jQuery)}
1
+ if(typeof jQuery!="undefined"){jQuery.noConflict();(function($){"use strict";$(function(){var LSOW_Frontend={init:function(){this.output_custom_css();this.carousel();this.setup_parallax();this.setup_ytp();this.setup_animations()},setup_animations:function(){$(".lsow-visible-on-scroll:not(.animated)").css("opacity",0);"function"!=typeof window.lsow_animate_widgets&&(window.lsow_animate_widgets=function(){"undefined"!=typeof $.fn.livemeshWaypoint&&$(".lsow-animate-on-scroll:not(.animated)").livemeshWaypoint(function(){var animateClass=$(this.element).data("animation");$(this.element).addClass("animated "+animateClass).css("opacity",1)},{offset:"85%"})});window.setTimeout(lsow_animate_widgets,500)},output_custom_css:function(){var custom_css=lsow_settings["custom_css"];if(custom_css!==undefined&&custom_css!=""){custom_css='<style type="text/css">'+custom_css+"</style>";$("head").append(custom_css)}},isMobile:function(){"use strict";if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){return true}return false},vendor_prefix:function(){var prefix;function prefix(){var styles=window.getComputedStyle(document.documentElement,"");prefix=(Array.prototype.slice.call(styles).join("").match(/-(moz|webkit|ms)-/)||styles.OLink===""&&["","o"])[1];return prefix}prefix();return prefix},carousel:function(){if($().slick===undefined){return}var carousel_elements=$(".lsow-carousel, .lsow-posts-carousel, .lsow-gallery-carousel");carousel_elements.each(function(){var carousel_elem=$(this);var settings=carousel_elem.data("settings");var arrows=settings["arrows"];var dots=settings["dots"];var autoplay=settings["autoplay"];var autoplay_speed=parseInt(settings["autoplay_speed"])||3e3;var animation_speed=parseInt(settings["animation_speed"])||300;var fade=settings["fade"];var pause_on_hover=settings["pause_on_hover"];var display_columns=parseInt(settings["display_columns"])||4;var scroll_columns=parseInt(settings["scroll_columns"])||4;var tablet_width=parseInt(settings["tablet_width"])||800;var tablet_display_columns=parseInt(settings["tablet_display_columns"])||2;var tablet_scroll_columns=parseInt(settings["tablet_scroll_columns"])||2;var mobile_width=parseInt(settings["mobile_width"])||480;var mobile_display_columns=parseInt(settings["mobile_display_columns"])||1;var mobile_scroll_columns=parseInt(settings["mobile_scroll_columns"])||1;carousel_elem.slick({arrows:arrows,dots:dots,infinite:true,autoplay:autoplay,autoplaySpeed:autoplay_speed,speed:animation_speed,fade:false,pauseOnHover:pause_on_hover,slidesToShow:display_columns,slidesToScroll:scroll_columns,responsive:[{breakpoint:tablet_width,settings:{slidesToShow:tablet_display_columns,slidesToScroll:tablet_scroll_columns}},{breakpoint:mobile_width,settings:{slidesToShow:mobile_display_columns,slidesToScroll:mobile_scroll_columns}}]})})},setup_parallax:function(){var scroll=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/600)};function init_parallax(){if(LSOW_Frontend.isMobile()===false){var windowHeight=$(window).height();$(".lsow-section-bg-parallax").each(function(){var segment=$(this);var elementHeight=segment.outerHeight(true);var boundingRect=segment[0].getBoundingClientRect();if(boundingRect.bottom>=0&&boundingRect.top<=windowHeight){var distanceToCover=windowHeight+elementHeight;var pixelsMoved=windowHeight-boundingRect.top;var toTransform=50;var transformPercent=toTransform*Math.abs(pixelsMoved/distanceToCover);transformPercent=-transformPercent.toFixed(2);segment.find(".lsow-parallax-bg").css("-"+LSOW_Frontend.vendor_prefix()+"-transform","translate3d(0px, "+transformPercent+"%, 0px)")}})}}if(this.isMobile()===false){scroll(init_parallax);$(window).on("scroll",function(){scroll(init_parallax)})}},setup_ytp:function(){if(this.isMobile()||$().mb_YTPlayer===undefined){return}$(".lsow-section-bg-youtube").mb_YTPlayer({startAt:0,showYTLogo:false,showControls:false,autoPlay:true,mute:true,containment:"self"})}};LSOW_Frontend.init()})})(jQuery)}
freemius/.codeclimate.yml ADDED
@@ -0,0 +1,19 @@
1
+ engines:
2
+ phpcodesniffer:
3
+ enabled: true
4
+ config:
5
+ standard: "WordPress"
6
+ checks:
7
+ Squiz Commenting InlineComment InvalidEndChar:
8
+ enabled: false
9
+ Squiz Commenting InlineComment SpacingBefore:
10
+ enabled: false
11
+ Squiz Commenting InlineComment WrongStyle:
12
+ enabled: false
13
+ Generic Commenting DocComment MissingShort:
14
+ enabled: false
15
+ Generic WhiteSpace ScopeIndent IncorrectExact:
16
+ enabled: false
17
+ ratings:
18
+ paths:
19
+ - "**.php"
freemius/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ sudo: false
2
+
3
+ language: php
4
+
5
+ php:
6
+ - 5.3
7
+ - 5.4
8
+ - 5.5
9
+ - 5.6
10
+ - 7.0
11
+ - hhvm
freemius/assets/img/addons-for-beaver-builder.png ADDED
Binary file
freemius/assets/js/postmessage.min.js ADDED
@@ -0,0 +1 @@
1
+ (function($,undef){var global=this;global.FS=global.FS||{};global.FS.PostMessage=function(){var _is_child=false,_postman=new NoJQueryPostMessageMixin("postMessage","receiveMessage"),_callbacks={},_base_url,_parent_url=decodeURIComponent(document.location.hash.replace(/^#/,"")),_parent_subdomain=_parent_url.substring(0,_parent_url.indexOf("/","https://"===_parent_url.substring(0,"https://".length)?8:7)),_init=function(){_postman.receiveMessage(function(e){var data=JSON.parse(e.data);if(_callbacks[data.type]){for(var i=0;i<_callbacks[data.type].length;i++){_callbacks[data.type][i](data.data)}}},_base_url)},_hasParent=""!==_parent_url,$window=$(window),$html=$("html");return{init:function(url,iframes){_base_url=url;_init();FS.PostMessage.receiveOnce("forward",function(data){window.location=data.url});iframes=iframes||[];if(iframes.length>0){$window.on("scroll",function(){for(var i=0;i<iframes.length;i++){FS.PostMessage.postScroll(iframes[i])}})}},init_child:function(){this.init(_parent_subdomain);_is_child=true;$(window).bind("load",function(){FS.PostMessage.postHeight();FS.PostMessage.post("loaded")})},hasParent:function(){return _hasParent},postHeight:function(diff,wrapper){diff=diff||0;wrapper=wrapper||"#wrap_section";this.post("height",{height:diff+$(wrapper).outerHeight(true)})},postScroll:function(iframe){this.post("scroll",{top:$window.scrollTop(),height:$window.height()-parseFloat($html.css("paddingTop"))-parseFloat($html.css("marginTop"))},iframe)},post:function(type,data,iframe){console.debug("PostMessage.post",type);if(iframe){_postman.postMessage(JSON.stringify({type:type,data:data}),iframe.src,iframe.contentWindow)}else{_postman.postMessage(JSON.stringify({type:type,data:data}),_parent_url,window.parent)}},receive:function(type,callback){console.debug("PostMessage.receive",type);if(undef===_callbacks[type])_callbacks[type]=[];_callbacks[type].push(callback)},receiveOnce:function(type,callback){if(this.is_set(type))return;this.receive(type,callback)},is_set:function(type){return undef!=_callbacks[type]},parent_url:function(){return _parent_url},parent_subdomain:function(){return _parent_subdomain}}}()})(jQuery);
freemius/composer.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "freemius/wordpress-sdk",
3
+ "description": "Freemius WordPress SDK",
4
+ "keywords": ["freemius", "wordpress", "plugin", "sdk"],
5
+ "homepage": "https://freemius.com",
6
+ "license": "GPL-3.0-only",
7
+ "require": {
8
+ "php": ">=5.2"
9
+ }
10
+ }
freemius/gulpfile.js ADDED
@@ -0,0 +1,167 @@
1
+ var gulp = require('gulp');
2
+ var path = require('path');
3
+ var filesystem = require('fs');
4
+ var wpPot = require('gulp-wp-pot');
5
+ var gettext = require('gulp-gettext');
6
+ var sort = require('gulp-sort');
7
+ var pofill = require('gulp-pofill');
8
+ var rename = require('gulp-rename');
9
+ var clean = require('gulp-clean');
10
+
11
+ var languagesFolder = './languages/';
12
+
13
+ var options = require('./transifex-config.json');
14
+
15
+ function getFolders(dir) {
16
+ return filesystem.readdirSync(dir)
17
+ .filter(function (file) {
18
+ return filesystem.statSync(path.join(dir, file)).isDirectory();
19
+ });
20
+ }
21
+
22
+ var transifex = require('gulp-transifex').createClient(options);
23
+
24
+ // Create POT out of i18n.php.
25
+ gulp.task('prepare-source', function () {
26
+ gulp.src('**/*.php')
27
+ .pipe(sort())
28
+ .pipe(wpPot({
29
+ destFile : 'freemius.pot',
30
+ package : 'freemius',
31
+ bugReport : 'https://github.com/Freemius/wordpress-sdk/issues',
32
+ lastTranslator : 'Vova Feldman <vova@freemius.com>',
33
+ team : 'Freemius Team <admin@freemius.com>',
34
+ /*gettextMethods: {
35
+ instances: ['this', '_fs'],
36
+ methods: [
37
+ 'get_text_inline'
38
+ ]
39
+ },*/
40
+ gettextFunctions: [
41
+ {name: 'get_text_inline'},
42
+
43
+ {name: 'fs_text_inline'},
44
+ {name: 'fs_echo_inline'},
45
+ {name: 'fs_esc_js_inline'},
46
+ {name: 'fs_esc_attr_inline'},
47
+ {name: 'fs_esc_attr_echo_inline'},
48
+ {name: 'fs_esc_html_inline'},
49
+ {name: 'fs_esc_html_echo_inline'},
50
+
51
+ {name: 'get_text_x_inline', context: 2},
52
+ {name: 'fs_text_x_inline', context: 2},
53
+ {name: 'fs_echo_x_inline', context: 2},
54
+ {name: 'fs_esc_attr_x_inline', context: 2},
55
+ {name: 'fs_esc_js_x_inline', context: 2},
56
+ {name: 'fs_esc_js_echo_x_inline', context: 2},
57
+ {name: 'fs_esc_html_x_inline', context: 2},
58
+ {name: 'fs_esc_html_echo_x_inline', context: 2}
59
+ /*,
60
+
61
+
62
+ {name: '_fs_text'},
63
+ {name: '_fs_x', context: 2},
64
+ {name: '_fs_echo'},
65
+ {name: '_fs_esc_attr'},
66
+ {name: '_fs_esc_attr_echo'},
67
+ {name: '_fs_esc_html'},
68
+ {name: '_fs_esc_html_echo'},
69
+ {name: '_fs_ex', context: 2},
70
+ {name: '_fs_esc_attr_x', context: 2},
71
+ {name: '_fs_esc_html_x', context: 2},
72
+
73
+ {name: '_fs_n', plural: 2},
74
+ {name: '_fs_n_noop', plural: 2},
75
+ {name: '_fs_nx', plural: 2, context: 4},
76
+ {name: '_fs_nx_noop', plural: 2, context: 3}*/
77
+ ]
78
+ }))
79
+ .pipe(gulp.dest(languagesFolder + 'freemius.pot'));
80
+
81
+ // Create English PO out of the POT.
82
+ return gulp.src(languagesFolder + 'freemius.pot')
83
+ .pipe(pofill({
84
+ items: function (item) {
85
+ // If msgstr is empty, use identity translation
86
+ if (!item.msgstr.length) {
87
+ item.msgstr = [''];
88
+ }
89
+ if (!item.msgstr[0]) {
90
+ item.msgstr[0] = item.msgid;
91
+ }
92
+ return item;
93
+ }
94
+ }))
95
+ .pipe(rename('freemius-en.po'))
96
+ .pipe(gulp.dest(languagesFolder));
97
+ });
98
+
99
+ // Push updated po resource to transifex.
100
+ gulp.task('update-transifex', ['prepare-source'], function () {
101
+ return gulp.src(languagesFolder + 'freemius-en.po')
102
+ .pipe(transifex.pushResource());
103
+ });
104
+
105
+ // Download latest *.po translations.
106
+ gulp.task('download-translations', ['update-transifex'], function () {
107
+ return gulp.src(languagesFolder + 'freemius-en.po')
108
+ .pipe(transifex.pullResource());
109
+ });
110
+
111
+ // Move translations to languages root.
112
+ gulp.task('prepare-translations', ['download-translations'], function () {
113
+ var folders = getFolders(languagesFolder);
114
+
115
+ return folders.map(function (folder) {
116
+ return gulp.src(path.join(languagesFolder, folder, 'freemius-en.po'))
117
+ .pipe(rename('freemius-' + folder + '.po'))
118
+ .pipe(gulp.dest(languagesFolder));
119
+ });
120
+ });
121
+
122
+ // Feel up empty translations with English.
123
+ gulp.task('translations-feelup', ['prepare-translations'], function () {
124
+ return gulp.src(languagesFolder + '*.po')
125
+ .pipe(pofill({
126
+ items: function (item) {
127
+ // If msgstr is empty, use identity translation
128
+ if (0 == item.msgstr.length) {
129
+ item.msgstr = [''];
130
+ }
131
+ if (0 == item.msgstr[0].length) {
132
+ // item.msgid[0] = item.msgid;
133
+ item.msgstr[0] = item.msgid;
134
+ }
135
+ return item;
136
+ }
137
+ }))
138
+ .pipe(gulp.dest(languagesFolder));
139
+ });
140
+
141
+ // Cleanup temporary translation folders.
142
+ gulp.task('cleanup', ['prepare-translations'], function () {
143
+ var folders = getFolders(languagesFolder);
144
+
145
+ return folders.map(function (folder) {
146
+ return gulp.src(path.join(languagesFolder, folder), {read: false})
147
+ .pipe(clean());
148
+ });
149
+ });
150
+
151
+ // Compile *.po to *.mo binaries for usage.
152
+ gulp.task('compile-translations', ['translations-feelup'], function () {
153
+ // Compile POs to MOs.
154
+ return gulp.src(languagesFolder + '*.po')
155
+ .pipe(gettext())
156
+ .pipe(gulp.dest(languagesFolder))
157
+ });
158
+
159
+ gulp.task('default', [], function () {
160
+ gulp.run('prepare-source');
161
+ gulp.run('update-transifex');
162
+ gulp.run('download-translations');
163
+ gulp.run('prepare-translations');
164
+ gulp.run('translations-feelup');
165
+ gulp.run('cleanup');
166
+ gulp.run('compile-translations');
167
+ });
freemius/gulpfile.min.js ADDED
@@ -0,0 +1 @@
1
+ var gulp=require("gulp");var path=require("path");var filesystem=require("fs");var wpPot=require("gulp-wp-pot");var gettext=require("gulp-gettext");var sort=require("gulp-sort");var pofill=require("gulp-pofill");var rename=require("gulp-rename");var clean=require("gulp-clean");var languagesFolder="./languages/";var options=require("./transifex-config.json");function getFolders(dir){return filesystem.readdirSync(dir).filter(function(file){return filesystem.statSync(path.join(dir,file)).isDirectory()})}var transifex=require("gulp-transifex").createClient(options);gulp.task("prepare-source",function(){gulp.src("**/*.php").pipe(sort()).pipe(wpPot({destFile:"freemius.pot",package:"freemius",bugReport:"https://github.com/Freemius/wordpress-sdk/issues",lastTranslator:"Vova Feldman <vova@freemius.com>",team:"Freemius Team <admin@freemius.com>",gettextFunctions:[{name:"get_text_inline"},{name:"fs_text_inline"},{name:"fs_echo_inline"},{name:"fs_esc_js_inline"},{name:"fs_esc_attr_inline"},{name:"fs_esc_attr_echo_inline"},{name:"fs_esc_html_inline"},{name:"fs_esc_html_echo_inline"},{name:"get_text_x_inline",context:2},{name:"fs_text_x_inline",context:2},{name:"fs_echo_x_inline",context:2},{name:"fs_esc_attr_x_inline",context:2},{name:"fs_esc_js_x_inline",context:2},{name:"fs_esc_js_echo_x_inline",context:2},{name:"fs_esc_html_x_inline",context:2},{name:"fs_esc_html_echo_x_inline",context:2}]})).pipe(gulp.dest(languagesFolder+"freemius.pot"));return gulp.src(languagesFolder+"freemius.pot").pipe(pofill({items:function(item){if(!item.msgstr.length){item.msgstr=[""]}if(!item.msgstr[0]){item.msgstr[0]=item.msgid}return item}})).pipe(rename("freemius-en.po")).pipe(gulp.dest(languagesFolder))});gulp.task("update-transifex",["prepare-source"],function(){return gulp.src(languagesFolder+"freemius-en.po").pipe(transifex.pushResource())});gulp.task("download-translations",["update-transifex"],function(){return gulp.src(languagesFolder+"freemius-en.po").pipe(transifex.pullResource())});gulp.task("prepare-translations",["download-translations"],function(){var folders=getFolders(languagesFolder);return folders.map(function(folder){return gulp.src(path.join(languagesFolder,folder,"freemius-en.po")).pipe(rename("freemius-"+folder+".po")).pipe(gulp.dest(languagesFolder))})});gulp.task("translations-feelup",["prepare-translations"],function(){return gulp.src(languagesFolder+"*.po").pipe(pofill({items:function(item){if(0==item.msgstr.length){item.msgstr=[""]}if(0==item.msgstr[0].length){item.msgstr[0]=item.msgid}return item}})).pipe(gulp.dest(languagesFolder))});gulp.task("cleanup",["prepare-translations"],function(){var folders=getFolders(languagesFolder);return folders.map(function(folder){return gulp.src(path.join(languagesFolder,folder),{read:false}).pipe(clean())})});gulp.task("compile-translations",["translations-feelup"],function(){return gulp.src(languagesFolder+"*.po").pipe(gettext()).pipe(gulp.dest(languagesFolder))});gulp.task("default",[],function(){gulp.run("prepare-source");gulp.run("update-transifex");gulp.run("download-translations");gulp.run("prepare-translations");gulp.run("translations-feelup");gulp.run("cleanup");gulp.run("compile-translations")});
freemius/includes/class-freemius.php CHANGED
@@ -2630,26 +2630,28 @@
2630
self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
2631
2632
if ( is_multisite() ) {
2633
/**
2634
- * If the id_slug_type_path_map exists on the site level but doesn't exist on the
2635
* network level storage, it means that we need to process the storage with migration.
2636
*
2637
- * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, id_slug_type_path_map will be already set in the network level storage.
2638
*
2639
* @author Vova Feldman (@svovaf)
2640
* @since 2.0.0
2641
*/
2642
- if ( null === self::$_accounts->get_option( 'id_slug_type_path_map', null, true ) &&
2643
- null !== self::$_accounts->get_option( 'id_slug_type_path_map', null, false )
2644
) {
2645
- self::migrate_accounts_to_network();
2646
-
2647
- // Migrate API options from site level to network level.
2648
- $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
2649
- $api_network_options->migrate_to_network();
2650
-
2651
- // Migrate API cache to network level storage.
2652
- FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
2653
}
2654
}
2655
@@ -2679,6 +2681,24 @@
2679
self::$_statics_loaded = true;
2680
}
2681
2682
#----------------------------------------------------------------------------------
2683
#region Localization
2684
#----------------------------------------------------------------------------------
@@ -2905,6 +2925,10 @@
2905
}
2906
2907
fs_redirect( $download_url );
2908
}
2909
}
2910
@@ -5987,7 +6011,7 @@
5987
* @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
5988
*/
5989
private function schedule_install_sync( $except_blog_id = 0 ) {
5990
- $this->schedule_cron( 'install_sync', 'install_sync', 'single', 0, false, $except_blog_id );
5991
}
5992
5993
/**
@@ -10574,7 +10598,7 @@
10574
return;
10575
}
10576
10577
- if ( ! $this->is_premium() || $this->has_active_valid_license() ) {
10578
// This is relevant only to the free versions and premium versions without an active license.
10579
return;
10580
}
@@ -15590,7 +15614,8 @@
15590
return;
15591
}
15592
15593
- $encrypted_site = clone ( is_object( $site ) ? $site : $this->_site );
15594
15595
$sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15596
@@ -16288,14 +16313,62 @@
16288
* @since 1.2.1
16289
*/
16290
function has_active_valid_license() {
16291
return (
16292
- is_object( $this->_license ) &&
16293
- is_numeric( $this->_license->id ) &&
16294
- $this->_license->is_active() &&
16295
- $this->_license->is_valid()
16296
);
16297
}
16298
16299
/**
16300
* Check if site assigned with license with enabled features.
16301
*
@@ -17289,7 +17362,7 @@
17289
* @return bool
17290
*/
17291
private function _can_download_premium() {
17292
- return $this->has_active_valid_license() ||
17293
( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
17294
}
17295
@@ -18442,7 +18515,15 @@
18442
$this->_logger->entrance();
18443
18444
$vars = array( 'id' => $this->_module_id );
18445
- fs_require_once_template( 'contact.php', $vars );
18446
}
18447
18448
#endregion ------------------------------------------------------------------------
@@ -18748,14 +18829,14 @@
18748
18749
// Show promotion if never shown before and 24 hours after initial activation with FS.
18750
if ( ! $was_promotion_shown_before &&
18751
- $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
18752
) {
18753
return false;
18754
}
18755
18756
// OR if promotion was shown before, try showing it every 30 days.
18757
if ( $was_promotion_shown_before &&
18758
- 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
18759
) {
18760
return false;
18761
}
2630
self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
2631
2632
if ( is_multisite() ) {
2633
+ $has_skipped_migration = (
2634
+ // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
2635
+ null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
2636
+ // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
2637
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false )
2638
+ );
2639
+
2640
/**
2641
+ * If the file_slug_map exists on the site level but doesn't exist on the
2642
* network level storage, it means that we need to process the storage with migration.
2643
*
2644
+ * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
2645
*
2646
* @author Vova Feldman (@svovaf)
2647
* @since 2.0.0
2648
*/
2649
+ if (
2650
+ ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
2651
+ ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
2652
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
2653
) {
2654
+ self::migrate_options_to_network();
2655
}
2656
}
2657
2681
self::$_statics_loaded = true;
2682
}
2683
2684
+ /**
2685
+ * @author Leo Fajardo (@leorw)
2686
+ *
2687
+ * @since 2.1.3
2688
+ */
2689
+ private static function migrate_options_to_network() {
2690
+ self::migrate_accounts_to_network();
2691
+
2692
+ // Migrate API options from site level to network level.
2693
+ $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
2694
+ $api_network_options->migrate_to_network();
2695
+
2696
+ // Migrate API cache to network level storage.
2697
+ FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
2698
+
2699
+ self::$_accounts->set_option( 'ms_migration_complete', true, true );
2700
+ }
2701
+
2702
#----------------------------------------------------------------------------------
2703
#region Localization
2704
#----------------------------------------------------------------------------------
2925
}
2926
2927
fs_redirect( $download_url );
2928
+ } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
2929
+ check_admin_referer( 'migrate_options_to_network' );
2930
+
2931
+ self::migrate_options_to_network();
2932
}
2933
}
2934
6011
* @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
6012
*/
6013
private function schedule_install_sync( $except_blog_id = 0 ) {
6014
+ $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
6015
}
6016
6017
/**
10598
return;
10599
}
10600
10601
+ if ( ! $this->is_premium() || $this->has_any_active_valid_license() ) {
10602
// This is relevant only to the free versions and premium versions without an active license.
10603
return;
10604
}
15614
return;
15615
}
15616
15617
+ $site_clone = is_object( $site ) ? $site : $this->_site;
15618
+ $encrypted_site = clone $site_clone;
15619
15620
$sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15621
16313
* @since 1.2.1
16314
*/
16315
function has_active_valid_license() {
16316
+ return self::is_active_valid_license( $this->_license );
16317
+ }
16318
+
16319
+ /**
16320
+ * Check if a given license is active & valid (not expired).
16321
+ *
16322
+ * @author Vova Feldman (@svovaf)
16323
+ * @since 2.1.3
16324
+ *
16325
+ * @param FS_Plugin_License $license
16326
+ *
16327
+ * @return bool
16328
+ */
16329
+ private static function is_active_valid_license( $license ) {
16330
return (
16331
+ is_object( $license ) &&
16332
+ FS_Plugin_License::is_valid_id( $license->id ) &&
16333
+ $license->is_active() &&
16334
+ $license->is_valid()
16335
);
16336
}
16337
16338
+ /**
16339
+ * Checks if there's any site that is associated with an active & valid license.
16340
+ * This logic is used to determine if the admin can download the premium code base from a network level admin.
16341
+ *
16342
+ * @author Vova Feldman (@svovaf)
16343
+ * @since 2.1.3
16344
+ *
16345
+ * @return bool
16346
+ */
16347
+ function has_any_active_valid_license() {
16348
+ if ( ! fs_is_network_admin() ) {
16349
+ return $this->has_active_valid_license();
16350
+ }
16351
+
16352
+ $installs = $this->get_blog_install_map();
16353
+ $all_plugin_licenses = self::get_all_licenses( $this->_module_id );
16354
+
16355
+ foreach ( $installs as $blog_id => $install ) {
16356
+ if ( ! FS_Plugin_License::is_valid_id( $install->license_id ) ) {
16357
+ continue;
16358
+ }
16359
+
16360
+ foreach ( $all_plugin_licenses as $license ) {
16361
+ if ( $license->id == $install->license_id ) {
16362
+ if ( self::is_active_valid_license( $license ) ) {
16363
+ return true;
16364
+ }
16365
+ }
16366
+ }
16367
+ }
16368
+
16369
+ return false;
16370
+ }
16371
+
16372
/**
16373
* Check if site assigned with license with enabled features.
16374
*
17362
* @return bool
17363
*/
17364
private function _can_download_premium() {
17365
+ return $this->has_any_active_valid_license() ||
17366
( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
17367
}
17368
18515
$this->_logger->entrance();
18516
18517
$vars = array( 'id' => $this->_module_id );
18518
+
18519
+ /**
18520
+ * Added filter to the template to allow developers wrapping the template
18521
+ * in custom HTML (e.g. within a wizard/tabs).
18522
+ *
18523
+ * @author Vova Feldman (@svovaf)
18524
+ * @since 2.1.3
18525
+ */
18526
+ echo $this->apply_filters( 'templates/contact.php', fs_get_template( 'contact.php', $vars ) );
18527
}
18528
18529
#endregion ------------------------------------------------------------------------
18829
18830
// Show promotion if never shown before and 24 hours after initial activation with FS.
18831
if ( ! $was_promotion_shown_before &&
18832
+ $this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) )
18833
) {
18834
return false;
18835
}
18836
18837
// OR if promotion was shown before, try showing it every 30 days.
18838
if ( $was_promotion_shown_before &&
18839
+ $this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown
18840
) {
18841
return false;
18842
}
freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -82,7 +82,7 @@
82
83
$this->add_transient_filters();
84
85
- if ( ! $this->_fs->has_active_valid_license() ) {
86
/**
87
* If user has the premium plugin's code but do NOT have an active license,
88
* encourage him to upgrade by showing that there's a new release, but instead
@@ -114,7 +114,7 @@
114
add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
115
}
116
117
- if ( ! $this->_fs->has_active_valid_license() ) {
118
add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
119
}
120
}
82
83
$this->add_transient_filters();
84
85
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
86
/**
87
* If user has the premium plugin's code but do NOT have an active license,
88
* encourage him to upgrade by showing that there's a new release, but instead
114
add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
115
}
116
117
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
118
add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
119
}
120
}
freemius/includes/entities/class-fs-site.php CHANGED
@@ -150,6 +150,7 @@
150
fs_starts_with( $subdomain, 'local.' ) ||
151
fs_starts_with( $subdomain, 'dev.' ) ||
152
fs_starts_with( $subdomain, 'test.' ) ||
153
fs_starts_with( $subdomain, 'staging.' ) ||
154
155
// Ends with.
@@ -171,7 +172,9 @@
171
( fs_ends_with($subdomain, 'pantheonsite.io') &&
172
(fs_starts_with($subdomain, 'test-') || fs_starts_with($subdomain, 'dev-'))) ||
173
// Cloudways
174
- fs_ends_with( $subdomain, '.cloudwaysapps.com' )
175
);
176
}
177
150
fs_starts_with( $subdomain, 'local.' ) ||
151
fs_starts_with( $subdomain, 'dev.' ) ||
152
fs_starts_with( $subdomain, 'test.' ) ||
153
+ fs_starts_with( $subdomain, 'stage.' ) ||
154
fs_starts_with( $subdomain, 'staging.' ) ||
155
156
// Ends with.
172
( fs_ends_with($subdomain, 'pantheonsite.io') &&
173
(fs_starts_with($subdomain, 'test-') || fs_starts_with($subdomain, 'dev-'))) ||
174
// Cloudways
175
+ fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
176
+ // Kinsta
177
+ (fs_ends_with($subdomain, '.kinsta.com') && fs_starts_with($subdomain, 'staging-'))
178
);
179
}
180
freemius/includes/fs-plugin-info-dialog.php CHANGED
@@ -203,7 +203,7 @@
203
204
if ( is_object( $latest ) ) {
205
$data->version = $latest->version;
206
- $data->last_updated = ! is_null( $latest->updated ) ? $latest->updated : $latest->created;
207
$data->requires = $latest->requires_platform_version;
208
$data->tested = $latest->tested_up_to_version;
209
} else {
203
204
if ( is_object( $latest ) ) {
205
$data->version = $latest->version;
206
+ $data->last_updated = $latest->created;
207
$data->requires = $latest->requires_platform_version;
208
$data->tested = $latest->tested_up_to_version;
209
} else {
freemius/package.json CHANGED
@@ -4,7 +4,7 @@
4
"author": "Freemius, Inc.",
5
"license": "GPL-3.0",
6
"homepage": "https://freemius.com",
7
- "version": "1.2.3",
8
"main": "gulpfile.js",
9
"dependencies": {},
10
"scripts": {
4
"author": "Freemius, Inc.",
5
"license": "GPL-3.0",
6
"homepage": "https://freemius.com",
7
+ "version": "2.1.2",
8
"main": "gulpfile.js",
9
"dependencies": {},
10
"scripts": {
freemius/start.php CHANGED
@@ -15,7 +15,7 @@
15
*
16
* @var string
17
*/
18
- $this_sdk_version = '2.1.1';
19
20
#region SDK Selection Logic --------------------------------------------------------------------
21
15
*
16
* @var string
17
*/
18
+ $this_sdk_version = '2.1.3';
19
20
#region SDK Selection Logic --------------------------------------------------------------------
21
freemius/templates/connect.php CHANGED
@@ -253,6 +253,17 @@
253
<a class="show-license-resend-modal show-license-resend-modal-<?php echo $fs->get_unique_affix() ?>"
254
href="#"><?php fs_esc_html_echo_inline( "Can't find your license key?", 'cant-find-license-key', $slug ); ?></a>
255
</div>
256
<?php
257
$send_updates_text = sprintf(
258
'%s<span class="action-description"> - %s</span>',
253
<a class="show-license-resend-modal show-license-resend-modal-<?php echo $fs->get_unique_affix() ?>"
254
href="#"><?php fs_esc_html_echo_inline( "Can't find your license key?", 'cant-find-license-key', $slug ); ?></a>
255
</div>
256
+
257
+ <?php
258
+ /**
259
+ * Allows developers to include custom HTML after the license input container.
260
+ *
261
+ * @author Vova Feldman
262
+ * @since 2.1.2
263
+ */
264
+ $fs->do_action( 'connect/after_license_input' );
265
+ ?>
266
+
267
<?php
268
$send_updates_text = sprintf(
269
'%s<span class="action-description"> - %s</span>',
freemius/templates/debug.php CHANGED
@@ -86,6 +86,16 @@
86
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
87
</form>
88
</td>
89
<td>
90
<button id="fs_load_db_option" class="button"><?php fs_esc_html_echo_inline( 'Load DB Option' ) ?></button>
91
</td>
86
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
87
</form>
88
</td>
89
+ <?php if ( fs_is_network_admin() && true !== $fs_options->get_option( 'ms_migration_complete', false, true ) ) : ?>
90
+ <td>
91
+ <!-- Migrate Options to Network -->
92
+ <form action="" method="POST">
93
+ <input type="hidden" name="fs_action" value="migrate_options_to_network">
94
+ <?php wp_nonce_field( 'migrate_options_to_network' ) ?>
95
+ <button class="button button-primary"><?php fs_esc_html_echo_inline( 'Migrate Options to Network' ) ?></button>
96
+ </form>
97
+ </td>
98
+ <?php endif ?>
99
<td>
100
<button id="fs_load_db_option" class="button"><?php fs_esc_html_echo_inline( 'Load DB Option' ) ?></button>
101
</td>
freemius/templates/forms/deactivation/form.php CHANGED
@@ -94,7 +94,7 @@ HTML;
94
isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
95
otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
96
dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
97
- deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_active_valid_license() ? 'true' : 'false' ?>;
98
99
$modal.appendTo($('body'));
100
94
isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
95
otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
96
dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
97
+ deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>;
98
99
$modal.appendTo($('body'));
100
includes/helper-functions.php CHANGED
@@ -30,6 +30,26 @@ function lsow_get_terms( $taxonomy )
30
return $term_coll;
31
}
32
33
function lsow_get_chosen_terms( $query_args )
34
{
35
$chosen_terms = array();
@@ -64,27 +84,8 @@ function lsow_get_chosen_terms( $query_args )
64
65
// Remove duplicates
66
$taxonomies = array_unique( $taxonomies );
67
- return array( $chosen_terms, $taxonomies );
68
- }
69
-
70
- function lsow_entry_terms_list(
71
- $taxonomy = 'category',
72
- $separator = ', ',
73
- $before = ' ',
74
- $after = ' '
75
- )
76
- {
77
- global $post ;
78
- $output = '<span class="lsow-' . $taxonomy . '-list">';
79
- $output .= get_the_term_list(
80
- $post->ID,
81
- $taxonomy,
82
- $before,
83
- $separator,
84
- $after
85
- );
86
- $output .= '</span>';
87
- return $output;
88
}
89
90
function lsow_get_taxonomy_info( $taxonomy )
@@ -105,7 +106,7 @@ function lsow_get_taxonomy_info( $taxonomy )
105
$output .= '</span>';
106
}
107
108
- return $output;
109
}
110
111
function lsow_get_info_for_taxonomies( $taxonomies )
@@ -114,7 +115,18 @@ function lsow_get_info_for_taxonomies( $taxonomies )
114
foreach ( $taxonomies as $taxonomy ) {
115
$output .= lsow_get_taxonomy_info( $taxonomy );
116
}
117
- return $output;
118
}
119
120
function lsow_entry_published( $format = null )
@@ -123,56 +135,15 @@ function lsow_entry_published( $format = null )
123
$format = get_option( 'date_format' );
124
}
125
$published = '<span class="published"><abbr title="' . sprintf( get_the_time( esc_html__( 'l, F, Y, g:i a', 'livemesh-so-widgets' ) ) ) . '">' . sprintf( get_the_time( $format ) ) . '</abbr></span>';
126
- return $published;
127
$link = '<span class="published">' . '<a href="' . get_day_link( get_the_time( esc_html__( 'Y', 'livemesh-so-widgets' ) ), get_the_time( esc_html__( 'm', 'livemesh-so-widgets' ) ), get_the_time( esc_html__( 'd', 'livemesh-so-widgets' ) ) ) . '" title="' . sprintf( get_the_time( esc_html__( 'l, F, Y, g:i a', 'livemesh-so-widgets' ) ) ) . '">' . '<span class="updated">' . get_the_time( $format ) . '</span>' . '</a></span>';
128
- return $link;
129
}
130
131
function lsow_entry_author()
132
{
133
$author = '<span class="author vcard">' . esc_html__( 'By ', 'livemesh-so-widgets' ) . '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a></span>';
134
- return $author;
135
- }
136
-
137
- function lsow_read_more()
138
- {
139
- $output = '<div class="lsow-read-more">';
140
- $output .= '<a href="' . get_the_permalink() . '">' . esc_html__( 'Read more', 'livemesh-so-widgets' ) . '</a>';
141
- $output .= '</div>';
142
- return $output;
143
- }
144
-
145
- /** Isotope filtering support for Portfolio pages * */
146
- function lsow_get_taxonomy_terms_filter( $taxonomies, $chosen_terms = array() )
147
- {
148
- $output = '';
149
-
150
- if ( empty($chosen_terms) ) {
151
- global $wp_version ;
152
-
153
- if ( version_compare( $wp_version, '4.5', '>=' ) ) {
154
- $terms = get_terms( $taxonomies );
155
- } else {
156
- $terms = get_terms( $taxonomies[0] );
157
- }
158
-
159
- } else {
160
- $terms = $chosen_terms;
161
- }
162
-
163
-
164
- if ( !empty($terms) && !is_wp_error( $terms ) ) {
165
- $output .= '<div class="lsow-taxonomy-filter">';
166
- $output .= '<div class="lsow-filter-item segment-0 lsow-active"><a data-value="*" href="#">' . esc_html__( 'All', 'livemesh-so-widgets' ) . '</a></div>';
167
- $segment_count = 1;
168
- foreach ( $terms as $term ) {
169
- $output .= '<div class="lsow-filter-item segment-' . intval( $segment_count ) . '"><a href="#" data-value=".term-' . intval( $term->term_id ) . '" title="' . esc_html__( 'View all items filed under ', 'livemesh-so-widgets' ) . esc_attr( $term->name ) . '">' . esc_html( $term->name ) . '</a></div>';
170
- $segment_count++;
171
- }
172
- $output .= '</div>';
173
- }
174
-
175
- return $output;
176
}
177
178
/* Return the css class name to help achieve the number of columns specified for mobile resolution */
@@ -184,7 +155,12 @@ function lsow_get_grid_classes( $settings, $columns_field = 'per_line' )
184
$grid_classes .= $settings[$columns_field . '_tablet'];
185
$grid_classes .= ' lsow-grid-mobile-';
186
$grid_classes .= $settings[$columns_field . '_mobile'];
187
- return $grid_classes;
188
}
189
190
/*
@@ -206,17 +182,6 @@ function lsow_to_boolean( $value )
206
// Make sure you do not touch the value if the value is not a string
207
}
208
209
- // get all registered taxonomies
210
- function lsow_get_taxonomies_map()
211
- {
212
- $map = array();
213
- $taxonomies = get_taxonomies();
214
- foreach ( $taxonomies as $taxonomy ) {
215
- $map[$taxonomy] = $taxonomy;
216
- }
217
- return $map;
218
- }
219
-
220
/**
221
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7
222
* @param str $hex Colour as hexadecimal (with or without hash);
@@ -255,7 +220,12 @@ function lsow_get_option( $option_name, $default = null )
255
$option_value = $default;
256
}
257
258
- return $option_value;
259
}
260
261
function lsow_update_option( $option_name, $option_value )
@@ -392,6 +362,52 @@ function lsow_get_sysinfo()
392
return $return;
393
}
394
395
function lsow_get_animation_atts( $animation )
396
{
397
$animate_class = "";
@@ -438,15 +454,48 @@ function lsow_get_animation_atts( $animation )
438
$animation_attr = ' data-animation="' . esc_attr( $animation ) . '"';
439
}
440
441
- return array( $animate_class, $animation_attr );
442
}
443
444
function lsow_get_animation_options()
445
{
446
- return array(
447
'none' => __( 'None', 'livemesh-so-widgets' ),
448
'fadeIn' => __( 'Fade In', 'livemesh-so-widgets' ),
449
'fadeInLeft' => __( 'Fade In Left', 'livemesh-so-widgets' ),
450
'fadeInRight' => __( 'Fade In Right', 'livemesh-so-widgets' ),
451
- );
452
}
30
return $term_coll;
31
}
32
33
+ function lsow_entry_terms_list(
34
+ $taxonomy = 'category',
35
+ $separator = ', ',
36
+ $before = ' ',
37
+ $after = ' '
38
+ )
39
+ {
40
+ global $post ;
41
+ $output = '<span class="lsow-' . $taxonomy . '-list">';
42
+ $output .= get_the_term_list(
43
+ $post->ID,
44
+ $taxonomy,
45
+ $before,
46
+ $separator,
47
+ $after
48
+ );
49
+ $output .= '</span>';
50
+ return $output;
51
+ }
52
+
53
function lsow_get_chosen_terms( $query_args )
54
{
55
$chosen_terms = array();
84
85
// Remove duplicates
86
$taxonomies = array_unique( $taxonomies );
87
+ $return = array( $chosen_terms, $taxonomies );
88
+ return apply_filters( 'lsow_chosen_taxonomy_terms', $return, $query_args );
89
}
90
91
function lsow_get_taxonomy_info( $taxonomy )
106
$output .= '</span>';
107
}
108
109
+ return apply_filters( 'lsow_taxonomy_info', $output, $taxonomy );
110
}
111
112
function lsow_get_info_for_taxonomies( $taxonomies )
115
foreach ( $taxonomies as $taxonomy ) {
116
$output .= lsow_get_taxonomy_info( $taxonomy );
117
}
118
+ return apply_filters( 'lsow_taxonomies_info', $output, $taxonomies );
119
+ }
120
+
121
+ // get all registered taxonomies
122
+ function lsow_get_taxonomies_map()
123
+ {
124
+ $map = array();
125
+ $taxonomies = get_taxonomies();
126
+ foreach ( $taxonomies as $taxonomy ) {
127
+ $map[$taxonomy] = $taxonomy;
128
+ }
129
+ return apply_filters( 'lsow_taxonomies_map', $map );
130
}
131
132
function lsow_entry_published( $format = null )
135
$format = get_option( 'date_format' );
136
}
137
$published = '<span class="published"><abbr title="' . sprintf( get_the_time( esc_html__( 'l, F, Y, g:i a', 'livemesh-so-widgets' ) ) ) . '">' . sprintf( get_the_time( $format ) ) . '</abbr></span>';
138
+ return apply_filters( 'lsow_entry_published', $published, $format );
139
$link = '<span class="published">' . '<a href="' . get_day_link( get_the_time( esc_html__( 'Y', 'livemesh-so-widgets' ) ), get_the_time( esc_html__( 'm', 'livemesh-so-widgets' ) ), get_the_time( esc_html__( 'd', 'livemesh-so-widgets' ) ) ) . '" title="' . sprintf( get_the_time( esc_html__( 'l, F, Y, g:i a', 'livemesh-so-widgets' ) ) ) . '">' . '<span class="updated">' . get_the_time( $format ) . '</span>' . '</a></span>';
140
+ return apply_filters( 'lsow_entry_published_link', $link, $format );
141
}
142
143
function lsow_entry_author()
144
{
145
$author = '<span class="author vcard">' . esc_html__( 'By ', 'livemesh-so-widgets' ) . '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a></span>';
146
+ return apply_filters( 'lsow_entry_author', $author );
147
}
148
149
/* Return the css class name to help achieve the number of columns specified for mobile resolution */
155
$grid_classes .= $settings[$columns_field . '_tablet'];
156
$grid_classes .= ' lsow-grid-mobile-';
157
$grid_classes .= $settings[$columns_field . '_mobile'];
158
+ return apply_filters(
159
+ 'lsow_grid_classes',
160
+ $grid_classes,
161
+ $settings,
162
+ $columns_field
163
+ );
164
}
165
166
/*
182
// Make sure you do not touch the value if the value is not a string
183
}
184
185
/**
186
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7
187
* @param str $hex Colour as hexadecimal (with or without hash);
220
$option_value = $default;
221
}
222
223
+ return apply_filters(
224
+ 'lsow_get_option',
225
+ $option_value,
226
+ $option_name,
227
+ $default
228
+ );
229
}
230
231
function lsow_update_option( $option_name, $option_value )
362
return $return;
363
}
364
365
+ /** Isotope filtering support for Portfolio pages **/
366
+ function lsow_get_taxonomy_terms_filter( $taxonomies, $chosen_terms = array() )
367
+ {
368
+ $output = '';
369
+ $terms = array();
370
+
371
+ if ( empty($chosen_terms) ) {
372
+ foreach ( $taxonomies as $taxonomy ) {
373
+ global $wp_version ;
374
+
375
+ if ( version_compare( $wp_version, '4.5', '>=' ) ) {
376
+ $taxonomy_terms = get_terms( array(
377
+ 'taxonomy' => $taxonomy,
378
+ ) );
379
+ } else {
380
+ $taxonomy_terms = get_terms( $taxonomy );
381
+ }
382
+
383
+ if ( !empty($taxonomy_terms) && !is_wp_error( $taxonomy_terms ) ) {
384
+ $terms = array_merge( $terms, $taxonomy_terms );
385
+ }
386
+ }
387
+ } else {
388
+ $terms = $chosen_terms;
389
+ }
390
+
391
+
392
+ if ( !empty($terms) ) {
393
+ $output .= '<div class="lsow-taxonomy-filter">';
394
+ $output .= '<div class="lsow-filter-item segment-0 lsow-active"><a data-value="*" href="#">' . esc_html__( 'All', 'livemesh-so-widgets' ) . '</a></div>';
395
+ $segment_count = 1;
396
+ foreach ( $terms as $term ) {
397
+ $output .= '<div class="lsow-filter-item segment-' . intval( $segment_count ) . '"><a href="#" data-value=".term-' . intval( $term->term_id ) . '" title="' . esc_html__( 'View all items filed under ', 'livemesh-so-widgets' ) . esc_attr( $term->name ) . '">' . esc_html( $term->name ) . '</a></div>';
398
+ $segment_count++;
399
+ }
400
+ $output .= '</div>';
401
+ }
402
+
403
+ return apply_filters(
404
+ 'lsow_taxonomy_terms_filter',
405
+ $output,
406
+ $taxonomies,
407
+ $chosen_terms
408
+ );
409
+ }
410
+
411
function lsow_get_animation_atts( $animation )
412
{
413
$animate_class = "";
454
$animation_attr = ' data-animation="' . esc_attr( $animation ) . '"';
455
}
456
457
+ $return = array( $animate_class, $animation_attr );
458
+ return apply_filters( 'lsow_animation_attributes', $return, $animation );
459
}
460
461
function lsow_get_animation_options()
462
{
463
+ return apply_filters( 'lsow_animation_options', array(
464
'none' => __( 'None', 'livemesh-so-widgets' ),
465
'fadeIn' => __( 'Fade In', 'livemesh-so-widgets' ),
466
'fadeInLeft' => __( 'Fade In Left', 'livemesh-so-widgets' ),
467
'fadeInRight' => __( 'Fade In Right', 'livemesh-so-widgets' ),
468
+ ) );
469
+ }
470
+
471
+ function lsow_get_template_part( $template_name, $settings )
472
+ {
473
+ // Allow the user to place the templates in a different folder
474
+ $templates_folder = apply_filters( 'lsow_templates_folder', 'siteorigin-widgets' );
475
+ $template = locate_template( $templates_folder . '/' . $template_name . '.php' );
476
+ /* If template is found */
477
+
478
+ if ( '' !== $template ) {
479
+ ob_start();
480
+ include $template;
481
+ return ob_get_clean();
482
+ }
483
+
484
+ return null;
485
+ }
486
+
487
+ function lsow_get_module_template_part( $template_name, $module )
488
+ {
489
+ // Allow the user to place the templates in a different folder
490
+ $templates_folder = apply_filters( 'lsow_templates_folder', 'siteorigin-widgets/modules' );
491
+ $template = locate_template( $templates_folder . '/' . $template_name . '.php' );
492
+ /* If template is found */
493
+
494
+ if ( '' !== $template ) {
495
+ ob_start();
496
+ include $template;
497
+ return ob_get_clean();
498
+ }
499
+
500
+ return null;
501
}
includes/widgets/lsow-accordion-widget/lsow-accordion-widget.php CHANGED
@@ -67,7 +67,6 @@ class LSOW_Accordion_Widget extends SiteOrigin_Widget
67
'type' => 'text',
68
'label' => __( 'Panel ID', 'livemesh-so-widgets' ),
69
'description' => __( 'The Panel ID is required to link to a panel. It must be unique across the page, must begin with a letter and may be followed by any number of letters, digits, hyphens or underscores.', 'livemesh-so-widgets' ),
70
- 'connections' => array( 'string', 'html' ),
71
),
72
'panel_content' => array(
73
'type' => 'tinymce',
@@ -88,12 +87,15 @@ class LSOW_Accordion_Widget extends SiteOrigin_Widget
88
89
function get_template_variables( $instance, $args )
90
{
91
- return array(
92
'style' => $instance['style'],
93
'toggle' => $instance['toggle'],
94
'expanded' => $instance['expanded'],
95
'accordion' => ( !empty($instance['accordion']) ? $instance['accordion'] : array() ),
96
);
97
}
98
99
}
67
'type' => 'text',
68
'label' => __( 'Panel ID', 'livemesh-so-widgets' ),
69
'description' => __( 'The Panel ID is required to link to a panel. It must be unique across the page, must begin with a letter and may be followed by any number of letters, digits, hyphens or underscores.', 'livemesh-so-widgets' ),
70
),
71
'panel_content' => array(
72
'type' => 'tinymce',
87
88
function get_template_variables( $instance, $args )
89
{
90
+ $settings = array(
91
'style' => $instance['style'],
92
'toggle' => $instance['toggle'],
93
'expanded' => $instance['expanded'],
94
'accordion' => ( !empty($instance['accordion']) ? $instance['accordion'] : array() ),
95
);
96
+ return array(
97
+ 'settings' => $settings,
98
+ );
99
}
100
101
}
includes/widgets/lsow-accordion-widget/tpl/default.php CHANGED
@@ -1,10 +1,7 @@
1
<?php
2
3
/**
4
- * @var $accordion
5
- * @var $toggle
6
- * @var $expanded
7
- * @var $style
8
*/
9
?>
10
@@ -12,41 +9,20 @@
12
if ( !empty($instance['title']) ) {
13
echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title'] ;
14
}
15
- ?>
16
-
17
- <div class="lsow-accordion <?php
18
- echo $style ;
19
- ?>" data-toggle="<?php
20
- echo ( $toggle ? "true" : "false" ) ;
21
- ?>"
22
- data-expanded="<?php
23
- echo ( $expanded ? "true" : "false" ) ;
24
- ?>">
25
-
26
- <?php
27
- foreach ( $accordion as $panel ) {
28
- ?>
29
-
30
- <?php
31
$panel_id = '';
32
- ?>
33
-
34
- <div class="lsow-panel" id="<?php
35
- echo $panel_id ;
36
- ?>">
37
-
38
- <div class="lsow-panel-title"><?php
39
- echo htmlspecialchars_decode( esc_html( $panel['title'] ) ) ;
40
- ?></div>
41
-
42
- <div class="lsow-panel-content"><?php
43
- echo do_shortcode( $panel['panel_content'] ) ;
44
- ?></div>
45
-
46
- </div>
47
-
48
- <?php
49
}
50
- ?>
51
-
52
- </div>
1
<?php
2
3
/**
4
+ * @var $settings
5
*/
6
?>
7
9
if ( !empty($instance['title']) ) {
10
echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title'] ;
11
}
12
+ $settings = apply_filters( 'lsow_accordion_' . $this->id . '_settings', $settings );
13
+ $output = '<div class="lsow-accordion ' . $settings['style'] . '" data-toggle="' . (( $settings['toggle'] ? "true" : "false" )) . '" data-expanded="' . (( $settings['expanded'] ? "true" : "false" )) . '">';
14
+ foreach ( $settings['accordion'] as $panel ) {
15
$panel_id = '';
16
+ $child_output = '<div class="lsow-panel" id="' . $panel_id . '">';
17
+ $child_output .= '<div class="lsow-panel-title">' . htmlspecialchars_decode( esc_html( $panel['title'] ) ) . '</div>';
18
+ $child_output .= '<div class="lsow-panel-content">' . do_shortcode( $panel['panel_content'] ) . '</div>';
19
+ $child_output .= '</div><!-- .lsow-panel -->';
20
+ $output .= apply_filters(
21
+ 'lsow_accordion_item_output',
22
+ $child_output,
23
+ $panel,
24
+ $settings
25
+ );
26
}
27
+ $output .= '</div><!-- .lsow-accordion -->';
28
+ echo apply_filters( 'lsow_accordion_output', $output, $settings ) ;
includes/widgets/lsow-button-widget/lsow-button-widget.php CHANGED
@@ -198,24 +198,19 @@ class LSOW_Button_Widget extends SiteOrigin_Widget {
198
}
199
200
function get_template_variables($instance, $args) {
201
- return array(
202
"id" => $this->element_id,
203
- "style" => $instance['settings']["style"],
204
- "class" => $instance['settings']["class"],
205
- "color" => $instance['settings']["color"],
206
- "custom_color" => $instance['settings']["custom_color"],
207
- "hover_color" => $instance['settings']["hover_color"],
208
- "type" => $instance['settings']["type"],
209
- "align" => $instance['settings']["align"],
210
- "target" => $instance['settings']["target"],
211
- "rounded" => $instance['settings']["rounded"],
212
"href" => (!empty($instance['href'])) ? sow_esc_url($instance['href']) : '',
213
"text" => $instance["text"],
214
'icon_type' => $instance['icon_type'],
215
'icon_image' => $instance['icon_image'],
216
- 'icon' => $instance['icon'],
217
- 'settings' => $instance['settings']
218
- );
219
}
220
221
}
198
}
199
200
function get_template_variables($instance, $args) {
201
+
202
+ $settings = $instance['settings'];
203
+
204
+ $settings = array_merge($settings, array(
205
"id" => $this->element_id,
206
"href" => (!empty($instance['href'])) ? sow_esc_url($instance['href']) : '',
207
"text" => $instance["text"],
208
'icon_type' => $instance['icon_type'],
209
'icon_image' => $instance['icon_image'],
210
+ 'icon' => $instance['icon']
211
+ ));
212
+
213
+ return array('settings' => $settings);
214
}
215
216
}
includes/widgets/lsow-button-widget/tpl/default.php CHANGED
@@ -1,68 +1,58 @@
1
<?php
2
/**
3
- * @var $id
4
- * @var $style
5
- * @var $class
6
- * @var $color
7
- * @var $custom_color
8
- * @var $hover_color
9
- * @var $type
10
- * @var $rounded
11
- * @var $href
12
- * @var $align
13
- * @var $target
14
- * @var $text
15
- * @var $icon_type
16
- * @var $icon_image
17
- * @var $icon
18
* @var $settings
19
*/
20
21
list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']);
22
23
$icon_html = '';
24
25
- $id = (!empty($id)) ? ' id="' . $id . '"' : '';
26
27
- $class = (!empty($class)) ? ' ' . $class : '';
28
29
- $color_class = ' lsow-' . esc_attr($color);
30
- if (!empty($type))
31
- $type = ' lsow-' . esc_attr($type);
32
33
- $rounded = (!empty($rounded)) ? ' lsow-rounded' : '';
34
35
- if (!empty($target))
36
$target = ' target="_blank"';
37
else
38
$target = '';
39
40
- if ($color == 'default' || ($color == 'custom' && empty($custom_color))) {
41
$options = get_option('lsow_settings');
42
43
if ($options && isset($options['lsow_theme_color'])) {
44
- $custom_color = $options['lsow_theme_color'];
45
}
46
else {
47
- $custom_color = '#f94213'; // default button color if none set in theme options
48
}
49
}
50
51
- $style = ($style) ? ' style="' . esc_attr($style) . '"' : '';
52
53
// Use the custom color only if user wants to use the custom color set
54
- $color_attr = ($color == 'custom') ? ' data-color=' . esc_html($custom_color) : '';
55
56
- $hover_color_attr = ($hover_color) ? ' data-hover-color=' . esc_html($hover_color) : '';
57
58
- if ($icon_type == 'icon_image')
59
- $icon_html = wp_get_attachment_image($icon_image, 'thumbnail', false, array('class' => 'lsow-image lsow-thumbnail'));
60
- elseif ($icon_type == 'icon')
61
- $icon_html = siteorigin_widget_get_icon($icon);
62
63
- $button_content = '<a' . $id . ' class= "lsow-button ' . ((!empty($icon_html)) ? ' lsow-with-icon' : '') . esc_attr($class) . $color_class . $type . $rounded . $animate_class . '"' . $style . $color_attr . $hover_color_attr . $animation_attr . ' href="' . sow_esc_url($href) . '"' . esc_html($target) . '>' . $icon_html . esc_html($text) . '</a>';
64
65
- if ($align != 'none')
66
- $button_content = '<div class="lsow-button-wrap" style="clear: both; text-align:' . esc_attr($align) . ';">' . $button_content . '</div>';
67
68
- echo $button_content;
1
<?php
2
/**
3
* @var $settings
4
*/
5
6
+
7
+ $settings = apply_filters('lsow_button_' . $this->id . '_settings', $settings);
8
+
9
list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']);
10
11
$icon_html = '';
12
13
+ $id = (!empty($settings['id'])) ? ' id="' . $settings['id'] . '"' : '';
14
15
+ $class = (!empty($settings['class'])) ? ' ' . $settings['class'] : '';
16
17
+ $color_class = ' lsow-' . esc_attr($settings['color']);
18
+ if (!empty($settings['type']))
19
+ $settings['type'] = ' lsow-' . esc_attr($settings['type']);
20
21
+ $rounded = (!empty($settings['rounded'])) ? ' lsow-rounded' : '';
22
23
+ if (!empty($settings['target']))
24
$target = ' target="_blank"';
25
else
26
$target = '';
27
28
+ if ($settings['color'] == 'default' || ($settings['color'] == 'custom' && empty($settings['custom_color']))) {
29
$options = get_option('lsow_settings');
30
31
if ($options && isset($options['lsow_theme_color'])) {
32
+ $settings['custom_color'] = $options['lsow_theme_color'];
33
}
34
else {
35
+ $settings['custom_color'] = '#f94213'; // default button color if none set in theme options
36
}
37
}
38
39
+ $style = ($settings['style']) ? ' style="' . esc_attr($settings['style']) . '"' : '';
40
41
// Use the custom color only if user wants to use the custom color set
42
+ $color_attr = ($settings['color'] == 'custom') ? ' data-color=' . esc_html($settings['custom_color']) : '';
43
+
44
+ $hover_color_attr = ($settings['hover_color']) ? ' data-hover-color=' . esc_html($settings['hover_color']) : '';
45
46
+ if ($settings['icon_type'] == 'icon_image')
47
+ $icon_html = wp_get_attachment_image($settings['icon_image'], 'thumbnail', false, array('class' => 'lsow-image lsow-thumbnail'));
48
+ elseif ($settings['icon_type'] == 'icon')
49
+ $icon_html = siteorigin_widget_get_icon($settings['icon']);
50
51
+ $button_content = '<a' . $id . ' class= "lsow-button ' . ((!empty($icon_html)) ? ' lsow-with-icon' : '') . esc_attr($class) . $color_class . $settings['type'] . $rounded . $animate_class . '"' . $style . $color_attr . $hover_color_attr . $animation_attr . ' href="' . sow_esc_url($settings['href']) . '"' . esc_html($target) . '>' . $icon_html . esc_html($settings['text']) . '</a>';
52
53
+ if ($settings['align'] != 'none')
54
+ $button_content = '<div class="lsow-button-wrap" style="clear: both; text-align:' . esc_attr($settings['align']) . ';">' . $button_content . '</div>';
55
56
+ $output = $button_content;
57
58
+ echo apply_filters('lsow_button_output', $output, $settings);
includes/widgets/lsow-carousel-widget/lsow-carousel-widget.php CHANGED
@@ -293,24 +293,23 @@ class LSOW_Carousel_Widget extends SiteOrigin_Widget {
293
}
294
295
function get_template_variables($instance, $args) {
296
297
-
298
- $return = array(
299
'elements' => !empty($instance['elements']) ? $instance['elements'] : array(),
300
- 'settings' => $instance['settings'],
301
'carousel_settings' => $instance['carousel_settings']
302
- );
303
304
- unset($return['carousel_settings']['responsive']);
305
306
- $return['carousel_settings']['tablet_width'] = $instance['carousel_settings']['responsive']['tablet']['width'];
307
- $return['carousel_settings']['tablet_display_columns'] = $instance['carousel_settings']['responsive']['tablet']['display_columns'];
308
- $return['carousel_settings']['tablet_scroll_columns'] = $instance['carousel_settings']['responsive']['tablet']['scroll_columns'];
309
- $return['carousel_settings']['mobile_width'] = $instance['carousel_settings']['responsive']['mobile']['width'];
310
- $return['carousel_settings']['mobile_display_columns'] = intval($instance['carousel_settings']['responsive']['mobile']['display_columns']);
311
- $return['carousel_settings']['mobile_scroll_columns'] = $instance['carousel_settings']['responsive']['mobile']['scroll_columns'];
312
313
- return $return;
314
}
315
316
}
293
}
294
295
function get_template_variables($instance, $args) {
296
+ $settings = $instance['settings'];
297
298
+ $settings = array_merge($settings, array(
299
'elements' => !empty($instance['elements']) ? $instance['elements'] : array(),
300
'carousel_settings' => $instance['carousel_settings']
301
+ ));
302
303
+ unset($settings['carousel_settings']['responsive']);
304
305
+ $settings['carousel_settings']['tablet_width'] = $instance['carousel_settings']['responsive']['tablet']['width'];
306
+ $settings['carousel_settings']['tablet_display_columns'] = $instance['carousel_settings']['responsive']['tablet']['display_columns'];
307
+ $settings['carousel_settings']['tablet_scroll_columns'] = $instance['carousel_settings']['responsive']['tablet']['scroll_columns'];
308
+ $settings['carousel_settings']['mobile_width'] = $instance['carousel_settings']['responsive']['mobile']['width'];
309
+ $settings['carousel_settings']['mobile_display_columns'] = intval($instance['carousel_settings']['responsive']['mobile']['display_columns']);
310
+ $settings['carousel_settings']['mobile_scroll_columns'] = $instance['carousel_settings']['responsive']['mobile']['scroll_columns'];
311
312
+ return array('settings' => $settings);
313
}
314
315
}
includes/widgets/lsow-carousel-widget/tpl/default.php CHANGED
@@ -1,35 +1,32 @@
1
<?php
2
/**
3
- * @var $carousel_settings
4
* @var $settings
5
- * @var $elements
6
*/
7
8
if( !empty( $instance['title'] ) ) echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'];
9
10
- // Loop through the elements and do something with them.
11
12
- if (!empty($elements)) : ?>
13
14
- <div
15
- class="lsow-carousel lsow-container" <?php foreach ($carousel_settings as $key => $val) : ?>
16
17
- <?php if (!empty($val)) : ?>
18
- data-<?php echo $key . '="' . esc_attr($val) . '"' ?>
19
- <?php endif ?>
20
21
- <?php endforeach; ?>>
22
23
- <?php foreach ($elements as $element) : ?>
24
25
- <div class="lsow-carousel-item">
26
27
- <?php echo do_shortcode(wp_kses_post($element['text'])); ?>
28
29
- </div><!--.lsow-carousel-item -->
30
31
- <?php endforeach; ?>
32
33
- </div> <!-- .lsow-carousel -->
34
35
- <?php endif; ?>
1
<?php
2
/**
3
* @var $settings
4
*/
5
6
if( !empty( $instance['title'] ) ) echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'];
7
8
+ $settings = apply_filters('lsow_carousel_' . $this->id . '_settings', $settings);
9
10
+ $carousel_settings = $settings['carousel_settings'];
11
12
+ if (!empty($settings['elements'])) :
13
14
+ $output = '<div id="lsow-carousel-' . $this->id . '" class="lsow-carousel lsow-container" data-settings=\'' . wp_json_encode($carousel_settings) . '\'>';
15
16
+ foreach ($settings['elements'] as $element) :
17
18
+ $child_output = '<div class="lsow-carousel-item">';
19
20
+ $child_output .= do_shortcode(wp_kses_post($element['text']));
21
22
+ $child_output .= '</div><!-- .lsow-carousel-item -->';
23
24
+ $output .= apply_filters('lsow_carousel_item_output', $child_output, $element, $settings);
25
26
+ endforeach;
27
28
+ $output .= '</div><!-- .lsow-carousel -->';
29
30
+ echo apply_filters('lsow_carousel_output', $output, $settings);
31
+
32
+ endif;
includes/widgets/lsow-clients-widget/lsow-clients-widget.php CHANGED
@@ -119,10 +119,14 @@ class LSOW_Client_Widget extends SiteOrigin_Widget {
119
}
120
121
function get_template_variables($instance, $args) {
122
- return array(
123
'clients' => !empty($instance['clients']) ? $instance['clients'] : array(),
124
- 'settings' => $instance['settings']
125
- );
126
}
127
128
}
119
}
120
121
function get_template_variables($instance, $args) {
122
+
123
+ $settings = $instance['settings'];
124
+
125
+ $settings = array_merge($settings, array(
126
'clients' => !empty($instance['clients']) ? $instance['clients'] : array(),
127
+ ));
128
+
129
+ return array('settings' => $settings);
130
}
131
132
}
includes/widgets/lsow-clients-widget/tpl/default.php CHANGED
@@ -1,54 +1,55 @@
1
<?php
2
/**
3
- * @var $clients
4
* @var $settings
5
*/
6
7
- ?>
8
9
- <?php list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']); ?>
10
11
- <?php if (!empty($instance['title']))
12
- echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
13
14
- <div class="lsow-clients lsow-gapless-grid">
15
16
- <div class="lsow-grid-container <?php echo lsow_get_grid_classes($settings); ?> ">
17
18
- <?php $column_count = 0; ?>
19
20
- <?php foreach ($clients as $client): ?>
21
22
- <div class="lsow-grid-item lsow-client <?php echo $animate_class; ?>" <?php echo $animation_attr; ?>>
23
24
- <?php echo wp_get_attachment_image($client['image'], 'full', false, array('class' => 'lsow-image full', 'alt' => $client['name'])); ?>
25
26
- <div class="lsow-client-name">
27
28
- <?php if (!empty($client['link'])): ?>
29
30
- <a href="<?php echo sow_esc_url($client['link']); ?>"
31
- title="<?php echo esc_html($client['name']); ?>"
32
- target="_blank"><?php echo esc_html($client['name']); ?></a>
33
34
- <?php else: ?>
35
36
- <?php echo esc_html($client['name']); ?>
37
38
- <?php endif; ?>
39
40
- </div>
41
42
- <div class="lsow-image-overlay"></div>
43
44
- </div>
45
46
- <?php
47
48
- endforeach;
49
50
- ?>
51
52
- </div>
53
54
- </div>
1
<?php
2
/**
3
* @var $settings
4
*/
5
6
+ if (!empty($instance['title']))
7
+ echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'];
8
9
+ $settings = apply_filters('lsow_clients_' . $this->id . '_settings', $settings);
10
11
+ list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']);
12
13
+ $output = '<div class="lsow-clients lsow-gapless-grid">';
14
15
+ $output .= '<div class="lsow-grid-container ' . lsow_get_grid_classes($settings) . '">';
16
17
+ foreach ($settings['clients'] as $client):
18
19
+ $child_output = '<div class="lsow-grid-item lsow-client ' . $animate_class . '" ' . $animation_attr . '>';
20
21
+ if (!empty($client['image'])):
22
23
+ $child_output .= wp_get_attachment_image($client['image'], 'full', false, array('class' => 'lsow-image full', 'alt' => $client['name']));
24
25
+ endif;
26
27
+ if (!empty($client['link'])):
28
29
+ $child_output .= '<div class="lsow-client-name">';
30
31
+ $child_output .= '<a href="' . sow_esc_url($client['link'])
32
+ . ' " title="' . esc_html($client['name'])
33
+ . '" target="_blank">' . wp_kses_post($client['name']) . '</a>';
34
35
+ $child_output .= '</div>';
36
37
+ else:
38
39
+ $child_output .= '<div class="lsow-client-name">' . wp_kses_post($client['name']) . '</div>';
40
41
+ endif;
42
43
+ $child_output .= '<div class="lsow-image-overlay"></div>';
44
45
+ $child_output .= '</div><!-- .lsow-client -->';
46
47
+ $output .= apply_filters('lsow_client_item_output', $child_output, $client, $settings);
48
49
+ endforeach;
50
51
+ $output .= '</div>';
52
53
+ $output .= '</div><!-- .lsow-clients -->';
54
+
55
+ echo apply_filters('lsow_clients_output', $output, $settings);
includes/widgets/lsow-heading-widget/lsow-heading-widget.php CHANGED
@@ -113,24 +113,32 @@ class LSOW_Heading_Widget extends SiteOrigin_Widget {
113
}
114
115
function get_template_variables($instance, $args) {
116
- return array(
117
'style' => $instance['style'],
118
'align' => $instance['align'],
119
'heading' => $instance['heading'],
120
'short_text' => !empty($instance['short_text']) ? $instance['short_text'] : '',
121
'subtitle' => !empty($instance['subtitle']) ? $instance['subtitle'] : '',
122
123
- 'heading' => $instance['heading'],
124
- 'settings' => $instance['settings']
125
- );
126
}
127
128
function get_less_variables($instance) {
129
$less = array();
130
131
- $font = siteorigin_widget_get_font( $instance['heading_font'] );
132
$less['heading_font'] = $font['family'];
133
- if ( ! empty( $font['weight'] ) ) {
134
$less['heading_font_weight'] = $font['weight'];
135
}
136
@@ -141,11 +149,12 @@ class LSOW_Heading_Widget extends SiteOrigin_Widget {
141
* Less function for importing Google web fonts.
142
*/
143
function less_import_google_font($instance, $args) {
144
- if( empty( $instance ) ) return;
145
146
- $font_import = siteorigin_widget_get_font( $instance['heading_font'] );
147
- if( !empty( $font_import['css_import'] ) ) {
148
- return $font_import['css_import'];
149
}
150
}
151
113
}
114
115
function get_template_variables($instance, $args) {
116
+
117
+ $settings = $instance['settings'];
118
+
119
+ $settings = array_merge($settings, array(
120
'style' => $instance['style'],
121
'align' => $instance['align'],
122
'heading' => $instance['heading'],
123
'short_text' => !empty($instance['short_text']) ? $instance['short_text'] : '',
124
'subtitle' => !empty($instance['subtitle']) ? $instance['subtitle'] : '',
125
126
+ 'heading' => $instance['heading']
127
+ ));
128
+
129
+ return array('settings' => $settings);
130
}
131
132
function get_less_variables($instance) {
133
+
134
+ if (empty($instance) || !isset($instance['heading_font']))
135
+ return;
136
+
137
$less = array();
138
139
+ $font = siteorigin_widget_get_font($instance['heading_font']);
140
$less['heading_font'] = $font['family'];
141
+ if (!empty($font['weight'])) {
142
$less['heading_font_weight'] = $font['weight'];
143
}
144
149
* Less function for importing Google web fonts.
150
*/
151
function less_import_google_font($instance, $args) {
152
+ if (empty($instance) || !isset($instance['heading_font']))
153
+ return;
154
155
+ $font_import = siteorigin_widget_get_font($instance['heading_font']);
156
+ if (!empty($font_import['css_import'])) {
157
+ return $font_import['css_import'];
158
}
159
}
160
includes/widgets/lsow-heading-widget/tpl/default.php CHANGED
@@ -1,31 +1,28 @@
1
<?php
2
/**
3
- * @var $style
4
- * @var $align
5
- * @var $heading
6
- * @var $subtitle
7
- * @var $short_text
8
* @var $settings
9
*/
10
11
- ?>
12
13
- <?php list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']); ?>
14
15
- <div class="lsow-heading lsow-<?php echo $style; ?> lsow-align<?php echo $align; ?><?php echo $animate_class; ?>" <?php echo $animation_attr; ?>>
16
17
- <?php if ($style == 'style2' && !empty($subtitle)): ?>
18
19
- <div class="lsow-subtitle"><?php echo esc_html($subtitle); ?></div>
20
21
- <?php endif; ?>
22
23
- <h3 class="lsow-title"><?php echo wp_kses_post($heading); ?></h3>
24
25
- <?php if ($style != 'style3' && !empty($short_text)): ?>
26
27
- <p class="lsow-text"><?php echo wp_kses_post($short_text); ?></p>
28
29
- <?php endif; ?>
30
31
- </div>
1
<?php
2
/**
3
* @var $settings
4
*/
5
6
+ $settings = apply_filters('lsow_heading_' . $this->id . '_settings', $settings);
7
8
+ list($animate_class, $animation_attr) = lsow_get_animation_atts($settings['animation']);
9
10
+ $output = '<div class="lsow-heading lsow-' . $settings['style'] . ' lsow-align' . $settings['align'] . ' ' . $animate_class . '" ' . $animation_attr . '>';
11
12
+ if ($settings['style'] == 'style2' && !empty($settings['subtitle'])):
13
14
+ $output .= '<div class="lsow-subtitle">' . esc_html($settings['subtitle']) . '</div>';
15
16
+ endif;
17
18
+ $output .= '<h3 class="lsow-title">' . wp_kses_post($settings['heading']) . '</h3>';
19
20
+ if ($settings['style'] != 'style3' && !empty($settings['short_text'])):
21
22
+ $output .= '<p class="lsow-text">' . wp_kses_post($settings['short_text']) . '</p>';
23
24
+ endif;
25
26
+ $output .= '</div><!-- .lsow-heading -->';
27
+
28
+ echo apply_filters('lsow_heading_output', $output, $settings);
includes/widgets/lsow-hero-image-widget/lsow-hero-image-widget.php CHANGED
@@ -414,14 +414,18 @@ class LSOW_Hero_Image_Widget extends SiteOrigin_Widget {
414
}
415
416
function get_template_variables($instance, $args) {
417
- return array(
418
'header_type' => $instance['header_type'],
419
'custom_header' => $instance['custom_header'],
420
'standard_header' => $instance['standard_header'],
421
'pointer_down_url' => $instance['pointer_down_url'],
422
'background' => $instance['background'],
423
- 'settings' => $instance['settings']
424
- );
425
}
426
427
}
414
}
415
416
function get_template_variables($instance, $args) {
417
+
418
+ $settings = $instance['settings'];
419
+
420
+ $settings = array_merge($settings, array(
421
'header_type' => $instance['header_type'],
422
'custom_header' => $instance['custom_header'],
423
'standard_header' => $instance['standard_header'],
424
'pointer_down_url' => $instance['pointer_down_url'],
425
'background' => $instance['background'],
426
+ ));
427
+
428
+ return array('settings' => $settings);
429
}
430
431
}
includes/widgets/lsow-hero-image-widget/tpl/default.php CHANGED
@@ -1,38 +1,36 @@
1
<?php
2
/**
3
- * @var $header_type
4
- * @var $custom_header
5
- * @var $standard_header
6
- * @var $pointer_down_url
7
- * @var $background
8
* @var $settings
9
*/
10
11
$youtube_markup = '';
12
- if ($background['bg_type'] == 'youtube') {
13
- $youtube_markup = ' data-property="{mute:true,autoPlay:true,opacity:1,loop:true, ' . 'videoURL:\'' . esc_url($background['youtube_video']['youtube_url']) . '\',' . 'quality:\'' . esc_attr($background['youtube_video']['quality']) . '\',' . 'ratio:\'' . esc_attr($background['youtube_video']['ratio']) . '\'}"';
14
}
15
16
?>
17
18
<?php if( !empty( $instance['title'] ) ) echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
19
20
- <div class="lsow-hero-header lsow-section-bg-<?php echo $background['bg_type']; ?>" <?php echo $youtube_markup; ?>>
21
22
<div class="lsow-background">
23
24
- <?php if ($background['bg_type'] == 'html5video'): ?>
25
26
<div class="lsow-html5-video-bg">
27
28
- <video poster="<?php echo wp_get_attachment_url($background['bg_image']['image']); ?>" preload="auto"
29
autoplay loop muted>
30
31
- <source src="<?php echo wp_get_attachment_url($background['html5_videos']['mp4_file']); ?>"
32
type="video/mp4">
33
- <source src="<?php echo wp_get_attachment_url($background['html5_videos']['ogg_file']); ?>"
34
type="video/ogg">
35
- <source src="<?php echo wp_get_attachment_url($background['html5_videos']['webm_file']); ?>"
36
type="video/webm">
37
38
</video>
@@ -41,16 +39,16 @@ if ($background['bg_type'] == 'youtube') {
41
42
<?php else: ?>
43
44
- <?php $attachment = wp_get_attachment_image_src(intval($background['bg_image']['image']), 'full'); ?>
45
46
<?php if (!empty($attachment)): ?>
47
48
- <?php if ($background['bg_type'] == 'parallax'): ?>
49
50
<div class="lsow-parallax-bg"
51
style="background-image: url(<?php echo $attachment[0]; ?>);"></div>
52
53
- <?php elseif ($background['bg_type'] == 'cover' || $background['bg_type'] == 'youtube'): ?>
54
55
<div class="lsow-image-bg"
56
style="background-image: url(<?php echo $attachment[0]; ?>);"></div>
@@ -65,7 +63,7 @@ if ($background['bg_type'] == 'youtube') {
65
66
<?php
67
68
- $overlay = $background['overlay'];
69
70
if (!empty($overlay['overlay_color'])) :
71
@@ -86,29 +84,29 @@ if ($background['bg_type'] == 'youtube') {
86
87
<div class="lsow-header-content">
88
89
- <?php if ($header_type == 'standard') : ?>
90
91
<div class="lsow-standard-header">
92
93
- <?php echo empty($standard_header['subheading']) ? '' : '<div class="lsow-subheading">' . htmlspecialchars_decode($standard_header['subheading']) . '</div>'; ?>
94
95
- <?php echo empty($standard_header['heading']) ? '' : '<h3 class="lsow-heading">' . $standard_header['heading'] . '</h3>'; ?>
96
97
- <?php if (!empty($standard_header['button_url'])) : ?>
98
99
<a class="lsow-button lsow-trans"
100
- href="<?php echo sow_esc_url($standard_header['button_url']); ?>"
101
- <?php echo (empty($standard_header['new_window'])) ? '' : 'target="_blank"'; ?>><?php echo $standard_header['button_text']; ?></a>
102
103
<?php endif; ?>
104
105
</div>
106
107
- <?php elseif ($header_type == 'custom'): ?>
108
109
<div class="lsow-custom-header">
110
111
- <?php echo do_shortcode($custom_header['custom']); ?>
112
113
</div>
114
@@ -117,9 +115,9 @@ if ($background['bg_type'] == 'youtube') {
117
118
</div>
119
120
- <?php if (!empty($pointer_down_url)): ?>
121
122
- <a href="<?php echo $pointer_down_url; ?>" class="icon-angle-down lsow-pointer-down"></a>
123
124
<?php endif; ?>
125
1
<?php
2
/**
3
* @var $settings
4
*/
5
6
$youtube_markup = '';
7
+ if ($settings['background']['bg_type'] == 'youtube') {
8
+ $youtube_markup = ' data-property="{mute:true,autoPlay:true,opacity:1,loop:true, '
9
+ . 'videoURL:\'' . esc_url($settings['background']['youtube_video']['youtube_url']) . '\','
10
+ . 'quality:\'' . esc_attr($settings['background']['youtube_video']['quality']) . '\','
11
+ . 'ratio:\'' . esc_attr($settings['background']['youtube_video']['ratio']) . '\'}"';
12
}
13
14
?>
15
16
<?php if( !empty( $instance['title'] ) ) echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
17
18
+ <div class="lsow-hero-header lsow-section-bg-<?php echo $settings['background']['bg_type']; ?>" <?php echo $youtube_markup; ?>>
19
20
<div class="lsow-background">
21
22
+ <?php if ($settings['background']['bg_type'] == 'html5video'): ?>
23
24
<div class="lsow-html5-video-bg">
25
26
+ <video poster="<?php echo wp_get_attachment_url($settings['background']['bg_image']['image']); ?>" preload="auto"
27
autoplay loop muted>
28
29
+ <source src="<?php echo wp_get_attachment_url($settings['background']['html5_videos']['mp4_file']); ?>"
30
type="video/mp4">
31
+ <source src="<?php echo wp_get_attachment_url($settings['background']['html5_videos']['ogg_file']); ?>"
32
type="video/ogg">
33
+ <source src="<?php echo wp_get_attachment_url($settings['background']['html5_videos']['webm_file']); ?>"
34
type="video/webm">
35
36
</video>
39
40
<?php else: ?>
41
42
+ <?php $attachment = wp_get_attachment_image_src(intval($settings['background']['bg_image']['image']), 'full'); ?>
43
44
<?php if (!empty($attachment)): ?>
45
46
+ <?php if ($settings['background']['bg_type'] == 'parallax'): ?>
47
48
<div class="lsow-parallax-bg"
49
style="background-image: url(<?php echo $attachment[0]; ?>);"></div>
50
51
+ <?php elseif ($settings['background']['bg_type'] == 'cover' || $settings['background']['bg_type'] == 'youtube'): ?>
52
53
<div class="lsow-image-bg"
54
style="background-image: url(<?php echo $attachment[0]; ?>);"></div>
63
64
<?php
65
66
+ $overlay = $settings['background']['overlay'];
67
68
if (!empty($overlay['overlay_color'])) :
69
84
85
<div class="lsow-header-content">
86
87
+ <?php if ($settings['header_type'] == 'standard') : ?>
88
89
<div class="lsow-standard-header">
90
91
+ <?php echo empty($settings['standard_header']['subheading']) ? '' : '<div class="lsow-subheading">' . htmlspecialchars_decode($settings['standard_header']['subheading']) . '</div>'; ?>
92
93
+ <?php echo empty($settings['standard_header']['heading']) ? '' : '<h3 class="lsow-heading">' . $settings['standard_header']['heading'] . '</h3>'; ?>
94
95
+ <?php if (!empty($settings['standard_header']['button_url'])) : ?>
96
97
<a class="lsow-button lsow-trans"
98
+ href="<?php echo sow_esc_url($settings['standard_header']['button_url']); ?>"
99
+ <?php echo (empty($settings['standard_header']['new_window'])) ? '' : 'target="_blank"'; ?>><?php echo $settings['standard_header']['button_text']; ?></a>
100
101
<?php endif; ?>
102
103
</div>
104
105
+ <?php elseif ($settings['header_type'] == 'custom'): ?>
106
107
<div class="lsow-custom-header">
108
109
+ <?php echo do_shortcode($settings['custom_header']['custom']); ?>
110
111
</div>
112
115
116
</div>
117
118
+ <?php if (!empty($settings['pointer_down_url'])): ?>
119
120
+ <a href="<?php echo $settings['pointer_down_url']; ?>" class="icon-angle-down lsow-pointer-down"></a>
121
122
<?php endif; ?>
123
includes/widgets/lsow-icon-list-widget/lsow-icon-list-widget.php CHANGED
@@ -186,11 +186,14 @@ class LSOW_Icon_List_Widget extends SiteOrigin_Widget {
186
}
187
188
function get_template_variables($instance, $args) {
189
- return array(
190
'icon_type' => $instance['icon_type'],
191
- 'icon_list' => !empty($instance['icon_list']) ? $instance['icon_list'] : array(),
192
- 'settings' => $instance['settings']
193
- );
194
}
195
196
}
186
}
187
188
function get_template_variables($instance, $args) {
189
+ $settings = $instance['settings'];
190
+
191
+ $settings = array_merge($settings, array(
192
'icon_type' => $instance['icon_type'],
193
+ 'icon_list' => !empty($instance['icon_list']) ? $instance['icon_list'] : array()
194
+ ));
195
+
196
+ return array('settings' => $settings);
197
}
198
199
}
includes/widgets/lsow-icon-list-widget/tpl/default.php CHANGED
@@ -1,7 +1,5 @@
1
<?php
2
/**
3
- * @var $icon_type
4
- * @var $icon_list
5
* @var $settings
6
*/