├── css └── tpl │ ├── simple │ ├── style.php │ ├── img │ │ ├── close.png │ │ └── close@2x.png │ ├── template.php │ └── style.css │ ├── cabriolet │ ├── style.php │ ├── img │ │ ├── close.png │ │ └── close@2x.png │ └── template.php │ ├── minimal │ ├── style.php │ └── template.php │ ├── old-default │ ├── style.php │ ├── img │ │ ├── opaque.png │ │ ├── loading.gif │ │ ├── closemessage.png │ │ └── closemessagebland.png │ ├── template.php │ └── style.css │ ├── old-fixed │ ├── style.php │ ├── img │ │ ├── loading.gif │ │ ├── opaque.png │ │ ├── closemessage.png │ │ └── closemessagebland.png │ ├── template.php │ └── style.css │ └── old-fullbackground │ ├── style.php │ ├── img │ ├── opaque.png │ ├── loading.gif │ ├── opaque80.png │ ├── closemessage.png │ └── closemessagebland.png │ ├── template.php │ └── style.css ├── img ├── icon.png └── dev-team.png ├── lang └── popover-en_US.mo ├── humans.txt ├── views ├── meta-side-ads.php ├── meta-customcss.php ├── meta-rules.php ├── network.php ├── meta-submitdiv.php ├── info-shortcodes.php ├── meta-content.php ├── meta-behavior-premium.php ├── meta-appearance.php └── meta-behavior.php ├── inc ├── config-defaults.php ├── class-popup-help.php ├── addons │ ├── class-popup-addon-geo-db.php │ └── class-popup-addon-headerfooter.php ├── rules │ ├── class-popup-rule-browser.php │ ├── class-popup-rule-popup.php │ ├── class-popup-rule-prosite.php │ ├── class-popup-rule-user.php │ ├── class-popup-rule-role.php │ ├── class-popup-rule-advurl.php │ ├── class-popup-rule-events.php │ ├── class-popup-rule-datetime.php │ ├── class-popup-rule-width.php │ ├── class-popup-rule-url.php │ ├── class-popup-rule-posttype.php │ ├── class-popup-rule-protectedcontent.php │ ├── class-popup-rule-xprofile.php │ └── class-popup-rule-category.php └── class-popup-posttype.php ├── js ├── theme-chrome.min.js ├── vendor │ └── theme-chrome.js ├── theme-chrome.js ├── popup-admin.min.js └── public.min.js ├── popover.php └── changelog.txt /css/tpl/simple/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Simple', 'popover' ); 3 | -------------------------------------------------------------------------------- /img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/img/icon.png -------------------------------------------------------------------------------- /img/dev-team.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/img/dev-team.png -------------------------------------------------------------------------------- /lang/popover-en_US.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/lang/popover-en_US.mo -------------------------------------------------------------------------------- /css/tpl/cabriolet/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Cabriolet', 'popover' ); 3 | $info->pro = true; -------------------------------------------------------------------------------- /css/tpl/minimal/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Minimal', 'popover' ); 3 | $info->pro = true; -------------------------------------------------------------------------------- /css/tpl/old-default/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Default', 'popover' ); 3 | $info->deprecated = true; -------------------------------------------------------------------------------- /css/tpl/simple/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/simple/img/close.png -------------------------------------------------------------------------------- /css/tpl/cabriolet/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/cabriolet/img/close.png -------------------------------------------------------------------------------- /css/tpl/old-fixed/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Default Fixed', 'popover' ); 3 | $info->deprecated = true; -------------------------------------------------------------------------------- /css/tpl/simple/img/close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/simple/img/close@2x.png -------------------------------------------------------------------------------- /css/tpl/cabriolet/img/close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/cabriolet/img/close@2x.png -------------------------------------------------------------------------------- /css/tpl/old-default/img/opaque.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-default/img/opaque.png -------------------------------------------------------------------------------- /css/tpl/old-fixed/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fixed/img/loading.gif -------------------------------------------------------------------------------- /css/tpl/old-fixed/img/opaque.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fixed/img/opaque.png -------------------------------------------------------------------------------- /css/tpl/old-default/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-default/img/loading.gif -------------------------------------------------------------------------------- /css/tpl/old-fixed/img/closemessage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fixed/img/closemessage.png -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/style.php: -------------------------------------------------------------------------------- 1 | name = __( 'Dark Background Fixed', 'popover' ); 3 | $info->deprecated = true; -------------------------------------------------------------------------------- /css/tpl/old-default/img/closemessage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-default/img/closemessage.png -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/img/opaque.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fullbackground/img/opaque.png -------------------------------------------------------------------------------- /css/tpl/old-fixed/img/closemessagebland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fixed/img/closemessagebland.png -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fullbackground/img/loading.gif -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/img/opaque80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fullbackground/img/opaque80.png -------------------------------------------------------------------------------- /css/tpl/old-default/img/closemessagebland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-default/img/closemessagebland.png -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/img/closemessage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fullbackground/img/closemessage.png -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/img/closemessagebland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/popup-pro/master/css/tpl/old-fullbackground/img/closemessagebland.png -------------------------------------------------------------------------------- /humans.txt: -------------------------------------------------------------------------------- 1 | /* TEAM */ 2 | Developer: Barry 3 | Contact: 4 | Twitter: @caffeinatedwp 5 | Location: 6 | 7 | Developer: Marko Miljus 8 | Location: Novi Sad, Serbia 9 | Contact: marko [at] incsub [dot] com 10 | Twitter: @markomiljus 11 | 12 | Developer: Ve Bailovity 13 | Contact: ve [at] incsub [dot] com 14 | Twitter: @vebailovity 15 | Location: Zrenjanin, Serbia 16 | 17 | Developer: Philipp Stracker 18 | Contact: philipp [at] incsub [dot] com 19 | Twitter: 20 | Location: Götzis, Austria -------------------------------------------------------------------------------- /views/meta-side-ads.php: -------------------------------------------------------------------------------- 1 | 9 | 10 |

11 | 12 |

13 | 14 | -------------------------------------------------------------------------------- /views/meta-customcss.php: -------------------------------------------------------------------------------- 1 | 12 |
13 | 16 |
17 |
18 | 21 |
custom_css ); 27 | ?>
28 |
29 |
30 | #popup, e.g. #popup .wdpu-text { font-family: sans }', 'popover' ); ?> 31 |
-------------------------------------------------------------------------------- /views/meta-rules.php: -------------------------------------------------------------------------------- 1 | 10 |
11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 |
    23 | 24 |
25 |
26 |
27 |
28 |
29 |
    30 | 31 |
32 |
33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /inc/config-defaults.php: -------------------------------------------------------------------------------- 1 | content ); 10 | $msg_class .= 'wdpu-' . $this->id . ' '; 11 | 12 | if ( defined( 'PO_ALLOW_CONTENT_FILTERING' ) && PO_ALLOW_CONTENT_FILTERING ) { 13 | $content = defined( 'PO_USE_FULL_CONTENT_FILTERING' ) && PO_USE_FULL_CONTENT_FILTERING 14 | ? apply_filters( 'the_content', stripslashes( $content ) ) 15 | : wptexturize( wpautop( $content ) ); 16 | } 17 | 18 | ?> 19 | 20 |
23 | 24 | 25 |
26 | 27 | 28 | 29 |
30 | can_hide ) : ?> 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 |
-------------------------------------------------------------------------------- /css/tpl/old-default/template.php: -------------------------------------------------------------------------------- 1 | content ); 10 | $msg_class .= 'wdpu-' . $this->id . ' '; 11 | 12 | if ( defined( 'PO_ALLOW_CONTENT_FILTERING' ) && PO_ALLOW_CONTENT_FILTERING ) { 13 | $content = defined( 'PO_USE_FULL_CONTENT_FILTERING' ) && PO_USE_FULL_CONTENT_FILTERING 14 | ? apply_filters( 'the_content', stripslashes( $content ) ) 15 | : wptexturize( wpautop( $content ) ); 16 | } 17 | 18 | ?> 19 | 20 |
23 | 24 | 25 |
26 | 27 | 28 | 29 |
30 | can_hide ) : ?> 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 |
-------------------------------------------------------------------------------- /css/tpl/old-fullbackground/template.php: -------------------------------------------------------------------------------- 1 | content ); 10 | $msg_class .= 'wdpu-' . $this->id . ' '; 11 | 12 | if ( defined( 'PO_ALLOW_CONTENT_FILTERING' ) && PO_ALLOW_CONTENT_FILTERING ) { 13 | $content = defined( 'PO_USE_FULL_CONTENT_FILTERING' ) && PO_USE_FULL_CONTENT_FILTERING 14 | ? apply_filters( 'the_content', stripslashes( $content ) ) 15 | : wptexturize( wpautop( $content ) ); 16 | } 17 | 18 | ?> 19 |
20 |
23 | 24 | 25 |
26 | 27 | 28 | 29 |
30 | can_hide ) : ?> 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 |
41 |
-------------------------------------------------------------------------------- /inc/class-popup-help.php: -------------------------------------------------------------------------------- 1 | add_help_tab( 58 | array( 59 | 'id' => 'help_shortcodes', 60 | 'title' => __( 'Shortcodes', 'popover' ), 61 | 'callback' => array( $this, 'content_shortcodes' ), 62 | ) 63 | ); 64 | 65 | return $help_obj; 66 | } 67 | 68 | /** 69 | * Output help contents for section "Shortcodes" 70 | * 71 | * @since 4.6.1.1 72 | */ 73 | public function content_shortcodes() { 74 | IncPopup::load_view( 'info-shortcodes' ); 75 | } 76 | }; 77 | -------------------------------------------------------------------------------- /views/network.php: -------------------------------------------------------------------------------- 1 | 18 | 27 |
28 |
29 |

30 | 31 |
32 |

We moved the global PopUp menu items ' . 36 | 'to the Main Blog of your multisite ' . 37 | 'network!
The Main Blog of this network is "%1$s" - ' . 38 | 'Go to the Main Blog now!', 'popover' 39 | ), 40 | $blog_title, 41 | esc_url( $main_url ) 42 | ); 43 | ?>

44 |
45 | 46 |
47 |

Network Admin are not used anymore ' . 51 | 'you can hide them at any time:', 'popover' 52 | ); 53 | ?>

54 |

55 | 56 | 57 | 58 |

59 |
60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /css/tpl/old-fixed/style.css: -------------------------------------------------------------------------------- 1 | #messagebox { 2 | position: fixed; 3 | background: transparent url(%styleurl%img/opaque.png) repeat; 4 | padding: 10px; 5 | visibility: visible; 6 | z-index: 999999; 7 | } 8 | #messagebox .claimbutton { 9 | position: absolute; 10 | bottom: 0; 11 | right: 0; 12 | width: 100%; 13 | background: transparent url(%styleurl%img/opaque.png) repeat; 14 | text-align: right; 15 | padding-top: 5px; 16 | padding-bottom: 5px; 17 | display: none; 18 | } 19 | #messagebox .claimbutton a:visited, 20 | #messagebox .claimbutton a { 21 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 22 | color: #FFF; 23 | text-shadow: #000 1px 1px 0px; 24 | font-weight: bold; 25 | padding-right: 5px; 26 | } 27 | #messagebox .wdpu-close { 28 | position: absolute; 29 | width: 30px; 30 | height: 29px; 31 | background: transparent url(%styleurl%img/closemessagebland.png) no-repeat; 32 | top: -5px; 33 | left: -5px; 34 | z-index: 5; 35 | } 36 | #messagebox .wdpu-msg { 37 | position: relative; 38 | background: #fff; 39 | font: 0.9em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 40 | line-height: normal; 41 | height: 100%; 42 | overflow: hidden; 43 | } 44 | #messagebox .wdpu-msg.waiting { 45 | background: #fff url(%styleurl%img/loading.gif) no-repeat center center; 46 | } 47 | #messagebox .wdpu-msg p { 48 | position: relative; 49 | clear: both; 50 | } 51 | #messagebox .wdpu-msg h2 { 52 | color: #000; 53 | font: bold 1.3em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 54 | margin-top: 0px; 55 | } 56 | #messagebox .wdpu-msg h2 a { 57 | text-decoration: none; 58 | color: #000; 59 | } 60 | #messagebox .wdpu-msg blockquote { 61 | padding: 0px; 62 | font-weight: bold; 63 | border-left: 5px solid #ccc; 64 | } 65 | #messagebox .wdpu-msg blockquote p { 66 | padding: 2px 5px; 67 | } 68 | #messagebox .clear { 69 | clear: both; 70 | } 71 | #messagebox .hide { 72 | display: none; 73 | } 74 | #messagebox:hover .claimbutton { 75 | display: block; 76 | } 77 | 78 | .wp-admin #messagebox { 79 | font-size: 16px; 80 | } 81 | -------------------------------------------------------------------------------- /css/tpl/old-default/style.css: -------------------------------------------------------------------------------- 1 | #messagebox { 2 | position: absolute; 3 | background: transparent url(%styleurl%img/opaque.png) repeat; 4 | padding: 10px; 5 | visibility: visible; 6 | z-index: 999999; 7 | } 8 | #messagebox .claimbutton { 9 | position: absolute; 10 | bottom: 0; 11 | right: 0; 12 | width: 100%; 13 | background: transparent url(%styleurl%img/opaque.png) repeat; 14 | text-align: right; 15 | padding-top: 5px; 16 | padding-bottom: 5px; 17 | display: none; 18 | } 19 | #messagebox .claimbutton a:visited, 20 | #messagebox .claimbutton a { 21 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 22 | color: #FFF; 23 | text-shadow: #000 1px 1px 0px; 24 | font-weight: bold; 25 | padding-right: 5px; 26 | } 27 | #messagebox .wdpu-close { 28 | position: absolute; 29 | width: 30px; 30 | height: 29px; 31 | background: transparent url(%styleurl%img/closemessagebland.png) no-repeat; 32 | top: -5px; 33 | left: -5px; 34 | z-index: 5; 35 | } 36 | #messagebox .wdpu-msg { 37 | position: relative; 38 | background: #fff; 39 | font: 0.9em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 40 | line-height: normal; 41 | height: 100%; 42 | overflow: hidden; 43 | } 44 | #messagebox .wdpu-msg.waiting { 45 | background: #fff url(%styleurl%img/loading.gif) no-repeat center center; 46 | } 47 | #messagebox .wdpu-msg p { 48 | position: relative; 49 | clear: both; 50 | } 51 | #messagebox .wdpu-msg h2 { 52 | color: #000; 53 | font: bold 1.3em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 54 | margin-top: 0px; 55 | } 56 | #messagebox .wdpu-msg h2 a { 57 | text-decoration: none; 58 | color: #000; 59 | } 60 | #messagebox .wdpu-msg blockquote { 61 | padding: 0px; 62 | font-weight: bold; 63 | border-left: 5px solid #ccc; 64 | } 65 | #messagebox .wdpu-msg blockquote p { 66 | padding: 2px 5px; 67 | } 68 | #messagebox .clear { 69 | clear: both; 70 | } 71 | #messagebox .hide { 72 | display: none; 73 | } 74 | #messagebox:hover .claimbutton { 75 | display: block; 76 | } 77 | 78 | .wp-admin #messagebox { 79 | font-size: 16px; 80 | } 81 | -------------------------------------------------------------------------------- /css/tpl/simple/template.php: -------------------------------------------------------------------------------- 1 | 31 |
32 |
33 | 34 | 35 | 36 |
37 | 38 |
39 | 40 | 41 |
42 |
43 |
44 |
%title%
45 |
%subtitle%
46 |
47 |
%content%
48 |
49 | 50 | 51 |
52 | %cta_button% 53 | %hide_forever% 54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 | 63 |
64 |
-------------------------------------------------------------------------------- /css/tpl/minimal/template.php: -------------------------------------------------------------------------------- 1 | 31 |
32 |
33 | 34 | 37 | 38 |
39 |
40 |
%title%
41 |
%subtitle%
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 |
50 |
51 |
%content%
52 |
53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 | 61 |
62 | %hide_forever% 63 | %cta_button% 64 |
65 | 66 |
67 | 68 |
69 |
70 | -------------------------------------------------------------------------------- /css/tpl/old-fullbackground/style.css: -------------------------------------------------------------------------------- 1 | #darkbackground { 2 | position: fixed; 3 | background: transparent url(%styleurl%img/opaque80.png) repeat; 4 | top: 0; 5 | width: 100%; 6 | left: 0; 7 | height: 100%; 8 | z-index: 99999; 9 | visibility: visible; 10 | } 11 | 12 | #messagebox { 13 | position: absolute; 14 | background: transparent url(%styleurl%img/opaque.png) repeat; 15 | padding: 10px; 16 | visibility: visible; 17 | z-index: 999999; 18 | } 19 | #messagebox .claimbutton { 20 | position: absolute; 21 | bottom: 0; 22 | right: 0; 23 | width: 100%; 24 | background: transparent url(%styleurl%img/opaque.png) repeat; 25 | text-align: right; 26 | padding-top: 5px; 27 | padding-bottom: 5px; 28 | display: none; 29 | } 30 | #messagebox .claimbutton a:visited, 31 | #messagebox .claimbutton a { 32 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 33 | color: #FFF; 34 | text-shadow: #000 1px 1px 0px; 35 | font-weight: bold; 36 | padding-right: 5px; 37 | } 38 | #messagebox .wdpu-msg { 39 | position: relative; 40 | background: #fff; 41 | font: 0.9em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 42 | line-height: normal; 43 | height: 100%; 44 | overflow: hidden; 45 | } 46 | #messagebox .wdpu-msg.waiting { 47 | background: #fff url(%styleurl%img/loading.gif) no-repeat center center; 48 | } 49 | #messagebox .wdpu-msg p { 50 | position: relative; 51 | clear: both; 52 | } 53 | #messagebox .wdpu-msg h2 { 54 | color: #000; 55 | font: bold 1.3em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 56 | margin-top: 0px; 57 | } 58 | #messagebox .wdpu-msg h2 a { 59 | text-decoration: none; 60 | color: #000; 61 | } 62 | #messagebox .wdpu-msg blockquote { 63 | padding: 0px; 64 | font-weight: bold; 65 | border-left: 5px solid #ccc; 66 | } 67 | #messagebox .wdpu-msg blockquote p { 68 | padding: 2px 5px; 69 | } 70 | #messagebox .wdpu-close { 71 | position: absolute; 72 | width: 30px; 73 | height: 29px; 74 | background: transparent url(%styleurl%img/closemessagebland.png) no-repeat; 75 | top: -5px; 76 | left: -5px; 77 | z-index: 5; 78 | } 79 | #messagebox .clear { 80 | clear: both; 81 | } 82 | #messagebox .hide { 83 | display: none; 84 | } 85 | #messagebox:hover .claimbutton { 86 | display: block; 87 | } 88 | 89 | .wp-admin #messagebox { 90 | font-size: 16px; 91 | } 92 | -------------------------------------------------------------------------------- /css/tpl/cabriolet/template.php: -------------------------------------------------------------------------------- 1 | 31 |
32 |
33 | 34 |
35 |
36 |
%title%
37 |
%subtitle%
38 |
39 | 40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 |
49 |
50 |
%content%
51 |
52 | 53 | 54 |
55 | %cta_button% 56 | %hide_forever% 57 |
58 | 59 |
60 | 61 | 62 |
63 | 64 |
65 |
66 |
67 | 68 |
69 |
70 | -------------------------------------------------------------------------------- /inc/addons/class-popup-addon-geo-db.php: -------------------------------------------------------------------------------- 1 | prepare( $sql, POPOVER_GEOLOOKUPTABLE ); 53 | $table = $wpdb->get_var( $sql ); 54 | 55 | $Result = ( POPOVER_GEOLOOKUPTABLE == $table ); 56 | } 57 | 58 | return $Result; 59 | } 60 | 61 | /** 62 | * Searches the local cache table for the IP address and returns the 63 | * associated country code. 64 | * 65 | * @since 1.0.0 66 | * @param string $country The default value suggested by the filter caller. 67 | * @param string $ip IP address to look up. 68 | * @return string The country code of the IP address. 69 | */ 70 | static public function get_country( $country, $ip ) { 71 | global $wpdb; 72 | 73 | $sql = ' 74 | SELECT ctry 75 | FROM ' . POPOVER_GEOLOOKUPTABLE . ' 76 | WHERE ipfrom <= INET_ATON(%s) 77 | AND ipto >= INET_ATON(%s) 78 | '; 79 | $sql = $wpdb->prepare( $sql, $ip, $ip ); 80 | 81 | $data = $wpdb->get_row( $sql ); 82 | 83 | if ( ! empty( $data ) ) { 84 | if ( $data->ctry == 'ZZ' ) { 85 | $country = 'XX'; 86 | } else { 87 | $country = $data->ctry; 88 | } 89 | } else { 90 | $country = 'XX'; 91 | } 92 | 93 | if ( 'XX' == $country && PO_DEFAULT_COUNTRY ) { 94 | $country = PO_DEFAULT_COUNTRY; 95 | } 96 | 97 | return $country; 98 | } 99 | /* end:pro */ 100 | }; 101 | -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-browser.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 26 | 27 | // 'mobile' rule. 28 | $this->add_rule( 29 | 'mobile', 30 | __( 'Only on mobile devices', 'popover' ), 31 | __( 'Shows the PopUp to visitors that are using a mobile device (Phone or Tablet).', 'popover' ), 32 | 'no_mobile', 33 | 6 34 | ); 35 | 36 | // 'no_mobile' rule. 37 | $this->add_rule( 38 | 'no_mobile', 39 | __( 'Not on mobile devices', 'popover' ), 40 | __( 'Shows the PopUp to visitors that are using a normal computer or laptop (i.e. not a Phone or Tablet).', 'popover' ), 41 | 'mobile', 42 | 6 43 | ); 44 | } 45 | 46 | 47 | /*============================*\ 48 | ================================ 49 | == == 50 | == MOBILE == 51 | == == 52 | ================================ 53 | \*============================*/ 54 | 55 | 56 | /** 57 | * Apply the rule-logic to the specified popup 58 | * 59 | * @since 4.6 60 | * @param mixed $data Rule-data which was saved via the save_() handler. 61 | * @return bool Decission to display popup or not. 62 | */ 63 | protected function apply_mobile( $data ) { 64 | return wp_is_mobile(); 65 | } 66 | 67 | 68 | /*===============================*\ 69 | =================================== 70 | == == 71 | == NO_MOBILE == 72 | == == 73 | =================================== 74 | \*===============================*/ 75 | 76 | 77 | /** 78 | * Apply the rule-logic to the specified popup 79 | * 80 | * @since 4.6 81 | * @param mixed $data Rule-data which was saved via the save_() handler. 82 | * @return bool Decission to display popup or not. 83 | */ 84 | protected function apply_no_mobile( $data ) { 85 | return ! wp_is_mobile(); 86 | } 87 | 88 | 89 | }; 90 | 91 | IncPopupRules::register( 'IncPopupRule_Browser' ); -------------------------------------------------------------------------------- /js/theme-chrome.min.js: -------------------------------------------------------------------------------- 1 | /*! PopUp - v4.8.0 2 | * http://premium.wpmudev.org/project/the-pop-over-plugin/ 3 | * Copyright (c) 2017; * Licensed GPLv2+ */ 4 | ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(a,b,c){b.isDark=!1,b.cssClass="ace-chrome",b.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var d=a("../lib/dom");d.importCssString(b.cssText,b.cssClass)}); -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-popup.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 26 | 27 | // 'count' rule. 28 | $this->add_rule( 29 | 'count', 30 | __( 'PopUp shown less than', 'popover' ), 31 | __( 'Shows the PopUp if the user has only seen it less than a specific number of times.', 'popover' ), 32 | '', 33 | 5 34 | ); 35 | } 36 | 37 | 38 | /*===========================*\ 39 | =============================== 40 | == == 41 | == COUNT == 42 | == == 43 | =============================== 44 | \*===========================*/ 45 | 46 | 47 | /** 48 | * Apply the rule-logic to the specified popup 49 | * 50 | * @since 4.6 51 | * @param mixed $data Rule-data which was saved via the save_() handler. 52 | * @param IncPopupItem $popup The PopUp that is displayed. 53 | * @return bool Decission to display popup or not. 54 | */ 55 | protected function apply_count( $data, $popup ) { 56 | $max_count = absint( $data ); 57 | $count = absint( @$_COOKIE['po_c-' . $popup->id] ); 58 | return $count < $max_count; 59 | } 60 | 61 | /** 62 | * Output the Admin-Form for the active rule. 63 | * 64 | * @since 4.6 65 | * @param mixed $data Rule-data which was saved via the save_() handler. 66 | */ 67 | protected function form_count( $data ) { 68 | $count = absint( $data ); 69 | if ( $count < 1 ) { $count = 1; } 70 | ?> 71 | 74 | 83 | array->equip( $data, 'count' ); 95 | 96 | $count = absint( $data['count'] ); 97 | if ( $count < 1 ) { $count = 1; } 98 | return $count; 99 | } 100 | 101 | }; 102 | 103 | IncPopupRules::register( 'IncPopupRule_Popup' ); -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-prosite.php: -------------------------------------------------------------------------------- 1 | Learn more » 6 | Author: Philipp (Incsub) 7 | Author URI: http://premium.wpmudev.org 8 | Type: Rule 9 | Rules: Site is not a Pro Site 10 | Limit: global, pro 11 | Version: 1.0 12 | 13 | NOTE: DON'T RENAME THIS FILE!! 14 | This filename is saved as metadata with each popup that uses these rules. 15 | Renaming the file will DISABLE the rules, which is very bad! 16 | */ 17 | 18 | /* start:pro */ 19 | class IncPopupRule_Prosite extends IncPopupRule { 20 | 21 | /** 22 | * Initialize the rule object. 23 | * 24 | * @since 4.6 25 | */ 26 | protected function init() { 27 | $this->filename = basename( __FILE__ ); 28 | 29 | // 'no_prosite' rule. 30 | $this->add_rule( 31 | 'no_prosite', 32 | __( 'Site is not a Pro Site', 'popover' ), 33 | __( 'Shows the PopUp if the site is not a Pro Site.', 'popover' ), 34 | '', 35 | 20 36 | ); 37 | 38 | // -- Initialize rule. 39 | 40 | $this->is_active = function_exists( 'is_pro_site' ); 41 | } 42 | 43 | 44 | /*================================*\ 45 | ==================================== 46 | == == 47 | == NO_PROSITE == 48 | == == 49 | ==================================== 50 | \*================================*/ 51 | 52 | 53 | /** 54 | * Apply the rule-logic to the specified popup 55 | * 56 | * @since 4.6 57 | * @param mixed $data Rule-data which was saved via the save_() handler. 58 | * @return bool Decission to display popup or not. 59 | */ 60 | protected function apply_no_prosite( $data ) { 61 | $prosite = function_exists( 'is_pro_site' ) && is_pro_site(); 62 | return ! $prosite; 63 | } 64 | 65 | /** 66 | * Output the Admin-Form for the active rule. 67 | * 68 | * @since 4.6 69 | * @param mixed $data Rule-data which was saved via the save_() handler. 70 | */ 71 | protected function form_no_prosite( $data ) { 72 | if ( ! $this->is_active ) { 73 | $this->render_plugin_inactive(); 74 | } 75 | } 76 | 77 | 78 | /*======================================*\ 79 | ========================================== 80 | == == 81 | == HELPER FUNCTIONS == 82 | == == 83 | ========================================== 84 | \*======================================*/ 85 | 86 | 87 | /** 88 | * Displays a warning message in case the Membership plugin is not active. 89 | * 90 | * @since 1.0.0 91 | */ 92 | protected function render_plugin_inactive() { 93 | ?> 94 |

95 | ' . 98 | 'Pro Sites Plugin is installed and activated.', 'popover' 99 | ), 100 | 'http://premium.wpmudev.org/project/pro-sites/' 101 | );?> 102 |

103 | ID ); 13 | $duplicate_url = esc_url_raw( add_query_arg( 'do', 'duplicate' ) ); 14 | 15 | /* start:free */ 16 | $warn = ( 0 != IncPopupDatabase::count_active( $post->ID ) ); 17 | /* end:free */ 18 | 19 | ?> 20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 |
31 | data-tooltip="" 32 | data-class="status-hint" 33 | data-pos="left" 34 | data-width="250" 35 | 36 | > 37 |
38 | status, 'active' ); ?>/> 42 | 47 |
48 |
49 | 50 |
51 | 55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 |
63 |
64 | ID ) ) : ?> 65 | 66 | 67 | 68 | 69 |
70 | 71 |
72 | 73 | id ) ) : ?> 74 | 75 | 76 | 77 | 78 | 79 | 82 |
83 | 84 |
85 |
86 | 87 | 88 |
89 |
90 | ID ) ) : ?> 91 | 92 | 93 | 94 | 95 |
96 | 97 |
98 | 99 | 102 |
103 | 104 |
105 | 109 |
110 | 111 |
112 | 113 | id ) ) : ?> 114 | 115 | 116 | 117 | 118 |
119 | 120 |
121 |
122 |
123 | -------------------------------------------------------------------------------- /views/info-shortcodes.php: -------------------------------------------------------------------------------- 1 | $handler ) { 22 | if ( ! isset( $shortcodes[ $code ] ) ) { 23 | $shortcodes[ $code ] = ''; 24 | } 25 | 26 | $shortcodes[ $code ] .= 'sc-admin '; 27 | } 28 | 29 | // Add Front-End Shortcodes to the list. 30 | foreach ( $theme_compat->shortcodes as $code ) { 31 | if ( ! isset( $shortcodes[ $code ] ) ) { 32 | $shortcodes[ $code ] = ''; 33 | } 34 | 35 | $shortcodes[ $code ] .= 'sc-front '; 36 | } 37 | 38 | foreach ( $shortcodes as $code => $compat ) { 39 | foreach ( $limited as $pattern ) { 40 | if ( preg_match( '/^' . $pattern . '$/i', $code ) ) { 41 | $shortcodes[ $code ] = $compat . 'sc-limited '; 42 | } 43 | } 44 | } 45 | 46 | 47 | echo '

'; 48 | _e( 49 | 'You can use all your shortcodes inside the PopUp contents, ' . 50 | 'however some Plugins or Themes might provide shortcodes that ' . 51 | 'only work with the loading method "Page Footer".
' . 52 | 'This list explains which shortcodes can be used with each ' . 53 | 'loading method:', 'popover' 54 | ); 55 | echo '

'; 56 | 57 | if ( IncPopup::use_global() ) : 58 | ?> 59 |

Global ' . 62 | 'PopUps:
' . 63 | 'Shortcodes can be provided by a plugin or theme, so ' . 64 | 'each blog can have a different list of shortcodes. The ' . 65 | 'following list is valid for the current blog only!', 'popover' 66 | ); 67 | ?>

68 | 73 |
74 | 75 | 76 | 77 | 82 | 87 | 92 | 97 | 102 | 107 | 108 | 109 | 110 | $classes ) : ?> 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 |
78 |
79 | 80 |
81 |
83 |
84 | 85 |
86 |
88 |
89 | 90 |
91 |
93 |
94 | 95 |
96 |
98 |
99 | 100 |
101 |
103 |
104 | 105 |
106 |
[]
122 |
123 | 124 | 125 |
126 |
127 | 128 | 129 |
130 |
131 | 132 | 133 |
134 |
-------------------------------------------------------------------------------- /inc/class-popup-posttype.php: -------------------------------------------------------------------------------- 1 | _x( 'PopUps', 'Post Type General Name', 'popover' ), 76 | 'singular_name' => _x( 'PopUp', 'Post Type Singular Name', 'popover' ), 77 | 'menu_name' => __( 'PopUp', 'popover' ), 78 | 'parent_item_colon' => __( 'Parent Item:', 'popover' ), 79 | 'all_items' => __( 'PopUps', 'popover' ), 80 | 'view_item' => __( 'View Item', 'popover' ), 81 | 'add_new_item' => __( 'Add New PopUp', 'popover' ), 82 | 'add_new' => __( 'Add New', 'popover' ), 83 | 'edit_item' => __( 'Edit PopUp', 'popover' ), 84 | 'update_item' => __( 'Update PopUp', 'popover' ), 85 | 'search_items' => __( 'Search PopUp', 'popover' ), 86 | 'not_found' => __( 'Not found', 'popover' ), 87 | 'not_found_in_trash' => __( 'No PopUp found in Trash', 'popover' ), 88 | ); 89 | 90 | if ( IncPopup::use_global() ) { 91 | $labels['name'] = _x( 'Global PopUps', 'Post Type General Name', 'popover' ); 92 | $labels['singular_name'] = _x( 'Global PopUp', 'Post Type Singular Name', 'popover' ); 93 | $labels['all_items'] = __( 'Global PopUps', 'popover' ); 94 | } 95 | 96 | $capabilities = array( 97 | 'read_post' => self::$perms, 98 | 'edit_post' => self::$perms, 99 | 'edit_posts' => self::$perms, 100 | 'delete_post' => self::$perms, 101 | 'delete_posts' => self::$perms, 102 | 'publish_posts' => self::$perms, 103 | 'edit_others_posts' => self::$perms, 104 | 'read_private_posts' => self::$perms, 105 | 'create_posts' => self::$perms, 106 | ); 107 | 108 | $args = array( 109 | 'label' => __( 'PopUp', 'popover' ), 110 | 'description' => __( 'Display PopUp messages on your website!', 'popover' ), 111 | 'labels' => $labels, 112 | 'supports' => array( '' ), 113 | 'hierarchical' => false, 114 | 'public' => false, 115 | 'show_ui' => $manage_popups, 116 | 'show_in_menu' => $manage_popups, 117 | 'show_in_nav_menus' => false, 118 | 'show_in_admin_bar' => $manage_popups, 119 | 'menu_position' => self::$menu_pos, 120 | 'menu_icon' => PO_IMG_URL . 'icon.png', 121 | 'can_export' => true, 122 | 'has_archive' => false, 123 | 'exclude_from_search' => true, 124 | 'publicly_queryable' => false, 125 | 'rewrite' => false, 126 | 'capabilities' => $capabilities, 127 | ); 128 | register_post_type( IncPopupItem::POST_TYPE, $args ); 129 | } 130 | }; 131 | -------------------------------------------------------------------------------- /inc/addons/class-popup-addon-headerfooter.php: -------------------------------------------------------------------------------- 1 | 44 | * 45 | * @since 1.0.0 46 | */ 47 | static public function test_head() { 48 | self::test_shortcodes(); 49 | echo 'exists'; 50 | } 51 | 52 | /** 53 | * Echo a string that we can search for later into the footer of the document 54 | * This should end up appearing directly before 55 | * 56 | * @since 1.0.0 57 | */ 58 | static public function test_footer() { 59 | self::test_shortcodes(); 60 | echo 'exists'; 61 | } 62 | 63 | /** 64 | * Echo a list of all available shortcodes. 65 | * This is used to check which shortcodes are available for loading method 66 | * 'Page Footer' 67 | * 68 | * @since 1.1 69 | */ 70 | static public function test_shortcodes() { 71 | global $shortcode_tags; 72 | $shortcodes = array_keys( $shortcode_tags ); 73 | echo '' . implode( ',', $shortcodes ) . ''; 74 | } 75 | 76 | /** 77 | * Check for the existence of the strings where wp_head and wp_footer should 78 | * have been called from. 79 | * 80 | * This is loading the front-page of the current installation via 81 | * wp_remove_get and then parses the resonse to see if the header/footer 82 | * comments exist in the HTML code. 83 | * 84 | * @since 1.0.0 85 | */ 86 | static public function check() { 87 | static $Init = false; 88 | static $Resp = null; 89 | 90 | if ( false === $Init ) { 91 | $Init = true; 92 | $Resp = (object) array( 93 | 'okay' => false, 94 | 'msg' => array(), 95 | 'shortcodes' => array(), 96 | ); 97 | 98 | // Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0 99 | $url = esc_url_raw( 100 | add_query_arg( 101 | array( 'popup-headerfooter-check' => '1' ), 102 | home_url() 103 | ) 104 | ); 105 | 106 | // Perform the HTTP GET ignoring SSL errors 107 | $cookies = $_COOKIE; 108 | unset( $cookies['PHPSESSID'] ); 109 | $response = wp_remote_get( 110 | $url, 111 | array( 112 | 'sslverify' => false, 113 | 'cookies' => $cookies, 114 | ) 115 | ); 116 | 117 | // Grab the response code and make sure the request was sucessful 118 | $code = (int) wp_remote_retrieve_response_code( $response ); 119 | if ( is_wp_error( $response ) ) { 120 | lib3()->ui->admin_message( $response->get_error_message() ); 121 | return $Resp; 122 | } 123 | 124 | if ( $code !== 200 ) { return $Resp; } 125 | 126 | // Strip all tabs, line feeds, carriage returns and spaces 127 | $html = preg_replace( 128 | '/[\t\r\n\s]/', 129 | '', 130 | wp_remote_retrieve_body( $response ) 131 | ); 132 | 133 | if ( ! strstr( $html, 'exists' ) ) { 134 | // wp_head is missing 135 | $Resp->msg[] = __( 136 | 'Critical: Call to wp_head(); is missing! It ' . 137 | 'should appear directly before </head>', 'popover' 138 | ); 139 | } 140 | 141 | if ( ! strstr( $html, 'exists' ) ) { 142 | // wp_footer is missing. 143 | $Resp->msg[] = __( 144 | 'Critical: Call to wp_footer(); is missing! It ' . 145 | 'should appear directly before </body>', 'popover' 146 | ); 147 | } 148 | 149 | $matches = array(); 150 | $has_shortcodes = preg_match( '#([^\<]*)#', $html, $matches ); 151 | if ( $has_shortcodes ) { 152 | $items = $matches[1]; 153 | $Resp->shortcodes = explode( ',', $items ); 154 | } 155 | 156 | // Display any errors that we found. 157 | if ( empty( $Resp->msg ) ) { 158 | $Resp->okay = true; 159 | $Resp->msg[] = __( 160 | 'Okay: Your current theme uses wp_head(); and ' . 161 | 'wp_footer(); correctly!', 'popover' 162 | ); 163 | } 164 | } 165 | 166 | return $Resp; 167 | } 168 | }; 169 | 170 | IncPopupAddon_HeaderFooter::init(); -------------------------------------------------------------------------------- /views/meta-content.php: -------------------------------------------------------------------------------- 1 | image ); 10 | 11 | ?> 12 |
13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 |
21 |
22 |
23 | 29 |
30 |
31 | 37 |
38 |
39 | 40 |
41 | 44 |
45 |
46 | 10, 49 | 'drag_drop_upload' => true, 50 | ); 51 | wp_editor( $popup->content, 'po_content', $args ); 52 | ?> 53 |
54 | 55 |
56 | 59 |
60 |
61 |
62 | 68 |
69 |
70 | 76 |
77 |
78 | 85 |
86 |
87 |
88 | 89 | 90 |
91 |
92 | 95 |
96 |
97 | 105 | 106 | 110 | 111 |
112 | 115 | style="display: none;" 116 | /> 117 | 118 | 120 | style="display: none;" 121 | > 122 | 123 | 124 |
125 |
126 |
127 |
128 | 129 | 130 | 131 | 132 | 133 |
134 | 135 |
137 | style="display: none;" 138 | > 139 | 140 |
141 | 147 |
148 | 149 |
150 | 157 | 158 | 165 |
166 |
167 |
168 |
-------------------------------------------------------------------------------- /popover.php: -------------------------------------------------------------------------------- 1 | 123, 115 | 'name' => 'PopUp Pro', 116 | 'screens' => array( 117 | 'edit-inc_popup', 118 | 'inc_popup', 119 | 'inc_popup_page_settings', 120 | ), 121 | ); 122 | /* end:pro */ 123 | 124 | foreach ( $modules as $path ) { 125 | if ( file_exists( $path ) ) { require_once $path; } 126 | } 127 | 128 | // Register the current plugin, for pro and free plugins! 129 | do_action( 130 | 'wdev-register-plugin', 131 | /* Plugin ID */ plugin_basename( __FILE__ ), 132 | /* Plugin Title */ 'PopUp', 133 | /* https://wordpress.org */ '/plugins/wordpress-popup/', 134 | /* Email Button CTA */ $cta_label, 135 | /* getdrip Plugin param */ $drip_param 136 | ); 137 | 138 | // Initialize the plugin as soon as we have identified the current user. 139 | IncPopup::instance(); 140 | } 141 | 142 | /* start:pro */ 143 | inc_popup_init(); 144 | 145 | 146 | /* start:free */ 147 | // Init free after all plugins are loaded, in case both 148 | // Pro and Free versions are installed. 149 | add_action( 150 | 'plugins_loaded', 151 | 'inc_popup_init' 152 | ); 153 | /* end:free */ 154 | 155 | // Translation. 156 | function inc_popup_init_translation() { 157 | if ( defined( 'PO_LANG_DIR' ) ) { 158 | load_plugin_textdomain( 159 | 'popover', 160 | false, 161 | PO_LANG_DIR 162 | ); 163 | } 164 | } 165 | add_action( 'plugins_loaded', 'inc_popup_init_translation' ); 166 | -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-user.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 26 | 27 | // 'login' rule. 28 | $this->add_rule( 29 | 'login', 30 | __( 'Visitor is logged in', 'popover' ), 31 | __( 'Shows the PopUp if the user is logged in to your site.', 'popover' ), 32 | 'no_login', 33 | 1 34 | ); 35 | 36 | // 'no_login' rule. 37 | $this->add_rule( 38 | 'no_login', 39 | __( 'Visitor is not logged in', 'popover' ), 40 | __( 'Shows the PopUp if the user is not logged in to your site.', 'popover' ), 41 | 'login', 42 | 1 43 | ); 44 | 45 | // 'comment' rule. 46 | $this->add_rule( 47 | 'comment', 48 | __( 'Visitor has commented before', 'popover' ), 49 | __( 50 | 'Shows the PopUp if the user has already left a comment. ' . 51 | 'You may want to combine this condition with either "Visitor ' . 52 | 'is logged in" or "Visitor is not logged in".', 'popover' 53 | ), 54 | 'no_comment', 55 | 20 56 | ); 57 | 58 | // 'no_comment' rule. 59 | $this->add_rule( 60 | 'no_comment', 61 | __( 'Visitor has never commented', 'popover' ), 62 | __( 63 | 'Shows the PopUp if the user has never left a comment. ' . 64 | 'You may want to combine this condition with either "Visitor ' . 65 | 'is logged in" or "Visitor is not logged in".', 'popover' 66 | ), 67 | 'comment', 68 | 20 69 | ); 70 | } 71 | 72 | 73 | /*===========================*\ 74 | =============================== 75 | == == 76 | == LOGIN == 77 | == == 78 | =============================== 79 | \*===========================*/ 80 | 81 | 82 | /** 83 | * Apply the rule-logic to the specified popup 84 | * 85 | * @since 4.6 86 | * @param mixed $data Rule-data which was saved via the save_() handler. 87 | * @return bool Decission to display popup or not. 88 | */ 89 | protected function apply_login( $data ) { 90 | return is_user_logged_in(); 91 | } 92 | 93 | 94 | /*==============================*\ 95 | ================================== 96 | == == 97 | == NO_LOGIN == 98 | == == 99 | ================================== 100 | \*==============================*/ 101 | 102 | 103 | /** 104 | * Apply the rule-logic to the specified popup 105 | * 106 | * @since 4.6 107 | * @param mixed $data Rule-data which was saved via the save_() handler. 108 | * @return bool Decission to display popup or not. 109 | */ 110 | protected function apply_no_login( $data ) { 111 | return ! is_user_logged_in(); 112 | } 113 | 114 | 115 | /*================================*\ 116 | ==================================== 117 | == == 118 | == NO_COMMENT == 119 | == == 120 | ==================================== 121 | \*================================*/ 122 | 123 | 124 | /** 125 | * Apply the rule-logic to the specified popup 126 | * 127 | * @since 4.6 128 | * @param mixed $data Rule-data which was saved via the save_() handler. 129 | * @return bool Decission to display popup or not. 130 | */ 131 | protected function apply_no_comment( $data ) { 132 | return ! $this->did_user_comment(); 133 | } 134 | 135 | 136 | /*=============================*\ 137 | ================================= 138 | == == 139 | == COMMENT == 140 | == == 141 | ================================= 142 | \*=============================*/ 143 | 144 | 145 | /** 146 | * Apply the rule-logic to the specified popup 147 | * 148 | * @since 4.6 149 | * @param mixed $data Rule-data which was saved via the save_() handler. 150 | * @return bool Decission to display popup or not. 151 | */ 152 | protected function apply_comment( $data ) { 153 | return $this->did_user_comment(); 154 | } 155 | 156 | 157 | /*======================================*\ 158 | ========================================== 159 | == == 160 | == HELPER FUNCTIONS == 161 | == == 162 | ========================================== 163 | \*======================================*/ 164 | 165 | 166 | /** 167 | * Checks if the user did already post any comments. 168 | * 169 | * @since 4.6 170 | * @return bool 171 | */ 172 | protected function did_user_comment() { 173 | global $wpdb; 174 | static $Comment = null; 175 | 176 | if ( null === $Comment ) { 177 | // Guests (and maybe logged in users) are tracked via a cookie. 178 | $Comment = isset( $_COOKIE['comment_author_' . COOKIEHASH] ) ? 1 : 0; 179 | 180 | if ( ! $Comment && is_user_logged_in() ) { 181 | // For logged-in users we can also check the database. 182 | $sql = " 183 | SELECT COUNT(1) 184 | FROM {$wpdb->comments} 185 | WHERE user_id = %s 186 | "; 187 | $sql = $wpdb->prepare( $sql, get_current_user_id() ); 188 | $count = absint( $wpdb->get_var( $sql ) ); 189 | $Comment = $count > 0; 190 | } 191 | } 192 | return $Comment; 193 | } 194 | 195 | }; 196 | 197 | IncPopupRules::register( 'IncPopupRule_User' ); -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-role.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 28 | 29 | // 'role' rule. 30 | $this->add_rule( 31 | 'role', 32 | __( 'Visitor has role', 'popover' ), 33 | __( 'Shows the PopUp if the user is logged in and is assigned to a certain role.', 'popover' ), 34 | 'no_role', 35 | 15 36 | ); 37 | 38 | // 'no_role' rule. 39 | $this->add_rule( 40 | 'no_role', 41 | __( 'Visitor does not have role', 'popover' ), 42 | __( 'Shows the PopUp if the user is logged in and is not assigned to a certain role.', 'popover' ), 43 | 'role', 44 | 15 45 | ); 46 | 47 | // -- Initialize rule. 48 | 49 | global $wp_roles; 50 | $this->roles = $wp_roles->get_names(); 51 | } 52 | 53 | 54 | /*==========================*\ 55 | ============================== 56 | == == 57 | == ROLE == 58 | == == 59 | ============================== 60 | \*==========================*/ 61 | 62 | 63 | /** 64 | * Apply the rule-logic to the specified popup 65 | * 66 | * @since 4.6 67 | * @param mixed $data Rule-data which was saved via the save_() handler. 68 | * @return bool Decission to display popup or not. 69 | */ 70 | protected function apply_role( $data ) { 71 | return is_user_logged_in() && $this->user_has_role( $data ); 72 | } 73 | 74 | /** 75 | * Output the Admin-Form for the active rule. 76 | * 77 | * @since 4.6 78 | * @param mixed $data Rule-data which was saved via the save_() handler. 79 | */ 80 | protected function form_role( $data ) { 81 | $this->render_role_form( 82 | 'role', 83 | __( 'Show to users that have one of these roles:', 'popover' ), 84 | $data 85 | ); 86 | } 87 | 88 | /** 89 | * Update and return the $settings array to save the form values. 90 | * 91 | * @since 4.6 92 | * @param array $data The contents of $_POST['po_rule_data']. 93 | * @return mixed Data collection of this rule. 94 | */ 95 | protected function save_role( $data ) { 96 | lib3()->array->equip( $data, 'role' ); 97 | return $data['role']; 98 | } 99 | 100 | 101 | /*=============================*\ 102 | ================================= 103 | == == 104 | == NO_ROLE == 105 | == == 106 | ================================= 107 | \*=============================*/ 108 | 109 | 110 | /** 111 | * Apply the rule-logic to the specified popup 112 | * 113 | * @since 4.6 114 | * @param mixed $data Rule-data which was saved via the save_() handler. 115 | * @return bool Decission to display popup or not. 116 | */ 117 | protected function apply_no_role( $data ) { 118 | return is_user_logged_in() && ! $this->user_has_role( $data ); 119 | } 120 | 121 | /** 122 | * Output the Admin-Form for the active rule. 123 | * 124 | * @since 4.6 125 | * @param mixed $data Rule-data which was saved via the save_() handler. 126 | */ 127 | protected function form_no_role( $data ) { 128 | $this->render_role_form( 129 | 'no_role', 130 | __( 'Show to users that do not have one of these roles:', 'popover' ), 131 | $data 132 | ); 133 | } 134 | 135 | /** 136 | * Update and return the $settings array to save the form values. 137 | * 138 | * @since 4.6 139 | * @param array $data The contents of $_POST['po_rule_data']. 140 | * @return mixed Data collection of this rule. 141 | */ 142 | protected function save_no_role( $data ) { 143 | lib3()->array->equip( $data, 'no_role' ); 144 | return $data['no_role']; 145 | } 146 | 147 | 148 | /*======================================*\ 149 | ========================================== 150 | == == 151 | == HELPER FUNCTIONS == 152 | == == 153 | ========================================== 154 | \*======================================*/ 155 | 156 | 157 | /** 158 | * Renders the roles options-form 159 | * 160 | * @since 1.0.0 161 | * @param string $name 162 | * @param string $label 163 | * @param array $data 164 | */ 165 | protected function render_role_form( $name, $label, $data ) { 166 | if ( ! is_array( $data ) ) { $data = array(); } 167 | if ( ! is_array( @$data['roles'] ) ) { $data['roles'] = array(); } 168 | 169 | ?> 170 |
171 | 172 | 180 |
181 | roles; 199 | 200 | // Can a user have more than one Role? Better be sure and use a loop... 201 | foreach ( $user_roles as $key ) { 202 | if ( in_array( $key, $role_list ) ) { 203 | $result = true; 204 | break; 205 | } 206 | } 207 | return $result; 208 | } 209 | }; 210 | 211 | IncPopupRules::register( 'IncPopupRule_UserRole' ); 212 | /* end:pro */ 213 | -------------------------------------------------------------------------------- /views/meta-behavior-premium.php: -------------------------------------------------------------------------------- 1 | 10 |
11 |
12 | 13 |
14 |
15 |
16 |
17 | 26 | 27 | 35 | 43 | 44 |
45 | 46 |
47 | 56 | 57 | 65 | 73 | 74 | 75 |
76 |
77 | 86 | 87 | 92 | 93 |
94 | 95 |
96 | 97 |
98 | 99 |
100 |
101 | 102 |
103 |
104 |
105 |
106 | 115 |
116 |
117 | 126 |
127 |
128 | 139 |
140 |
141 | 142 |
143 | 144 |
145 |
146 | 147 |
148 |
149 |
150 |
151 | 158 |
159 | 160 |
161 | 162 |
163 | 164 | 171 |
172 |
173 | 174 |
175 |
176 |
177 |
178 | 181 |
182 |
183 | 197 |
198 | 199 |
200 | -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-advurl.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 28 | 29 | // 'url' rule. 30 | $this->add_rule( 31 | 'adv_url', 32 | __( 'On approximate URL', 'popover' ), 33 | __( 'Shows the PopUp if the user is on a certain URL.', 'popover' ), 34 | 'no_adv_url', 35 | 30 36 | ); 37 | 38 | // 'no_url' rule. 39 | $this->add_rule( 40 | 'no_adv_url', 41 | __( 'Not on approximate URL', 'popover' ), 42 | __( 'Shows the PopUp if the user is not on a certain URL.', 'popover' ), 43 | 'adv_url', 44 | 30 45 | ); 46 | } 47 | 48 | 49 | /*=============================*\ 50 | ================================= 51 | == == 52 | == ADV_URL == 53 | == == 54 | ================================= 55 | \*=============================*/ 56 | 57 | 58 | /** 59 | * Apply the rule-logic to the specified popup 60 | * 61 | * @since 4.6 62 | * @param mixed $data Rule-data which was saved via the save_() handler. 63 | * @return bool Decission to display popup or not. 64 | */ 65 | protected function apply_adv_url( $data ) { 66 | if ( is_string( $data ) ) { $data = array( $data ); } 67 | if ( ! is_array( $data ) ) { return true; } 68 | $url = $this->current_url(); 69 | 70 | return $this->check_adv_url( $url, $data ); 71 | } 72 | 73 | /** 74 | * Output the Admin-Form for the active rule. 75 | * 76 | * @since 4.6 77 | * @param mixed $data Rule-data which was saved via the save_() handler. 78 | */ 79 | protected function form_adv_url( $data ) { 80 | if ( is_string( $data ) ) { 81 | $urls = $data; 82 | } elseif ( is_array( $data ) ) { 83 | $urls = implode( "\n", $data ); 84 | } else { 85 | $urls = ''; 86 | } 87 | ?> 88 | 91 | 94 | array->equip( $data, 'adv_url' ); 106 | return explode( "\n", $data['adv_url'] ); 107 | } 108 | 109 | 110 | /*================================*\ 111 | ==================================== 112 | == == 113 | == NO_ADV_URL == 114 | == == 115 | ==================================== 116 | \*================================*/ 117 | 118 | 119 | /** 120 | * Apply the rule-logic to the specified popup 121 | * 122 | * @since 4.6 123 | * @param mixed $data Rule-data which was saved via the save_() handler. 124 | * @return bool Decission to display popup or not. 125 | */ 126 | protected function apply_no_adv_url( $data ) { 127 | if ( is_string( $data ) ) { $data = array( $data ); } 128 | if ( ! is_array( $data ) ) { return true; } 129 | $url = $this->current_url(); 130 | 131 | return ! $this->check_adv_url( $url, $data ); 132 | } 133 | 134 | /** 135 | * Output the Admin-Form for the active rule. 136 | * 137 | * @since 4.6 138 | * @param mixed $data Rule-data which was saved via the save_() handler. 139 | */ 140 | protected function form_no_adv_url( $data ) { 141 | if ( is_string( $data ) ) { $urls = $data; } 142 | else if ( is_array( $data ) ) { $urls = implode( "\n", $data ); } 143 | else { $urls = ''; } 144 | ?> 145 | 148 | 151 | array->equip( $data, 'no_adv_url' ); 163 | return explode( "\n", $data['no_adv_url'] ); 164 | } 165 | 166 | 167 | /*======================================*\ 168 | ========================================== 169 | == == 170 | == HELPER FUNCTIONS == 171 | == == 172 | ========================================== 173 | \*======================================*/ 174 | 175 | 176 | /** 177 | * Returns the URL which can be defined by REQUEST[theform] or wp->request. 178 | * 179 | * @since 4.6 180 | * @return string 181 | */ 182 | protected function current_url() { 183 | global $wp; 184 | $current_url = ''; 185 | 186 | if ( empty( $_REQUEST['thefrom'] ) ) { 187 | $current_url = lib3()->net->current_url(); 188 | } else { 189 | $current_url = strtok( $_REQUEST['thefrom'], '#' ); 190 | } 191 | 192 | return $current_url; 193 | } 194 | 195 | /** 196 | * Tests if the $test_url matches any pattern defined in the $list. 197 | * 198 | * @since 4.6 199 | * @param string $test_url The URL to test. 200 | * @param array $list List of URL-patterns to test against. 201 | * @return bool 202 | */ 203 | protected function check_adv_url( $test_url, $list ) { 204 | $response = false; 205 | $list = array_map( 'trim', $list ); 206 | 207 | if ( empty( $list ) ) { 208 | $response = true; 209 | } else { 210 | foreach ( $list as $match ) { 211 | if ( preg_match( '#' . $match . '#i', $test_url ) ) { 212 | $response = true; 213 | break; 214 | } 215 | } 216 | } 217 | 218 | return $response; 219 | } 220 | }; 221 | 222 | IncPopupRules::register( 'IncPopupRule_AdvUrl' ); 223 | /* end:pro */ 224 | -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-events.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 28 | 29 | IncPopupItem::$display_opts[] = 'leave'; 30 | IncPopupItem::$display_opts[] = 'click'; 31 | 32 | add_action( 33 | 'popup-display-behavior', 34 | array( $this, 'display_options' ), 35 | 10, 1 36 | ); 37 | 38 | add_filter( 39 | 'popup-output-data', 40 | array( $this, 'append_data_on_exit' ), 41 | 10, 2 42 | ); 43 | 44 | add_filter( 45 | 'popup-output-data', 46 | array( $this, 'append_data_on_click' ), 47 | 10, 2 48 | ); 49 | } 50 | 51 | /** 52 | * Renders the new display options on the meta_behavior.php view 53 | * 54 | * @since 4.6 55 | * @param IncPopupItem $popup The PopUp that is displayed 56 | */ 57 | public function display_options( $popup ) { 58 | $this->form_mouseleave( $popup ); 59 | $this->form_click( $popup ); 60 | } 61 | 62 | 63 | /*=============================*\ 64 | ================================= 65 | == == 66 | == ON_EXIT == 67 | == == 68 | ================================= 69 | \*=============================*/ 70 | 71 | 72 | protected function form_mouseleave( $popup ) { 73 | ?> 74 |
75 | 84 |
85 | array->get( $script_data ); 99 | 100 | if ( 'leave' == $popup->display ) { 101 | if ( ! isset( $script_data['script'] ) ) { 102 | $script_data['script'] = ''; 103 | } 104 | 105 | $script_data['script'] .= 'me.custom_handler = ' . $this->script_on_exit(); 106 | } 107 | 108 | return $script_data; 109 | } 110 | 111 | /** 112 | * Returns the javascript code that triggers the exit event. 113 | * 114 | * @since 4.6 115 | */ 116 | public function script_on_exit() { 117 | ob_start(); 118 | ?> 119 | function( me ) { 120 | var tmr = null; 121 | 122 | function set( ev ) { 123 | if ( ! me ) return; 124 | tmr = setTimeout( function trigger() { 125 | me.show_popup(); 126 | me = false; 127 | 128 | jQuery( 'html' ).off( 'mousemove', reset ); 129 | jQuery( document ).off( 'mouseleave', set ); 130 | }, 10 ); 131 | } 132 | 133 | function reset( ev ) { 134 | clearTimeout( tmr ); 135 | } 136 | 137 | jQuery( 'html' ).on( 'mousemove', reset ); 138 | jQuery( document ).on( 'mouseleave', set ); 139 | } 140 | 157 |
158 | 167 | 168 | 172 | 173 | 174 | 180 | 181 |
182 | array->get( $script_data ); 195 | 196 | if ( 'click' == $popup->display ) { 197 | if ( ! isset( $script_data['script'] ) ) { 198 | $script_data['script'] = ''; 199 | } 200 | 201 | $script_data['script'] .= 'me.custom_handler = ' . $this->script_on_click(); 202 | } 203 | 204 | return $script_data; 205 | } 206 | 207 | /** 208 | * Returns the javascript code that triggers the click event. 209 | * 210 | * @since 4.6 211 | */ 212 | public function script_on_click() { 213 | ob_start(); 214 | ?> 215 | function( me ) { 216 | if ( me.data.display_data['click_multi'] ) { 217 | jQuery(document).on( 'click', me.data.display_data['click'], me.show_popup ); 218 | } else { 219 | jQuery(document).one( 'click', me.data.display_data['click'], me.show_popup ); 220 | } 221 | } 222 | filename = basename( __FILE__ ); 28 | 29 | // 'date_from' rule. 30 | $this->add_rule( 31 | 'date_from', 32 | __( 'Show PopUp on Date', 'popover' ), 33 | sprintf( 34 | __( 'Shows the PopUp only when the specified date is reached.', 'popover' ) . '
' . 35 | __( 'Values in %sUTC%s. Current UTC time: %s', 'popover' ), 36 | '', 37 | '', 38 | '' . gmdate( 'Y-m-d H:i' ) . '' 39 | ), 40 | '', 41 | 5 42 | ); 43 | 44 | // 'date_until' rule. 45 | $this->add_rule( 46 | 'date_until', 47 | __( 'Hide PopUp on Date', 'popover' ), 48 | sprintf( 49 | __( 'Hide the PopUp once a specific date is reached.', 'popover' ) . '
' . 50 | __( 'Values in %sUTC%s. Current UTC time: %s', 'popover' ), 51 | '', 52 | '', 53 | '' . gmdate( 'Y-m-d H:i' ) . '' 54 | ), 55 | '', 56 | 5 57 | ); 58 | } 59 | 60 | 61 | /*===============================*\ 62 | =================================== 63 | == == 64 | == DATE_FROM == 65 | == == 66 | =================================== 67 | \*===============================*/ 68 | 69 | 70 | /** 71 | * Apply the rule-logic to the specified popup 72 | * 73 | * @since 4.7.1 74 | * @param mixed $data Rule-data which was saved via the save_() handler. 75 | * @param IncPopupItem $popup The PopUp that is displayed. 76 | * @return bool Decission to display popup or not. 77 | */ 78 | protected function apply_date_from( $data, $popup ) { 79 | $data = intval( $data ); 80 | 81 | if ( $data > 0 && time() >= $data ) { 82 | return true; 83 | } else { 84 | return false; 85 | } 86 | } 87 | 88 | /** 89 | * Output the Admin-Form for the active rule. 90 | * 91 | * @since 4.7.1 92 | * @param mixed $data Rule-data which was saved via the save_() handler. 93 | */ 94 | protected function form_date_from( $data ) { 95 | $data = intval( $data ); 96 | if ( ! $data ) { $data = time(); } 97 | 98 | $date_from = gmdate( 'Y-m-d', $data ); 99 | $time_from = gmdate( 'H:i', $data ); 100 | ?> 101 |
102 | 105 | 110 |
111 |
112 | 115 | 120 |
121 | array->equip( $data, 'date_from', 'date_from_time' ); 133 | 134 | $date_str = $data['date_from'] . ' ' . $data['date_from_time']; 135 | $date_from = strtotime( $date_str ); 136 | return $date_from; 137 | } 138 | 139 | /*================================*\ 140 | ==================================== 141 | == == 142 | == DATE_UNTIL == 143 | == == 144 | ==================================== 145 | \*================================*/ 146 | 147 | 148 | /** 149 | * Apply the rule-logic to the specified popup 150 | * 151 | * @since 4.7.1 152 | * @param mixed $data Rule-data which was saved via the save_() handler. 153 | * @param IncPopupItem $popup The PopUp that is displayed. 154 | * @return bool Decission to display popup or not. 155 | */ 156 | protected function apply_date_until( $data, $popup ) { 157 | $data = intval( $data ); 158 | 159 | if ( $data > 0 && time() <= $data ) { 160 | return true; 161 | } else { 162 | return false; 163 | } 164 | } 165 | 166 | /** 167 | * Output the Admin-Form for the active rule. 168 | * 169 | * @since 4.7.1 170 | * @param mixed $data Rule-data which was saved via the save_() handler. 171 | */ 172 | protected function form_date_until( $data ) { 173 | $data = intval( $data ); 174 | if ( ! $data ) { $data = time(); } 175 | 176 | $date_until = gmdate( 'Y-m-d', $data ); 177 | $time_from = gmdate( 'H:i', $data ); 178 | ?> 179 |
180 | 183 | 188 |
189 |
190 | 193 | 198 |
199 | array->equip( $data, 'date_until', 'date_until_time' ); 211 | 212 | $date_str = $data['date_until'] . ' ' . $data['date_until_time']; 213 | $date_until = strtotime( $date_str ); 214 | if ( $date_until ) { 215 | $date_until += 59; // add 59 seconds 216 | } 217 | return $date_until; 218 | } 219 | }; 220 | 221 | IncPopupRules::register( 'IncPopupRule_Datetime' ); 222 | /* end:pro */ 223 | -------------------------------------------------------------------------------- /inc/rules/class-popup-rule-width.php: -------------------------------------------------------------------------------- 1 | filename = basename( __FILE__ ); 28 | 29 | // 'width' rule. 30 | $this->add_rule( 31 | 'width', 32 | __( 'Depending on screen size', 'popover' ), 33 | __( 34 | 'Shows the PopUp if the window-width is within the defined ' . 35 | 'limits. Note: The window size is checked upon page load! ' . 36 | 'when the user resizes the window after the page is loaded it ' . 37 | 'will not affect this rule.', 'popover' 38 | ), 39 | '', 40 | 30 41 | ); 42 | 43 | // -- Init the rule. 44 | 45 | $this->max_width = apply_filters( 'popup-rule-max-screen-width', 2400 ); 46 | 47 | add_filter( 48 | 'popup-output-data', 49 | array( $this, 'append_data_width' ), 50 | 10, 2 51 | ); 52 | } 53 | 54 | /** 55 | * Returns the javascript to evaluate the rule. 56 | * 57 | * @since 4.6 58 | */ 59 | public function script_width() { 60 | ob_start(); 61 | ?> 62 | var apply_rule = function (e, popup, data) { 63 | var reject = false, width = jQuery(window).width(); 64 | data = data || {}; 65 | if ( ! isNaN(data.width_min) && data.width_min > 0 ) { 66 | if ( width < data.width_min ) { reject = true; } 67 | } 68 | if ( ! isNaN(data.width_max) && data.width_max > 0 ) { 69 | if ( width > data.width_max ) { reject = true; } 70 | } 71 | 72 | if ( reject ) { 73 | popup.reject(); 74 | } 75 | }; 76 | 77 | jQuery(document).on( 'popup-init', apply_rule ); 78 | uses_rule( 'width' ) ) { 93 | lib3()->array->equip( $popup->rule_data, 'width' ); 94 | $data = $this->sanitize_values( $popup->rule_data['width'] ); 95 | 96 | if ( $data['max'] >= $this->max_width ) { $data['max'] = 0; } 97 | 98 | $script_data['width_min'] = $data['min']; 99 | $script_data['width_max'] = $data['max']; 100 | 101 | if ( ! isset( $script_data['script'] ) ) { 102 | $script_data['script'] = ''; 103 | } 104 | $script_data['script'] .= $this->script_width(); 105 | } 106 | 107 | return $script_data; 108 | } 109 | 110 | 111 | /*===========================*\ 112 | =============================== 113 | == == 114 | == WIDTH == 115 | == == 116 | =============================== 117 | \*===========================*/ 118 | 119 | 120 | /** 121 | * Output the Admin-Form for the active rule. 122 | * 123 | * @since 4.6 124 | * @param mixed $data Rule-data which was saved via the save_() handler. 125 | */ 126 | protected function form_width( $data ) { 127 | $data = $this->sanitize_values( $data ); 128 | ?> 129 |
130 |
131 | 134 | 135 | 136 | px 144 | 145 | 149 |
150 | 151 | 154 | 155 | 156 | px 164 | 165 | 169 |
170 |
174 |
175 |
176 | array->equip( $data, 'width' ); 188 | return $this->sanitize_values( $data['width'] ); 189 | } 190 | 191 | 192 | /*======================================*\ 193 | ========================================== 194 | == == 195 | == HELPER FUNCTIONS == 196 | == == 197 | ========================================== 198 | \*======================================*/ 199 | 200 | 201 | /** 202 | * Sanitizes the data parameter so it can be savely used by other functions. 203 | * 204 | * @since 4.6 205 | * @param mixed $data 206 | * @return array 207 | */ 208 | protected function sanitize_values( $data ) { 209 | if ( is_numeric( $data ) ) { 210 | $data = array( 'min' => $data, 'max' => $this->max_width ); 211 | } else if ( ! is_array( $data ) ) { 212 | $data = array(); 213 | } 214 | 215 | $data['min'] = absint( @$data['min'] ); 216 | $data['max'] = absint( @$data['max'] ); 217 | 218 | if ( ! $data['max'] || $data['max'] < $data['min'] ) { 219 | $data['max'] = $this->max_width; 220 | } 221 | 222 | return $data; 223 | } 224 | }; 225 | 226 | IncPopupRules::register( 'IncPopupRule_Width' ); 227 | /* end:pro */ 228 | -------------------------------------------------------------------------------- /js/popup-admin.min.js: -------------------------------------------------------------------------------- 1 | /*! PopUp - v4.8.0 2 | * http://premium.wpmudev.org/project/the-pop-over-plugin/ 3 | * Copyright (c) 2017; * Licensed GPLv2+ */ 4 | jQuery(function(){function a(){var a=jQuery(".meta-box-sortables"),b=jQuery(".postbox .hndle");a.length&&(a.sortable({disabled:!0}),b.css("cursor","pointer"))}function b(){function a(){f.hasClass("columns-1")||g.hasClass("po-small")?g.hasClass("sticky-submit")||(g.addClass("sticky-submit"),g.removeClass("floating-submit"),e.css({marginTop:0}),e.find(".sticky-actions").show(),e.find(".non-sticky").hide()):g.hasClass("floating-submit")||(g.addClass("floating-submit"),g.removeClass("sticky-submit"))}function b(){g.hasClass("sticky-submit")&&(g.removeClass("sticky-submit"),e.find(".sticky-actions").hide(),e.find(".non-sticky").show()),g.hasClass("floating-submit")&&g.removeClass("floating-submit")}var c,d,e=jQuery("#submitdiv"),f=jQuery("#post-body"),g=jQuery("body"),h=20;e.length&&(d=e.position().top,jQuery(window).resize(function(){var a=jQuery(window).width()<=850;a?g.hasClass("po-small")||g.addClass("po-small"):g.hasClass("po-small")&&(g.removeClass("po-small"),b())}).scroll(function(){c=jQuery(window).scrollTop()-d+h,c>0?a():b()}),window.setTimeout(function(){jQuery(window).trigger("scroll")},100))}function c(){var a=jQuery(".colorpicker");if(a.length&&"function"==typeof a.wpColorPicker){var b=function(a){var b=jQuery(a.target),c=b.closest(".wp-picker-container"),d=c.find(".colorpicker"),e=jQuery(".colorpicker");c.length&&(e=e.not(d)),e.each(function(){var a=jQuery(this),b=a.closest(".wp-picker-container");a.iris("hide"),a.hide(),b.find(".wp-picker-clear").addClass("hidden"),b.find(".wp-picker-open").removeClass("wp-picker-open")})};a.wpColorPicker(),jQuery(document).on("mousedown",b),jQuery(document).on("click",b),jQuery(document).on("mouseup",b)}}function d(){var a=jQuery("#po-custom-colors"),b=jQuery("#po-custom-size"),c=jQuery("[name=po_display]"),d=jQuery("#po-can-hide"),e=jQuery("#po-close-hides");if(a.length){var f=function(){var a,b=jQuery(this),c=b.data("toggle"),d=jQuery(c),e=b.data("or"),f=b.data("and"),g=!1;e?(a=jQuery(e),g=a.filter(":checked").length>0):f?(a=jQuery(f),g=a.length===a.filter(":checked").length):g=b.prop("checked"),g?(d.removeClass("inactive"),d.find("input,select,textarea,a").prop("readonly",!1).removeClass("disabled")):(d.addClass("inactive"),d.find("input,select,textarea,a").prop("readonly",!0).addClass("disabled")),d.addClass("inactive-anim")},g=function(){var a=jQuery(this),b=a.attr("name"),c=jQuery('[name="'+b+'"]');c.each(function(){f.call(this)})},h=function(){jQuery(".slider").each(function(){var a=jQuery(this),b=a.closest(".slider-wrap"),c=a.data("input"),d=b.find(c+"min"),e=b.find(c+"max"),f=b.find(".slider-min-input"),g=b.find(".slider-min-ignore"),h=b.find(".slider-max-input"),i=b.find(".slider-max-ignore"),j=a.data("min"),k=a.data("max");isNaN(j)&&(j=0),isNaN(k)&&(k=9999),d.prop("readonly",!0),e.prop("readonly",!0);var l=function(a,b){d.val(a),e.val(b),a===j?(f.hide(),g.show()):(f.show(),g.hide()),b===k?(h.hide(),i.show()):(h.show(),i.hide())};a.slider({range:!0,min:j,max:k,values:[d.val(),e.val()],slide:function(a,b){l(b.values[0],b.values[1])}}),l(d.val(),e.val())})};a.click(f),b.click(f),d.click(f),e.click(f),c.click(g),f.call(a),f.call(b),f.call(d),f.call(e),c.each(function(){f.call(jQuery(this))}),h()}}function e(){var a=jQuery("#meta-rules .all-rules"),b=jQuery("#meta-rules .active-rules");if(a.length){var c=function(a){var b=jQuery(a.target),c=b.find("input.wpmui-toggle-checkbox");if(!b.closest(".wpmui-toggle").length)return!b.hasClass("inactive")&&void c.trigger("click")},d=function(){var a=jQuery(this),c=a.closest(".rule"),d=a.data("form"),f=b.find(d),g=a.prop("checked");g?(c.removeClass("off").addClass("on"),f.removeClass("off").addClass("on open")):(c.removeClass("on").addClass("off"),f.removeClass("on").addClass("off")),e(a,g)},e=function(c,d){var e,f,g,h=c.data("exclude"),i=h?h.split(","):[];for(e=i.length-1;e>=0;e-=1)f=a.find(".rule-"+i[e]),g=b.find("#po-rule-"+i[e]),f.hasClass("on")||(f.prop("disabled",d),d?(f.addClass("inactive off").removeClass("on"),g.addClass("off").removeClass("on")):f.removeClass("inactive off"))},f=function(){var a=jQuery(this),b=a.closest(".rule");b.toggleClass("open")};a.find("input.wpmui-toggle-checkbox").click(d),a.find(".rule").click(c),b.on("click",".rule-title,.rule-toggle",f),a.find(".rule.on input.wpmui-toggle-checkbox").each(function(){e(jQuery(this),!0)}),jQuery(".init-loading").removeClass("wpmui-loading")}}function f(){var a,b=jQuery(".content-image"),c=b.find(".add_image"),d=b.find(".featured-img"),e=b.find(".reset"),f=b.find(".po-image"),g=b.find(".img-preview"),h=b.find(".lbl-empty"),i=b.find(".img-pos"),j=function(a){f.val(a),g.attr("src",a).show(),h.hide(),i.show(),d.addClass("has-image")},k=function(a){f.val(""),g.attr("src","").hide(),h.show(),i.hide(),d.removeClass("has-image")},l=function(b){return b.preventDefault(),a?void a.open():(a=wp.media.frames.file_frame=wp.media({title:c.attr("data-title"),button:{text:c.attr("data-button")},multiple:!1}),a.on("select",function(){var b=a.state().get("selection").first().toJSON();j(b.url)}),void a.open())},m=function(a){var b=jQuery(this);i.find(".option").removeClass("selected"),b.addClass("selected")};c.on("click",l),e.on("click",k),i.on("click",".option",m)}function g(){var a,b=jQuery('select[name="action"] '),c=jQuery('select[name="action2"] ');if(b.length&&"object"==typeof window.po_bulk)for(a in window.po_bulk)jQuery("