Related Posts Thumbnails Plugin for WordPress - Version 1.6.0

Version Description

  • Compatible with 4.8
  • Multiple bugfixes
Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Related Posts Thumbnails Plugin for WordPress
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.2 to 1.6.0

Files changed (2) hide show
  1. readme.txt +30 -20
  2. related-posts-thumbnails.php +198 -24
readme.txt CHANGED
@@ -1,16 +1,16 @@
1
- === Related Posts ===
2
- Contributors: marynixie, hiddenpearls
3
  Donate link: http://wordpress.shaldybina.com/donate
4
  Tags: related, posts, thumbnails, Related Content, related posts, pages, similar posts, shortcodes, widgets, related thumbs
5
  Requires at least: 2.9
6
- Tested up to: 4.5.3
7
- Stable tag: 1.5.2
8
 
9
- Related Posts is The Best Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
11
  == Description ==
12
 
13
- Related Posts is a plugin will add related posts thumbnails after the post. This Related Posts Plugin allows to customize thumbnail sizes, display settings and type of relation.
14
 
15
  By default it uses generated by Wordpress thumbnail for the first image appeared in the post, that was uploaded on the server with sizes as set in Media settings. You can select between 'thumbnail' and 'medium' size options. In addition if your theme supports Post Thumbnails feature introduced in Wordpress 2.9 you can specify custom thumbnail size. You can also specify post custom field name to be used as thumbnails source.
16
 
@@ -20,7 +20,7 @@ You can specify number of related posts to display, start date, categories to sh
20
 
21
  Contributions:
22
 
23
- * Thanks to <a href="http://adnan.pk/">Adnan</a> for giving life to this plugin.
24
 
25
  Translations:
26
 
@@ -33,14 +33,14 @@ Translations:
33
 
34
  Related Links:
35
 
36
- * <a href="http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/" title="Related Posts Thumbnails Plugin for WordPress">Plugin Homepage</a> - see possible problems and solutions
37
- * <a href="http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/" title="New in WordPress 2.9: Post Thumbnail Images - Mark on WordPress">New in WordPress 2.9: Post Thumbnail Images &laquo; Mark on WordPress</a>
38
 
39
  == Installation ==
40
 
41
  1. Extract zip in the /wp-content/plugins/ directory.
42
  1. Activate the plugin through the 'Plugins' menu in WordPress.
43
- 1. Customize plugin settings under Settings -> Related Posts Thumbs
44
 
45
  == Frequently Asked Questions ==
46
 
@@ -65,6 +65,16 @@ If there are no images of the specified size in the post, or file does not exist
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
 
 
 
 
68
  = 1.5.2 =
69
  * [BugFix] Top Text title allows h1 to h6 tags now.
70
 
@@ -84,7 +94,7 @@ If there are no images of the specified size in the post, or file does not exist
84
  * Added support of custom post types and custom taxonomies
85
  * Added multibyte strings support
86
  * Fixed a bug with double quotes in title
87
- * Fixed a bug with stripping shortcodes
88
  * Added Indonesian translation
89
 
90
  = 1.2.9 =
@@ -105,10 +115,10 @@ If there are no images of the specified size in the post, or file does not exist
105
  = 1.2.6 =
106
  * Fixed relative custom url
107
 
108
- = 1.2.5 =
109
  * Fixed selection of categories on plugin settings page
110
 
111
- = 1.2.4 =
112
  * French version updated
113
 
114
  = 1.2.3 =
@@ -145,15 +155,15 @@ If there are no images of the specified size in the post, or file does not exist
145
  * removed PHP warnings for getimagesize and file if wrong header was received
146
  * fixed Categories and Tags confusion (when you selected Categories relation was based on Tags and vice versa)
147
  * added Categories option to select specific categories
148
- * added post custom field name option as a source for thumbnails
149
 
150
  = 1.0 =
151
  * Released plugin initial version
152
 
153
  == Upgrade Notice ==
154
 
155
- = 1.5.2 =
156
- * [BugFix] Top Text title allows h1 to h6 tags now.
157
 
158
  = 1.5.1 =
159
 
@@ -168,7 +178,7 @@ Added support of custom types and taxonomies, fixed double quotes and shortcodes
168
  = 1.2.9 =
169
  Fixed bug when not all categories selected and tags only, removed image file existence check
170
 
171
- = 1.2.8 =
172
  Fixed bug with only one post in category, accept quotes in font family, Turkish and German versions
173
 
174
  = 1.2.7 =
@@ -177,7 +187,7 @@ Added clean HTML option without plugin CSS, fixed background color change
177
  = 1.2.6 =
178
  Fixed relative custom URL
179
 
180
- = 1.2.5 =
181
  Fixed selection of categories on plugin settings page
182
 
183
  = 1.2.4 =
@@ -196,10 +206,10 @@ French version included, generation of excerpt, developer mode.
196
  This version supports php tag, title and excerpt length, sidebar widget.
197
 
198
  = 1.1.1 =
199
- This version includes elimination of warning on settings page some may experience, plus full html support in top text field.
200
 
201
  = 1.1 =
202
- This version includes categories/tags confusion in settings, elimination of warnings in case of wrong headers, new features - Categories and custom field support.
203
 
204
  = 1.0 =
205
  The first released version
1
+ === Related Posts Thumbnails Plugin for WordPress ===
2
+ Contributors: marynixie, hiddenpearls, WPBrigade
3
  Donate link: http://wordpress.shaldybina.com/donate
4
  Tags: related, posts, thumbnails, Related Content, related posts, pages, similar posts, shortcodes, widgets, related thumbs
5
  Requires at least: 2.9
6
+ Tested up to: 4.8
7
+ Stable tag: 1.6.0
8
 
9
+ Related Posts by WPBrigade is The Best Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
11
  == Description ==
12
 
13
+ **[Related Posts by WPBrigade](https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=readme&utm_campaign=pro-upgrade-rp)** will add related posts thumbnails after the post. This Related Posts Plugin allows to customize thumbnail sizes, display settings and type of relation.
14
 
15
  By default it uses generated by Wordpress thumbnail for the first image appeared in the post, that was uploaded on the server with sizes as set in Media settings. You can select between 'thumbnail' and 'medium' size options. In addition if your theme supports Post Thumbnails feature introduced in Wordpress 2.9 you can specify custom thumbnail size. You can also specify post custom field name to be used as thumbnails source.
16
 
20
 
21
  Contributions:
22
 
23
+ * Thanks to <a href="http://adnan.pk/?utm_source=related-posts-lite&utm_medium=readme&utm_campaign=xp">Adnan</a> for giving life to this plugin.
24
 
25
  Translations:
26
 
33
 
34
  Related Links:
35
 
36
+ * <a href="https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=readme&utm_campaign=pro-upgrade-rp" title="Related Posts Thumbnails Plugin for WordPress">Plugin Homepage</a> - see possible problems and solutions.
37
+ * <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=related-posts-lite&utm_medium=readme&utm_campaign=pro-upgrade" title="Rebrand your WordPress login page with LoginPress">Rebrand your WordPress login page with LoginPress</a>
38
 
39
  == Installation ==
40
 
41
  1. Extract zip in the /wp-content/plugins/ directory.
42
  1. Activate the plugin through the 'Plugins' menu in WordPress.
43
+ 1. Customize plugin settings at menu Related Posts. Find it at the left bottom of the side menu in wp-admin.
44
 
45
  == Frequently Asked Questions ==
46
 
65
 
66
  == Changelog ==
67
 
68
+ = 1.6.0 =
69
+ * Compatible with 4.8
70
+ * Multiple bugfixes
71
+
72
+ = 1.5.4 =
73
+ * Fixed Category Settings bug.
74
+
75
+ = 1.5.3 =
76
+ * [BugFix] Improved.
77
+
78
  = 1.5.2 =
79
  * [BugFix] Top Text title allows h1 to h6 tags now.
80
 
94
  * Added support of custom post types and custom taxonomies
95
  * Added multibyte strings support
96
  * Fixed a bug with double quotes in title
97
+ * Fixed a bug with stripping shortcodes
98
  * Added Indonesian translation
99
 
100
  = 1.2.9 =
115
  = 1.2.6 =
116
  * Fixed relative custom url
117
 
118
+ = 1.2.5 =
119
  * Fixed selection of categories on plugin settings page
120
 
121
+ = 1.2.4 =
122
  * French version updated
123
 
124
  = 1.2.3 =
155
  * removed PHP warnings for getimagesize and file if wrong header was received
156
  * fixed Categories and Tags confusion (when you selected Categories relation was based on Tags and vice versa)
157
  * added Categories option to select specific categories
158
+ * added post custom field name option as a source for thumbnails
159
 
160
  = 1.0 =
161
  * Released plugin initial version
162
 
163
  == Upgrade Notice ==
164
 
165
+ = 1.6.0 =
166
+ * Upgrade immediately - Multiple bugfixes and compatible with 4.8
167
 
168
  = 1.5.1 =
169
 
178
  = 1.2.9 =
179
  Fixed bug when not all categories selected and tags only, removed image file existence check
180
 
181
+ = 1.2.8 =
182
  Fixed bug with only one post in category, accept quotes in font family, Turkish and German versions
183
 
184
  = 1.2.7 =
187
  = 1.2.6 =
188
  Fixed relative custom URL
189
 
190
+ = 1.2.5 =
191
  Fixed selection of categories on plugin settings page
192
 
193
  = 1.2.4 =
206
  This version supports php tag, title and excerpt length, sidebar widget.
207
 
208
  = 1.1.1 =
209
+ This version includes elimination of warning on settings page some may experience, plus full html support in top text field.
210
 
211
  = 1.1 =
212
+ This version includes categories/tags confusion in settings, elimination of warnings in case of wrong headers, new features - Categories and custom field support.
213
 
214
  = 1.0 =
215
  The first released version
related-posts-thumbnails.php CHANGED
@@ -1,15 +1,17 @@
1
  <?php
2
  /**
3
- * Plugin Name: Related Posts Thumbnails
4
- * Plugin URI: http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/
5
- * Description: Showing related posts thumbnails under the post.
6
- * Version: 1.5.2
7
- * Author: Maria Shaldybina
8
- * Author URI: http://shaldybina.com/
9
  */
10
 
11
  /*
12
- Copyright 2010 Maria I Shaldybina
 
 
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
@@ -48,7 +50,7 @@ class RelatedPostsThumbnails {
48
  var $post_types = array( 'post' );
49
  var $custom_taxonomies = array();
50
 
51
- protected $wp_kses_rp_args = array(
52
 
53
  'h1' => array(),
54
  'h2' => array(),
@@ -76,6 +78,72 @@ class RelatedPostsThumbnails {
76
  add_shortcode( 'related-posts-thumbnails' , array( $this, 'get_html' ) );
77
 
78
  $this->wp_version = get_bloginfo( 'version' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
 
81
  /**
@@ -454,7 +522,7 @@ class RelatedPostsThumbnails {
454
  }
455
 
456
  function admin_menu() {
457
- $page = add_options_page( __( 'Related Posts Thumbnails', 'related-posts-thumbnails' ), __( 'Related Posts Thumbs', 'related-posts-thumbnails' ), 'administrator', 'related-posts-thumbnails', array( $this, 'admin_interface' ) );
458
  }
459
 
460
  function admin_interface() {
@@ -546,7 +614,7 @@ class RelatedPostsThumbnails {
546
 
547
  if( isset( $_POST['relpoststh_fontcolor'] ) ) {
548
  update_option( 'relpoststh_fontcolor', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontcolor'] ) ) );
549
- }
550
 
551
  if( isset( $_POST['relpoststh_fontsize'] ) ) {
552
  update_option( 'relpoststh_fontsize', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontsize'] ) ) );
@@ -554,7 +622,7 @@ class RelatedPostsThumbnails {
554
 
555
  if( isset( $_POST['relpoststh_fontfamily'] ) ) {
556
  update_option( 'relpoststh_fontfamily', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontfamily'] ) ) );
557
- }
558
 
559
  if( isset( $_POST['relpoststh_textlength'] ) ) {
560
  update_option( 'relpoststh_textlength', sanitize_text_field( wp_unslash( $_POST['relpoststh_textlength'] ) ) );
@@ -574,7 +642,7 @@ class RelatedPostsThumbnails {
574
 
575
  if( isset( $_POST['relpoststh_theme_resize_url'] ) ) {
576
  update_option( 'relpoststh_theme_resize_url', sanitize_text_field( wp_unslash( $_POST['relpoststh_theme_resize_url'] ) ) );
577
- }
578
 
579
  if( isset( $_POST['relpoststh_customwidth'] ) ) {
580
  update_option( 'relpoststh_customwidth', sanitize_text_field( wp_unslash( $_POST['relpoststh_customwidth'] ) ) );
@@ -582,7 +650,7 @@ class RelatedPostsThumbnails {
582
 
583
  if( isset( $_POST['relpoststh_customheight'] ) ) {
584
  update_option( 'relpoststh_customheight', sanitize_text_field( wp_unslash( $_POST['relpoststh_customheight'] ) ) );
585
- }
586
 
587
  if( isset( $_POST['relpoststh_textblockheight'] ) ) {
588
  update_option( 'relpoststh_textblockheight', sanitize_text_field( wp_unslash( $_POST['relpoststh_textblockheight'] ) ) );
@@ -590,7 +658,7 @@ class RelatedPostsThumbnails {
590
 
591
  if( isset( $_POST['relpoststh_customwidth'] ) ) {
592
  update_option( 'relpoststh_customwidth', sanitize_text_field( wp_unslash( $_POST['relpoststh_customwidth'] ) ) );
593
- }
594
 
595
  if( isset( $_POST['relpoststh_categories'] ) ) {
596
  update_option( 'relpoststh_categories', array_map( 'sanitize_text_field', wp_unslash( $_POST['relpoststh_categories'] ) ) );
@@ -600,10 +668,14 @@ class RelatedPostsThumbnails {
600
 
601
  if( isset( $_POST['relpoststh_categoriesall'] ) ) {
602
  update_option( 'relpoststh_categoriesall', sanitize_text_field( wp_unslash( $_POST['relpoststh_categoriesall'] ) ) );
 
 
603
  }
604
 
605
  if( isset( $_POST['relpoststh_show_categoriesall'] ) ) {
606
  update_option( 'relpoststh_show_categoriesall', sanitize_text_field( wp_unslash( $_POST['relpoststh_show_categoriesall'] ) ) );
 
 
607
  }
608
 
609
  if( isset( $_POST['relpoststh_show_categories'] ) ) {
@@ -709,7 +781,7 @@ class RelatedPostsThumbnails {
709
  $('#content_thumbnail_options').hide();
710
  $('#content_relation_options').hide();
711
 
712
- });
713
 
714
 
715
  $('#wpbr_rpt_thumbnails_source').on('click', function(){
@@ -722,10 +794,10 @@ class RelatedPostsThumbnails {
722
  $('#content_thumbnail_options').show();
723
  $('#content_relation_options').hide();
724
 
725
- });
 
726
 
727
 
728
-
729
 
730
  $(".select_all").click(function(){
731
  if (this.checked) {
@@ -761,9 +833,46 @@ class RelatedPostsThumbnails {
761
  $('#custom_taxonomies').hide();
762
  }
763
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
  });
765
  </script>
766
  <style>
 
 
 
 
 
 
767
  #relpoststh-settings .nav-tab-wrapper li a {
768
  float: none;
769
  margin:0;
@@ -790,7 +899,7 @@ class RelatedPostsThumbnails {
790
  }
791
 
792
  .relpoststh .wpbr-tabsWrapper{
793
- width: calc(100% - 250px);
794
  float: left;
795
  }
796
  #relpoststh-settings .nav-tab-wrapper{
@@ -825,7 +934,7 @@ class RelatedPostsThumbnails {
825
  padding: 10px;
826
  }
827
  .relpoststh .wpbr-sidebar{
828
- width: 235px;
829
  float: right;
830
  min-width: inherit;
831
  box-sizing: border-box;
@@ -921,7 +1030,28 @@ class RelatedPostsThumbnails {
921
  box-sizing: border-box;
922
  display: none;
923
  }
924
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  </style>
926
  <div class="wrap relpoststh">
927
  <div class="icon32" id="icon-options-general"><br></div>
@@ -938,7 +1068,7 @@ class RelatedPostsThumbnails {
938
  </div>
939
  <input type="submit" name="Submit" class="wpbrmedia-settings-submit button button-primary button-big" value="<?php esc_html_e( 'Save Settings','related-posts-thumbnails' );?>" id="wpbr_save_setting_top">
940
  </div>
941
-
942
  <div id="relpoststh-settings" class="">
943
  <ul class="nav-tab-wrapper">
944
  <li> <a href="#nogo" class="nav-tab nav-tab-active" id="wpbr_rpt_general_options">General Display Options</a> </li>
@@ -1192,7 +1322,7 @@ class RelatedPostsThumbnails {
1192
 
1193
  <div class="wpbr-button-container bottom">
1194
  <div class="wpbr-social-links alignleft">
1195
- <a href="https://profiles.wordpress.org/marynixie/" class="wordpress" target="_blank"><span class="dashicons dashicons-wordpress"></span></a>
1196
  </div>
1197
  <input type="submit" name="Submit" class="wpbrmedia-settings-submit button button-primary button-big" value="<?php esc_html_e( 'Save Settings','related-posts-thumbnails' ); ?>" id="wpbr_save_setting_bottom">
1198
  </div>
@@ -1217,11 +1347,55 @@ class RelatedPostsThumbnails {
1217
  </li>
1218
  </ul>
1219
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1220
  </div>
1221
 
1222
  </div>
1223
  </form>
1224
- <p style="margin-top: 40px;"><small><?php _e( 'If you experience some problems with this plugin please let me know about it on <a href="http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/">Plugin\'s homepage</a>. If you think this plugin is awesome please vote on <a href="http://wordpress.org/extend/plugins/related-posts-thumbnails/">Wordpress plugin page</a>. Thanks!', 'related-posts-thumbnails' ); ?></small></p>
1225
  <?php
1226
  }
1227
 
@@ -1255,7 +1429,7 @@ function get_related_posts_thumbnails() {
1255
  * Related Posts Widget, will be displayed on post page
1256
  */
1257
  class RelatedPostsThumbnailsWidget extends WP_Widget {
1258
-
1259
  function __construct() {
1260
  parent::__construct( false, $name = 'Related Posts Thumbnails' );
1261
  }
1
  <?php
2
  /**
3
+ * Plugin Name: WordPress Related Posts Thumbnails
4
+ * Plugin URI: https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=plugin-uri&utm_campaign=pro-upgrade-rp
5
+ * Description: Showing related posts thumbnails under the posts.
6
+ * Version: 1.6.0
7
+ * Author: WPBrigade
8
+ * Author URI: https://WPBrigade.com/?utm_source=related-posts-lite&utm_medium=author-link&utm_campaign=pro-upgrade-rp
9
  */
10
 
11
  /*
12
+ Copyright 2010 to 2017
13
+
14
+ This product was first developed by Maria I Shaldybina and later on maintained by Adnan (WPBrigade)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
50
  var $post_types = array( 'post' );
51
  var $custom_taxonomies = array();
52
 
53
+ protected $wp_kses_rp_args = array(
54
 
55
  'h1' => array(),
56
  'h2' => array(),
78
  add_shortcode( 'related-posts-thumbnails' , array( $this, 'get_html' ) );
79
 
80
  $this->wp_version = get_bloginfo( 'version' );
81
+
82
+ add_action( 'wp_ajax_relpost_subscriber', array( $this, 'relpost_subscriber' ) );
83
+ }
84
+
85
+ function relpost_subscriber() {
86
+ $email = sanitize_email( wp_unslash( $_POST['subscriber_mail'] ) );
87
+ $display_name = sanitize_text_field( wp_unslash( $_POST['name'] ) );
88
+
89
+
90
+ $data = array(
91
+ 'email_address' => $email,
92
+ "status_if_new" => "pending",
93
+ // 'status' => 'pending', // "subscribed","unsubscribed","cleaned","pending"
94
+ 'merge_fields' => array(
95
+ 'FNAME' => $display_name
96
+ ),
97
+ 'interests' => array(
98
+ '5f0e7578b3' => true, // add interest ? loginPress => d91a783713 || Related Posts Thumbnails => 1c85722a4b || Newsletter Subscribers => 3eefb18f62
99
+ )
100
+ );
101
+
102
+
103
+ $apiKey = '7f32f907a2e6ceeaf8a97fc00b962b2b-us15';
104
+ $listId = '30d28e0fc3';
105
+
106
+ $memberId = md5( strtolower( $data['email_address'] ) );
107
+ $dataCenter = substr( $apiKey , strpos( $apiKey,'-' ) + 1 );
108
+
109
+
110
+ $url = 'https://' . $dataCenter . '.api.mailchimp.com/3.0/lists/' . $listId .'/members/' . $memberId;
111
+
112
+ // 2d13665c08ff83f22de7cc7da216db12
113
+ $json = json_encode( $data );
114
+
115
+ $ch = curl_init( $url );
116
+
117
+ curl_setopt( $ch, CURLOPT_USERPWD, 'user:' . $apiKey );
118
+ curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' ) );
119
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
120
+ curl_setopt( $ch, CURLOPT_TIMEOUT, 10 );
121
+ curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT' );
122
+ curl_setopt( $ch, CURLOPT_POST, true );
123
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
124
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $json );
125
+
126
+ curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)' );
127
+
128
+ $result = curl_exec( $ch );
129
+
130
+ if( $request_type == 'GET' ){
131
+ $result_array = json_decode ( $result , true );
132
+ $status = $result_array['status'];
133
+ return $status;
134
+ }
135
+ // var_dump($result);
136
+ // var_dump( curl_getinfo( $ch ) );
137
+
138
+ $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
139
+
140
+ curl_close( $ch );
141
+ if ( 200 == $httpCode ) {
142
+ echo "Thank you!";
143
+ } else {
144
+ echo "oops! Please try again later.";
145
+ }
146
+ wp_die();
147
  }
148
 
149
  /**
522
  }
523
 
524
  function admin_menu() {
525
+ $page = add_menu_page( __( 'Related Posts Thumbnails', 'related-posts-thumbnails' ), __( 'Related Posts', 'related-posts-thumbnails' ), 'administrator', 'related-posts-thumbnails', array( $this, 'admin_interface' ) );
526
  }
527
 
528
  function admin_interface() {
614
 
615
  if( isset( $_POST['relpoststh_fontcolor'] ) ) {
616
  update_option( 'relpoststh_fontcolor', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontcolor'] ) ) );
617
+ }
618
 
619
  if( isset( $_POST['relpoststh_fontsize'] ) ) {
620
  update_option( 'relpoststh_fontsize', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontsize'] ) ) );
622
 
623
  if( isset( $_POST['relpoststh_fontfamily'] ) ) {
624
  update_option( 'relpoststh_fontfamily', sanitize_text_field( wp_unslash( $_POST['relpoststh_fontfamily'] ) ) );
625
+ }
626
 
627
  if( isset( $_POST['relpoststh_textlength'] ) ) {
628
  update_option( 'relpoststh_textlength', sanitize_text_field( wp_unslash( $_POST['relpoststh_textlength'] ) ) );
642
 
643
  if( isset( $_POST['relpoststh_theme_resize_url'] ) ) {
644
  update_option( 'relpoststh_theme_resize_url', sanitize_text_field( wp_unslash( $_POST['relpoststh_theme_resize_url'] ) ) );
645
+ }
646
 
647
  if( isset( $_POST['relpoststh_customwidth'] ) ) {
648
  update_option( 'relpoststh_customwidth', sanitize_text_field( wp_unslash( $_POST['relpoststh_customwidth'] ) ) );
650
 
651
  if( isset( $_POST['relpoststh_customheight'] ) ) {
652
  update_option( 'relpoststh_customheight', sanitize_text_field( wp_unslash( $_POST['relpoststh_customheight'] ) ) );
653
+ }
654
 
655
  if( isset( $_POST['relpoststh_textblockheight'] ) ) {
656
  update_option( 'relpoststh_textblockheight', sanitize_text_field( wp_unslash( $_POST['relpoststh_textblockheight'] ) ) );
658
 
659
  if( isset( $_POST['relpoststh_customwidth'] ) ) {
660
  update_option( 'relpoststh_customwidth', sanitize_text_field( wp_unslash( $_POST['relpoststh_customwidth'] ) ) );
661
+ }
662
 
663
  if( isset( $_POST['relpoststh_categories'] ) ) {
664
  update_option( 'relpoststh_categories', array_map( 'sanitize_text_field', wp_unslash( $_POST['relpoststh_categories'] ) ) );
668
 
669
  if( isset( $_POST['relpoststh_categoriesall'] ) ) {
670
  update_option( 'relpoststh_categoriesall', sanitize_text_field( wp_unslash( $_POST['relpoststh_categoriesall'] ) ) );
671
+ } else {
672
+ update_option( 'relpoststh_categoriesall', '' );
673
  }
674
 
675
  if( isset( $_POST['relpoststh_show_categoriesall'] ) ) {
676
  update_option( 'relpoststh_show_categoriesall', sanitize_text_field( wp_unslash( $_POST['relpoststh_show_categoriesall'] ) ) );
677
+ } else {
678
+ update_option( 'relpoststh_show_categoriesall', '' );
679
  }
680
 
681
  if( isset( $_POST['relpoststh_show_categories'] ) ) {
781
  $('#content_thumbnail_options').hide();
782
  $('#content_relation_options').hide();
783
 
784
+ });
785
 
786
 
787
  $('#wpbr_rpt_thumbnails_source').on('click', function(){
794
  $('#content_thumbnail_options').show();
795
  $('#content_relation_options').hide();
796
 
797
+ });
798
+
799
 
800
 
 
801
 
802
  $(".select_all").click(function(){
803
  if (this.checked) {
833
  $('#custom_taxonomies').hide();
834
  }
835
  });
836
+
837
+ // Ajax for subsriber
838
+ $('#rpt_subscribe_btn').on('click', function(event) {
839
+ event.preventDefault();
840
+
841
+ var subscriber_mail = $('#rpt_subscribe_mail').val();
842
+ var name = $('#rpt_subscribe_name').val();
843
+ if (!subscriber_mail) {
844
+ $('.rpt_subscribe_warning').html('Please Enter Email');
845
+ return;
846
+ }
847
+
848
+ $.ajax({
849
+ url: ajaxurl,
850
+ type: 'POST',
851
+ data: {
852
+ subscriber_mail : subscriber_mail,
853
+ action : 'relpost_subscriber',
854
+ name : name
855
+ },
856
+ beforeSend : function() {
857
+ $('.rpt_subscribe_loader').show();
858
+ $('#rpt_subscribe_btn').attr('disabled', 'disabled');
859
+ }
860
+ })
861
+ .done(function(res) {
862
+ $('.rpt_return_message').html(res);
863
+ $('.rpt_subscribe_loader').hide();
864
+ });
865
+
866
+ });
867
  });
868
  </script>
869
  <style>
870
+
871
+ #rpt_subscribe_btn{
872
+ display: block;
873
+ margin: 20px auto 0;
874
+ }
875
+
876
  #relpoststh-settings .nav-tab-wrapper li a {
877
  float: none;
878
  margin:0;
899
  }
900
 
901
  .relpoststh .wpbr-tabsWrapper{
902
+ width: calc(100% - 265px);
903
  float: left;
904
  }
905
  #relpoststh-settings .nav-tab-wrapper{
934
  padding: 10px;
935
  }
936
  .relpoststh .wpbr-sidebar{
937
+ width: 255px;
938
  float: right;
939
  min-width: inherit;
940
  box-sizing: border-box;
1030
  box-sizing: border-box;
1031
  display: none;
1032
  }
1033
+ #relpoststh-settings .postbox{
1034
+ border: 0px solid #e5e5e5;
1035
+ -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.0);
1036
+ box-shadow: 0 1px 1px rgba(0,0,0,.0);
1037
+ }
1038
+ #relpoststh-settings .nav-tab-wrapper{
1039
+ padding-top: 0;
1040
+ border-bottom: 0px solid #ccc;
1041
+ border-right: 1px solid #ccc;
1042
+ }
1043
+ #relpoststh-settings .nav-tab-wrapper li a.nav-tab-active{
1044
+ margin: 0 -1px 0 0;
1045
+ outline: none;
1046
+ box-shadow: none;
1047
+ }
1048
+ #relpoststh-settings .nav-tab-wrapper .nav-tab{
1049
+ border-right: 0;
1050
+ }
1051
+ .plugins_lists li{
1052
+ padding-bottom: 12px;
1053
+ line-height: 1.4;
1054
+ }
1055
  </style>
1056
  <div class="wrap relpoststh">
1057
  <div class="icon32" id="icon-options-general"><br></div>
1068
  </div>
1069
  <input type="submit" name="Submit" class="wpbrmedia-settings-submit button button-primary button-big" value="<?php esc_html_e( 'Save Settings','related-posts-thumbnails' );?>" id="wpbr_save_setting_top">
1070
  </div>
1071
+
1072
  <div id="relpoststh-settings" class="">
1073
  <ul class="nav-tab-wrapper">
1074
  <li> <a href="#nogo" class="nav-tab nav-tab-active" id="wpbr_rpt_general_options">General Display Options</a> </li>
1322
 
1323
  <div class="wpbr-button-container bottom">
1324
  <div class="wpbr-social-links alignleft">
1325
+ <a href="https://profiles.wordpress.org/hiddenpearls/" class="wordpress" target="_blank"><span class="dashicons dashicons-wordpress"></span></a>
1326
  </div>
1327
  <input type="submit" name="Submit" class="wpbrmedia-settings-submit button button-primary button-big" value="<?php esc_html_e( 'Save Settings','related-posts-thumbnails' ); ?>" id="wpbr_save_setting_bottom">
1328
  </div>
1347
  </li>
1348
  </ul>
1349
  </div>
1350
+ <form>
1351
+
1352
+ <div class="sidebar postbox">
1353
+
1354
+ <h2><?php esc_html_e( 'Subscribe Newsletter' , 'related-posts-thumbnails' )?></h2>
1355
+ <ul>
1356
+ <li>
1357
+ <label for="">Email</label>
1358
+ <input type="email" name="subscriber_mail" value="<?php echo get_option( 'admin_email' ) ?>" id="rpt_subscribe_mail">
1359
+ <p class='rpt_subscribe_warning'></p>
1360
+ </li>
1361
+ <li>
1362
+ <label for="">Name</label>
1363
+ <input type="text" name="subscriber_name" id="rpt_subscribe_name" value="<?php echo wp_get_current_user()->display_name ?>" id="rpt_subscribe_mail">
1364
+ </li>
1365
+ <li>
1366
+ <input type="submit" value="Subscribe Now" class="button button-primary button-big" id='rpt_subscribe_btn' />
1367
+ <img src="<?php echo admin_url( 'images/spinner.gif' ) ?>" class='rpt_subscribe_loader' style="display:none" />
1368
+ </li>
1369
+ <li>
1370
+ <p class='rpt_return_message'></p>
1371
+ </li>
1372
+ </ul>
1373
+ </div>
1374
+
1375
+ <div class="sidebar postbox">
1376
+ <h2><?php esc_html_e( 'Recommended Plugins' , 'related-posts-thumbnails' )?></h2>
1377
+ <!-- <p>Following are the plugins highly recommend by Team WPBrigade.</p> -->
1378
+ <ul class="plugins_lists">
1379
+ <li>
1380
+ <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=related-posts-lite&utm_medium=sidebar&utm_campaign=pro-upgrade" data-count="none" target="_blank" title="Post to Twitter Now"><?php esc_html_e( 'LoginPress - Login Customizer' , 'related-posts-thumbnails' )?></a>
1381
+ </li>
1382
+
1383
+ <li>
1384
+ <a href="https://analytify.io/ref/73/?utm_source=related-posts-lite&utm_medium=sidebar&utm_campaign=pro-upgrade" target="_blank" title="Share with your facebook friends about this awesome plugin."><?php esc_html_e( 'Google Analytics by Analytify' , 'related-posts-thumbnails' )?></span>
1385
+ </a>
1386
+ </li>
1387
+
1388
+ <li>
1389
+ <a href="http://wpbrigade.com/recommend/maintenance-mode" target="_blank" title="Under Construction & Maintenance mode"><?php esc_html_e( 'Under Construction & Maintenance mode' , 'related-posts-thumbnails' )?></span>
1390
+ </a>
1391
+ </li>
1392
+ </ul>
1393
+ </div>
1394
  </div>
1395
 
1396
  </div>
1397
  </form>
1398
+ <p style="margin-top: 40px;"><small><?php _e( 'If you experience some problems with this plugin please let me know about it on <a target="_blank" href="https://wpbrigade.com/wordpress/plugins/related-posts/">Plugin\'s homepage</a>. If you think this plugin is awesome please vote on <a target="_blank" href="https://wordpress.org/plugins/related-posts-thumbnails/">Wordpress plugin page</a>. Thanks!', 'related-posts-thumbnails' ); ?></small></p>
1399
  <?php
1400
  }
1401
 
1429
  * Related Posts Widget, will be displayed on post page
1430
  */
1431
  class RelatedPostsThumbnailsWidget extends WP_Widget {
1432
+
1433
  function __construct() {
1434
  parent::__construct( false, $name = 'Related Posts Thumbnails' );
1435
  }