Platinum SEO Pack - Version 2.2.6

Version Description

2020-12-20 - The plugin now has an Export/Import Utility to export Platinum SEO Options (Sitewide Settings) and platinum SEO Meta Data (of all Post types). You may find this utility in Platinum SEO and social Pack -> Tools.

Download this release

Release Info

Developer Rajesh Babu
Plugin Icon 128x128 Platinum SEO Pack
Version 2.2.6
Comparing to
See all releases

Code changes from version 2.2.5 to 2.2.6

Changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  = 2.2.5 =
2
  2020-12-04 - Resolved the authorization error thrown for roles other than Admin, like Editor role etc. while trying to access a POST to which the Role has not been assigned access to Platinum SEO Metabox in role Manager.
3
 
1
+ = 2.2.6 =
2
+ 2020-12-20 - The plugin now has an Export/Import Utility to export Platinum SEO Options (Sitewide Settings) and platinum SEO Meta Data (of all Post types). You may find this utility in Platinum SEO and social Pack -> Tools.
3
+
4
  = 2.2.5 =
5
  2020-12-04 - Resolved the authorization error thrown for roles other than Admin, like Editor role etc. while trying to access a POST to which the Role has not been assigned access to Platinum SEO Metabox in role Manager.
6
 
platinum-seo-pack.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Platinum SEO Pack
5
  Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
  Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
- Version: 2.2.5
8
  Author: Techblissonline.com (Rajesh)
9
  Author URI: https://techblissonline.com/
10
  Text Domain: platinum-seo-pack
4
  Plugin Name: Platinum SEO Pack
5
  Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
  Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
+ Version: 2.2.6
8
  Author: Techblissonline.com (Rajesh)
9
  Author URI: https://techblissonline.com/
10
  Text Domain: platinum-seo-pack
psp-include/settings/psp_tools_renderer.php CHANGED
@@ -8,17 +8,259 @@ Author: Rajesh - Techblissonline
8
  Author URI: https://techblissonline.com/
9
  */
10
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <div id="logo" class="container-fluid" style="width:90%">
12
  <div class="row m-2 p-1"><div class="h3 col-sm-12">
13
  <a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-logo.png'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO Wordpress Tools"/></a></div></div>
14
  </div><!-- end of #logo -->
15
  <div class="clearfix"></div>
 
16
  <div class="container bg-info" id="header" style="width:90%">
17
- <h1 class="btn-success"> Tools </h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  </div>
19
  <div class="clearfix"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  <div class="container bg-success" id="header" style="width:90%">
21
- <p> These are premium tools available as SaaS on Techblissonline.com. You can subscribe to them for just 9$ Google NLP Entity Analyser is available for subscribers who pay 14$. You also get to download Platinum SEO Premium for free, if you buy this subscription for one month. Subscribe <a href="https://techblissonline.com/tools/" target="_blank">here</a></p>
 
22
  </div>
23
  <div class="clearfix"></div>
24
  <div class="container-fluid bg-info form-group" id="tools" style="width:90%">
8
  Author URI: https://techblissonline.com/
9
  */
10
  ?>
11
+ <style>.vertical-align {
12
+ display: flex;
13
+ align-items: center;
14
+ }</style>
15
+ <?php
16
+ do {
17
+ if ($_FILES) {
18
+
19
+ $psp_meta_file_uploaded = false;
20
+ $psp_options_file_uploaded = false;
21
+ if( isset($_FILES['pspmetafile']) && strpos( $_FILES['pspmetafile']['name'], 'platinumseometa' ) !== false) {
22
+
23
+ if (!isset( $_POST['psp_import_meta_nonce'] ) || !wp_verify_nonce( sanitize_key($_POST['psp_import_meta_nonce']), 'do_psp_importmeta_action' )) {
24
+
25
+ //raise error;
26
+ $message = esc_html__( 'The nonce key does not exist or validate. Import of Meta Data Failed!' , 'platinum-seo-pack');
27
+ add_settings_error('psp_tools_renderer', 'nonce_error', esc_html($message), 'error');
28
+ break;
29
+ }
30
+ $psp_meta_file_uploaded = 'pspmetafile';
31
+
32
+ }
33
+ if( isset($_FILES['optionsfile']) && strpos( $_FILES['optionsfile']['name'], 'platinumseooptions' ) !== false) {
34
+
35
+ if (!isset( $_POST['psp_import_options_nonce'] ) || !wp_verify_nonce( sanitize_key($_POST['psp_import_options_nonce']), 'do_psp_importoptions_action' )) {
36
+
37
+ //raise error;
38
+ $message = esc_html__( 'The nonce key does not exist or validate. Import of Options Data Failed!' , 'platinum-seo-pack');
39
+ add_settings_error('psp_tools_renderer', 'nonce_error', esc_html($message), 'error');
40
+ break;
41
+ }
42
+ $psp_options_file_uploaded = 'optionsfile';
43
+
44
+ }
45
+
46
+ $options_file_type = [];
47
+ if ($psp_options_file_uploaded) {
48
+ $options_file_type = wp_check_filetype($_FILES['optionsfile']['name']);
49
+ } else if ($psp_meta_file_uploaded) {
50
+ $options_file_type = wp_check_filetype($_FILES['pspmetafile']['name']);
51
+ } else {
52
+ //raise error;
53
+ $message = esc_html__( 'The file you are trying to upload should have the same name and be of the same type as the exported file. Import Failed!' , 'platinum-seo-pack');
54
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html($message), 'error');
55
+ break;
56
+ }
57
+ if ( empty($options_file_type ) ) {
58
+ //raise error;
59
+ $message = esc_html__( 'The file extension is not csv. Import Failed!' , 'platinum-seo-pack');
60
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html($message), 'error');
61
+ break;
62
+ }
63
+ if (!empty($options_file_type ) && $options_file_type['ext'] !== 'csv' ) {
64
+ //raise error;
65
+ $message = esc_html__( 'The file extension is not csv. Import Failed!' , 'platinum-seo-pack');
66
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html($message), 'error');
67
+ break;
68
+ }
69
+
70
+ // Accepted file types
71
+ $csv_file_types = array('text/csv', 'text/plain', 'application/csv', 'application/vnd.ms-excel');
72
+
73
+ if ( isset($options_file_type['type'] ) && !in_array($options_file_type['type'], $csv_file_types )){
74
+
75
+ //raise error;
76
+ $message = esc_html__( 'The file type is not csv. Import Failed!', 'platinum-seo-pack');
77
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html($message), 'error');
78
+ break;
79
+
80
+ }
81
+ global $wp_filesystem;
82
+ if (!function_exists('wp_handle_upload')) {
83
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
84
+ if ( empty( $wp_filesystem ) ) {
85
+ WP_Filesystem();
86
+ }
87
+ }
88
+
89
+ $file = [];
90
+
91
+ if ($psp_options_file_uploaded) {
92
+
93
+ $file = wp_handle_upload( $_FILES['optionsfile'] );
94
+ } else if ($psp_meta_file_uploaded) {
95
+
96
+ $file = wp_handle_upload( $_FILES['pspmetafile'] );
97
+
98
+ }
99
+
100
+ if ( !empty($file) && ( !file_exists($file['file']) || !is_readable($file['file']))) {
101
+ $message = esc_html__( 'There no csv file to upload or the file is not readable.Import Failed!' , 'platinum-seo-pack');
102
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html( $message), 'error');
103
+ break;
104
+ }
105
+ if ( is_wp_error( $file ) ) {
106
+ $message = esc_html__( 'There was a WP Error. Import Failed!' , 'platinum-seo-pack');
107
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html( $message. ' '. $file['error']), 'error');
108
+ break;
109
+ }
110
+
111
+ if ( isset( $file['error'] ) ) {
112
+ $message = esc_html__( 'Import Failed!' , 'platinum-seo-pack');
113
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html( $message. ' '. $file['error']), 'error');
114
+ break;
115
+ }
116
+
117
+ if ( ! isset( $file['file'] ) ) {
118
+ $message = esc_html__( 'Import Failed as CSV file cannot be uploaded or is not the correct csv file!' , 'platinum-seo-pack');
119
+ add_settings_error('psp_tools_renderer', 'file_error', esc_html( $message ), 'error');
120
+ break;
121
+ }
122
+
123
+ if ( false === $file ) {
124
+ return false;
125
+ }
126
+
127
+ $pspfh = @fopen($file['file'], "r");
128
+
129
+ $psp_values = array();
130
+ $header_row = true;
131
+
132
+ global $wpdb;
133
+
134
+ if ($psp_meta_file_uploaded) {
135
+
136
+ $psp_post_seo_tbl = $wpdb->prefix . "platinumseometa";
137
+ $psp_post_tmp_seo_tbl = $wpdb->prefix . "tempmeta";
138
+
139
+ $wpdb->query("TRUNCATE TABLE {$psp_post_tmp_seo_tbl}");
140
+ $wpdb->query("Insert into {$psp_post_tmp_seo_tbl} (meta_id, post_id, meta_key, meta_value) Select meta_id, platinumseo_id, meta_key, meta_value from {$psp_post_seo_tbl}");
141
+ } else if ( $psp_options_file_uploaded ) {
142
+ $psp_options_tbl = $wpdb->prefix . "options";
143
+ }
144
+
145
+ // Assign .csv rows to array
146
+ while ( ( $row = fgetcsv( $pspfh )) !== false ) { // Get file contents
147
+ if ($header_row ) {
148
+ $header_row = false;
149
+ continue;
150
+ }
151
+
152
+ array_push($psp_values,$row[0], $row[1], $row[2], $row[3]);
153
+
154
+ if ($psp_meta_file_uploaded) {
155
+ $place_holders[] = "(%d, %d, %s, %s)";
156
+ } else if ($psp_options_file_uploaded) {
157
+ $place_holders[] = "(%d, %s, %s, %s)";
158
+ }
159
+ $row= [];
160
+ }
161
+
162
+ if ($psp_values) {
163
+
164
+ if ($psp_meta_file_uploaded) {
165
+ $psp_query = "INSERT INTO {$psp_post_seo_tbl} (meta_id, platinumseo_id, meta_key, meta_value) VALUES ";
166
+
167
+ $wpdb->query("TRUNCATE TABLE {$psp_post_seo_tbl}");
168
+ $psp_query .= implode(', ', $place_holders);
169
+ $wpdb->query( $wpdb->prepare("$psp_query", $psp_values));
170
+
171
+ $message = esc_html__( 'Platinum SEO Meta Data successfully imported!' , 'platinum-seo-pack');
172
+ add_settings_error('psp_tools_renderer', 'success', esc_html( $message), 'success');
173
+ break;
174
+ } else if ($psp_options_file_uploaded) {
175
+
176
+ $wpdb->query("DELETE FROM {$psp_options_tbl} WHERE option_name like 'psp_%'");
177
+ $psp_query = "INSERT INTO {$psp_options_tbl} (option_id, option_name, option_value, autoload) VALUES ";
178
+ $psp_query .= implode(', ', $place_holders);
179
+ $wpdb->query( $wpdb->prepare("$psp_query", $psp_values));
180
+
181
+ $message = esc_html__( 'Platinum SEO Options Data successfully imported!' , 'platinum-seo-pack');
182
+ add_settings_error('psp_tools_renderer', 'success', esc_html( $message), 'success');
183
+ break;
184
+
185
+ }
186
+ }
187
+
188
+ }
189
+ } while (0);
190
+ settings_errors( 'psp_tools_renderer' );
191
+ ?>
192
  <div id="logo" class="container-fluid" style="width:90%">
193
  <div class="row m-2 p-1"><div class="h3 col-sm-12">
194
  <a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-logo.png'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO Wordpress Tools"/></a></div></div>
195
  </div><!-- end of #logo -->
196
  <div class="clearfix"></div>
197
+
198
  <div class="container bg-info" id="header" style="width:90%">
199
+ <h2 class="btn-success"> Import Platinum SEO Data </h2>
200
+ <h4 class="col-sm-12"> Import Platinum SEO Options Data </h4>
201
+ <form action="" method="post" enctype="multipart/form-data">
202
+ <div class="form-group">
203
+ <div class="col-sm-2"><h4>Select csv File to Upload:</h4> </div>
204
+ <div class="col-sm-10">
205
+ <input type="file" class="form-control" name="optionsfile" id="optionsfile"/>
206
+ </div>
207
+ </div>
208
+ <div class="form-group">
209
+ <div class="col-sm-offset-2 col-sm-10">
210
+ <input type="hidden" value="wp_handle_upload" name="action" />
211
+ <input type="submit" value="<?php _e('Submit'); ?>" name="submitit" class="btn btn-success" />
212
+ </div>
213
+ </div>
214
+ <?php
215
+ wp_nonce_field( 'do_psp_importoptions_action', 'psp_import_options_nonce' );
216
+ ?>
217
+ </form>
218
+ <h4 class="col-sm-12"> Import Platinum SEO Meta Data </h4>
219
+ <form action="" method="post" enctype="multipart/form-data">
220
+ <div class="form-group">
221
+ <div class="col-sm-2"><h4>Select csv File to Upload:</h4> </div>
222
+ <div class="col-sm-10">
223
+ <input type="file" class="form-control" name="pspmetafile" id="pspmetafile"/>
224
+ </div>
225
+ </div>
226
+ <div class="form-group">
227
+ <div class="col-sm-offset-2 col-sm-10">
228
+ <input type="hidden" value="wp_handle_upload" name="action" />
229
+ <input type="submit" value="<?php _e('Submit'); ?>" name="submitit" class="btn btn-success" />
230
+ </div>
231
+ </div>
232
+ <?php
233
+ wp_nonce_field( 'do_psp_importmeta_action', 'psp_import_meta_nonce' );
234
+ ?>
235
+ </form>
236
  </div>
237
  <div class="clearfix"></div>
238
+ <div class="container bg-info" id="header" style="width:90%">
239
+ <h2 class="btn-success"> Export Platinum SEO Data </h2>
240
+ <div class="clearfix"></div>
241
+ <br />
242
+ <div class="row vertical-align">
243
+ <div class="col-sm-6"><h4>Export Platinum SEO Meta Data:</h4> </div>
244
+ <div class="col-sm-6">
245
+ <a href="<?php echo admin_url( 'admin.php?page=psp-seo-tools-by-techblissonline' ) ?>&action=psp_meta_download_csv&_wpnonce=<?php echo wp_create_nonce( 'psp_meta_download_csv' )?>" class="btn btn-default btn-success"><?php _e('Export to CSV','platinum-seo-pack');?></a>
246
+ </div>
247
+ </div>
248
+ <div class="clearfix"></div>
249
+ <br />
250
+ <div class="row vertical-align">
251
+ <div class="col-sm-6"><h4>Export Platinum SEO Option Data:</h4> </div>
252
+ <div class="col-sm-6">
253
+ <a href="<?php echo admin_url( 'admin.php?page=psp-seo-tools-by-techblissonline' ) ?>&action=psp_options_download_csv&_wpnonce=<?php echo wp_create_nonce( 'psp_options_download_csv' )?>" class="btn btn-default btn-success"><?php _e('Export to CSV','platinum-seo-pack');?></a>
254
+ </div>
255
+ </div>
256
+ </div>
257
+ <div class="clearfix"></div>
258
+
259
+
260
+
261
  <div class="container bg-success" id="header" style="width:90%">
262
+ <h1 class="btn-success"> Tools </h1>
263
+ <p> These are premium tools available as SaaS on Techblissonline.com. You can subscribe to them for just 9$ Google NLP Entity Analyser is available for subscribers who pay 14$. If you buy Platinum SEO Premium, you get a free subscription to use these Tools for one month. Subscribe <a href="https://techblissonline.com/tools/" target="_blank">here</a></p>
264
  </div>
265
  <div class="clearfix"></div>
266
  <div class="container-fluid bg-info form-group" id="tools" style="width:90%">
psp-include/utilities/psp_helper.php CHANGED
@@ -19,7 +19,7 @@ class PspHelper {
19
  * as description. Touch only if you know what you're doing
20
  */
21
  private $min_description_length = 1;
22
- private $version = "2.2.5";
23
 
24
  public $sitename = "";
25
  public $sitedescription = "";
19
  * as description. Touch only if you know what you're doing
20
  */
21
  private $min_description_length = 1;
22
+ private $version = "2.2.6";
23
 
24
  public $sitename = "";
25
  public $sitedescription = "";
psp_main.php CHANGED
@@ -51,6 +51,20 @@ class PspMain {
51
  $this->psp_sitewide_settings = $psp_settings;
52
  $this->psp_permalink_settings = $psp_permalink_settings;
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  //if ($psp_settings['rewrite_titles'] && $psp_settings['force_psp_titles']) {
55
  //do nothing;
56
  //} else {
@@ -273,14 +287,14 @@ class PspMain {
273
  $user_id = get_current_user_id();
274
  // Add the meta so that the notice is permanently dismissed.
275
  //delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
276
- update_user_meta( $user_id, 'psp_ignore_notice', "v_225" );
277
  };
278
  };
279
  }
280
 
281
  public function platinum_seo_admin_notice__success() {
282
  $user_id = get_current_user_id();
283
- if ( "v_225" === trim(get_user_meta( $user_id, 'psp_ignore_notice', true ) )) return;
284
  global $pagenow;
285
  $psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
286
  if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
@@ -290,7 +304,7 @@ class PspMain {
290
  'psp_ignore_notice' => '1',
291
  'action' => 'psp_delete_adminnotice',
292
  'nonce' => wp_create_nonce('psp_delete_adminnotice'),
293
- ] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'.'<br>'. esc_html__( 'See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"> '.esc_html__( ' Version ', 'platinum-seo-pack' ).'2.2.5'.esc_html__( ' and earlier Versions!', 'platinum-seo-pack' ) .'</a>'.'<br>'.esc_html__( 'Like this Plugin? Pls. give it a rating on WordPress', 'platinum-seo-pack' ).'<a href="https://wordpress.org/support/plugin/platinum-seo-pack/reviews/#new-post" target="_blank" rel="noopener">'.esc_html__(' here','platinum-seo-pack' ).'</a>'; ?></p></strong>
294
  </div>
295
  <?php
296
  }
@@ -1711,5 +1725,121 @@ class PspMain {
1711
  public function psp_loaded_filter() {
1712
  add_filter('status_header', array($this->psp_redirect_instance, 'psp_log_404'), 10, 4);
1713
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1714
  }
1715
  ?>
51
  $this->psp_sitewide_settings = $psp_settings;
52
  $this->psp_permalink_settings = $psp_permalink_settings;
53
 
54
+ // Add action hook only if action=psp_meta_download_csv
55
+ if ( isset($_GET['action'] ) && $_GET['action'] == 'psp_meta_download_csv' ) {
56
+ // Handle CSV Export
57
+ //add_action( 'admin_init', 'psp_meta_export_to_csv' ;
58
+ add_action( 'admin_init', array(&$this, 'psp_meta_export_to_csv') );
59
+ }
60
+
61
+ // Add action hook only if action=psp_meta_download_csv
62
+ if ( isset($_GET['action'] ) && $_GET['action'] == 'psp_options_download_csv' ) {
63
+ // Handle CSV Export
64
+ //add_action( 'admin_init', 'psp_meta_export_to_csv' ;
65
+ add_action( 'admin_init', array(&$this, 'psp_options_export_to_csv') );
66
+ }
67
+
68
  //if ($psp_settings['rewrite_titles'] && $psp_settings['force_psp_titles']) {
69
  //do nothing;
70
  //} else {
287
  $user_id = get_current_user_id();
288
  // Add the meta so that the notice is permanently dismissed.
289
  //delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
290
+ update_user_meta( $user_id, 'psp_ignore_notice', "v_226" );
291
  };
292
  };
293
  }
294
 
295
  public function platinum_seo_admin_notice__success() {
296
  $user_id = get_current_user_id();
297
+ if ( "v_226" === trim(get_user_meta( $user_id, 'psp_ignore_notice', true ) )) return;
298
  global $pagenow;
299
  $psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
300
  if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
304
  'psp_ignore_notice' => '1',
305
  'action' => 'psp_delete_adminnotice',
306
  'nonce' => wp_create_nonce('psp_delete_adminnotice'),
307
+ ] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'.'<br>'. esc_html__( 'See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"> '.esc_html__( ' Version ', 'platinum-seo-pack' ).'2.2.6'.esc_html__( ' and earlier Versions!', 'platinum-seo-pack' ) .'</a>'.'<br>'.esc_html__( 'Like this Plugin? Pls. give it a rating on WordPress', 'platinum-seo-pack' ).'<a href="https://wordpress.org/support/plugin/platinum-seo-pack/reviews/#new-post" target="_blank" rel="noopener">'.esc_html__(' here','platinum-seo-pack' ).'</a>'; ?></p></strong>
308
  </div>
309
  <?php
310
  }
1725
  public function psp_loaded_filter() {
1726
  add_filter('status_header', array($this->psp_redirect_instance, 'psp_log_404'), 10, 4);
1727
  }
1728
+
1729
+ public function psp_meta_export_to_csv() {
1730
+
1731
+ if( !is_admin() ){ return false; }
1732
+ if( !current_user_can( 'manage_options' ) ){ return false; }
1733
+
1734
+
1735
+ $psp_meta_nonce = isset( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : '';
1736
+ if ( ! wp_verify_nonce( $psp_meta_nonce, 'psp_meta_download_csv' ) ) {
1737
+ die( 'Security check error' );
1738
+ }
1739
+
1740
+ ob_start();
1741
+
1742
+ $domain = $_SERVER['SERVER_NAME'];
1743
+ $filename = 'platinumseometa-' . $domain . '-' . time() . '.csv';
1744
+
1745
+ $header_row = array(
1746
+ 'meta_id',
1747
+ 'platinumseo_id',
1748
+ 'meta_key',
1749
+ 'meta_value'
1750
+ );
1751
+ $psp_meta_rows = array();
1752
+ global $wpdb;
1753
+ $psp_meta_tbl = $wpdb->prefix . 'platinumseometa';
1754
+ $wpdb->platinumseometa = $psp_meta_tbl;
1755
+
1756
+ $platinumseometa_sql = 'SELECT * FROM ' . $psp_meta_tbl;
1757
+ //$platinumseometa_sql = $wpdb->prepare("SELECT * FROM {$psp_meta_tbl}");
1758
+ $psp_metadatas = $wpdb->get_results( $platinumseometa_sql, 'ARRAY_A' );
1759
+ foreach ( $psp_metadatas as $psp_metadata ) {
1760
+ $row = array(
1761
+ $psp_metadata['meta_id'],
1762
+ $psp_metadata['platinumseo_id'],
1763
+ $psp_metadata['meta_key'],
1764
+ $psp_metadata['meta_value']
1765
+ );
1766
+ $psp_meta_rows[] = $row;
1767
+ }
1768
+ $fh = @fopen( 'php://output', 'w' );
1769
+ fprintf( $fh, chr(0xEF) . chr(0xBB) . chr(0xBF) );
1770
+ header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
1771
+ header( 'Content-Description: File Transfer' );
1772
+ header( 'Content-type: text/csv' );
1773
+ header( "Content-Disposition: attachment; filename={$filename}" );
1774
+ header( 'Expires: 0' );
1775
+ header( 'Pragma: public' );
1776
+ fputcsv( $fh, $header_row );
1777
+ foreach ( $psp_meta_rows as $psp_meta_row ) {
1778
+ fputcsv( $fh, $psp_meta_row );
1779
+ }
1780
+ fclose( $fh );
1781
+
1782
+ ob_end_flush();
1783
+
1784
+ die();
1785
+ }
1786
+
1787
+ public function psp_options_export_to_csv() {
1788
+
1789
+ if( !is_admin() ){ return false; }
1790
+ if( !current_user_can( 'manage_options' ) ){ return false; }
1791
+
1792
+
1793
+ $psp_options_nonce = isset( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : '';
1794
+ if ( ! wp_verify_nonce( $psp_options_nonce, 'psp_options_download_csv' ) ) {
1795
+ die( 'Security check error' );
1796
+ }
1797
+
1798
+ ob_start();
1799
+
1800
+ $domain = $_SERVER['SERVER_NAME'];
1801
+ $filename = 'platinumseooptions-' . $domain . '-' . time() . '.csv';
1802
+
1803
+ $header_row = array(
1804
+ 'option_id',
1805
+ 'option_name',
1806
+ 'option_value',
1807
+ 'autoload'
1808
+ );
1809
+ $psp_option_rows = array();
1810
+ global $wpdb;
1811
+ $psp_options_tbl = $wpdb->prefix . 'options';
1812
+ //$wpdb->platinumseometa = $psp_options_tbl;
1813
+
1814
+ $platinumseooptions_sql = 'SELECT * FROM ' . $psp_options_tbl .' WHERE `option_name` like "psp_%"' ;
1815
+ //$platinumseooptions_sql = $wpdb->prepare("SELECT * FROM {$psp_options_tbl}");
1816
+ $psp_optiondatas = $wpdb->get_results( $platinumseooptions_sql, 'ARRAY_A' );
1817
+ foreach ( $psp_optiondatas as $psp_optiondata ) {
1818
+ $row = array(
1819
+ $psp_optiondata['option_id'],
1820
+ $psp_optiondata['option_name'],
1821
+ $psp_optiondata['option_value'],
1822
+ $psp_optiondata['autoload']
1823
+ );
1824
+ $psp_option_rows[] = $row;
1825
+ }
1826
+ $fh = @fopen( 'php://output', 'w' );
1827
+ //fprintf( $fh, chr(0xEF) . chr(0xBB) . chr(0xBF) );
1828
+ header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
1829
+ header( 'Content-Description: File Transfer' );
1830
+ header( 'Content-type: text/csv' );
1831
+ header( "Content-Disposition: attachment; filename={$filename}" );
1832
+ header( 'Expires: 0' );
1833
+ header( 'Pragma: public' );
1834
+ fputcsv( $fh, $header_row );
1835
+ foreach ( $psp_option_rows as $psp_option_row ) {
1836
+ fputcsv( $fh, $psp_option_row );
1837
+ }
1838
+ fclose( $fh );
1839
+
1840
+ ob_end_flush();
1841
+
1842
+ die();
1843
+ }
1844
  }
1845
  ?>
readme.txt CHANGED
@@ -4,9 +4,9 @@ Donate link: https://www.patreon.com/join/techblissonline
4
  Plugin link: https://techblissonline.com/platinum-wordpress-seo-plugin/
5
  Tags: seo, wordpress seo, plugin, google seo, platinum seo, schema, schema markup, Json schema
6
  Requires at least: 4.0
7
- Tested up to: 5.5.3
8
  Requires PHP: 5.6
9
- Stable tag: 2.2.5
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -75,6 +75,9 @@ Please read these **[FAQs](https://techblissonline.com/platinum-seo-pack-faq/)**
75
  4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
76
 
77
  == Changelog ==
 
 
 
78
  = 2.2.5 =
79
  2020-12-04 - Resolved the authorization error thrown for roles other than Admin, like Editor role etc. while trying to access a POST to which the Role has not been assigned access to Platinum SEO Metabox in role Manager.
80
 
4
  Plugin link: https://techblissonline.com/platinum-wordpress-seo-plugin/
5
  Tags: seo, wordpress seo, plugin, google seo, platinum seo, schema, schema markup, Json schema
6
  Requires at least: 4.0
7
+ Tested up to: 5.6
8
  Requires PHP: 5.6
9
+ Stable tag: 2.2.6
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
75
  4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
76
 
77
  == Changelog ==
78
+ = 2.2.6 =
79
+ 2020-12-20 - The plugin now has an Export/Import Utility to export Platinum SEO Options (Sitewide Settings) and platinum SEO Meta Data (of all Post types). You may find this utility in Platinum SEO and social Pack -> Tools.
80
+
81
  = 2.2.5 =
82
  2020-12-04 - Resolved the authorization error thrown for roles other than Admin, like Editor role etc. while trying to access a POST to which the Role has not been assigned access to Platinum SEO Metabox in role Manager.
83