Newsletter - Version 6.3.5

Version Description

  • New addons panel
Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 6.3.5
Comparing to
See all releases

Code changes from version 6.3.4 to 6.3.5

Files changed (7) hide show
  1. admin.css +194 -142
  2. includes/helper.php +6 -0
  3. main/extensions.php +49 -140
  4. main/main.php +25 -11
  5. plugin.php +8 -5
  6. readme.txt +5 -1
  7. tnp-header.php +28 -25
admin.css CHANGED
@@ -36,7 +36,7 @@
36
  .row:after {
37
  display: table;
38
  content: " ";
39
-
40
  }
41
  .row:after {
42
  clear: both;
@@ -106,9 +106,9 @@
106
  @font-face {
107
  font-family: "Circular Std";
108
  src: url("vendor/fonts/CircularStd-Medium.woff") format("woff"),
109
- url("vendor/fonts/CircularStd-Medium.woff2") format("woff2"),
110
- url("vendor/fonts/CircularStd-Medium.eot") format("embedded-opentype"),
111
- url("vendor/fonts/CircularStd-Medium.ttf") format("truetype");
112
 
113
  }
114
 
@@ -116,9 +116,9 @@
116
  font-family: "Circular Std";
117
  font-weight: bold;
118
  src: url("vendor/fonts/CircularStd-Bold.woff") format("woff"),
119
- url("vendor/fonts/CircularStd-Bold.woff2") format("woff2"),
120
- url("vendor/fonts/CircularStd-Bold.eot") format("embedded-opentype"),
121
- url("vendor/fonts/CircularStd-Bold.ttf") format("truetype");
122
  }
123
 
124
  #tnp-wrap,
@@ -1614,16 +1614,16 @@ Tnp Welcome Slider
1614
  -------------------------------- */
1615
 
1616
  .cd-slider-wrapper {
1617
- position: relative;
1618
- width: 100%;
1619
- height: 90vh;
1620
- /* hide horizontal scrollbar on IE11 */
1621
- overflow: hidden;
1622
- margin: 0 auto;
1623
  }
1624
  .cd-slider-wrapper .cd-slider, .cd-slider-wrapper .cd-slider > li {
1625
- height: 100%;
1626
- width: 100%;
1627
  }
1628
 
1629
  .tnp-logo-big {
@@ -1757,111 +1757,111 @@ Tnp Welcome Slider
1757
  }
1758
 
1759
  .cd-slider > li {
1760
- position: absolute;
1761
- top: 0;
1762
- left: 0;
1763
- opacity: 0;
1764
- /* used to vertically center its content */
1765
- display: table;
1766
- background-position: center center;
1767
- background-repeat: no-repeat;
1768
- -webkit-font-smoothing: antialiased;
1769
- -moz-osx-font-smoothing: grayscale;
1770
  }
1771
  .cd-slider > li.visible {
1772
- /* selected slide */
1773
- position: relative;
1774
- z-index: 2;
1775
- opacity: 1;
1776
  }
1777
  .cd-slider > li:first-of-type {
1778
- background-color: #2B313A;
1779
  }
1780
  .cd-slider > li:nth-of-type(2) {
1781
- background-color: #2B313A;
1782
  }
1783
  .cd-slider > li:nth-of-type(3) {
1784
- background-color: #2B313A;
1785
  }
1786
  .cd-slider > li:nth-of-type(4) {
1787
- background-color: #2B313A;
1788
  }
1789
  .cd-slider > li:first-of-type, .cd-slider > li:nth-of-type(2), .cd-slider > li:nth-of-type(3), .cd-slider > li:nth-of-type(4) {
1790
- background-size: cover;
1791
  }
1792
  .cd-slider > li > div {
1793
- /* vertically center the slider content */
1794
- display: table-cell;
1795
- vertical-align: middle;
1796
- text-align: center;
1797
  }
1798
  .cd-slider > li h2, .cd-slider > li p {
1799
- text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1800
- line-height: 1.2;
1801
- margin: 0 auto 14px;
1802
- color: #ffffff;
1803
- width: 90%;
1804
- max-width: 320px;
1805
  }
1806
  .cd-slider > li h2 {
1807
  font-size: 40px;
1808
- }
1809
- .cd-slider > li p {
1810
  font-size: 18px;
1811
  line-height: 26px;
1812
  text-align: left;
1813
  color: #B8C3C9;
1814
  margin: 40px auto;
1815
- }
1816
-
1817
  .cd-slider > li .cd-btn {
1818
- display: inline-block;
1819
- padding: 1.2em 1.4em;
1820
- margin-top: .8em;
1821
- background-color: rgba(0, 0, 0, 0.6);
1822
- border-radius: .25em;
1823
- font-size: 1.3rem;
1824
- font-weight: 700;
1825
- letter-spacing: 1px;
1826
- color: #ffffff;
1827
- text-transform: uppercase;
1828
- -webkit-transition: background-color 0.2s;
1829
- -moz-transition: background-color 0.2s;
1830
- transition: background-color 0.2s;
1831
  }
1832
  .no-touch .cd-slider > li .cd-btn:hover {
1833
- background-color: rgba(0, 0, 0, 0.8);
1834
  }
1835
  @media only screen and (min-width: 768px) {
1836
- .cd-slider > li h2, .cd-slider > li p {
1837
- max-width: 520px;
1838
- }
1839
- .cd-slider > li h2 {
1840
- font-size: 40px;
1841
- }
1842
- .cd-slider > li p {
1843
- font-size: 18px;
1844
- line-height: 26px;
1845
- text-align: left;
1846
- color: #B8C3C9;
1847
- margin: 40px auto;
1848
-
1849
- }
1850
  }
1851
  @media only screen and (min-width: 1170px) {
1852
- .cd-slider > li h2, .cd-slider > li p {
1853
- margin-bottom: 20px;
1854
- }
1855
- .cd-slider > li h2 {
1856
- font-size: 40px;
1857
- }
1858
- .cd-slider > li p {
1859
- font-size: 18px;
1860
- line-height: 26px;
1861
- text-align: center;
1862
- color: #B8C3C9;
1863
- margin: 30px auto;
1864
- }
1865
  }
1866
 
1867
  /* --------------------------------
@@ -1880,33 +1880,33 @@ Tnp Welcome Slider Navigation
1880
  /* svg cover layer */
1881
 
1882
  .cd-svg-cover {
1883
- position: absolute;
1884
- z-index: 1;
1885
- left: 0;
1886
- top: 0;
1887
- height: 100%;
1888
- width: 100%;
1889
- opacity: 0;
1890
  }
1891
  .cd-svg-cover path {
1892
- fill: #ED6A6A;
1893
  }
1894
  .cd-svg-cover.is-animating {
1895
- z-index: 4;
1896
- opacity: 1;
1897
- -webkit-transition: opacity 0.6s;
1898
- -moz-transition: opacity 0.6s;
1899
- transition: opacity 0.6s;
1900
  }
1901
 
1902
  /* Switch element style */
1903
 
1904
  /* The switch - the box around the slider */
1905
  .switch {
1906
- position: relative;
1907
- display: inline-block;
1908
- width: 60px;
1909
- height: 34px;
1910
  }
1911
 
1912
  /* Hide default HTML checkbox */
@@ -1914,50 +1914,50 @@ Tnp Welcome Slider Navigation
1914
 
1915
  /* The slider */
1916
  .slider {
1917
- position: absolute;
1918
- cursor: pointer;
1919
- top: 0;
1920
- left: 0;
1921
- right: 0;
1922
- bottom: 0;
1923
- background-color: #ccc;
1924
- -webkit-transition: .4s;
1925
- transition: .4s;
1926
  }
1927
 
1928
  .slider:before {
1929
- position: absolute;
1930
- content: "";
1931
- height: 26px;
1932
- width: 26px;
1933
- left: 4px;
1934
- bottom: 4px;
1935
- background-color: white;
1936
- -webkit-transition: .4s;
1937
- transition: .4s;
1938
  }
1939
 
1940
  input:checked + .slider {
1941
- background-color: #2196F3;
1942
  }
1943
 
1944
  input:focus + .slider {
1945
- box-shadow: 0 0 1px #2196F3;
1946
  }
1947
 
1948
  input:checked + .slider:before {
1949
- -webkit-transform: translateX(26px);
1950
- -ms-transform: translateX(26px);
1951
- transform: translateX(26px);
1952
  }
1953
 
1954
  /* Rounded sliders */
1955
  .slider.round {
1956
- border-radius: 34px;
1957
  }
1958
 
1959
  .slider.round:before {
1960
- border-radius: 50%;
1961
  }
1962
 
1963
  /* Cossa sea sta roba? ORDINE! */
@@ -2109,16 +2109,16 @@ iframe.tnp-editor-preview-mobile {
2109
  }
2110
 
2111
  iframe.tnp-editor-preview-desktop {
2112
- box-sizing: border-box;
2113
- background-color: #fff;
2114
- border: 1px solid #bbb;
2115
- border-radius: 10px;
2116
- box-shadow: 1px 1px 10px #777;
2117
- padding: 15px;
2118
- width: 650px;
2119
- margin-right: 20px;
2120
- height: 500px;
2121
- float: left;
2122
  }
2123
 
2124
 
@@ -2443,4 +2443,56 @@ span.tnp-email-status-sent {
2443
  box-sizing: border-box;
2444
  padding: 10px;
2445
  float: left;
2446
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  .row:after {
37
  display: table;
38
  content: " ";
39
+
40
  }
41
  .row:after {
42
  clear: both;
106
  @font-face {
107
  font-family: "Circular Std";
108
  src: url("vendor/fonts/CircularStd-Medium.woff") format("woff"),
109
+ url("vendor/fonts/CircularStd-Medium.woff2") format("woff2"),
110
+ url("vendor/fonts/CircularStd-Medium.eot") format("embedded-opentype"),
111
+ url("vendor/fonts/CircularStd-Medium.ttf") format("truetype");
112
 
113
  }
114
 
116
  font-family: "Circular Std";
117
  font-weight: bold;
118
  src: url("vendor/fonts/CircularStd-Bold.woff") format("woff"),
119
+ url("vendor/fonts/CircularStd-Bold.woff2") format("woff2"),
120
+ url("vendor/fonts/CircularStd-Bold.eot") format("embedded-opentype"),
121
+ url("vendor/fonts/CircularStd-Bold.ttf") format("truetype");
122
  }
123
 
124
  #tnp-wrap,
1614
  -------------------------------- */
1615
 
1616
  .cd-slider-wrapper {
1617
+ position: relative;
1618
+ width: 100%;
1619
+ height: 90vh;
1620
+ /* hide horizontal scrollbar on IE11 */
1621
+ overflow: hidden;
1622
+ margin: 0 auto;
1623
  }
1624
  .cd-slider-wrapper .cd-slider, .cd-slider-wrapper .cd-slider > li {
1625
+ height: 100%;
1626
+ width: 100%;
1627
  }
1628
 
1629
  .tnp-logo-big {
1757
  }
1758
 
1759
  .cd-slider > li {
1760
+ position: absolute;
1761
+ top: 0;
1762
+ left: 0;
1763
+ opacity: 0;
1764
+ /* used to vertically center its content */
1765
+ display: table;
1766
+ background-position: center center;
1767
+ background-repeat: no-repeat;
1768
+ -webkit-font-smoothing: antialiased;
1769
+ -moz-osx-font-smoothing: grayscale;
1770
  }
1771
  .cd-slider > li.visible {
1772
+ /* selected slide */
1773
+ position: relative;
1774
+ z-index: 2;
1775
+ opacity: 1;
1776
  }
1777
  .cd-slider > li:first-of-type {
1778
+ background-color: #2B313A;
1779
  }
1780
  .cd-slider > li:nth-of-type(2) {
1781
+ background-color: #2B313A;
1782
  }
1783
  .cd-slider > li:nth-of-type(3) {
1784
+ background-color: #2B313A;
1785
  }
1786
  .cd-slider > li:nth-of-type(4) {
1787
+ background-color: #2B313A;
1788
  }
1789
  .cd-slider > li:first-of-type, .cd-slider > li:nth-of-type(2), .cd-slider > li:nth-of-type(3), .cd-slider > li:nth-of-type(4) {
1790
+ background-size: cover;
1791
  }
1792
  .cd-slider > li > div {
1793
+ /* vertically center the slider content */
1794
+ display: table-cell;
1795
+ vertical-align: middle;
1796
+ text-align: center;
1797
  }
1798
  .cd-slider > li h2, .cd-slider > li p {
1799
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1800
+ line-height: 1.2;
1801
+ margin: 0 auto 14px;
1802
+ color: #ffffff;
1803
+ width: 90%;
1804
+ max-width: 320px;
1805
  }
1806
  .cd-slider > li h2 {
1807
  font-size: 40px;
1808
+ }
1809
+ .cd-slider > li p {
1810
  font-size: 18px;
1811
  line-height: 26px;
1812
  text-align: left;
1813
  color: #B8C3C9;
1814
  margin: 40px auto;
1815
+ }
1816
+
1817
  .cd-slider > li .cd-btn {
1818
+ display: inline-block;
1819
+ padding: 1.2em 1.4em;
1820
+ margin-top: .8em;
1821
+ background-color: rgba(0, 0, 0, 0.6);
1822
+ border-radius: .25em;
1823
+ font-size: 1.3rem;
1824
+ font-weight: 700;
1825
+ letter-spacing: 1px;
1826
+ color: #ffffff;
1827
+ text-transform: uppercase;
1828
+ -webkit-transition: background-color 0.2s;
1829
+ -moz-transition: background-color 0.2s;
1830
+ transition: background-color 0.2s;
1831
  }
1832
  .no-touch .cd-slider > li .cd-btn:hover {
1833
+ background-color: rgba(0, 0, 0, 0.8);
1834
  }
1835
  @media only screen and (min-width: 768px) {
1836
+ .cd-slider > li h2, .cd-slider > li p {
1837
+ max-width: 520px;
1838
+ }
1839
+ .cd-slider > li h2 {
1840
+ font-size: 40px;
1841
+ }
1842
+ .cd-slider > li p {
1843
+ font-size: 18px;
1844
+ line-height: 26px;
1845
+ text-align: left;
1846
+ color: #B8C3C9;
1847
+ margin: 40px auto;
1848
+
1849
+ }
1850
  }
1851
  @media only screen and (min-width: 1170px) {
1852
+ .cd-slider > li h2, .cd-slider > li p {
1853
+ margin-bottom: 20px;
1854
+ }
1855
+ .cd-slider > li h2 {
1856
+ font-size: 40px;
1857
+ }
1858
+ .cd-slider > li p {
1859
+ font-size: 18px;
1860
+ line-height: 26px;
1861
+ text-align: center;
1862
+ color: #B8C3C9;
1863
+ margin: 30px auto;
1864
+ }
1865
  }
1866
 
1867
  /* --------------------------------
1880
  /* svg cover layer */
1881
 
1882
  .cd-svg-cover {
1883
+ position: absolute;
1884
+ z-index: 1;
1885
+ left: 0;
1886
+ top: 0;
1887
+ height: 100%;
1888
+ width: 100%;
1889
+ opacity: 0;
1890
  }
1891
  .cd-svg-cover path {
1892
+ fill: #ED6A6A;
1893
  }
1894
  .cd-svg-cover.is-animating {
1895
+ z-index: 4;
1896
+ opacity: 1;
1897
+ -webkit-transition: opacity 0.6s;
1898
+ -moz-transition: opacity 0.6s;
1899
+ transition: opacity 0.6s;
1900
  }
1901
 
1902
  /* Switch element style */
1903
 
1904
  /* The switch - the box around the slider */
1905
  .switch {
1906
+ position: relative;
1907
+ display: inline-block;
1908
+ width: 60px;
1909
+ height: 34px;
1910
  }
1911
 
1912
  /* Hide default HTML checkbox */
1914
 
1915
  /* The slider */
1916
  .slider {
1917
+ position: absolute;
1918
+ cursor: pointer;
1919
+ top: 0;
1920
+ left: 0;
1921
+ right: 0;
1922
+ bottom: 0;
1923
+ background-color: #ccc;
1924
+ -webkit-transition: .4s;
1925
+ transition: .4s;
1926
  }
1927
 
1928
  .slider:before {
1929
+ position: absolute;
1930
+ content: "";
1931
+ height: 26px;
1932
+ width: 26px;
1933
+ left: 4px;
1934
+ bottom: 4px;
1935
+ background-color: white;
1936
+ -webkit-transition: .4s;
1937
+ transition: .4s;
1938
  }
1939
 
1940
  input:checked + .slider {
1941
+ background-color: #2196F3;
1942
  }
1943
 
1944
  input:focus + .slider {
1945
+ box-shadow: 0 0 1px #2196F3;
1946
  }
1947
 
1948
  input:checked + .slider:before {
1949
+ -webkit-transform: translateX(26px);
1950
+ -ms-transform: translateX(26px);
1951
+ transform: translateX(26px);
1952
  }
1953
 
1954
  /* Rounded sliders */
1955
  .slider.round {
1956
+ border-radius: 34px;
1957
  }
1958
 
1959
  .slider.round:before {
1960
+ border-radius: 50%;
1961
  }
1962
 
1963
  /* Cossa sea sta roba? ORDINE! */
2109
  }
2110
 
2111
  iframe.tnp-editor-preview-desktop {
2112
+ box-sizing: border-box;
2113
+ background-color: #fff;
2114
+ border: 1px solid #bbb;
2115
+ border-radius: 10px;
2116
+ box-shadow: 1px 1px 10px #777;
2117
+ padding: 15px;
2118
+ width: 650px;
2119
+ margin-right: 20px;
2120
+ height: 500px;
2121
+ float: left;
2122
  }
2123
 
2124
 
2443
  box-sizing: border-box;
2444
  padding: 10px;
2445
  float: left;
2446
+ }
2447
+
2448
+ /* Addons page */
2449
+
2450
+ #tnp-promo {
2451
+ text-align: left;
2452
+ background-color: #222b36;
2453
+ margin: 20px;
2454
+ border-radius: 5px;
2455
+ padding: 20px 40px;
2456
+ }
2457
+ #tnp-promo .tnp-promo-how-to {
2458
+ width: 50%;
2459
+ padding: 5px 20px;
2460
+ margin-top: 30px;
2461
+ margin-bottom: 30px;
2462
+ border-left: 2px solid #F1C40F;
2463
+ }
2464
+
2465
+ #tnp-promo .tnp-promo-how-to h3 {
2466
+ color: #ECF0F1;
2467
+ margin: 0px;
2468
+ line-height: 36px;
2469
+ }
2470
+
2471
+ #tnp-promo .tnp-promo-how-to p {
2472
+ color: #ECF0F1;
2473
+ margin: 0px;
2474
+ font-size: 16px;
2475
+ line-height: 26px;
2476
+ }
2477
+
2478
+ #tnp-promo .tnp-promo-buttons {
2479
+ margin: 50px 0px;
2480
+ }
2481
+
2482
+ #tnp-promo .tnp-promo-button {
2483
+ background: #27AE60;
2484
+ text-decoration: none;
2485
+ color: white;
2486
+ padding: 15px 20px;
2487
+ font-size: 15px;
2488
+ border-radius: 2px;
2489
+ }
2490
+
2491
+ #tnp-promo .tnp-promo-button:hover {
2492
+ background: #2ECC71;
2493
+ color: white;
2494
+ }
2495
+
2496
+ #tnp-promo .tnp-promo-button i {
2497
+ margin-right: 3px;
2498
+ }
includes/helper.php CHANGED
@@ -122,6 +122,12 @@ function tnp_media_resize($media_id, $size) {
122
  //return $editor;
123
  //return $uploads['baseurl'] . '/' . $relative_file;
124
  }
 
 
 
 
 
 
125
 
126
  $editor->set_quality(80);
127
  $resized = $editor->resize($width, $height, $crop);
122
  //return $editor;
123
  //return $uploads['baseurl'] . '/' . $relative_file;
124
  }
125
+
126
+ $original_size = $editor->get_size();
127
+ if ($width > $original_size['width'] || $height > $original_size['height']) {
128
+ $src = wp_get_attachment_image_src($media_id, $size);
129
+ return $src[0];
130
+ }
131
 
132
  $editor->set_quality(80);
133
  $resized = $editor->resize($width, $height, $crop);
main/extensions.php CHANGED
@@ -22,82 +22,67 @@ if (isset($_POST['email']) && check_admin_referer('subscribe')) {
22
  die();
23
  }
24
 
25
- $subscribed = get_option('newsletter_subscribed', false);
26
- $has_license = !empty(Newsletter::instance()->options['contract_key']);
27
- if ($has_license) {
28
- if (!class_exists('NewsletterExtensions')) {
29
- $controls->warnings = 'Please, install our Addons manager to manage all extensions from this panel.
30
- <a href="https://www.thenewsletterplugin.com/documentation/how-to-install-the-addons-manager" target="_blank">Get it here</a>.';
 
 
 
31
  }
32
  }
 
33
  ?>
34
 
35
  <div class="wrap" id="tnp-wrap">
36
 
37
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
38
 
39
- <div id="tnp-heading">
40
-
41
- <h2><?php _e('Extensions', 'newsletter') ?></h2>
42
-
43
- <p><?php _e('Extend your Newsletter experience with our addons', 'newsletter') ?>.</p>
44
-
45
- </div>
46
 
47
  <div id="tnp-body">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  <?php if (is_array($extensions)) { ?>
50
 
51
- <!-- Extensions -->
52
  <?php foreach ($extensions AS $e) { ?>
53
 
54
- <?php
55
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_extensions_index&act=activate&id=' . $e->id, 'save');
56
- if ($subscribed) {
57
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
58
- } else {
59
- $e->install_url = 'javascript:newsletter_subscribe(' . $e->id . ')';
60
- }
61
- ?>
62
-
63
  <?php if ($e->type == "extension" || $e->type == "premium") { ?>
64
- <?php if ($e->free) { ?>
65
- <div class="tnp-extension-free-box <?php echo $e->slug ?>">
66
- <?php } else { ?>
67
- <div class="tnp-extension-premium-box <?php echo $e->slug ?>">
68
- <?php } ?>
69
  <?php if ($e->free) { ?>
70
- <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter')?>/images/extension-free.png">
71
  <?php } ?>
72
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
73
  <h3><?php echo $e->title ?></h3>
74
  <p><?php echo $e->description ?></p>
75
- <div class="tnp-extension-premium-action">
76
- <?php if (is_plugin_active($e->wp_slug)) { ?>
77
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
78
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
79
- <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
80
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
81
- </a>
82
- <?php } elseif ($e->downloadable) { ?>
83
- <a href="<?php echo $e->install_url ?>" class="tnp-extension-install">
84
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
85
- </a>
86
- <?php } else { ?>
87
- <a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-buy" target="_blank">
88
- <i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy Now
89
- </a>
90
- <?php } ?>
91
- <!--
92
- <?php if ($e->url) { ?>
93
- <br><br>
94
- <a href="<?php echo $e->url ?>" class="tnp-extension-details" target="_blank">
95
- View details
96
- </a>
97
- <?php } ?>
98
- -->
99
- </div>
100
-
101
  </div>
102
  <?php } ?>
103
  <?php } ?>
@@ -105,109 +90,33 @@ if ($has_license) {
105
  <!-- Integrations -->
106
  <?php foreach ($extensions AS $e) { ?>
107
 
108
- <?php
109
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_extensions_index&act=activate&id=' . $e->id, 'save');
110
- if ($subscribed) {
111
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
112
- } else {
113
- $e->install_url = 'javascript:newsletter_subscribe(' . $e->id . ')';
114
- }
115
- ?>
116
  <?php if ($e->type == "integration") { ?>
117
- <?php if ($e->free) { ?>
118
- <div class="tnp-extension-free-box <?php echo $e->slug ?>">
119
- <?php } else { ?>
120
- <div class="tnp-integration-box <?php echo $e->slug ?>">
121
- <?php } ?>
122
  <?php if ($e->free) { ?>
123
- <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter')?>/images/extension-free.png">
124
  <?php } ?>
125
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>"></div>
126
  <h3><?php echo $e->title ?></h3>
127
  <p><?php echo $e->description ?></p>
128
- <div class="tnp-extension-free-action">
129
- <?php if (is_plugin_active($e->wp_slug)) { ?>
130
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
131
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
132
- <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
133
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
134
- </a>
135
- <?php } elseif ($e->downloadable) { ?>
136
- <a href="<?php echo $e->install_url ?>" class="tnp-extension-install">
137
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
138
- </a>
139
- <?php } else { ?>
140
- <a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-buy" target="_blank">
141
- <i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy Now
142
- </a>
143
- <?php } ?>
144
- <!--
145
- <?php if ($e->url) { ?>
146
- <br><br>
147
- <div class="tnp-integration-details">
148
- <a href="<?php echo $e->url ?>" class="tnp-extension-details" target="_blank">
149
- View details
150
- </a>
151
- </div>
152
- <?php } ?>
153
- -->
154
- </div>
155
  </div>
156
  <?php } ?>
157
 
158
  <?php } ?>
159
 
160
- <!-- Delivery -->
161
  <?php foreach ($extensions AS $e) { ?>
162
 
163
- <?php
164
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_extensions_index&act=activate&id=' . $e->id, 'save');
165
- if ($subscribed) {
166
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
167
- } else {
168
- $e->install_url = 'javascript:newsletter_subscribe(' . $e->id . ')';
169
- }
170
- ?>
171
-
172
  <?php if ($e->type == "delivery") { ?>
173
- <?php if ($e->free) { ?>
174
- <div class="tnp-extension-free-box <?php echo $e->slug ?>">
175
- <?php } else { ?>
176
- <div class="tnp-integration-box <?php echo $e->slug ?>">
177
- <?php } ?>
178
  <?php if ($e->free) { ?>
179
- <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter')?>/images/extension-free.png">
180
  <?php } ?>
181
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
182
  <h3><?php echo $e->title ?></h3>
183
  <p><?php echo $e->description ?></p>
184
- <div class="tnp-integration-action">
185
- <?php if (is_plugin_active($e->wp_slug)) { ?>
186
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
187
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
188
- <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
189
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
190
- </a>
191
- <?php } elseif ($e->downloadable) { ?>
192
- <a href="<?php echo $e->install_url ?>" class="tnp-extension-install">
193
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
194
- </a>
195
- <?php } else { ?>
196
- <a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-buy" target="_blank">
197
- <i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy Now
198
- </a>
199
- <?php } ?>
200
- <!--
201
- <?php if ($e->url) { ?>
202
- <br><br>
203
- <div class="tnp-integration-details">
204
- <a href="<?php echo $e->url ?>" class="tnp-extension-details" target="_blank">
205
- View details
206
- </a>
207
- </div>
208
- <?php } ?>
209
- -->
210
- </div>
211
  </div>
212
  <?php } ?>
213
 
@@ -216,7 +125,7 @@ if ($has_license) {
216
 
217
  <?php } else { ?>
218
 
219
- <p style="color: white;">No extensions available.</p>
220
 
221
  <?php } ?>
222
 
22
  die();
23
  }
24
 
25
+ if ($controls->is_action('activate')) {
26
+ $result = activate_plugin('newsletter-extensions/extensions.php');
27
+ if (is_wp_error($result)) {
28
+ $controls->errors .= __('Error while activating:', 'newsletter') . " " . $result->get_error_message();
29
+ } else {
30
+ wp_clean_plugins_cache(false);
31
+ delete_transient("tnp_extensions_json");
32
+ $controls->js_redirect('admin.php?page=newsletter_extensions_index');
33
+ wp_die();
34
  }
35
  }
36
+
37
  ?>
38
 
39
  <div class="wrap" id="tnp-wrap">
40
 
41
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
42
 
 
 
 
 
 
 
 
43
 
44
  <div id="tnp-body">
45
+ <?php if (is_wp_error(validate_plugin('newsletter-extensions/extensions.php'))) { ?>
46
+ <div id="tnp-promo">
47
+
48
+ <h1>Supercharge Newsletter with our Professional Addons</h1>
49
+ <div class="tnp-promo-how-to">
50
+ <h3>How to install:</h3>
51
+ <p>To add our addons, free or professional, you need to install our Addons Manager. But don't worry, it's super easy! Just click on "Download" button to download the zip file of
52
+ the Addon Manager from our website, then click on "Install" to upload the same zip file to your WordPress installation.</p>
53
+ </div>
54
+ <div class="tnp-promo-buttons">
55
+ <a class="tnp-promo-button" href="https://www.thenewsletterplugin.com/get-addons-manager"><i class="fas fa-cloud-download-alt"></i> Download Addons Manager</a>
56
+ <a class="tnp-promo-button" href="<?php echo admin_url('plugin-install.php?tab=upload') ?>"><i class="fas fa-cloud-upload-alt"></i> Install</a>
57
+ </div>
58
+
59
+ </div>
60
+ <?php } elseif (is_plugin_inactive('newsletter-extensions/extensions.php')) { ?>
61
+ <div id="tnp-promo">
62
+ <div class="tnp-promo-how-to">
63
+ <p>Addons Manager seems installed but not active.</p>
64
+ <p>Activate it to install and update our free and professional addons.</p>
65
+ </div>
66
+ <div class="tnp-promo-buttons">
67
+ <a class="tnp-promo-button" href="<?php echo wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate', 'save'); ?>"><i class="fas fa-power-off"></i> Activate</a>
68
+ </div>
69
+ </div>
70
+ <?php } ?>
71
 
72
  <?php if (is_array($extensions)) { ?>
73
 
74
+ <!-- Extensions -->
75
  <?php foreach ($extensions AS $e) { ?>
76
 
 
 
 
 
 
 
 
 
 
77
  <?php if ($e->type == "extension" || $e->type == "premium") { ?>
78
+ <div class="<?php echo $e->free ? 'tnp-extension-free-box' : 'tnp-extension-premium-box' ?> <?php echo $e->slug ?>">
79
+
 
 
 
80
  <?php if ($e->free) { ?>
81
+ <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter') ?>/images/extension-free.png">
82
  <?php } ?>
83
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
84
  <h3><?php echo $e->title ?></h3>
85
  <p><?php echo $e->description ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  </div>
87
  <?php } ?>
88
  <?php } ?>
90
  <!-- Integrations -->
91
  <?php foreach ($extensions AS $e) { ?>
92
 
 
 
 
 
 
 
 
 
93
  <?php if ($e->type == "integration") { ?>
94
+
95
+ <div class="<?php echo $e->free ? 'tnp-extension-free-box' : 'tnp-integration-box' ?> <?php echo $e->slug ?>">
96
+
 
 
97
  <?php if ($e->free) { ?>
98
+ <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter') ?>/images/extension-free.png">
99
  <?php } ?>
100
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>"></div>
101
  <h3><?php echo $e->title ?></h3>
102
  <p><?php echo $e->description ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </div>
104
  <?php } ?>
105
 
106
  <?php } ?>
107
 
108
+ <!-- Delivery -->
109
  <?php foreach ($extensions AS $e) { ?>
110
 
 
 
 
 
 
 
 
 
 
111
  <?php if ($e->type == "delivery") { ?>
112
+ <div class="<?php echo $e->free ? 'tnp-extension-free-box' : 'tnp-integration-box' ?> <?php echo $e->slug ?>">
113
+
 
 
 
114
  <?php if ($e->free) { ?>
115
+ <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter') ?>/images/extension-free.png">
116
  <?php } ?>
117
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
118
  <h3><?php echo $e->title ?></h3>
119
  <p><?php echo $e->description ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  </div>
121
  <?php } ?>
122
 
125
 
126
  <?php } else { ?>
127
 
128
+ <p style="color: white;">No addons available, try later.</p>
129
 
130
  <?php } ?>
131
 
main/main.php CHANGED
@@ -87,23 +87,37 @@ if (!empty($controls->data['contract_key']) || defined('NEWSLETTER_LICENSE_KEY')
87
  } else {
88
  $license_key = $controls->data['contract_key'];
89
  }
90
- $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . urlencode($license_key), array('sslverify' => false));
 
91
 
92
  if (is_wp_error($response)) {
93
  /* @var $response WP_Error */
94
  $controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
95
  $controls->errors .= esc_html($response->get_error_code()) . ' - ' . esc_html($response->get_error_message());
96
- $controls->data['licence_expires'] = "";
97
- } else if ($response['response']['code'] != 200) {
98
- $controls->errors .= '[' . $response['response']['code'] . '] The license seems expired or not valid, please check your <a href="https://www.thenewsletterplugin.com/account">license code and status</a>, thank you.';
99
- $controls->errors .= '<br>You can anyway download the professional extension from https://www.thenewsletterplugin.com.';
100
- $controls->data['licence_expires'] = "";
101
- } elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
102
- $controls->data['licence_expires'] = $expires->expire;
103
- $controls->messages = 'Your license is valid and expires on ' . esc_html(date('Y-m-d', $expires->expire));
104
  } else {
105
- $controls->errors = 'Unable to detect the license expiration. Debug data to report to the support: <code>' . esc_html(wp_remote_retrieve_body($response)) . '</code>';
106
- $controls->data['licence_expires'] = "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
  $module->merge_options($controls->data);
109
  }
87
  } else {
88
  $license_key = $controls->data['contract_key'];
89
  }
90
+
91
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/license-check.php?k=' . urlencode($license_key), array('sslverify' => false));
92
 
93
  if (is_wp_error($response)) {
94
  /* @var $response WP_Error */
95
  $controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
96
  $controls->errors .= esc_html($response->get_error_code()) . ' - ' . esc_html($response->get_error_message());
97
+ $controls->data['licence_expires'] = '';
 
 
 
 
 
 
 
98
  } else {
99
+ if (wp_remote_retrieve_response_code($response) != 200) {
100
+ $controls->errors .= '[' . wp_remote_retrieve_response_code($response) . '] The license validator returned an error, please check your <a href="https://www.thenewsletterplugin.com/account">license code and status</a>, thank you.';
101
+ $controls->errors .= '<br>You can anyway download the professional addons from https://www.thenewsletterplugin.com if your license is valid.';
102
+ $controls->data['licence_expires'] = '';
103
+ } else {
104
+ $expires = json_decode(wp_remote_retrieve_body($response));
105
+
106
+ if (!empty($expires->message)) {
107
+ $controls->errors = $expires->message;
108
+ } else {
109
+ $controls->data['licence_expires'] = $expires->expire;
110
+
111
+ if ($expires->expire == -1) {
112
+ $controls->messages = 'Your FREE license is valid';
113
+ } elseif ($expires->expire >= time()) {
114
+ $controls->messages = 'Your license is valid and expires on ' . esc_html(date('Y-m-d', $expires->expire));
115
+ } else {
116
+ $controls->messages = 'Your license is expired on ' . esc_html(date('Y-m-d', $expires->expire));
117
+ }
118
+ }
119
+ }
120
+
121
  }
122
  $module->merge_options($controls->data);
123
  }
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 6.3.4
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -28,8 +28,7 @@
28
 
29
  */
30
 
31
- // Used as dummy parameter on css and js links
32
- define('NEWSLETTER_VERSION', '6.3.4');
33
 
34
  global $newsletter, $wpdb;
35
 
@@ -345,7 +344,6 @@ class Newsletter extends NewsletterModule {
345
  if (current_user_can('administrator')) {
346
  return true;
347
  }
348
- //if (!empty($this->options['editor']) && current_user_can('editor')) return true;
349
  if (!empty($this->options['roles'])) {
350
  foreach ($this->options['roles'] as $role) {
351
  if (current_user_can($role)) {
@@ -1020,8 +1018,9 @@ class Newsletter extends NewsletterModule {
1020
 
1021
  $extensions = $this->getTnpExtensions();
1022
 
1023
- if (!$extensions)
1024
  return $value;
 
1025
 
1026
  foreach ($extensions as $extension) {
1027
  unset($value->response[$extension->wp_slug]);
@@ -1150,6 +1149,10 @@ class Newsletter extends NewsletterModule {
1150
 
1151
  return $extensions;
1152
  }
 
 
 
 
1153
 
1154
  function hook_plugins_loaded() {
1155
 
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 6.3.5
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
28
 
29
  */
30
 
31
+ define('NEWSLETTER_VERSION', '6.3.5');
 
32
 
33
  global $newsletter, $wpdb;
34
 
344
  if (current_user_can('administrator')) {
345
  return true;
346
  }
 
347
  if (!empty($this->options['roles'])) {
348
  foreach ($this->options['roles'] as $role) {
349
  if (current_user_can($role)) {
1018
 
1019
  $extensions = $this->getTnpExtensions();
1020
 
1021
+ if (!$extensions) {
1022
  return $value;
1023
+ }
1024
 
1025
  foreach ($extensions as $extension) {
1026
  unset($value->response[$extension->wp_slug]);
1149
 
1150
  return $extensions;
1151
  }
1152
+
1153
+ function clear_extensions_cache() {
1154
+ delete_transient('tnp_extensions_json');
1155
+ }
1156
 
1157
  function hook_plugins_loaded() {
1158
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.2.3
5
- Stable tag: 6.3.4
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -109,6 +109,10 @@ Thank you, The Newsletter Team
109
 
110
  == Changelog ==
111
 
 
 
 
 
112
  = 6.3.4 =
113
 
114
  * Fixes
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.2.3
5
+ Stable tag: 6.3.5
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
109
 
110
  == Changelog ==
111
 
112
+ = 6.3.5 =
113
+
114
+ * New addons panel
115
+
116
  = 6.3.4 =
117
 
118
  * Fixes
tnp-header.php CHANGED
@@ -139,34 +139,37 @@ $warning |= empty($status_options['mail']);
139
  </li>
140
  <?php } ?>
141
 
142
- <?php
143
- if (empty(Newsletter::instance()->options['contract_key']) && !defined('NEWSLETTER_LICENSE_KEY')) {
144
- ?>
145
  <li class="tnp-professional-extensions-button"><a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=header" target="_blank">
146
- <i class="fa fa-trophy"></i> <?php _e('Get Professional Addons', 'newsletter') ?></a>
147
  </li>
148
- <?php } else {
149
- ?>
150
- <?php if (empty(Newsletter::instance()->options['licence_expires'])) { ?>
151
- <li class="tnp-professional-extensions-button-red">
152
- <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper" style="color: white"></i> <?php _e('Licence not valid', 'newsletter') ?></a>
153
- <?php } else { ?>
154
- <?php if (Newsletter::instance()->options['licence_expires'] > time()) { ?>
155
- <li class="tnp-professional-extensions-button">
156
- <?php
157
- if (!class_exists('NewsletterExtensions')) {
158
- echo '<a href="?page=newsletter_main_extensions">';
159
- } else {
160
- echo '<a href="?page=newsletter_extensions_index">';
161
- }
162
- ?>
163
- <i class="fa fa-check-square"></i> <?php _e('Licence active', 'newsletter') ?></a>
164
- <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
165
- <li class="tnp-professional-extensions-button-red">
166
- <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper" style="color: white"></i> <?php _e('Licence expired', 'newsletter') ?></a>
167
- <?php } ?>
168
- <?php } ?>
 
 
 
169
  </li>
 
170
  <?php } ?>
171
  </ul>
172
  </div>
139
  </li>
140
  <?php } ?>
141
 
142
+ <?php if (empty(Newsletter::instance()->options['contract_key']) && !defined('NEWSLETTER_LICENSE_KEY')) { ?>
143
+
 
144
  <li class="tnp-professional-extensions-button"><a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=header" target="_blank">
145
+ <i class="fa fa-trophy"></i> <?php _e('Get Professional Addons', 'newsletter') ?></a>
146
  </li>
147
+
148
+ <?php } elseif (Newsletter::instance()->options['licence_expires'] == -1) { ?>
149
+
150
+ <li class="tnp-professional-extensions-button"><a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=header" target="_blank">
151
+ <i class="fa fa-trophy"></i> <?php _e('Get Professional Addons', 'newsletter') ?></a>
152
+ </li>
153
+
154
+ <?php } elseif (empty(Newsletter::instance()->options['licence_expires'])) { ?>
155
+
156
+ <li class="tnp-professional-extensions-button-red">
157
+ <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper" style="color: white"></i> <?php _e('Licence not valid', 'newsletter') ?></a>
158
+ </li>
159
+
160
+ <?php } elseif (Newsletter::instance()->options['licence_expires'] >= time()) { ?>
161
+
162
+ <?php $p = class_exists('NewsletterExtensions')?'newsletter_extensions_index':'newsletter_main_extensions'; ?>
163
+ <li class="tnp-professional-extensions-button">
164
+ <a href="?page=<?php echo $p?>"><i class="fa fa-check-square"></i> <?php _e('Licence active', 'newsletter') ?></a>
165
+ </li>
166
+
167
+ <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
168
+
169
+ <li class="tnp-professional-extensions-button-red">
170
+ <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper" style="color: white"></i> <?php _e('Licence expired', 'newsletter') ?></a>
171
  </li>
172
+
173
  <?php } ?>
174
  </ul>
175
  </div>