Platinum SEO Pack - Version 2.3.0

Version Description

Download this release

Release Info

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

Code changes from version 2.2.9 to 2.3.0

Changelog.txt CHANGED
@@ -1,5 +1,8 @@
 
 
 
1
  = 2.2.9 =
2
- 2020-01-10 - Added a Bulk Edit Feature to SEO - Editors. Users can now edit SEO Titles and Descriptions in bulk. Made a few changes to the way Posts can be searched in Redirections module.
3
 
4
  = 2.2.8 =
5
  2020-12-28 - Made some alterations to 404 Manager and Redirections Manager to make it more user friendly. Included an option to retrieve all Posts in Redirections manager. one can also filter the Posts based on Post name or WordPress title. This would make it easier to create redirections in bulk for Posts (all post types). Restricted the filtering option to Posts while Redirected URLs may only be retrieved as a whole (All option). The same also applies to Redirection logs which are created for Redirected URLs if one chooses to log the redirect. The log entries can be deleted as a whole or selectively.
1
+ = 2.3.0=
2
+ 2021-01-12 - Made the Bulk Editor to retrieve only Builtin and Custom Post Types. Made similar changes to Redirections module.
3
+
4
  = 2.2.9 =
5
+ 2021-01-10 - Added a Bulk Edit Feature to SEO - Editors. Users can now edit SEO Titles and Descriptions in bulk. Made a few changes to the way Posts can be searched in Redirections module.
6
 
7
  = 2.2.8 =
8
  2020-12-28 - Made some alterations to 404 Manager and Redirections Manager to make it more user friendly. Included an option to retrieve all Posts in Redirections manager. one can also filter the Posts based on Post name or WordPress title. This would make it easier to create redirections in bulk for Posts (all post types). Restricted the filtering option to Posts while Redirected URLs may only be retrieved as a whole (All option). The same also applies to Redirection logs which are created for Redirected URLs if one chooses to log the redirect. The log entries can be deleted as a whole or selectively.
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.9
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.3.0
8
  Author: Techblissonline.com (Rajesh)
9
  Author URI: https://techblissonline.com/
10
  Text Domain: platinum-seo-pack
psp-include/bulkeditors/psp_bulk_edit_renderer.php DELETED
@@ -1,219 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Platinum SEO Pack
4
- Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
5
- Author: Rajesh - Techblissonline
6
- Author URI: http://techblissonline.com/
7
- */
8
- ?>
9
- <?php
10
- $psp_bulkedit_meta_nonce = wp_create_nonce( 'psp_bulkedit_meta_nonce' );
11
- wp_enqueue_script( 'psp-ajax-bulkedit-script', plugins_url( 'settings/js/psp-bulkedit.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.2.9' );
12
- wp_localize_script( 'psp-ajax-bulkedit-script', 'psp_ajax_bulkeditor_object', array( 'bedit_ajax_url' => admin_url( 'admin-ajax.php'), 'pspbeditnonce' => $psp_bulkedit_meta_nonce) );
13
- // wp_enqueue_script( 'psp-bulkedit', plugins_url( '/js/psp-bulkedit.js', __FILE__ ), array( 'jquery' ) );
14
- //wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
15
- wp_enqueue_style("psp-settings-bs-css", plugins_url( 'settings/css/psp-settings-bs.css', PSP_PLUGIN_SETTINGS_URL ));
16
- wp_enqueue_style("psp-settings-css", plugins_url( 'settings/css/psp-settings.css', PSP_PLUGIN_SETTINGS_URL ));
17
- //wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
18
- ?>
19
- <style>
20
- .page-numbers {
21
- display: inline-block;
22
- padding: 5px 10px;
23
- margin: 0 2px 0 0;
24
- border: 1px solid #eee;
25
- line-height: 1;
26
- text-decoration: none;
27
- border-radius: 2px;
28
- font-weight: 600;
29
- color:#111;
30
-
31
- }
32
- .page-numbers.current,
33
- a.page-numbers:hover {
34
- background: grey; /* color:#f9f9f9;*/
35
- color:#fff;
36
- }
37
- a.check {
38
- color:#fff;
39
- }
40
- a.check:hover {
41
- color:#0073aa;
42
- }
43
- .pspthe {
44
- width: 40%;
45
- }
46
- .editdiv {
47
- display: none;
48
- }
49
- .editabletext{
50
- width: 99%;
51
- }
52
- .editabletextarea{
53
- width: 99%;
54
- height: 50px;
55
- }
56
- </style>
57
-
58
- <div class="wrap">
59
-
60
- <h2><?php esc_html_e('Techblissonline Platinum SEO Bulk Editor:', 'platinum-seo-pack'); ?></h2>
61
- <a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline&psptab=psp_permalink" ?>"> <?php esc_html_e('Redirection Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/redirection-in-wordpress/" target="_blank" rel="noopener"><?php esc_html_e('Manage Redirections in WordPress', 'platinum-seo-pack'); ?></a> | <a href="https://techblissonline.com/http-redirection-status-codes-301-302-307-308/" target="_blank" rel="noopener"><?php esc_html_e('HTTP Redirection Status Codes', 'platinum-seo-pack'); ?></a>
62
- <form id="psp-search" action="" method="get">
63
- <div class="form-table top">
64
- <div class="alignleft actions">
65
-
66
- <input type="hidden" name="page" id="page" value="bulkeditor">
67
- <div id="pspmetatypes" class="alignleft">
68
- <strong><?php echo "Edit " ?></strong><select id="psp_meta_type" name="psp_meta_type"><?php $dditems = array('' => 'SEO Title', 'description' => 'Meta Description');
69
- foreach($dditems as $key => $val) {
70
- $selected = (isset($_GET['psp_meta_type']) && $_GET['psp_meta_type']==$key) ? 'selected="selected"' : '';
71
- echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
72
- } ?>
73
- </select>
74
- </div>
75
- <div id="pspposttypes" class="alignleft">
76
- <strong><?php echo "of " ?></strong><select id="psp_post_type" name="psp_post_type"><?php $dditems = array('' => 'Posts',);
77
- foreach($dditems as $key => $val) {
78
- $selected = (isset($_GET['psp_post_type']) && $_GET['psp_post_type']==$key) ? 'selected="selected"' : '';
79
- echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
80
- } ?>
81
- </select>
82
- </div>
83
- <div id="pspfilter" class="alignleft">
84
- <select id="psp_filter" name="psp_filter"><?php
85
- $dditems = array('' => 'All', 'contains' => 'that Contain', 'starts-with' => 'that Start with', 'ends-with' => 'that End With', 'equals' => 'Equal to' );
86
- //} else {
87
- // $dditems = array('' => 'All', 'equals' => 'Equal to', 'contains' => 'that Contain', 'starts-with' => 'that Start with', 'ends-with' => 'that End With');
88
- //}
89
- foreach($dditems as $key => $val) {
90
- $selected = (isset($_GET['psp_filter']) && $_GET['psp_filter']==$key) ? 'selected="selected"' : '';
91
- echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
92
- } ?></select></div>
93
- <div id="pspsearchfield" class="alignleft hidden">
94
- <input type="search" name="post-search-input" id="post-search-input" class="post-search-input" value="<?php echo (isset($_GET['post-search-input']) ? esc_attr(sanitize_text_field($_GET['post-search-input'])) : ''); ?>">
95
- </div>
96
-
97
- <div id="searchitdiv" class="alignleft"><input type="submit" name="searchit" id="searchit" class="button-secondary search" value="Search"></div>
98
-
99
- </div>
100
-
101
- </div>
102
- </form>
103
- <br class="clear" />
104
- <form id="psp-edit" action="" method="post">
105
- <div id="psp-edit-div" class="hidden">
106
-
107
- </div>
108
- <?php
109
- if (empty($psp_meta_type)) {
110
-
111
- wp_nonce_field( 'do_psp_posts_bulkedit_title', 'psp_posts_bulkedit_title_nonce' );
112
-
113
- } else {
114
- wp_nonce_field( 'do_psp_posts_bulkedit_desc', 'psp_posts_bulkedit_desc_nonce' );
115
- }
116
- ?>
117
- <div class="tablenav">
118
- <div class="alignleft">
119
- <select id="psp_action" name="psp_action">
120
- <?php
121
- $dditems = array('' => 'Bulk Actions', 'delete' => 'Delete Permanently');
122
- //$dditems = array('' => 'Bulk Actions', 'delete' => 'Delete Permanently', 'deleteall' => 'Delete All');
123
- foreach($dditems as $key => $val) {
124
- //$selected = (isset($_POST['psp_action']) && $_POST['psp_action']==$key) ? 'selected="selected"' : '';
125
- $selected = '';
126
- echo "<option id='$key' value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
127
- } ?>
128
- </select>
129
- </div>
130
- <div id="psp-delete-div" class="hidden alignleft">
131
- <input type="submit" value="<?php _e('Delete'); ?>" id="deleteit" name="deleteit" class="button-secondary delete" />
132
- </div>
133
-
134
- <script type="text/javascript">
135
- <!--
136
- function checkAll(form) {
137
- for (i = 0, n = form.elements.length; i < n; i++) {
138
- if(form.elements[i].type == "checkbox" && !(form.elements[i].getAttribute('onclick',2))) {
139
- if(form.elements[i].checked == true)
140
- form.elements[i].checked = false;
141
- else
142
- form.elements[i].checked = true;
143
- }
144
- }
145
- }
146
- //-->
147
- </script>
148
- <?php
149
- if ( $page_links )
150
- echo "<div class='tablenav-pages alignright'>$page_links</div>";
151
- ?>
152
- </div>
153
- <?php //if($psp_redir_type == "psplogs") { ?>
154
-
155
- <table class="widefat">
156
- <thead>
157
- <tr class="psp-header">
158
- <th scope="col" class=""><input onclick="checkAll(document.getElementById('psp-edit'));" type="checkbox"></th>
159
- <th scope="col" class="pspth">ID</th>
160
- <th scope="col" class="pspth">WordPress Post Title</th>
161
- <?php if (empty($psp_meta_type)) { ?>
162
- <th scope="col" class="pspthe">Techblissonline Platinum SEO Title</th>
163
- <?php } else { ?>
164
- <th scope="col" class="pspthe">Techblissonline Platinum SEO Meta Description</th>
165
- <?php } ?>
166
- <th scope="col" class="pspth">Update</th>
167
- </tr>
168
- </thead>
169
- <?php
170
- if(count($bad_links) > 0) { ?>
171
- <tbody>
172
- <?php
173
- $bgcolor = '';
174
- //$class = 'alternate' == $class ? '' : 'alternate';
175
- $class = 'alternate';
176
- foreach($bad_links as $bad_link){
177
-
178
- $psp_id = !empty( $bad_link->psp_id) ? $bad_link->psp_id : '';
179
- $psp_post_name = !empty( $bad_link->psp_post_name) ? $bad_link->psp_post_name : '';
180
- if (empty($psp_meta_type)) {
181
- $psp_editable_text = !empty( $bad_link->psp_title) ? esc_attr($bad_link->psp_title) : '';
182
- } else {
183
- $psp_editable_text = !empty( $bad_link->psp_description) ? esc_textarea($bad_link->psp_description) : '';
184
- }
185
-
186
- $class = 'alternate' == $class ? '' : 'alternate';
187
- ?>
188
- <tr id="<?php echo $psp_id; ?>" class="<?php echo trim( esc_attr($class) . ' author-self status-publish'); ?>" valign="top">
189
- <th scope="row" class=""><?php if ( current_user_can( 'edit_posts', $bad_link->psp_id ) ) { ?><input type="checkbox" name="update[]" value="<?php echo $psp_id; ?>" /><?php } ?></th>
190
- <td><strong><?php if ( current_user_can( 'edit_posts', $bad_link->psp_id ) ) { ?><a class="row-title" href="post.php?action=edit&amp;post=<?php echo $psp_id; ?>" target="_blank" title="<?php echo esc_attr(sprintf(__('Edit "%s"'), $psp_post_name)); ?>"><?php echo $psp_id; ?></a><?php } else { echo $psp_id; } ?></strong></td>
191
- <td><?php echo !empty($psp_post_name) ? esc_attr($psp_post_name) : ' - '; ?></td>
192
- <?php if (empty($psp_meta_type)) { ?>
193
- <td><div class='editdiv' ><?php echo !empty($psp_editable_text) ? ($psp_editable_text) : ' - '; ?></div><input type='text' class='editabletext' value='<?php echo $psp_editable_text; ?>' id='editabletext-<?php echo $psp_id; ?>' ></td>
194
- <td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="psp_title" id="psp_data_update_<?php echo $psp_id; ?>" class="psp_meta_updater_btn btn btn-success" type="btn" value="Update" /><p id ="loader-<?php echo $psp_id; ?>" class="psp_data_update-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="updating..."/></p></div><br /><span id="updatedmsg-<?php echo $psp_id; ?>" class="pspmsg"></span></td>
195
- <?php } else { ?>
196
- <td><div class='editdiv' ><?php echo !empty($psp_editable_text) ? ($psp_editable_text) : ' - '; ?></div><textarea id=<?php echo 'editabletextarea-'.$psp_id ?> type='text' class='editabletextarea' id='editabletext_<?php echo $psp_id; ?>' ><?php echo !empty($psp_editable_text) ? ($psp_editable_text) : ' '; ?></textarea></td>
197
- <td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="psp_description" id="psp_data_update_<?php echo $psp_id; ?>" class="psp_meta_updater_btn btn btn-success" type="btn" value="Update" /><p id ="loader-<?php echo $psp_id; ?>" class="psp_data_update-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="updating..."/></p></div><br /><span id="updatedmsg-<?php echo $psp_id; ?>" class="pspmsg"></span></td>
198
- <?php } ?>
199
- </tr>
200
- <?php } ?>
201
- </tbody>
202
- <?php } ?>
203
- </table>
204
-
205
- <?php //} ?>
206
- </form>
207
-
208
- <div class="tablenav top">
209
-
210
- <?php
211
- if ( $page_links )
212
- echo "<div class='tablenav-pages'>$page_links</div>";
213
- ?>
214
-
215
- </div>
216
-
217
- <br class="clear" />
218
-
219
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
psp-include/bulkeditors/psp_bulk_editor.php DELETED
@@ -1,331 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Platinum SEO Pack
4
- Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
5
- Author: Rajesh - Techblissonline
6
- Author URI: http://techblissonline.com/
7
- */
8
- class PspBulkEdit {
9
-
10
- private static $obj_handle = null;
11
-
12
- protected $psp_helper;
13
-
14
- protected $psp_plugin_options_key = 'platinum-seo-social-pack-by-techblissonline';
15
-
16
- public static function get_instance() {
17
-
18
- if ( null == self::$obj_handle ) {
19
- self::$obj_handle = new self;
20
- }
21
-
22
- return self::$obj_handle;
23
-
24
- } // end get_instance;
25
- //can be made private for singleton pattern
26
- public function __construct() {
27
-
28
- $psp_helper_instance = PspHelper::get_instance();
29
- $this->psp_helper = $psp_helper_instance;
30
-
31
- add_action('admin_menu', array(&$this, 'psp_bulkedit_admin_menu'));
32
-
33
- add_action( 'wp_ajax_psp_update_meta_data', array($this, 'psp_update_meta_data' ), 1);
34
-
35
- add_filter('set-screen-option', array(&$this, 'psp_set_screen_option'), 10, 3);
36
-
37
- }
38
-
39
- public function psp_bulkedit_admin_menu() {
40
-
41
- $psp_bulkedit_page = add_management_page('Bulk Editor', 'Platinum SEO Bulk Editor', 'manage_options', 'bulkeditor', array($this, 'bulkedit_mgmtpage'));
42
- $psp_bulkedit_page_2 = add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Bulk Editor', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-tools"></span> '.esc_html__('BulkEditor', 'platinum-seo-pack'), 'manage_options', 'bulkeditor', array($this, 'bulkedit_mgmtpage'));
43
-
44
- //$psp_bulkedit_page = add_management_page('Bulk Editor', 'Platinum SEO Bulk Editor', 'manage_options', 'bulkeditor', array($this, 'bulkedit_mgmtpage'));
45
- //$psp_bulkedit_page_2 = 'platinum-seo-and-social-pack_page_bulkeditor';
46
- //error_log('redir '. $psp_redir_page);
47
-
48
- //add_action("load-$psp_bulkedit_page", array($this, 'psp_screen_options'));
49
- //add_action("load-$psp_bulkedit_page_2", array($this, 'psp_screen_options'));
50
-
51
- add_action("load-$psp_bulkedit_page", array($this, 'psp_screen_options'));
52
- add_action("load-$psp_bulkedit_page_2", array($this, 'psp_screen_options'));
53
- //add_filter("manage_".$psp_bulkedit_page."_columns", array($this, 'psp_screen_column_options'));
54
- //add_filter("manage_".$psp_bulkedit_page_2."_columns", array($this, 'psp_screen_column_options'));
55
-
56
- }
57
-
58
- public function psp_screen_options() {
59
-
60
- //$psp_404_page = "tools_page_manager404";
61
- //$psp_404_page_2 = 'platinum-seo-and-social-pack_page_manager404';
62
- $psp_bulkedit_page = "tools_page_bulkeditor";
63
- $psp_bulkedit_page_2 = "platinum-seo-and-social-pack_page_bulkeditor";
64
-
65
- $screen = get_current_screen();
66
-
67
- //error_log($screen->id);
68
-
69
- // get out of here if we are not on our settings page
70
- if(!is_object($screen) || ($screen->id != $psp_bulkedit_page_2 && $screen->id != $psp_bulkedit_page ))
71
- {
72
- return;
73
- }
74
- if ($screen->id == $psp_bulkedit_page_2 || $screen->id == $psp_bulkedit_page) {
75
- $redir_args = array(
76
- 'label' => __('Rows per page'),
77
- 'default' => 10,
78
- 'option' => 'psp_bulkedit_rows_per_page'
79
- );
80
- add_screen_option( 'per_page', $redir_args );
81
- }
82
- /***
83
- if ($screen->id == $psp_404_page || $screen->id == $psp_404_page_2) {
84
- $filter_args = array(
85
- 'label' => __('Rows per page'),
86
- 'default' => 10,
87
- 'option' => 'psp_filter_rows_per_page'
88
- );
89
- add_screen_option( 'per_page', $filter_args );
90
- }**/
91
- }
92
-
93
- public function psp_screen_column_options() {
94
-
95
- $psp_bulkedit_page = "tools_page_bulkeditor";
96
- $psp_bulkedit_page_2 = "platinum-seo-and-social-pack_page_bulkeditor";
97
-
98
- $screen = get_current_screen();
99
-
100
- //error_log($screen->id);
101
-
102
- // get out of here if we are not on our settings page
103
- if(!is_object($screen) || ( $screen->id != $psp_bulkedit_page_2 && $screen->id != $psp_bulkedit_page ))
104
- {
105
- return;
106
- }
107
- /***
108
- $psp_redir_type = isset($_GET['psp_redir_type']) ? sanitize_key($_GET['psp_redir_type']) : '';
109
-
110
- if ($psp_redir_type != "psplogs") {
111
- return;
112
- }
113
- ***/
114
- if ($screen->id == $psp_bulkedit_page_2 || $screen->id == $psp_bulkedit_page) {
115
- $columns = array('ipaddress' => 'IP Address', 'useragent' => 'User Agent','referrer' => 'Referrer');
116
- return $columns;
117
-
118
- }
119
- }
120
-
121
- public function psp_set_screen_option($status, $option, $value) {
122
-
123
- //error_log('option '.$option.' '.$status.' '.$value);
124
-
125
- if ( 'psp_bulkedit_rows_per_page' == $option) {
126
- //error_log("psp rows ".$value);
127
- return sanitize_key($value);
128
- }
129
- }
130
-
131
- public function psp_update_meta_data() {
132
-
133
- check_ajax_referer( 'psp_bulkedit_meta_nonce', 'pspbedit_ajax_nonce');
134
- $psp_post_id = isset($_POST['pspid']) ? sanitize_key( $_POST['pspid'] ) : '';
135
- $whattoupdate = isset($_POST['title']) ? sanitize_key( $_POST['title'] ) : '';
136
- //$update_status = false;
137
- //error_log("psp_post_id ".$psp_post_id);
138
- //error_log("whattoupdate ".$whattoupdate);
139
- if($whattoupdate == "psp_title") {
140
- $valuetoupdate = isset($_POST['pspvalue']) ? sanitize_text_field( $_POST['pspvalue'] ) : '';
141
- //error_log("title ".$valuetoupdate);
142
- if ( !empty($valuetoupdate) ) {
143
- $update_status = update_metadata( 'platinumseo', $psp_post_id, '_techblissonline_psp_title', $valuetoupdate );
144
- } else {
145
- $update_status = delete_metadata( 'platinumseo', $psp_post_id, '_techblissonline_psp_title');
146
- }
147
- } else if ( $whattoupdate == "psp_description" ) {
148
- $valuetoupdate = isset($_POST['pspvalue']) ? sanitize_textarea_field( $_POST['pspvalue'] ) : '';
149
- //error_log("description ".$valuetoupdate);
150
- //update_metadata( 'platinumseo', $psp_post_id, '_techblissonline_psp_description', $valuetoupdate );
151
- if ( !empty($valuetoupdate) ) {
152
- $update_status = update_metadata( 'platinumseo', $psp_post_id, '_techblissonline_psp_description', $valuetoupdate );
153
- } else {
154
- $update_status = delete_metadata( 'platinumseo', $psp_post_id, '_techblissonline_psp_description');
155
- }
156
- }
157
-
158
- if($update_status === false) {
159
- $result['type'] = "error";
160
- $result['message'] = "Not updated or Update Error!";
161
- //error_log("failed");
162
- } else {
163
- $result['type'] = "success";
164
- $result['message'] = "Updated!";
165
- //error_log("success");
166
- }
167
-
168
- if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
169
- $result = json_encode($result);
170
- //error_log(print_r($result, true));
171
- echo $result;
172
- } else {
173
- //header("Location: ".$_SERVER["HTTP_REFERER"]);
174
- }
175
- //$result = json_encode($result);
176
- // echo $result;
177
- //echo ''. esc_html(' Updated!', 'platinum-seo-pack');
178
- //echo ucwords($plugin)." Meta Titles and Descriptions successfully Imported";
179
- wp_die();
180
-
181
- }
182
-
183
- public function bulkedit_mgmtpage() {
184
-
185
- global $wpdb;
186
-
187
- $tbl_posts = $wpdb->prefix . "posts";
188
- //$tbl_postmeta = $wpdb->prefix . "postmeta";
189
- $tbl_postmeta = $wpdb->prefix . "platinumseometa";
190
- //$psp_redirections_tbl = $wpdb->prefix . "psp_redirections";
191
- $psp_meta_log = $wpdb->prefix . "psp_meta_log";
192
-
193
- $posts_list = array();
194
- $sql_posts = '';
195
- $bad_links = array();
196
- $sql_posts_1 = '';
197
- $sql_posts_2 = '';
198
- $psp_meta_type = isset($_GET['psp_meta_type']) ? sanitize_key($_GET['psp_meta_type']) : '';
199
-
200
- // Handle bulk deletes
201
- if ( isset($_POST['deleteit']) && isset($_POST['update']) ) {
202
-
203
- foreach( (array) $_POST['update'] as $psp_id ) {
204
-
205
- $psp_id = sanitize_key($psp_id);
206
- if ( !current_user_can('edit_posts', $psp_id) )
207
- wp_die( __('You are not allowed to Delete.') );
208
-
209
- $psp_action = isset($_POST['psp_action']) ? sanitize_key($_POST['psp_action']) : '';
210
-
211
- //Delete SQL here
212
-
213
- if ( empty($psp_meta_type) && isset( $_POST['psp_posts_bulkedit_title_nonce'] ) && wp_verify_nonce( sanitize_key($_POST['psp_posts_bulkedit_title_nonce']), 'do_psp_posts_bulkedit_title' )) {
214
- delete_metadata( 'platinumseo', $psp_id, '_techblissonline_psp_title');
215
- } else if ( ($psp_meta_type == "description") && isset( $_POST['psp_posts_bulkedit_desc_nonce'] ) && wp_verify_nonce( sanitize_key($_POST['psp_posts_bulkedit_desc_nonce']), 'do_psp_posts_bulkedit_desc' )) {
216
- delete_metadata( 'platinumseo', $psp_id, '_techblissonline_psp_description');
217
- }
218
-
219
-
220
- }
221
- }
222
-
223
- //Handle search
224
- if ( !empty($_GET['psp_filter']) && !empty($_GET['post-search-input']) ) {
225
-
226
- if (!empty($_GET['post-search-input'])) {
227
-
228
- $psp_search = sanitize_text_field($_GET['post-search-input']);
229
-
230
- if ($_GET['psp_filter'] == "contains") {
231
-
232
- $psp_like = '%'.$wpdb->esc_like($psp_search).'%';
233
- //$psp_like = '%'. $psp_search.'%';
234
-
235
- }
236
-
237
- if ($_GET['psp_filter'] == "starts-with") {
238
-
239
- $psp_like = $wpdb->esc_like($psp_search).'%';
240
- }
241
-
242
- if ($_GET['psp_filter'] == "ends-with") {
243
-
244
- $psp_like = '%'.$wpdb->esc_like($psp_search);
245
-
246
- }
247
-
248
- if ($_GET['psp_filter'] == "equals") {
249
-
250
- $psp_like = "equals";
251
- }
252
-
253
- }
254
-
255
- if (!empty($psp_like)) {
256
-
257
- if (empty($psp_meta_type)) {
258
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
259
-
260
- if ($psp_like == "equals") {
261
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title = %s", $psp_search );
262
- }
263
- } else if($psp_meta_type == "description") {
264
-
265
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
266
-
267
- if ($psp_like == "equals") {
268
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title = %s", $psp_search );
269
- }
270
-
271
- }
272
- //error_log($sql_posts_1);
273
- $posts_list = $wpdb->get_results($sql_posts_1, OBJECT);
274
-
275
- }
276
-
277
-
278
- } else if ( empty($_GET['psp_filter']) ) {
279
-
280
- if (empty($psp_meta_type)) {
281
- $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish'";
282
- } else {
283
- $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish'";
284
- }
285
-
286
- $posts_list = $wpdb->get_results($sql_posts_2, OBJECT);
287
- }
288
-
289
- $total_no_posts = count($posts_list);
290
-
291
- //error_log("total number of posts ".$total_no_posts);
292
-
293
- $max_posts_per_page = 10;
294
- $user = get_current_user_id();
295
- $screen = get_current_screen();
296
- // retrieve the "per_page" option
297
- $screen_option = $screen->get_option('per_page', 'option');
298
- // retrieve the value of the option stored for the current user
299
- //error_log('screen option '.$screen_option);
300
- $max_posts_per_page = get_user_meta($user, $screen_option, true);
301
-
302
- if ( empty ( $max_posts_per_page) || $max_posts_per_page < 1 ) {
303
- // get the default value if none is set
304
- $max_posts_per_page = $screen->get_option( 'per_page', 'default' );
305
- }
306
-
307
- // now use $per_page to set the number of items displayed
308
- //$max_posts_per_page = 10;
309
- $link_count = ceil($total_no_posts/$max_posts_per_page);
310
- $page_no = isset( $_GET['paged'] ) ? sanitize_key( $_GET['paged'] ) : 1;
311
-
312
- $limit_sql = ' LIMIT '.(($page_no - 1) * $max_posts_per_page).', '.$max_posts_per_page;
313
- //if($sql_posts != '') $sql_posts .= $limit_sql;
314
- if($sql_posts_1 != '') $sql_posts = $sql_posts_1 . $limit_sql;
315
- if($sql_posts_2 != '') $sql_posts = $sql_posts_2 . $limit_sql;
316
-
317
- if($sql_posts != '') $bad_links = $wpdb->get_results( $sql_posts );
318
- //if($sql_posts_2 != '') $bad_links_2 = $wpdb->get_results( $sql_posts_2 );
319
-
320
- $page_links = paginate_links( array(
321
- 'base' => add_query_arg( 'paged', '%#%' ),
322
- 'format' => '',
323
- 'total' => ceil($total_no_posts/$max_posts_per_page),
324
- 'current' => $page_no
325
- ));
326
-
327
- include_once( 'psp_bulk_edit_renderer.php' );
328
- }
329
-
330
- }
331
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
psp-include/settings/psp_bulk_edit_renderer.php CHANGED
@@ -40,8 +40,11 @@ a.check {
40
  a.check:hover {
41
  color:#0073aa;
42
  }
 
 
 
43
  .pspthe {
44
- width: 40%;
45
  }
46
  .editdiv {
47
  display: none;
@@ -82,7 +85,8 @@ a.check:hover {
82
  </select>
83
  </div>
84
  <div id="pspposttypes" class="alignleft">
85
- <strong><?php echo "of " ?></strong><select id="psp_post_type" name="psp_post_type"><?php $dditems = array('' => 'Posts',);
 
86
  foreach($dditems as $key => $val) {
87
  $selected = (isset($_GET['psp_post_type']) && $_GET['psp_post_type']==$key) ? 'selected="selected"' : '';
88
  echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
@@ -104,7 +108,22 @@ a.check:hover {
104
  </div>
105
 
106
  <div id="searchitdiv" class="alignleft"><input type="submit" name="searchit" id="searchit" class="button-secondary search" value="Search"></div>
107
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
 
110
  </div>
@@ -166,13 +185,13 @@ a.check:hover {
166
  <tr class="psp-header">
167
  <th scope="col" class=""><input onclick="checkAll(document.getElementById('psp-edit'));" type="checkbox"></th>
168
  <th scope="col" class="pspth">ID</th>
169
- <th scope="col" class="pspth">WordPress Post Title</th>
170
  <?php if (empty($psp_meta_type)) { ?>
171
  <th scope="col" class="pspthe">Techblissonline Platinum SEO Title</th>
172
  <?php } else { ?>
173
  <th scope="col" class="pspthe">Techblissonline Platinum SEO Meta Description</th>
174
  <?php } ?>
175
- <th scope="col" class="pspth">Update</th>
176
  </tr>
177
  </thead>
178
  <?php
40
  a.check:hover {
41
  color:#0073aa;
42
  }
43
+ .psptht {
44
+ width: 30%;
45
+ }
46
  .pspthe {
47
+ width: 45%;
48
  }
49
  .editdiv {
50
  display: none;
85
  </select>
86
  </div>
87
  <div id="pspposttypes" class="alignleft">
88
+ <strong><?php echo "of " ?></strong><select id="psp_post_type" name="psp_post_type"><?php //$dditems = array('' => 'Posts',);
89
+ $dditems = $psp_posttypes_for_ddl;
90
  foreach($dditems as $key => $val) {
91
  $selected = (isset($_GET['psp_post_type']) && $_GET['psp_post_type']==$key) ? 'selected="selected"' : '';
92
  echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
108
  </div>
109
 
110
  <div id="searchitdiv" class="alignleft"><input type="submit" name="searchit" id="searchit" class="button-secondary search" value="Search"></div>
111
+ <div id="pspordertypes" class="alignleft">
112
+ <strong><?php echo " Sort By " ?></strong><select id="psp_sort_type" name="psp_sort_type"><?php $dditems = array('' => 'Post ID', 'psp_post_name' => 'WP Title');
113
+ foreach($dditems as $key => $val) {
114
+ $selected = (isset($_GET['psp_sort_type']) && $_GET['psp_sort_type']==$key) ? 'selected="selected"' : '';
115
+ echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
116
+ } ?>
117
+ </select>
118
+ </div>
119
+ <div id="pspsortby" class="alignleft">
120
+ <select id="psp_order_type" name="psp_order_type"><?php $dditems = array('' => 'DESC', 'asc' => 'ASC');
121
+ foreach($dditems as $key => $val) {
122
+ $selected = (isset($_GET['psp_order_type']) && $_GET['psp_order_type']==$key) ? 'selected="selected"' : '';
123
+ echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_html($val)."</option>";
124
+ } ?>
125
+ </select>
126
+ </div>
127
  </div>
128
 
129
  </div>
185
  <tr class="psp-header">
186
  <th scope="col" class=""><input onclick="checkAll(document.getElementById('psp-edit'));" type="checkbox"></th>
187
  <th scope="col" class="pspth">ID</th>
188
+ <th scope="col" class="psptht">WordPress Title</th>
189
  <?php if (empty($psp_meta_type)) { ?>
190
  <th scope="col" class="pspthe">Techblissonline Platinum SEO Title</th>
191
  <?php } else { ?>
192
  <th scope="col" class="pspthe">Techblissonline Platinum SEO Meta Description</th>
193
  <?php } ?>
194
+ <th scope="col" class="pspth"></th>
195
  </tr>
196
  </thead>
197
  <?php
psp-include/settings/psp_redirect_404.php CHANGED
@@ -409,6 +409,19 @@ class PspRedirections {
409
  $sql_posts_2 = '';
410
  $psp_redir_type = isset($_GET['psp_redir_type']) ? sanitize_key($_GET['psp_redir_type']) : '';
411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  //handle addnew
413
  if ( isset($_POST['insertit']) && !empty($psp_redir_type) ) {
414
 
@@ -585,9 +598,9 @@ class PspRedirections {
585
  if (!empty($psp_like)) {
586
  //$sql_posts = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_name AS psp_post_name, b.meta_value AS psp_redirect, c. meta_value AS psp_redirect_code FROM $tbl_posts a, $tbl_postmeta b, $tbl_postmeta c WHERE a.post_name LIKE %s AND a.ID = b.post_id AND a.ID = c.post_id AND (b.meta_key='_techblissonline_psp_redirect_to_url' or 1=1) AND (c.meta_key='_techblissonline_psp_redirect_status_code' or 1=1)", $psp_like );
587
  if (empty($psp_redir_type)) {
588
- $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_status='publish' AND a.post_title LIKE %s", $psp_like );
589
  if ($psp_like == "equals") {
590
- $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_status='publish' AND a.post_title = %s", $psp_search );
591
  }
592
  } else if($psp_redir_type == "pspurls") {
593
  //$sql_posts_2 = $wpdb-prepare("SELECT a.id AS psp_id, a.source_url AS psp_post_name, a.dest_url AS psp_redirect, a.redir_code AS psp_redirect_code FROM %s a WHERE a.source_url LIKE %s", array( $psp_redirections_tbl, $psp_like ));
@@ -633,7 +646,7 @@ class PspRedirections {
633
 
634
  if (empty($psp_redir_type)) {
635
 
636
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value AS psp_redirect, c. meta_value AS psp_redirect_code FROM $tbl_posts a, $tbl_postmeta b, $tbl_postmeta c WHERE a.ID = b.platinumseo_id AND a.ID = c.platinumseo_id AND (b.meta_key=%s) AND (c.meta_key=%s)", array('_techblissonline_psp_redirect_to_url', '_techblissonline_psp_redirect_status_code') );
637
  } else {
638
 
639
  if($psp_redir_type == "pspurls") {
@@ -657,10 +670,12 @@ class PspRedirections {
657
  //} else if ( $_GET['psp_filter'] == "all" ) {
658
  } else if ( empty($_GET['psp_filter']) ) {
659
 
660
- if (empty($psp_redir_type)) {
661
- $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_status='publish'";
 
 
662
  $posts_list = $wpdb->get_results($sql_posts_2, OBJECT);
663
- error_log("posts array ".print_r($posts_list, 'n'));
664
  } else {
665
  if($psp_redir_type == "pspurls") {
666
 
409
  $sql_posts_2 = '';
410
  $psp_redir_type = isset($_GET['psp_redir_type']) ? sanitize_key($_GET['psp_redir_type']) : '';
411
 
412
+ $builtin_post_types = array("post", "page");
413
+ //$custom_post_types = $this->custom_post_types;
414
+ $custom_post_types = get_post_types( array ( '_builtin' => FALSE ) );
415
+ $psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
416
+ $psp_post_types = array_combine($psp_all_posttypes, $psp_all_posttypes);
417
+
418
+ $psp_post_types_str = "";
419
+ foreach( $psp_post_types as $psp_post_typee) {
420
+ $psp_post_types_str = $psp_post_types_str . "'".$psp_post_typee."', ";
421
+ }
422
+ $psp_post_types_str = substr($psp_post_types_str, 0, -2);
423
+ //$psp_post_types_str = "( ". $psp_post_types_str . " )";
424
+
425
  //handle addnew
426
  if ( isset($_POST['insertit']) && !empty($psp_redir_type) ) {
427
 
598
  if (!empty($psp_like)) {
599
  //$sql_posts = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_name AS psp_post_name, b.meta_value AS psp_redirect, c. meta_value AS psp_redirect_code FROM $tbl_posts a, $tbl_postmeta b, $tbl_postmeta c WHERE a.post_name LIKE %s AND a.ID = b.post_id AND a.ID = c.post_id AND (b.meta_key='_techblissonline_psp_redirect_to_url' or 1=1) AND (c.meta_key='_techblissonline_psp_redirect_status_code' or 1=1)", $psp_like );
600
  if (empty($psp_redir_type)) {
601
+ $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_type in ($psp_post_types_str) AND a.post_status='publish' AND a.post_title LIKE %s", $psp_like );
602
  if ($psp_like == "equals") {
603
+ $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_status='publish' a.post_type in ($psp_post_types_str) AND a.post_title = %s", $psp_search );
604
  }
605
  } else if($psp_redir_type == "pspurls") {
606
  //$sql_posts_2 = $wpdb-prepare("SELECT a.id AS psp_id, a.source_url AS psp_post_name, a.dest_url AS psp_redirect, a.redir_code AS psp_redirect_code FROM %s a WHERE a.source_url LIKE %s", array( $psp_redirections_tbl, $psp_like ));
646
 
647
  if (empty($psp_redir_type)) {
648
 
649
+ $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value AS psp_redirect, c. meta_value AS psp_redirect_code FROM $tbl_posts a, $tbl_postmeta b, $tbl_postmeta c WHERE a.post_status = 'publish' AND a.post_type in ($psp_post_types_str) AND a.ID = b.platinumseo_id AND a.ID = c.platinumseo_id AND (b.meta_key=%s) AND (c.meta_key=%s)", array('_techblissonline_psp_redirect_to_url', '_techblissonline_psp_redirect_status_code') );
650
  } else {
651
 
652
  if($psp_redir_type == "pspurls") {
670
  //} else if ( $_GET['psp_filter'] == "all" ) {
671
  } else if ( empty($_GET['psp_filter']) ) {
672
 
673
+ if (empty($psp_redir_type)) {
674
+
675
+ $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name FROM $tbl_posts a WHERE a.post_type in ($psp_post_types_str) AND a.post_status='publish'";
676
+ //error_log("posts array ".print_r($sql_posts_2, 'n'));
677
  $posts_list = $wpdb->get_results($sql_posts_2, OBJECT);
678
+ //error_log("posts array ".print_r($posts_list, 'n'));
679
  } else {
680
  if($psp_redir_type == "pspurls") {
681
 
psp-include/settings/psp_tools_settings.php CHANGED
@@ -750,12 +750,55 @@ class PspToolSettings extends PspSettings {
750
  //$psp_redirections_tbl = $wpdb->prefix . "psp_redirections";
751
  $psp_meta_log = $wpdb->prefix . "psp_meta_log";
752
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
753
  $posts_list = array();
754
  $sql_posts = '';
755
  $bad_links = array();
756
  $sql_posts_1 = '';
757
  $sql_posts_2 = '';
758
- $psp_meta_type = isset($_GET['psp_meta_type']) ? sanitize_key($_GET['psp_meta_type']) : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
 
760
  // Handle bulk deletes
761
  if ( isset($_POST['deleteit']) && isset($_POST['update']) ) {
@@ -815,21 +858,34 @@ class PspToolSettings extends PspSettings {
815
  if (!empty($psp_like)) {
816
 
817
  if (empty($psp_meta_type)) {
818
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
819
 
820
  if ($psp_like == "equals") {
821
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title = %s", $psp_search );
822
  }
823
  } else if($psp_meta_type == "description") {
824
 
825
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
826
 
827
  if ($psp_like == "equals") {
828
- $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish' AND a.post_title = %s", $psp_search );
829
  }
830
 
831
  }
832
- //error_log($sql_posts_1);
 
 
 
 
 
 
 
 
 
 
 
 
 
833
  $posts_list = $wpdb->get_results($sql_posts_1, OBJECT);
834
 
835
  }
@@ -838,11 +894,24 @@ class PspToolSettings extends PspSettings {
838
  } else if ( empty($_GET['psp_filter']) ) {
839
 
840
  if (empty($psp_meta_type)) {
841
- $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish'";
842
  } else {
843
- $sql_posts_2 = "SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_status = 'publish'";
844
  }
845
-
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  $posts_list = $wpdb->get_results($sql_posts_2, OBJECT);
847
  }
848
 
750
  //$psp_redirections_tbl = $wpdb->prefix . "psp_redirections";
751
  $psp_meta_log = $wpdb->prefix . "psp_meta_log";
752
 
753
+ $psp_post_types = array();
754
+
755
+ $builtin_post_types = array("post", "page");
756
+ $custom_post_types = $this->custom_post_types;
757
+ $psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
758
+ $psp_post_types = array_combine($psp_all_posttypes, $psp_all_posttypes);
759
+
760
+ $builtin_all_post_types = array("" => "Posts", "page" => "Pages");
761
+ $psp_all_custom_post_types = array_combine($custom_post_types, $custom_post_types);
762
+ $all_posttypes = array("all" => "All Post types");
763
+ $psp_posttypes_for_ddl = array_merge( $builtin_all_post_types, $psp_all_custom_post_types, $all_posttypes );
764
+ //error_log("post types all ".print_r($psp_posttypes_for_ddl, "n"));
765
+
766
+ $post_types_count = count($psp_post_types);
767
+ $placeholders = array_fill(0, $post_types_count, '%s');
768
+ $psp_format = implode(', ', $placeholders);
769
+
770
+ $psp_post_types_str = "";
771
+ foreach( $psp_post_types as $psp_post_typee) {
772
+ $psp_post_types_str = $psp_post_types_str . "'".$psp_post_typee."', ";
773
+ }
774
+ $psp_post_types_str = substr($psp_post_types_str, 0, -2);
775
+ $psp_post_types_str = "( ". $psp_post_types_str . " )";
776
+ //error_log("post types ".$psp_post_types_str);
777
+
778
  $posts_list = array();
779
  $sql_posts = '';
780
  $bad_links = array();
781
  $sql_posts_1 = '';
782
  $sql_posts_2 = '';
783
+ $psp_meta_type = isset($_GET['psp_meta_type']) ? sanitize_key($_GET['psp_meta_type']) : '';
784
+ $psp_order_type = isset($_GET['psp_order_type']) ? sanitize_key($_GET['psp_order_type']) : '';
785
+ $psp_sort_type = isset($_GET['psp_order_type']) ? sanitize_key($_GET['psp_sort_type']) : '';
786
+ $psp_post_type = isset($_GET['psp_post_type']) ? sanitize_key($_GET['psp_post_type']) : '';
787
+
788
+ if ($psp_post_type !== "all") {
789
+
790
+ if (empty( $psp_post_type )) {
791
+ $psp_post_types = array("post" => "post");
792
+ $psp_post_type = "post";
793
+ $psp_post_types_str = "( '". $psp_post_type . "' )";
794
+ } else {
795
+ $psp_post_types = array($psp_post_type => $psp_post_type);
796
+ $psp_post_types_str = "( '". $psp_post_type . "' )";
797
+ }
798
+ $psp_format = "%s";
799
+ //error_log("post type ".print_r($psp_post_types, "n"));
800
+ //error_log("post type string ".print_r($psp_post_types_str, "n"));
801
+ }
802
 
803
  // Handle bulk deletes
804
  if ( isset($_POST['deleteit']) && isset($_POST['update']) ) {
858
  if (!empty($psp_like)) {
859
 
860
  if (empty($psp_meta_type)) {
861
+ $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_type in $psp_post_types_str AND a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
862
 
863
  if ($psp_like == "equals") {
864
+ $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_type in $psp_post_types_str AND a.post_status = 'publish' AND a.post_title = %s", $psp_search );
865
  }
866
  } else if($psp_meta_type == "description") {
867
 
868
+ $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_type in $psp_post_types_str AND a.post_status = 'publish' AND a.post_title LIKE %s", $psp_like );
869
 
870
  if ($psp_like == "equals") {
871
+ $sql_posts_1 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_type in $psp_post_types_str AND a.post_status = 'publish' AND a.post_title = %s", $psp_search );
872
  }
873
 
874
  }
875
+ if (empty($psp_order_type)) {
876
+ if (empty($psp_sort_type)) {
877
+ $sql_posts_1 = $sql_posts_1 . "ORDER BY psp_id DESC";
878
+ } else {
879
+ $sql_posts_1 = $sql_posts_1 . "ORDER BY psp_post_name DESC";
880
+ }
881
+ } else {
882
+ if (empty($psp_sort_type)) {
883
+ $sql_posts_1 = $sql_posts_1 . "ORDER BY psp_id ASC";
884
+ } else {
885
+ $sql_posts_1 = $sql_posts_1 . "ORDER BY psp_post_name ASC";
886
+ }
887
+ }
888
+ //error_log("sql 1 ".$sql_posts_1);
889
  $posts_list = $wpdb->get_results($sql_posts_1, OBJECT);
890
 
891
  }
894
  } else if ( empty($_GET['psp_filter']) ) {
895
 
896
  if (empty($psp_meta_type)) {
897
+ $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_title FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_title') b ON a.ID = b.platinumseo_id WHERE a.post_type in ($psp_format) AND a.post_status = 'publish'", $psp_post_types);
898
  } else {
899
+ $sql_posts_2 = $wpdb->prepare("SELECT a.ID AS psp_id, a.post_title AS psp_post_name, b.meta_value as psp_description FROM $tbl_posts a LEFT JOIN (Select platinumseo_id, meta_key, meta_value from $tbl_postmeta WHERE meta_key = '_techblissonline_psp_description') b ON a.ID = b.platinumseo_id WHERE a.post_type in ($psp_format) AND a.post_status = 'publish'", $psp_post_types);
900
  }
901
+ if (empty($psp_order_type)) {
902
+ if (empty($psp_sort_type)) {
903
+ $sql_posts_2 = $sql_posts_2 . "ORDER BY psp_id DESC";
904
+ } else {
905
+ $sql_posts_2 = $sql_posts_2 . "ORDER BY psp_post_name DESC";
906
+ }
907
+ } else {
908
+ if (empty($psp_sort_type)) {
909
+ $sql_posts_2 = $sql_posts_2 . "ORDER BY psp_id ASC";
910
+ } else {
911
+ $sql_posts_2 = $sql_posts_2 . "ORDER BY psp_post_name ASC";
912
+ }
913
+ }
914
+ //error_log("sql 2 ".$sql_posts_2);
915
  $posts_list = $wpdb->get_results($sql_posts_2, OBJECT);
916
  }
917
 
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.9";
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.3.0";
23
 
24
  public $sitename = "";
25
  public $sitedescription = "";
psp_main.php CHANGED
@@ -287,14 +287,14 @@ class PspMain {
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_229" );
291
  };
292
  };
293
  }
294
 
295
  public function platinum_seo_admin_notice__success() {
296
  $user_id = get_current_user_id();
297
- if ( "v_229" === 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,7 +304,7 @@ class PspMain {
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.9'.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
  }
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_230" );
291
  };
292
  };
293
  }
294
 
295
  public function platinum_seo_admin_notice__success() {
296
  $user_id = get_current_user_id();
297
+ if ( "v_230" === 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.3.0'.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
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: seo, wordpress seo, plugin, google seo, platinum seo, schema, schema marku
6
  Requires at least: 4.0
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
- Stable tag: 2.2.9
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -52,6 +52,7 @@ Some features:
52
  25) supports import of SEO Data from other plugins like Yoast (both new and old versions), RankMath and All in One SEO Pack.
53
  26) Role Manager that lets the admin configure which user role has access to which settings page or report in Platinum SEO.
54
  27) An easy and user friendly setup wizard that lets new users of plugin to migrate/import SEO data from other plugins and also configure the essential sitewide settings. The setup wizard is also accesible via the menu Platinum SEO and social Pack -> Setup wizard.
 
55
 
56
  == Installation ==
57
 
@@ -75,8 +76,11 @@ 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.9 =
79
- 2020-01-10 - Added a Bulk Edit Feature to SEO - Editors. Users can now edit SEO Titles and Descriptions in bulk. Made a few changes to the way Posts can be searched in Redirections module.
80
 
81
  = 2.2.8 =
82
  2020-12-28 - Made some alterations to 404 Manager and Redirections Manager to make it more user friendly. Included an option to retrieve all Posts in Redirections manager. one can also filter the Posts based on Post name or WordPress title. This would make it easier to create redirections in bulk for Posts (all post types). Restricted the filtering option to Posts while Redirected URLs may only be retrieved as a whole (All option). The same also applies to Redirection logs which are created for Redirected URLs if one chooses to log the redirect. The log entries can be deleted as a whole or selectively.
6
  Requires at least: 4.0
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
+ Stable tag: 2.3.0
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
52
  25) supports import of SEO Data from other plugins like Yoast (both new and old versions), RankMath and All in One SEO Pack.
53
  26) Role Manager that lets the admin configure which user role has access to which settings page or report in Platinum SEO.
54
  27) An easy and user friendly setup wizard that lets new users of plugin to migrate/import SEO data from other plugins and also configure the essential sitewide settings. The setup wizard is also accesible via the menu Platinum SEO and social Pack -> Setup wizard.
55
+ 28) Bulk Editor for Techblissonline SEO Title and Meta Description
56
 
57
  == Installation ==
58
 
76
  4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
77
 
78
  == Changelog ==
79
+ = 2.3.0=
80
+ 2021-01-12 - Made the Bulk Editor to retrieve only Builtin and Custom Post Types. Made similar changes to Redirections module.
81
+
82
  = 2.2.9 =
83
+ 2021-01-10 - Added a Bulk Edit Feature to SEO - Editors. Users can now edit SEO Titles and Descriptions in bulk. Made a few changes to the way Posts can be searched in Redirections module.
84
 
85
  = 2.2.8 =
86
  2020-12-28 - Made some alterations to 404 Manager and Redirections Manager to make it more user friendly. Included an option to retrieve all Posts in Redirections manager. one can also filter the Posts based on Post name or WordPress title. This would make it easier to create redirections in bulk for Posts (all post types). Restricted the filtering option to Posts while Redirected URLs may only be retrieved as a whole (All option). The same also applies to Redirection logs which are created for Redirected URLs if one chooses to log the redirect. The log entries can be deleted as a whole or selectively.