Popup Maker – Popup Forms, Optins & More - Version 1.3.7

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.3.7
Comparing to
See all releases

Code changes from version 1.3.6 to 1.3.7

assets/styles/popup-maker-site.css CHANGED
@@ -93,10 +93,16 @@ html.popup-open,
93
  margin-left: -47.5%;
94
  width: 95%;
95
  }
 
 
 
 
96
  }
97
 
98
- .popmake.fixed {
99
- position: fixed;
 
 
100
  }
101
 
102
  .popmake.custom-position {
93
  margin-left: -47.5%;
94
  width: 95%;
95
  }
96
+
97
+ .popmake.fixed {
98
+ position: fixed;
99
+ }
100
  }
101
 
102
+ @media only screen and (max-width: 767px) {
103
+ .popmake.fixed {
104
+ position: static!important;
105
+ }
106
  }
107
 
108
  .popmake.custom-position {
assets/styles/popup-maker-site.min.css CHANGED
@@ -1 +1 @@
1
- .popmake,.popmake:before,.popmake:after,.popmake *,.popmake *:before,.popmake *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html.popup-open,.popup-open body{overflow:hidden}.popmake-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;z-index:1999999998;overflow-x:hidden;overflow-y:auto}.popmake{top:100px;visibility:hidden;position:absolute;display:none;z-index:1999999999}.popmake>.popmake-close{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake.responsive{left:50%;margin-left:-40%;width:95%;height:auto;overflow:visible}.popmake.responsive .popmake-content img{max-width:100%;height:auto}@media only screen and (min-width:768px){.popmake.size-nano{margin-left:-5%;width:10%}.popmake.size-micro{margin-left:-10%;width:20%}.popmake.size-tiny{margin-left:-15%;width:30%}.popmake.size-small{margin-left:-20%;width:40%}.popmake.size-medium{margin-left:-30%;width:60%}.popmake.size-normal{margin-left:-30%;width:70%}.popmake.size-large{margin-left:-35%;width:80%}.popmake.size-xlarge{margin-left:-47.5%;width:95%}}.popmake.fixed{position:fixed}.popmake.custom-position{left:auto;top:auto;margin-left:inherit}.popmake.scrollable .popmake-content{overflow:auto;overflow-y:scroll;max-height:95%}.popmake .popmake-content:last-child{margin-bottom:0}.popmake iframe.formidable{width:100%;overflow:visible}.powered-by-popmake{bottom:-28px;display:block;left:0;margin:0 auto;position:absolute;text-align:center;width:100%}.powered-by-popmake>a{display:inline-block;max-width:205px}.powered-by-popmake img{max-width:100%;width:100%}.powered-by-popmake.small{bottom:-22px}.powered-by-popmake.small>a{max-width:125px}.powered-by-popmake.large{bottom:-30px}.powered-by-popmake.large>a{max-width:285px}
1
+ .popmake,.popmake:before,.popmake:after,.popmake *,.popmake *:before,.popmake *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html.popup-open,.popup-open body{overflow:hidden}.popmake-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;z-index:1999999998;overflow-x:hidden;overflow-y:auto}.popmake{top:100px;visibility:hidden;position:absolute;display:none;z-index:1999999999}.popmake>.popmake-close{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake.responsive{left:50%;margin-left:-40%;width:95%;height:auto;overflow:visible}.popmake.responsive .popmake-content img{max-width:100%;height:auto}@media only screen and (min-width:768px){.popmake.size-nano{margin-left:-5%;width:10%}.popmake.size-micro{margin-left:-10%;width:20%}.popmake.size-tiny{margin-left:-15%;width:30%}.popmake.size-small{margin-left:-20%;width:40%}.popmake.size-medium{margin-left:-30%;width:60%}.popmake.size-normal{margin-left:-30%;width:70%}.popmake.size-large{margin-left:-35%;width:80%}.popmake.size-xlarge{margin-left:-47.5%;width:95%}.popmake.fixed{position:fixed}}@media only screen and (max-width:767px){.popmake.fixed{position:static!important}}.popmake.custom-position{left:auto;top:auto;margin-left:inherit}.popmake.scrollable .popmake-content{overflow:auto;overflow-y:scroll;max-height:95%}.popmake .popmake-content:last-child{margin-bottom:0}.popmake iframe.formidable{width:100%;overflow:visible}.powered-by-popmake{bottom:-28px;display:block;left:0;margin:0 auto;position:absolute;text-align:center;width:100%}.powered-by-popmake>a{display:inline-block;max-width:205px}.powered-by-popmake img{max-width:100%;width:100%}.powered-by-popmake.small{bottom:-22px}.powered-by-popmake.small>a{max-width:125px}.powered-by-popmake.large{bottom:-30px}.powered-by-popmake.large>a{max-width:285px}
includes/admin/post-editor.php CHANGED
@@ -5,36 +5,184 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
 
8
- function popmake_enable_popup_classes_in_post_editor_styles_dropdown() {
9
- // Ultimate MCE Compatibility Check
10
- $ultmce = get_option( 'jwl_options_group1' );
11
- $row = isset( $ultmce['jwl_styleselect_field_id'] ) ? intval( $ultmce['jwl_styleselect_dropdown'] ) : 2;
12
- add_filter( "mce_buttons_$row", 'popmake_tiny_mce_buttons', 999 );
13
- add_filter( 'tiny_mce_before_init', 'popmake_tiny_mce_styles_dropdown_options', 999 );
14
- }
15
-
16
- add_action( 'admin_init', 'popmake_enable_popup_classes_in_post_editor_styles_dropdown' );
17
 
 
 
 
 
18
 
19
- function popmake_tiny_mce_buttons( $buttons ) {
20
- if ( ! in_array( 'styleselect', $buttons ) ) {
21
- $buttons[] = 'styleselect';
 
 
 
 
22
  }
23
 
24
- return $buttons;
25
- }
 
 
26
 
27
- function popmake_tiny_mce_styles_dropdown_options( $initArray ) {
28
- // Add Popup styles to styles dropdown
29
- $styles = ! empty( $initArray['style_formats'] ) && is_array( json_decode( $initArray['style_formats'] ) ) ? json_decode( $initArray['style_formats'] ) : array();
30
- foreach ( get_all_popups()->posts as $popup ) {
31
- $styles[] = array(
32
- 'title' => "Open Popup - {$popup->post_title}",
33
- 'inline' => 'span',
34
- 'classes' => "popmake-{$popup->ID}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  );
36
  }
37
- $initArray['style_formats'] = json_encode( $styles );
38
 
39
- return $initArray;
40
  }
 
 
 
5
  exit;
6
  }
7
 
8
+ class PopMake_Post_Editor {
 
 
 
 
 
 
 
 
9
 
10
+ public static function init() {
11
+ add_filter( 'mce_buttons', array( __CLASS__, 'editor_buttons' ), 10, 2 );
12
+ add_filter( 'tiny_mce_before_init', array( __CLASS__, 'format_options' ) );
13
+ }
14
 
15
+ /**
16
+ * Add Buttons To WP Editor Toolbar.
17
+ */
18
+ public static function editor_buttons( $buttons, $editor_id ){
19
+ /* Add it as first item in the row */
20
+ array_unshift( $buttons, 'styleselect' );
21
+ return $buttons;
22
  }
23
 
24
+ /**
25
+ * Add Dropcap options to the style_formats drop down.
26
+ */
27
+ public static function format_options( $settings ){
28
 
29
+ /* Our Own Custom Options */
30
+ $popup_formats = array();
31
+
32
+ foreach ( get_all_popups()->posts as $popup ) {
33
+ $popup_formats[] = array(
34
+ 'title' => $popup->post_title,
35
+ 'inline' => 'span',
36
+ 'classes' => "popmake-{$popup->ID}"
37
+ );
38
+ }
39
+
40
+ $new_formats = array(
41
+ array(
42
+ 'title' => __( 'Popup Trigger', 'popup-maker' ),
43
+ 'items' => $popup_formats
44
+ )
45
+ );
46
+
47
+ /* Check if custom "style_formats" is enabled */
48
+ if ( isset( $settings['style_formats'] ) ) {
49
+
50
+ /* Get old style_format config */
51
+ $old_formats = json_decode( $settings['style_formats'] );
52
+
53
+ /* Merge it with our own */
54
+ $new_formats = array_merge( $new_formats, $old_formats );
55
+ }
56
+ else {
57
+ $new_formats = array_merge( self::default_formats(), $new_formats );
58
+ }
59
+
60
+ /* Add it in tinymce config as json data */
61
+ $settings['style_formats'] = json_encode( $new_formats );
62
+ return $settings;
63
+ }
64
+
65
+ public static function default_formats() {
66
+ return array(
67
+ array(
68
+ 'title' => __( 'Headings' ),
69
+ 'items' => array(
70
+ array(
71
+ 'title' => __( 'Heading 1' ),
72
+ 'format' => 'h1',
73
+ ),
74
+ array(
75
+ 'title' => __( 'Heading 2' ),
76
+ 'format' => 'h2',
77
+ ),
78
+ array(
79
+ 'title' => __( 'Heading 3' ),
80
+ 'format' => 'h3',
81
+ ),
82
+ array(
83
+ 'title' => __( 'Heading 4' ),
84
+ 'format' => 'h4',
85
+ ),
86
+ array(
87
+ 'title' => __( 'Heading 5' ),
88
+ 'format' => 'h5',
89
+ ),
90
+ array(
91
+ 'title' => __( 'Heading 6' ),
92
+ 'format' => 'h6',
93
+ ),
94
+ ),
95
+ ),
96
+ array(
97
+ 'title' => 'Inline',
98
+ 'items' => array(
99
+ array(
100
+ 'title' => __( 'Bold' ),
101
+ 'format' => 'bold',
102
+ 'icon' => 'bold',
103
+ ),
104
+ array(
105
+ 'title' => __( 'Italic' ),
106
+ 'format' => 'italic',
107
+ 'icon' => 'italic',
108
+ ),
109
+ array(
110
+ 'title' => __( 'Underline' ),
111
+ 'format' => 'underline',
112
+ 'icon' => 'underline',
113
+ ),
114
+ array(
115
+ 'title' => __( 'Strikethrough' ),
116
+ 'format' => 'strikethrough',
117
+ 'icon' => 'strikethrough',
118
+ ),
119
+ array(
120
+ 'title' => __( 'Superscript' ),
121
+ 'format' => 'superscript',
122
+ 'icon' => 'superscript',
123
+ ),
124
+ array(
125
+ 'title' => __( 'Subscript' ),
126
+ 'format' => 'subscript',
127
+ 'icon' => 'subscript',
128
+ ),
129
+ array(
130
+ 'title' => __( 'Code' ),
131
+ 'format' => 'code',
132
+ 'icon' => 'code',
133
+ ),
134
+ ),
135
+ ),
136
+ array(
137
+ 'title' => 'Blocks',
138
+ 'items' => array(
139
+ array(
140
+ 'title' => __( 'Paragraph' ),
141
+ 'format' => 'p',
142
+ ),
143
+ array(
144
+ 'title' => __( 'Blockquote' ),
145
+ 'format' => 'blockquote',
146
+ ),
147
+ array(
148
+ 'title' => __( 'Div' ),
149
+ 'format' => 'div',
150
+ ),
151
+ array(
152
+ 'title' => __( 'Pre' ),
153
+ 'format' => 'pre',
154
+ ),
155
+ ),
156
+ ),
157
+ array(
158
+ 'title' => 'Alignment',
159
+ 'items' => array(
160
+ array(
161
+ 'title' => __( 'Left' ),
162
+ 'format' => 'alignleft',
163
+ 'icon' => 'alignleft',
164
+ ),
165
+ array(
166
+ 'title' => __( 'Center' ),
167
+ 'format' => 'aligncenter',
168
+ 'icon' => 'aligncenter',
169
+ ),
170
+ array(
171
+ 'title' => __( 'Right' ),
172
+ 'format' => 'alignright',
173
+ 'icon' => 'alignright',
174
+ ),
175
+ array(
176
+ 'title' => __( 'Justify' ),
177
+ 'format' => 'alignjustify',
178
+ 'icon' => 'alignjustify',
179
+ ),
180
+ ),
181
+ ),
182
  );
183
  }
 
184
 
 
185
  }
186
+
187
+ PopMake_Post_Editor::init();
188
+
includes/css-functions.php CHANGED
@@ -6,6 +6,9 @@ if ( ! defined( 'ABSPATH' ) ) {
6
  }
7
 
8
  function popmake_hex2rgb( $hex ) {
 
 
 
9
  $hex = str_replace( "#", "", $hex );
10
 
11
  if ( strlen( $hex ) == 3 ) {
6
  }
7
 
8
  function popmake_hex2rgb( $hex ) {
9
+ if ( is_array( $hex ) ) {
10
+ $hex = implode( '', $hex );
11
+ }
12
  $hex = str_replace( "#", "", $hex );
13
 
14
  if ( strlen( $hex ) == 3 ) {
includes/install.php CHANGED
@@ -101,6 +101,7 @@ function popmake_install_default_theme() {
101
  update_post_meta( $default_theme, 'popup_theme_defaults_set', true );
102
  update_post_meta( $default_theme, 'popmake_default_theme', true );
103
  update_option( 'popmake_default_theme', $default_theme );
 
104
  }
105
 
106
 
101
  update_post_meta( $default_theme, 'popup_theme_defaults_set', true );
102
  update_post_meta( $default_theme, 'popmake_default_theme', true );
103
  update_option( 'popmake_default_theme', $default_theme );
104
+ delete_transient( 'popmake_theme_styles' );
105
  }
106
 
107
 
includes/integrations/google-fonts.php CHANGED
@@ -5,37 +5,35 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
 
8
- function popmake_enqueue_google_fonts_during_preload( $data_attr, $popup_theme_id ) {
9
- global $popmake_needed_google_fonts;
10
- if ( ! is_array( $popmake_needed_google_fonts ) ) {
11
- $popmake_needed_google_fonts = array();
12
- }
13
 
14
  $google_fonts = popmake_get_google_webfonts_list();
15
 
16
- if ( ! empty( $data_attr['title']['font_family'] ) && array_key_exists( $data_attr['title']['font_family'], $google_fonts ) ) {
17
- $variant = $data_attr['title']['font_weight'] != 'normal' ? $data_attr['title']['font_family'] : '';
18
- if ( $data_attr['title']['font_style'] == 'italic' ) {
19
  $variant .= 'italic';
20
  }
21
- $popmake_needed_google_fonts[ $data_attr['title']['font_family'] ][ $variant ] = $variant;
22
  }
23
- if ( ! empty( $data_attr['content']['font_family'] ) && array_key_exists( $data_attr['content']['font_family'], $google_fonts ) ) {
24
- $variant = $data_attr['content']['font_weight'] != 'normal' ? $data_attr['content']['font_family'] : '';
25
- if ( $data_attr['content']['font_style'] == 'italic' ) {
26
  $variant .= 'italic';
27
  }
28
- $popmake_needed_google_fonts[ $data_attr['content']['font_family'] ][ $variant ] = $variant;
29
  }
30
- if ( ! empty( $data_attr['close']['font_family'] ) && array_key_exists( $data_attr['close']['font_family'], $google_fonts ) ) {
31
- $variant = $data_attr['close']['font_weight'] != 'normal' ? $data_attr['close']['font_family'] : '';
32
- if ( $data_attr['close']['font_style'] == 'italic' ) {
33
  $variant .= 'italic';
34
  }
35
- $popmake_needed_google_fonts[ $data_attr['close']['font_family'] ][ $variant ] = $variant;
36
  }
37
 
38
- return $data_attr;
39
  }
40
 
41
- add_action( 'popmake_get_popup_theme_data_attr', 'popmake_enqueue_google_fonts_during_preload', 10, 2 );
5
  exit;
6
  }
7
 
8
+ function popmake_get_popup_theme_google_fonts( $popup_theme_id ) {
9
+
10
+ $fonts_found = array();
11
+ $theme = popmake_get_popup_theme_data_attr( $popup_theme_id );
 
12
 
13
  $google_fonts = popmake_get_google_webfonts_list();
14
 
15
+ if ( ! empty( $theme['title']['font_family'] ) && is_string( $theme['title']['font_family'] ) && array_key_exists( $theme['title']['font_family'], $google_fonts ) ) {
16
+ $variant = $theme['title']['font_weight'] != 'normal' ? $theme['title']['font_family'] : '';
17
+ if ( $theme['title']['font_style'] == 'italic' ) {
18
  $variant .= 'italic';
19
  }
20
+ $fonts_found[ $theme['title']['font_family'] ][ $variant ] = $variant;
21
  }
22
+ if ( ! empty( $theme['content']['font_family'] ) && is_string( $theme['content']['font_family'] ) && array_key_exists( $theme['content']['font_family'], $google_fonts ) ) {
23
+ $variant = $theme['content']['font_weight'] != 'normal' ? $theme['content']['font_family'] : '';
24
+ if ( $theme['content']['font_style'] == 'italic' ) {
25
  $variant .= 'italic';
26
  }
27
+ $fonts_found[ $theme['content']['font_family'] ][ $variant ] = $variant;
28
  }
29
+ if ( ! empty( $theme['close']['font_family'] ) && is_string( $theme['close']['font_family'] ) && array_key_exists( $theme['close']['font_family'], $google_fonts ) ) {
30
+ $variant = $theme['close']['font_weight'] != 'normal' ? $theme['close']['font_family'] : '';
31
+ if ( $theme['close']['font_style'] == 'italic' ) {
32
  $variant .= 'italic';
33
  }
34
+ $fonts_found[ $theme['close']['font_family'] ][ $variant ] = $variant;
35
  }
36
 
37
+ return $fonts_found;
38
  }
39
 
 
includes/integrations/visual-composer.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
+ final class Popmake_VisualComposer_Integration {
9
+ public static function init() {
10
+ add_filter( 'popmake_popup_post_type_args', array( __CLASS__, 'popup_post_type_args' ) );
11
+ }
12
+
13
+ public static function popup_post_type_args( $popup_args ) {
14
+ if ( ! empty( $_GET['page'] ) && $_GET['page'] == 'vc_settings' ) {
15
+ $popup_args['public'] = true;
16
+ }
17
+ return $popup_args;
18
+ }
19
+ }
20
+
21
+ Popmake_VisualComposer_Integration::init();
includes/popup-functions.php CHANGED
@@ -137,16 +137,16 @@ function popmake_clean_popup_data_attr( $data_attr ) {
137
  if ( empty( $display['responsive_min_width'] ) ) {
138
  unset( $display['responsive_min_width'], $display['responsive_min_width_unit'] );
139
  }
140
- if ( ! strpos( $display['location'], 'left' ) ) {
141
  unset( $display['position_left'] );
142
  }
143
- if ( ! strpos( $display['location'], 'right' ) ) {
144
  unset( $display['position_right'] );
145
  }
146
- if ( ! strpos( $display['location'], 'top' ) ) {
147
  unset( $display['position_top'] );
148
  }
149
- if ( ! strpos( $display['location'], 'bottom' ) ) {
150
  unset( $display['position_bottom'] );
151
  }
152
 
@@ -573,18 +573,18 @@ function popmake_popup_is_loadable( $popup_id ) {
573
  $category_id = $wp_query->get_queried_object_id();
574
  if ( ! $sitewide ) {
575
  // Load on all categories
576
- if ( array_key_exists( 'on_categories', $conditions ) && ! array_key_exists( 'on_specific_categories', $conditions ) ) {
577
  $is_loadable = true;
578
  } // Load on specific categories
579
- elseif ( array_key_exists( 'on_specific_categories', $conditions ) && array_key_exists( 'on_category_' . $category_id, $conditions ) ) {
580
  $is_loadable = true;
581
  }
582
  } else {
583
  // Exclude on all categories.
584
- if ( array_key_exists( 'exclude_on_categories', $conditions ) && ! array_key_exists( 'exclude_on_specific_categories', $conditions ) ) {
585
  $is_loadable = false;
586
  } // Exclude on specific categories.
587
- elseif ( array_key_exists( 'exclude_on_specific_categories', $conditions ) && array_key_exists( 'exclude_on_category_' . $category_id, $conditions ) ) {
588
  $is_loadable = false;
589
  }
590
  }
137
  if ( empty( $display['responsive_min_width'] ) ) {
138
  unset( $display['responsive_min_width'], $display['responsive_min_width_unit'] );
139
  }
140
+ if ( strpos( $display['location'], 'left' ) === false ) {
141
  unset( $display['position_left'] );
142
  }
143
+ if ( strpos( $display['location'], 'right' ) === false ) {
144
  unset( $display['position_right'] );
145
  }
146
+ if ( strpos( $display['location'], 'top' ) === false ) {
147
  unset( $display['position_top'] );
148
  }
149
+ if ( strpos( $display['location'], 'bottom' ) === false ) {
150
  unset( $display['position_bottom'] );
151
  }
152
 
573
  $category_id = $wp_query->get_queried_object_id();
574
  if ( ! $sitewide ) {
575
  // Load on all categories
576
+ if ( array_key_exists( 'on_categorys', $conditions ) && ! array_key_exists( 'on_specific_categorys', $conditions ) ) {
577
  $is_loadable = true;
578
  } // Load on specific categories
579
+ elseif ( array_key_exists( 'on_specific_categorys', $conditions ) && array_key_exists( 'on_category_' . $category_id, $conditions ) ) {
580
  $is_loadable = true;
581
  }
582
  } else {
583
  // Exclude on all categories.
584
+ if ( array_key_exists( 'exclude_on_categorys', $conditions ) && ! array_key_exists( 'exclude_on_specific_categorys', $conditions ) ) {
585
  $is_loadable = false;
586
  } // Exclude on specific categories.
587
+ elseif ( array_key_exists( 'exclude_on_specific_categorys', $conditions ) && array_key_exists( 'exclude_on_category_' . $category_id, $conditions ) ) {
588
  $is_loadable = false;
589
  }
590
  }
includes/scripts.php CHANGED
@@ -35,7 +35,7 @@ function popmake_load_site_scripts() {
35
  'jquery-ui-position'
36
  ), POPMAKE_VERSION, true );
37
  wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
38
- wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) get_option( 'popmake_default_theme' ) );
39
 
40
  if ( popmake_get_option( 'popmake_powered_by_opt_in', false ) ) {
41
  $size = popmake_get_option( 'popmake_powered_by_size', '' );
@@ -59,26 +59,10 @@ add_action( 'wp_enqueue_scripts', 'popmake_load_site_scripts' );
59
  * @return void
60
  */
61
  function popmake_load_site_styles() {
62
- global $popmake_needed_google_fonts;
63
  $css_dir = POPMAKE_URL . '/assets/styles/';
64
  $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
65
  wp_register_style( 'popup-maker-site', $css_dir . 'popup-maker-site' . $suffix, false, POPMAKE_VERSION );
66
- if ( ! empty( $popmake_needed_google_fonts ) && ! popmake_get_option( 'disable_google_font_loading', false ) ) {
67
- $link = "//fonts.googleapis.com/css?family=";
68
- foreach ( $popmake_needed_google_fonts as $font_family => $variants ) {
69
- if ( $link != "//fonts.googleapis.com/css?family=" ) {
70
- $link .= "|";
71
- }
72
- $link .= $font_family;
73
- if ( ! empty( $variants ) ) {
74
- $link .= ":";
75
- $link .= implode( ',', $variants );
76
- }
77
- }
78
- wp_register_style( 'popup-maker-google-fonts', $link );
79
- }
80
  }
81
-
82
  add_action( 'wp_enqueue_scripts', 'popmake_load_site_styles' );
83
 
84
  function popmake_render_popup_theme_styles() {
@@ -94,15 +78,36 @@ function popmake_render_popup_theme_styles() {
94
 
95
  $styles = '';
96
 
 
 
97
  foreach ( popmake_get_all_popup_themes() as $theme ) {
98
  $theme_styles = popmake_render_theme_styles( $theme->ID );
99
 
 
 
100
  if ( $theme_styles != '' ) {
101
  $styles .= "/* Popup Theme " . $theme->ID . ": " . $theme->post_title . " */\r\n";
102
  $styles .= $theme_styles;
103
  }
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  set_transient( 'popmake_theme_styles', $styles, 7 * DAY_IN_SECONDS );
107
 
108
  }
@@ -147,7 +152,7 @@ function popmake_load_admin_scripts() {
147
  'jquery-ui-position'
148
  ), POPMAKE_VERSION, true );
149
  wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
150
- wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) get_option( 'popmake_default_theme' ) );
151
  }
152
  if ( popmake_is_admin_popup_theme_page() ) {
153
  wp_localize_script( 'popup-maker-admin', 'popmake_google_fonts', popmake_get_google_webfonts_list() );
35
  'jquery-ui-position'
36
  ), POPMAKE_VERSION, true );
37
  wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
38
+ wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) popmake_get_default_popup_theme() );
39
 
40
  if ( popmake_get_option( 'popmake_powered_by_opt_in', false ) ) {
41
  $size = popmake_get_option( 'popmake_powered_by_size', '' );
59
  * @return void
60
  */
61
  function popmake_load_site_styles() {
 
62
  $css_dir = POPMAKE_URL . '/assets/styles/';
63
  $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
64
  wp_register_style( 'popup-maker-site', $css_dir . 'popup-maker-site' . $suffix, false, POPMAKE_VERSION );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
 
66
  add_action( 'wp_enqueue_scripts', 'popmake_load_site_styles' );
67
 
68
  function popmake_render_popup_theme_styles() {
78
 
79
  $styles = '';
80
 
81
+ $google_fonts = array();
82
+
83
  foreach ( popmake_get_all_popup_themes() as $theme ) {
84
  $theme_styles = popmake_render_theme_styles( $theme->ID );
85
 
86
+ $google_fonts = array_merge( $google_fonts, popmake_get_popup_theme_google_fonts( $theme->ID ) );
87
+
88
  if ( $theme_styles != '' ) {
89
  $styles .= "/* Popup Theme " . $theme->ID . ": " . $theme->post_title . " */\r\n";
90
  $styles .= $theme_styles;
91
  }
92
  }
93
 
94
+ if ( ! empty( $google_fonts ) ) {
95
+ $link = "//fonts.googleapis.com/css?family=";
96
+ foreach ( $google_fonts as $font_family => $variants ) {
97
+ if ( $link != "//fonts.googleapis.com/css?family=" ) {
98
+ $link .= "|";
99
+ }
100
+ $link .= $font_family;
101
+ if ( ! empty( $variants ) ) {
102
+ $link .= ":";
103
+ $link .= implode( ',', $variants );
104
+ }
105
+ }
106
+
107
+ $styles = "/* Popup Google Fonts */\r\n@import url('$link');\r\n\r\n" . $styles;
108
+ }
109
+
110
+
111
  set_transient( 'popmake_theme_styles', $styles, 7 * DAY_IN_SECONDS );
112
 
113
  }
152
  'jquery-ui-position'
153
  ), POPMAKE_VERSION, true );
154
  wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
155
+ wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) popmake_get_default_popup_theme() );
156
  }
157
  if ( popmake_is_admin_popup_theme_page() ) {
158
  wp_localize_script( 'popup-maker-admin', 'popmake_google_fonts', popmake_get_google_webfonts_list() );
includes/shortcodes.php CHANGED
@@ -10,7 +10,8 @@ function popmake_shortcode_popup( $atts, $content = null ) {
10
  $atts = shortcode_atts(
11
  apply_filters( 'popmake_shortcode_popup_default_atts', array(
12
  'id' => "",
13
- 'theme_id' => 1,
 
14
  'title' => "",
15
  'overlay_disabled' => 0,
16
  'size' => "small",
@@ -34,6 +35,15 @@ function popmake_shortcode_popup( $atts, $content = null ) {
34
  'popup'
35
  );
36
 
 
 
 
 
 
 
 
 
 
37
  $popup_fields = apply_filters( 'popmake_shortcode_data_attr', array(
38
  'id' => $atts['id'],
39
  'theme' => $atts['theme_id'],
10
  $atts = shortcode_atts(
11
  apply_filters( 'popmake_shortcode_popup_default_atts', array(
12
  'id' => "",
13
+ 'theme_id' => null,
14
+ 'theme' => null,
15
  'title' => "",
16
  'overlay_disabled' => 0,
17
  'size' => "small",
35
  'popup'
36
  );
37
 
38
+ if ( ! $atts['theme_id'] ) {
39
+ if ( ! $atts['theme'] ) {
40
+ $atts['theme_id'] = popmake_get_default_popup_theme();
41
+ }
42
+ else {
43
+ $atts['theme_id'] = $atts['theme'];
44
+ }
45
+ }
46
+
47
  $popup_fields = apply_filters( 'popmake_shortcode_data_attr', array(
48
  'id' => $atts['id'],
49
  'theme' => $atts['theme_id'],
popup-maker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wppopupmaker.com
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: Daniel Iser
7
- * Version: 1.3.6
8
  * Author URI: https://wppopupmaker.com
9
  * Text Domain: popup-maker
10
  *
@@ -144,7 +144,7 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
144
  }
145
 
146
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
147
- define( 'POPMAKE_VERSION', '1.3.6' );
148
  }
149
 
150
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
@@ -238,6 +238,9 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
238
  require_once POPMAKE_DIR . 'includes/integrations/woocommerce.php';
239
  }
240
 
 
 
 
241
  require_once POPMAKE_DIR . 'includes/install.php';
242
  }
243
 
4
  * Plugin URI: https://wppopupmaker.com
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: Daniel Iser
7
+ * Version: 1.3.7
8
  * Author URI: https://wppopupmaker.com
9
  * Text Domain: popup-maker
10
  *
144
  }
145
 
146
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
147
+ define( 'POPMAKE_VERSION', '1.3.7' );
148
  }
149
 
150
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
238
  require_once POPMAKE_DIR . 'includes/integrations/woocommerce.php';
239
  }
240
 
241
+ if ( defined( 'WPB_VC_VERSION' ) ) {
242
+ require_once POPMAKE_DIR . 'includes/integrations/visual-composer.php';
243
+ }
244
  require_once POPMAKE_DIR . 'includes/install.php';
245
  }
246
 
readme.txt CHANGED
@@ -5,8 +5,8 @@ Plugin URI: https://wppopupmaker.com?utm_source=WordPress+Page&utm_medium=Text+L
5
  Donate link:
6
  Tags: age restriction, age verification, auto open, automatic popup, conversion, conversions, custom popup, dialog box, exit intent, fancy box, fancy popup, form modal, full page popup, full screen pop, full screen popup, marketing, modal, modals, onclick popup, optin popup, pop-up, pop-ups, popup, popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, unblockable, wordpress popup
7
  Requires at least: 3.4
8
- Tested up to: 4.3
9
- Stable tag: 1.3.6
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The most versatile popup plugin for WordPress! Grow email subscriber lists, get more FB Likes, create login modals, content restriction & more.
@@ -27,6 +27,8 @@ With hooks, filters and a full JavaScript events API you can take basic popups t
27
  * **Responsive Popups** - Choosing a responsive size will make your popups resize automatically with users screen size. Great for use with themes that are responsive.
28
  * **Too many features to list here** - If you can't figure out how to get the functionality your after, ask us we will be glad to help.
29
 
 
 
30
  = Supported Optin Forms =
31
  * Mailchimp
32
  * Aweber
@@ -44,6 +46,7 @@ Not all form plugins are optimal for use in popups. The following support AJAX s
44
 
45
  * Gravity Forms
46
  * Ninja Forms
 
47
  * Contact Form 7
48
 
49
  = Available Languages =
@@ -103,6 +106,18 @@ There are several common causes for this which include:
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  = v1.3.6 - 8/25/2015 =
107
  * Confirmed WP v4.3 compatibility.
108
  * Tweak: Default theme is automatically used if a popup does not have one assigned.
5
  Donate link:
6
  Tags: age restriction, age verification, auto open, automatic popup, conversion, conversions, custom popup, dialog box, exit intent, fancy box, fancy popup, form modal, full page popup, full screen pop, full screen popup, marketing, modal, modals, onclick popup, optin popup, pop-up, pop-ups, popup, popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, unblockable, wordpress popup
7
  Requires at least: 3.4
8
+ Tested up to: 4.3.1
9
+ Stable tag: 1.3.7
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The most versatile popup plugin for WordPress! Grow email subscriber lists, get more FB Likes, create login modals, content restriction & more.
27
  * **Responsive Popups** - Choosing a responsive size will make your popups resize automatically with users screen size. Great for use with themes that are responsive.
28
  * **Too many features to list here** - If you can't figure out how to get the functionality your after, ask us we will be glad to help.
29
 
30
+ Now works with Visual Composer by WP Bakery - Craft beautify & fully responsive popups in no time with Popup Maker & Visual Composer.
31
+
32
  = Supported Optin Forms =
33
  * Mailchimp
34
  * Aweber
46
 
47
  * Gravity Forms
48
  * Ninja Forms
49
+ * Caldera Forms
50
  * Contact Form 7
51
 
52
  = Available Languages =
106
 
107
  == Changelog ==
108
 
109
+ = v1.3.7 - 9/21/2015 =
110
+ * Feature: Added support for Visual Composer to popups. (Backend Editor Only). Works Perfectly with Responsive Popups.
111
+ * Tweak: Disable position fixed on mobile screens for responsive popups.
112
+ * Tweak: Improved UI with better popup formats selection.
113
+ * Fix: Bug with default theme not properly being created.
114
+ * Fix: Bug where default & theme formats were overridden in the WP Editor.
115
+ * Fix: Bug with default theme not being used for [popup] shortcode.
116
+ * Fix: Bug with loading Google Fonts properly.
117
+ * Fix: Errors generated by incorrectly formatted colors in the editor.
118
+ * Fix: Bug with targeting conditions for categories.
119
+ * Fix: Bug in positioning left & right values. Credit to @invik for the solution.
120
+
121
  = v1.3.6 - 8/25/2015 =
122
  * Confirmed WP v4.3 compatibility.
123
  * Tweak: Default theme is automatically used if a popup does not have one assigned.