Version Description
- 2020-11-20 - Introduced a comprehensive Role Manager that can be used to control who (which role) can access which Platinum SEO Settings. Introduced a SetUp wizard to make it easy for users installing Platinum SEO WordPress Plugin to configure various settings. It also makes it easy for users migrating from other popular SEO plugin to platinum SEO, to setup the SEO configuration. Fixed a few bugs in sitemap settings. Made the 404 guessing workaround to be compatible with the latest changes in WordPress 5.5.0.
Download this release
Release Info
Developer | Rajesh Babu |
Plugin | Platinum SEO Pack |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.0 to 2.2.1
- Changelog.txt +3 -0
- images/platinum-seo-no.jpg +0 -0
- platinum-seo-pack.php +3 -1
- psp-include/settings/css/psp-settings.css +9 -1
- psp-include/settings/js/psp_wizard.js +8 -0
- psp-include/settings/psp_basic_metabox_renderer.php +2 -1
- psp-include/settings/psp_pre_settings.php +247 -104
- psp-include/settings/psp_premiumad_metabox_renderer.php +9 -8
- psp-include/settings/psp_redirect_list_renderer.php +2 -1
- psp-include/settings/psp_rolecap_settings.php +286 -0
- psp-include/settings/psp_settings.php +289 -59
- psp-include/settings/psp_social_settings.php +19 -10
- psp-include/settings/psp_tools_settings.php +6 -6
- psp-include/sitemap/psp_sitemap_settings.php +25 -12
- psp-include/utilities/psp_helper.php +46 -1
- psp-include/wizard/psp_wizard_finishbtn_renderer.php +177 -0
- psp-include/wizard/psp_wizard_importer.php +300 -0
- psp-include/wizard/psp_wizard_settings.php +1738 -0
- psp-include/wizard/psp_wizard_startbtn_renderer.php +166 -0
- psp_main.php +66 -29
- readme.txt +5 -2
Changelog.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
= 2.2.0 =
|
2 |
* 2020-09-06 - Fixed a bug that caused the Platinum SEO Meta Box not to render in Post type 'Post' and custom Post typeswhen the category name has a single quote or apostrophe.
|
3 |
|
1 |
+
= 2.2.1 =
|
2 |
+
* 2020-11-20 - Introduced a comprehensive Role Manager that can be used to control who (which role) can access which Platinum SEO Settings. Introduced a SetUp wizard to make it easy for users installing Platinum SEO WordPress Plugin to configure various settings. It also makes it easy for users migrating from other popular SEO plugin to platinum SEO, to setup the SEO configuration. Fixed a few bugs in sitemap settings. Made the 404 guessing workaround to be compatible with the latest changes in WordPress 5.5.0.
|
3 |
+
|
4 |
= 2.2.0 =
|
5 |
* 2020-09-06 - Fixed a bug that caused the Platinum SEO Meta Box not to render in Post type 'Post' and custom Post typeswhen the category name has a single quote or apostrophe.
|
6 |
|
images/platinum-seo-no.jpg
ADDED
Binary file
|
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.
|
8 |
Author: Techblissonline.com (Rajesh)
|
9 |
Author URI: https://techblissonline.com/
|
10 |
Text Domain: platinum-seo-pack
|
@@ -58,11 +58,13 @@ include_once( PSP_PLUGIN_HOME . PSPINC . '/generators/psp_social_metas.php' );
|
|
58 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/generators/breadcrumbs.php' );
|
59 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_settings.php' );
|
60 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_pre_settings.php' );
|
|
|
61 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_social_settings.php' );
|
62 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_tools_settings.php' );
|
63 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_redirect_404.php' );
|
64 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap_settings.php' );
|
65 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/importers/psp_import.php' );
|
|
|
66 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap.php' );
|
67 |
|
68 |
global $psp;
|
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.1
|
8 |
Author: Techblissonline.com (Rajesh)
|
9 |
Author URI: https://techblissonline.com/
|
10 |
Text Domain: platinum-seo-pack
|
58 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/generators/breadcrumbs.php' );
|
59 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_settings.php' );
|
60 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_pre_settings.php' );
|
61 |
+
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_rolecap_settings.php' );
|
62 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_social_settings.php' );
|
63 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_tools_settings.php' );
|
64 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_redirect_404.php' );
|
65 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap_settings.php' );
|
66 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/importers/psp_import.php' );
|
67 |
+
include_once( PSP_PLUGIN_HOME . PSPINC . '/wizard/psp_wizard_settings.php' );
|
68 |
include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap.php' );
|
69 |
|
70 |
global $psp;
|
psp-include/settings/css/psp-settings.css
CHANGED
@@ -2,13 +2,21 @@
|
|
2 |
width: 100%;
|
3 |
}
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
label {
|
6 |
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
7 |
font-size: 14 px;
|
8 |
}
|
9 |
|
10 |
.pspeditor {
|
11 |
-
max-width:
|
12 |
}
|
13 |
|
14 |
body {
|
2 |
width: 100%;
|
3 |
}
|
4 |
|
5 |
+
.psp-btn {
|
6 |
+
-webkit-box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(4,4,4,.2);
|
7 |
+
-moz-box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(4,4,4,.2);
|
8 |
+
box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(0,0,0,.2);
|
9 |
+
border-radius:0;
|
10 |
+
padding-bottom: 10px;
|
11 |
+
}
|
12 |
+
|
13 |
label {
|
14 |
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
15 |
font-size: 14 px;
|
16 |
}
|
17 |
|
18 |
.pspeditor {
|
19 |
+
max-width: 500px;
|
20 |
}
|
21 |
|
22 |
body {
|
psp-include/settings/js/psp_wizard.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
jQuery('#adminmenu').remove();
|
4 |
+
jQuery('#adminmenumain').remove();
|
5 |
+
jQuery('.auto-fold #wpcontent').css({"margin-left":"0px"});
|
6 |
+
jQuery('.auto-fold #wpfooter').css({"margin-left":"0px"});
|
7 |
+
|
8 |
+
});
|
psp-include/settings/psp_basic_metabox_renderer.php
CHANGED
@@ -53,7 +53,8 @@ Author URI: http://techblissonline.com/
|
|
53 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
54 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
55 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
56 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
|
|
57 |
?></span>
|
58 |
<style>
|
59 |
label {
|
53 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
54 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
55 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
56 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
57 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
58 |
?></span>
|
59 |
<style>
|
60 |
label {
|
psp-include/settings/psp_pre_settings.php
CHANGED
@@ -71,7 +71,7 @@ class PspPreSettings extends PspSettings {
|
|
71 |
|
72 |
add_action('admin_init', array( &$this, 'pspp_activate_license') );
|
73 |
add_action('admin_init', array( &$this, 'pspp_deactivate_license') );
|
74 |
-
add_action('
|
75 |
//add_action( 'admin_notices', array( &$this, 'pspp_admin_notices') );
|
76 |
//add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
|
77 |
/***
|
@@ -256,7 +256,15 @@ class PspPreSettings extends PspSettings {
|
|
256 |
$home_url = esc_url(home_url());
|
257 |
$urlparts = parse_url(esc_url(home_url()));
|
258 |
$domain = $urlparts['host'];
|
259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
|
261 |
// data to send in our API request
|
262 |
$api_params = array(
|
@@ -265,6 +273,7 @@ class PspPreSettings extends PspSettings {
|
|
265 |
'clientid' => $clientid,
|
266 |
'domain' => $domain,
|
267 |
'installed_version' => $installed_version,
|
|
|
268 |
'item_name' => urlencode( self::$PSPP_ITEM_NAME ),
|
269 |
'url' => $home_url
|
270 |
);
|
@@ -292,11 +301,15 @@ class PspPreSettings extends PspSettings {
|
|
292 |
switch( $license_data->error ) {
|
293 |
|
294 |
case 'expired' :
|
295 |
-
|
296 |
$message = sprintf(
|
297 |
esc_html__( 'Your license key expired on %s.', 'platinum-seo-pack' ),
|
298 |
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
|
|
|
|
|
299 |
);
|
|
|
|
|
300 |
break;
|
301 |
|
302 |
case 'revoked' :
|
@@ -392,10 +405,20 @@ class PspPreSettings extends PspSettings {
|
|
392 |
$psp_settings['psp_premium_license_key_status'] = "valid";
|
393 |
$psp_settings['premium'] = 1;
|
394 |
$psp_pre_setting['psp_premium_license_key_status'] = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
update_option( 'psp_sitewide_settings', $psp_settings );
|
396 |
update_option( 'psp_pre_setting', $psp_pre_setting );
|
397 |
update_option( 'pspp_license_status', 'valid' );
|
398 |
-
|
|
|
|
|
399 |
//$base_url = admin_url( 'plugins.php?page=' . self::$PSPP_LICENSE_PAGE );
|
400 |
$message = esc_html__( 'License key successfully activated for this domain!', 'platinum-seo-pack' );
|
401 |
//$redirect = add_query_arg( array( 'sl_activation' => 'success', 'message' => urlencode( $message ) ), $base_url );
|
@@ -448,7 +471,15 @@ class PspPreSettings extends PspSettings {
|
|
448 |
$home_url = esc_url(home_url());
|
449 |
$urlparts = parse_url(esc_url(home_url()));
|
450 |
$domain = $urlparts['host'];
|
451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
|
453 |
// data to send in our API request
|
454 |
$api_params = array(
|
@@ -457,6 +488,7 @@ class PspPreSettings extends PspSettings {
|
|
457 |
'clientid' => $clientid,
|
458 |
'domain' => $domain,
|
459 |
'installed_version' => $installed_version,
|
|
|
460 |
'item_name' => urlencode( self::$PSPP_ITEM_NAME ), // the name of our product in PSPP
|
461 |
'url' => $home_url
|
462 |
);
|
@@ -509,12 +541,14 @@ class PspPreSettings extends PspSettings {
|
|
509 |
|
510 |
case 'empty_license' :
|
511 |
|
512 |
-
|
|
|
513 |
break;
|
514 |
|
515 |
case 'invalid_client_id' :
|
516 |
|
517 |
-
|
|
|
518 |
break;
|
519 |
|
520 |
case 'missing' :
|
@@ -534,7 +568,8 @@ class PspPreSettings extends PspSettings {
|
|
534 |
|
535 |
case 'empty_clientid' :
|
536 |
|
537 |
-
|
|
|
538 |
break;
|
539 |
|
540 |
case 'empty_domain' :
|
@@ -599,6 +634,11 @@ class PspPreSettings extends PspSettings {
|
|
599 |
update_option( 'psp_pre_setting', $psp_pre_setting );
|
600 |
delete_option( 'pspp_license_status' );
|
601 |
|
|
|
|
|
|
|
|
|
|
|
602 |
$message = esc_html__( 'License key successfully deactivated for this domain!','platinum-seo-pack' );
|
603 |
|
604 |
add_settings_error('psp_pre_settings', 'deactivation_success', esc_html($message), 'updated');
|
@@ -625,104 +665,207 @@ class PspPreSettings extends PspSettings {
|
|
625 |
}
|
626 |
|
627 |
//check license status
|
628 |
-
function pspp_check_license() {
|
629 |
-
|
630 |
-
global $wp_version;
|
631 |
-
$psp_validity = "valid";
|
632 |
-
|
633 |
-
// listen for our de-activate button to be clicked
|
634 |
-
if( isset( $_POST['pspp_check_license'] ) && 'pspp_check' == sanitize_key($_POST['pspp_check_license'])) {
|
635 |
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
if( $status !== 'valid' ) {
|
647 |
-
return;
|
648 |
-
}
|
649 |
-
|
650 |
-
if(!$license || !$clientid) {
|
651 |
-
return;
|
652 |
-
}
|
653 |
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
switch( $license_data->error ) {
|
681 |
-
|
682 |
-
case 'expired' :
|
683 |
-
|
684 |
-
$psp_validity = "invalid";
|
685 |
-
break;
|
686 |
|
687 |
-
|
|
|
|
|
|
|
688 |
|
689 |
-
|
690 |
-
|
691 |
|
692 |
-
|
|
|
|
|
|
|
|
|
693 |
|
694 |
-
|
695 |
-
break;
|
696 |
-
|
697 |
-
case 'invalid_client_id' :
|
698 |
-
|
699 |
-
$psp_validity = "invalid";
|
700 |
-
break;
|
701 |
|
702 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
703 |
|
704 |
-
|
705 |
-
break;
|
706 |
-
}
|
707 |
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
}
|
727 |
|
728 |
/**
|
@@ -775,7 +918,7 @@ class PspPreSettings extends PspSettings {
|
|
775 |
$psp_button = "submit";
|
776 |
?>
|
777 |
<div class="wrap">
|
778 |
-
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Premium
|
779 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
780 |
<?php $this->psp_pre_options_tabs(); ?>
|
781 |
<form name="platinum-seo-form" method="post" action="options.php">
|
@@ -823,13 +966,12 @@ class PspPreSettings extends PspSettings {
|
|
823 |
|
824 |
<div class="sidebar-cta">
|
825 |
<h2>
|
826 |
-
<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
|
|
|
827 |
</h2>
|
828 |
<div class="container bg-info" id="tools" style="width:100%">
|
829 |
-
<div class="row"><div class="h3 col-sm-12"><a class="
|
830 |
-
</div>
|
831 |
-
<a href="https://techblissonline.com/tools/" target="_blank">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
|
832 |
-
<div class="container" style="width:100%"><a href="https://techblissonline.com/tools/" target="_blank"><span class="col-sm-12 dashicons dashicons-thumbs-up dashicons-psp"></span></a></div>
|
833 |
</div>
|
834 |
</div>
|
835 |
<?php
|
@@ -844,7 +986,8 @@ class PspPreSettings extends PspSettings {
|
|
844 |
function psp_pre_options_tabs() {
|
845 |
$current_tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
846 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
847 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
|
|
848 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
849 |
//screen_icon();
|
850 |
echo '<h2 class="nav-tab-wrapper">';
|
71 |
|
72 |
add_action('admin_init', array( &$this, 'pspp_activate_license') );
|
73 |
add_action('admin_init', array( &$this, 'pspp_deactivate_license') );
|
74 |
+
//add_action('psp_vlk', array( &$this, 'pspp_check_license') );
|
75 |
//add_action( 'admin_notices', array( &$this, 'pspp_admin_notices') );
|
76 |
//add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
|
77 |
/***
|
256 |
$home_url = esc_url(home_url());
|
257 |
$urlparts = parse_url(esc_url(home_url()));
|
258 |
$domain = $urlparts['host'];
|
259 |
+
//$installed_version = '2.0';
|
260 |
+
if (class_exists('PsppMain')) {
|
261 |
+
global $pspp_db_version;
|
262 |
+
$installed_version = $pspp_db_version;
|
263 |
+
} else {
|
264 |
+
$installed_version = '2.0';
|
265 |
+
}
|
266 |
+
$installed_date = get_option( 'pspp_installed_dt' );
|
267 |
+
if (!$installed_date) $installed_date = "";
|
268 |
|
269 |
// data to send in our API request
|
270 |
$api_params = array(
|
273 |
'clientid' => $clientid,
|
274 |
'domain' => $domain,
|
275 |
'installed_version' => $installed_version,
|
276 |
+
'installed_date' => $installed_date,
|
277 |
'item_name' => urlencode( self::$PSPP_ITEM_NAME ),
|
278 |
'url' => $home_url
|
279 |
);
|
301 |
switch( $license_data->error ) {
|
302 |
|
303 |
case 'expired' :
|
304 |
+
/**
|
305 |
$message = sprintf(
|
306 |
esc_html__( 'Your license key expired on %s.', 'platinum-seo-pack' ),
|
307 |
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
|
308 |
+
|
309 |
+
|
310 |
);
|
311 |
+
**/
|
312 |
+
$message = esc_html__( 'Your license key has expired. Kindly buy a fresh license key' , 'platinum-seo-pack');
|
313 |
break;
|
314 |
|
315 |
case 'revoked' :
|
405 |
$psp_settings['psp_premium_license_key_status'] = "valid";
|
406 |
$psp_settings['premium'] = 1;
|
407 |
$psp_pre_setting['psp_premium_license_key_status'] = 1;
|
408 |
+
|
409 |
+
if ( isset( $license_data->created ) && !empty($license_data->created) ) {
|
410 |
+
$created = $license_data->created;
|
411 |
+
error_log($created);
|
412 |
+
update_option( 'pspp_buy_dt', $created );
|
413 |
+
}
|
414 |
+
|
415 |
+
|
416 |
update_option( 'psp_sitewide_settings', $psp_settings );
|
417 |
update_option( 'psp_pre_setting', $psp_pre_setting );
|
418 |
update_option( 'pspp_license_status', 'valid' );
|
419 |
+
|
420 |
+
|
421 |
+
|
422 |
//$base_url = admin_url( 'plugins.php?page=' . self::$PSPP_LICENSE_PAGE );
|
423 |
$message = esc_html__( 'License key successfully activated for this domain!', 'platinum-seo-pack' );
|
424 |
//$redirect = add_query_arg( array( 'sl_activation' => 'success', 'message' => urlencode( $message ) ), $base_url );
|
471 |
$home_url = esc_url(home_url());
|
472 |
$urlparts = parse_url(esc_url(home_url()));
|
473 |
$domain = $urlparts['host'];
|
474 |
+
//$installed_version = '2.0';
|
475 |
+
if (class_exists('PsppMain')) {
|
476 |
+
global $pspp_db_version;
|
477 |
+
$installed_version = $pspp_db_version;
|
478 |
+
} else {
|
479 |
+
$installed_version = '2.0';
|
480 |
+
}
|
481 |
+
$installed_date = get_option( 'pspp_installed_dt' );
|
482 |
+
if (!$installed_date) $installed_date = "";
|
483 |
|
484 |
// data to send in our API request
|
485 |
$api_params = array(
|
488 |
'clientid' => $clientid,
|
489 |
'domain' => $domain,
|
490 |
'installed_version' => $installed_version,
|
491 |
+
'installed_date' => $installed_date,
|
492 |
'item_name' => urlencode( self::$PSPP_ITEM_NAME ), // the name of our product in PSPP
|
493 |
'url' => $home_url
|
494 |
);
|
541 |
|
542 |
case 'empty_license' :
|
543 |
|
544 |
+
//$message = esc_html__( 'lience key was empty.' , 'platinum-seo-pack');
|
545 |
+
$psp_license_status = "deactivated";
|
546 |
break;
|
547 |
|
548 |
case 'invalid_client_id' :
|
549 |
|
550 |
+
//$message = esc_html__( 'Client ID is Imvalid.', 'platinum-seo-pack' );
|
551 |
+
$psp_license_status = "deactivated";
|
552 |
break;
|
553 |
|
554 |
case 'missing' :
|
568 |
|
569 |
case 'empty_clientid' :
|
570 |
|
571 |
+
//$message = esc_html__( 'Client ID was empty. Try again.' , 'platinum-seo-pack');
|
572 |
+
$psp_license_status = "deactivated";
|
573 |
break;
|
574 |
|
575 |
case 'empty_domain' :
|
634 |
update_option( 'psp_pre_setting', $psp_pre_setting );
|
635 |
delete_option( 'pspp_license_status' );
|
636 |
|
637 |
+
$links_hook = wp_next_scheduled( 'pspp_links_cron_hook' );
|
638 |
+
if ($links_hook) {
|
639 |
+
wp_unschedule_event( $links_hook, 'pspp_links_cron_hook' );
|
640 |
+
}
|
641 |
+
|
642 |
$message = esc_html__( 'License key successfully deactivated for this domain!','platinum-seo-pack' );
|
643 |
|
644 |
add_settings_error('psp_pre_settings', 'deactivation_success', esc_html($message), 'updated');
|
665 |
}
|
666 |
|
667 |
//check license status
|
668 |
+
function pspp_check_license() {
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
|
670 |
+
// retrieve the license from the database
|
671 |
+
//$license = trim( get_option( 'pspp_license_key' ) );
|
672 |
+
$psp_pre_settings = $this->psp_pre_settings;
|
673 |
+
$psp_settings = $this->psp_settings;
|
674 |
+
$psp_pre_setting = get_option('psp_pre_setting');
|
675 |
+
$license = isset($psp_pre_settings['psp_premium_license_key']) ? trim(esc_attr($psp_pre_settings['psp_premium_license_key'])) : '';
|
676 |
+
$clientid = isset($psp_pre_settings['psp_premium_client_id']) ? trim (esc_attr($psp_pre_settings['psp_premium_client_id'])) : '';
|
677 |
+
$status = isset($psp_pre_setting['psp_premium_license_key_status']) ? trim (esc_attr($psp_pre_setting['psp_premium_license_key_status'])) : '';
|
678 |
+
$psp_license_status = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
679 |
|
680 |
+
if(!$license || !$clientid) {
|
681 |
+
return;
|
682 |
+
}
|
683 |
+
|
684 |
+
$home_url = esc_url(home_url());
|
685 |
+
$urlparts = parse_url(esc_url(home_url()));
|
686 |
+
$domain = $urlparts['host'];
|
687 |
+
if (class_exists('PsppMain')) {
|
688 |
+
global $pspp_db_version;
|
689 |
+
$installed_version = $pspp_db_version;
|
690 |
+
} else {
|
691 |
+
$installed_version = '2.0';
|
692 |
+
}
|
693 |
+
$installed_date = get_option( 'pspp_installed_dt' );
|
694 |
+
if (!$installed_date) $installed_date = "";
|
695 |
+
// data to send in our API request
|
696 |
+
$api_params = array(
|
697 |
+
'pspp-action'=> 'check_license',
|
698 |
+
'license_key' => $license,
|
699 |
+
'clientid' => $clientid,
|
700 |
+
'domain' => $domain,
|
701 |
+
'installed_version' => $installed_version,
|
702 |
+
'installed_date' => $installed_date,
|
703 |
+
'item_name' => urlencode( self::$PSPP_ITEM_NAME ),
|
704 |
+
'url' => $home_url
|
705 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
|
707 |
+
// Call the custom API.
|
708 |
+
$response = wp_remote_post( self::$PSPP_SITE_URL, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
709 |
+
|
710 |
+
//error_log("Response ".print_r($response, true));
|
711 |
|
712 |
+
// make sure the response came back okay
|
713 |
+
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
714 |
|
715 |
+
if ( is_wp_error( $response ) ) {
|
716 |
+
$message = sanitize_text_field($response->get_error_message());
|
717 |
+
} else {
|
718 |
+
$message = esc_html__( 'An error occurred, please try again.', 'platinum-seo-pack' );
|
719 |
+
}
|
720 |
|
721 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
|
723 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
724 |
+
|
725 |
+
|
726 |
+
if ( isset( $license_data->created ) && !empty($license_data->created) ) {
|
727 |
+
update_option( 'pspp_buy_date', $license_data->created );
|
728 |
+
}
|
729 |
+
//error_log('license data '.print_r($license_data, true));
|
730 |
+
if ( $license_data && 'FAIL' === $license_data->success ) {
|
731 |
+
|
732 |
+
switch( $license_data->error ) {
|
733 |
+
|
734 |
+
case 'expired' :
|
735 |
+
|
736 |
+
/**$message = sprintf(
|
737 |
+
esc_html__( 'Your license key expired on %s.', 'platinum-seo-pack' ),
|
738 |
+
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
|
739 |
+
);**/
|
740 |
+
$psp_license_status == "expired";
|
741 |
+
break;
|
742 |
+
|
743 |
+
case 'revoked' :
|
744 |
+
|
745 |
+
$psp_license_status == "invalid";
|
746 |
+
//$message = esc_html__( 'Your license key has been disabled.' , 'platinum-seo-pack');
|
747 |
+
break;
|
748 |
+
|
749 |
+
case 'license_already_active' :
|
750 |
+
|
751 |
+
//$message = __( 'Your domain is already active using this license key.' );
|
752 |
+
$psp_license_status == "invalid";
|
753 |
+
break;
|
754 |
+
|
755 |
+
case 'empty_license' :
|
756 |
+
|
757 |
+
//$message = esc_html__( 'lience key is empty.' , 'platinum-seo-pack' );
|
758 |
+
$psp_license_status == "invalid";
|
759 |
+
break;
|
760 |
+
|
761 |
+
case 'invalid_client_id' :
|
762 |
+
|
763 |
+
//$message = esc_html__( 'Client ID is Imvalid.' , 'platinum-seo-pack' );
|
764 |
+
$psp_license_status == "invalid";
|
765 |
+
break;
|
766 |
+
|
767 |
+
case 'missing' :
|
768 |
+
|
769 |
+
//$message = esc_html__( 'Invalid license.' , 'platinum-seo-pack');
|
770 |
+
$psp_license_status == "expired";
|
771 |
+
break;
|
772 |
+
|
773 |
+
case 'empty_request' :
|
774 |
+
|
775 |
+
//$message = esc_html__( 'Request was empty. Try again.' , 'platinum-seo-pack');
|
776 |
+
$psp_license_status == "invalid";
|
777 |
+
break;
|
778 |
+
|
779 |
+
case 'invalid_request' :
|
780 |
+
|
781 |
+
//$message = esc_html__( 'Request was invalid.', 'platinum-seo-pack' );
|
782 |
+
$psp_license_status == "invalid";
|
783 |
+
break;
|
784 |
+
|
785 |
+
case 'empty_clientid' :
|
786 |
+
|
787 |
+
//$message = esc_html__( 'Client ID was empty. Try again.', 'platinum-seo-pack' );
|
788 |
+
$psp_license_status == "invalid";
|
789 |
+
break;
|
790 |
+
|
791 |
+
case 'empty_domain' :
|
792 |
+
|
793 |
+
//$message = esc_html__( 'Domain name was empty.', 'platinum-seo-pack' );
|
794 |
+
$psp_license_status == "invalid";
|
795 |
+
break;
|
796 |
+
|
797 |
+
case 'invalid' :
|
798 |
+
case 'site_inactive' :
|
799 |
+
|
800 |
+
//$message = esc_html__( 'Your license is not active for this URL.', 'platinum-seo-pack' );
|
801 |
+
$psp_license_status == "invalid";
|
802 |
+
break;
|
803 |
+
|
804 |
+
case 'item_name_mismatch' :
|
805 |
+
|
806 |
+
//$message = sprintf( esc_html__( 'This appears to be an invalid license key for %s.' , 'platinum-seo-pack'), self::$PSPP_ITEM_NAME );
|
807 |
+
$psp_license_status == "invalid";
|
808 |
+
break;
|
809 |
+
|
810 |
+
case 'no_activations_left':
|
811 |
+
|
812 |
+
//$message = esc_html__( 'Your license key has reached its activation limit.', 'platinum-seo-pack' );
|
813 |
+
$psp_license_status == "invalid";
|
814 |
+
break;
|
815 |
+
|
816 |
+
default :
|
817 |
+
|
818 |
+
//$message = esc_html__( 'An error occurred, please try again.' , 'platinum-seo-pack');
|
819 |
+
$psp_license_status == "invalid";
|
820 |
+
break;
|
821 |
+
}
|
822 |
|
823 |
+
}
|
|
|
|
|
824 |
|
825 |
+
}
|
826 |
+
|
827 |
+
if( $psp_license_status == "expired" ) {
|
828 |
+
|
829 |
+
$psp_pre_settings['psp_premium_license_key_status'] = "";
|
830 |
+
$psp_pre_settings['premium'] = 1;
|
831 |
+
|
832 |
+
update_option( 'psp_pre_setting', $psp_pre_settings );
|
833 |
+
|
834 |
+
$psp_settings = get_option('psp_sitewide_settings');
|
835 |
+
$separator = html_entity_decode($psp_settings['separator']);
|
836 |
+
$psp_settings['separator'] = $separator;
|
837 |
+
/**
|
838 |
+
if (array_key_exists("psp_premium_license_key_status", $psp_settings)) {
|
839 |
+
unset($psp_settings['psp_premium_license_key_status']);
|
840 |
+
}
|
841 |
+
**/
|
842 |
+
$psp_settings['premium'] = 1;
|
843 |
+
$psp_settings['psp_premium_license_key_status'] = "";
|
844 |
+
delete_option("psp_sitewide_settings");
|
845 |
+
add_option("psp_sitewide_settings", $psp_settings);
|
846 |
+
|
847 |
+
delete_option( 'pspp_license_status' );
|
848 |
+
update_option( 'pspp_installed_dt', '' );
|
849 |
+
//update_option( 'pspp_buy_dt', '' );
|
850 |
+
update_option( 'pspp_db_version', '' );
|
851 |
+
|
852 |
+
//delete_option("psp_pre_setting");
|
853 |
+
|
854 |
+
$links_hook = wp_next_scheduled( 'pspp_links_cron_hook' );
|
855 |
+
if ($links_hook) {
|
856 |
+
wp_unschedule_event( $links_hook, 'pspp_links_cron_hook' );
|
857 |
+
}
|
858 |
+
|
859 |
+
$vlk_hook = wp_next_scheduled( 'psp_vlk' );
|
860 |
+
if ($vlk_hook) {
|
861 |
+
wp_unschedule_event( $vlk_hook, 'psp_vlk' );
|
862 |
+
}
|
863 |
+
|
864 |
+
}
|
865 |
+
|
866 |
+
//$message = esc_html__( 'Some unknown error occured during validation, Pls. try Again!', 'platinum-seo-pack' );
|
867 |
+
return;
|
868 |
+
|
869 |
}
|
870 |
|
871 |
/**
|
918 |
$psp_button = "submit";
|
919 |
?>
|
920 |
<div class="wrap">
|
921 |
+
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Premium - License Manager', 'platinum-seo-pack') ?></h1>
|
922 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
923 |
<?php $this->psp_pre_options_tabs(); ?>
|
924 |
<form name="platinum-seo-form" method="post" action="options.php">
|
966 |
|
967 |
<div class="sidebar-cta">
|
968 |
<h2>
|
969 |
+
<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>
|
970 |
+
<a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/platinum-seo-no.jpg'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO WordPress Tools"/></a>
|
971 |
</h2>
|
972 |
<div class="container bg-info" id="tools" style="width:100%">
|
973 |
+
<div class="row"><div class="h3 col-sm-12 btn-primary psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for WordPress</a></div><div class="h3 col-sm-12 btn-success psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
|
974 |
+
</div>
|
|
|
|
|
975 |
</div>
|
976 |
</div>
|
977 |
<?php
|
986 |
function psp_pre_options_tabs() {
|
987 |
$current_tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
988 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
989 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
990 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
991 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
992 |
//screen_icon();
|
993 |
echo '<h2 class="nav-tab-wrapper">';
|
psp-include/settings/psp_premiumad_metabox_renderer.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Techblissonline Platinum SEO and Social Pack
|
4 |
-
Description: Complete SEO and Social optimization solution for your
|
5 |
Text Domain: platinum-seo-pack
|
6 |
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
|
7 |
Author: Rajesh - Techblissonline
|
@@ -11,15 +11,16 @@ Author URI: https://techblissonline.com/
|
|
11 |
<div class="col-sm-9">
|
12 |
<div class="pspad col-sm-6">
|
13 |
<h2>
|
14 |
-
<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
|
|
|
15 |
</h2>
|
|
|
|
|
|
|
16 |
<div class="bg-info row">
|
17 |
-
<div class="h3 col-sm-
|
18 |
-
</div>
|
19 |
-
<div class="row">
|
20 |
-
<a href="https://techblissonline.com/tools/" target="_blank" class="col-sm-12">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
|
21 |
-
|
22 |
</div>
|
|
|
23 |
</div>
|
24 |
-
|
25 |
</div>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Techblissonline Platinum SEO and Social Pack
|
4 |
+
Description: Complete SEO and Social optimization solution for your WordPress blog/site.
|
5 |
Text Domain: platinum-seo-pack
|
6 |
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
|
7 |
Author: Rajesh - Techblissonline
|
11 |
<div class="col-sm-9">
|
12 |
<div class="pspad col-sm-6">
|
13 |
<h2>
|
14 |
+
<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>
|
15 |
+
<a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/platinum-seo-no.jpg'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO WordPress Tools"/></a>
|
16 |
</h2>
|
17 |
+
<div class="row">
|
18 |
+
<object title="WordPress SEO - Platinum SEO Premium" width="100%" data="https://www.youtube.com/embed/OlSIfRbao4w?feature=oembed"></object>
|
19 |
+
</div>
|
20 |
<div class="bg-info row">
|
21 |
+
<div class="row"><div class="h3 col-sm-12 btn-primary psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for WordPress</a></div><div class="h3 col-sm-12 btn-success psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
|
|
|
|
|
|
|
|
|
22 |
</div>
|
23 |
+
|
24 |
</div>
|
25 |
+
|
26 |
</div>
|
psp-include/settings/psp_redirect_list_renderer.php
CHANGED
@@ -8,7 +8,8 @@ Author URI: http://techblissonline.com/
|
|
8 |
?>
|
9 |
<?php
|
10 |
wp_enqueue_script( 'psp-redirect', plugins_url( '/js/psp-redirect.js', __FILE__ ), array( 'jquery' ) );
|
11 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
|
|
12 |
?>
|
13 |
<style>
|
14 |
.page-numbers {
|
8 |
?>
|
9 |
<?php
|
10 |
wp_enqueue_script( 'psp-redirect', plugins_url( '/js/psp-redirect.js', __FILE__ ), array( 'jquery' ) );
|
11 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
12 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
13 |
?>
|
14 |
<style>
|
15 |
.page-numbers {
|
psp-include/settings/psp_rolecap_settings.php
ADDED
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Techblissonline Platinum SEO and Social Pack
|
5 |
+
Description: Role Capability Manager Class
|
6 |
+
Text Domain: platinum-seo-pack
|
7 |
+
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
|
8 |
+
Author: Rajesh - Techblissonline
|
9 |
+
Author URI: https://techblissonline.com/
|
10 |
+
*/
|
11 |
+
|
12 |
+
class PspRcapSettings extends PspSettings {
|
13 |
+
|
14 |
+
private static $obj_handle = null;
|
15 |
+
|
16 |
+
// this is the URL our updater / license checker pings.
|
17 |
+
private static $PSPP_SITE_URL = 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/';
|
18 |
+
|
19 |
+
// Product Name
|
20 |
+
//private static $PSPP_ITEM_NAME = 'techblissonline_platinum_seo_premium';
|
21 |
+
|
22 |
+
// the name of the settings page for the license input field to be displayed
|
23 |
+
//private static $PSPP_LICENSE_PAGE = 'psp-rolecap';//'pspp-license';
|
24 |
+
|
25 |
+
private $psp_helper;
|
26 |
+
private $psp_settings_instance;
|
27 |
+
private $sitename;
|
28 |
+
private $sitedescription;
|
29 |
+
|
30 |
+
private $plugin_settings_tabs = array();
|
31 |
+
|
32 |
+
private $psp_role_cap_settings_group = 'psp_role_capabilities';//'psp_pre_credentials';
|
33 |
+
|
34 |
+
protected $psp_plugin_options_key = 'psp-rcap-by-techblissonline';//'psp-pre-by-techblissonline';
|
35 |
+
//private $psp_plugin_lic_key = 'psp-pre-by-techblissonline';
|
36 |
+
private $psp_settings_tabs = array();
|
37 |
+
|
38 |
+
//private $psp_pre_settings = array();
|
39 |
+
private $psp_rcap_settings = array();
|
40 |
+
private $psp_settings = array();
|
41 |
+
|
42 |
+
public static function get_instance() {
|
43 |
+
|
44 |
+
if ( null == self::$obj_handle ) {
|
45 |
+
self::$obj_handle = new self;
|
46 |
+
}
|
47 |
+
|
48 |
+
return self::$obj_handle;
|
49 |
+
|
50 |
+
} // end get_instance;
|
51 |
+
|
52 |
+
function __construct() {
|
53 |
+
|
54 |
+
$psp_helper_instance = PspHelper::get_instance();
|
55 |
+
$this->psp_helper = $psp_helper_instance;
|
56 |
+
|
57 |
+
//$psp_settings_instance = PspSettings::get_instance();
|
58 |
+
//$this->psp_settings_instance = $psp_settings_instance;
|
59 |
+
|
60 |
+
$this->sitename = $psp_helper_instance->get_sitename();
|
61 |
+
|
62 |
+
if (get_option("psp_tools_plugin_url")) {
|
63 |
+
self::$PSPP_SITE_URL = get_option("psp_tools_plugin_url");
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->psp_settings_tabs[$this->psp_role_cap_settings_group] = 'Role Capabilities';
|
67 |
+
//$this->psp_settings_tabs[$this->psp_home_settings_group] = 'Home';
|
68 |
+
$this->psp_settings = get_option("psp_sitewide_settings");
|
69 |
+
|
70 |
+
add_action( 'admin_init', array( &$this, 'psp_rcap_settings_init' ) );
|
71 |
+
//add_action( 'admin_init', array( &$this, 'pspp_init_plugin_updater' ),
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
function psp_rcap_settings_init() {
|
76 |
+
|
77 |
+
$tab = isset( $_GET['psprolecaptab'] ) ? Sanitize_key($_GET['psprolecaptab']) : $this->psp_role_cap_settings_group;
|
78 |
+
|
79 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
80 |
+
|
81 |
+
$this->register_role_cap_settings();
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
/*
|
86 |
+
* Registers the Home SEO settings and appends the
|
87 |
+
* key to the plugin settings tabs array.
|
88 |
+
*/
|
89 |
+
private function register_role_cap_settings() {
|
90 |
+
$this->psp_settings_tabs[$this->psp_role_cap_settings_group] = 'Role Capabilities';
|
91 |
+
$psp_rcap_settings_name = "psp_rolecap"; //"psp_rcap_settings";
|
92 |
+
|
93 |
+
$psp_rcap_settings = get_option($psp_rcap_settings_name);
|
94 |
+
if (!empty($psp_rcap_settings)) $this->psp_rcap_settings = $psp_rcap_settings;
|
95 |
+
|
96 |
+
$psp_pre_settings = get_option('psp_pre_setting');
|
97 |
+
$psp_premium_valid = isset($psp_pre_settings['psp_premium_license_key_status']) ? $psp_pre_settings['psp_premium_license_key_status'] : '';
|
98 |
+
|
99 |
+
//wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ) );
|
100 |
+
//wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ), '2.1.7');
|
101 |
+
//register
|
102 |
+
register_setting( $this->psp_role_cap_settings_group, $psp_rcap_settings_name, array( &$this, 'psp_sanitize_capabilities' ) );
|
103 |
+
//add Section
|
104 |
+
add_settings_section( 'psp_section_roles_capabilities', esc_html__('', 'platinum-seo-pack' ), array( &$this, 'section_roles_capabilities_desc' ), $this->psp_role_cap_settings_group );
|
105 |
+
|
106 |
+
$user_roles = get_editable_roles();
|
107 |
+
|
108 |
+
//$psp_capabilities = array( 'metabox' => 'Platinum SEO MetaBox', 'basicseo' => 'Generic SEO', 'analysis' => 'SEO Analysis', 'advancedseo' => 'Advanced SEO', 'basicsocial' => 'Basic Social', 'advancedsocial' => 'Advanced social', 'internallinks' => 'Internal Links', 'seosettings' => 'SEO Settings', 'general' => 'SEO - General', 'home' => 'SEO - Home', 'posttype' => 'SEO - PostType', 'taxonomy' => 'SEO - Taxonomy', 'archives' => 'SEO - Archives', 'permalinks' => 'SEO - Permalinks', 'sitemaps' => 'SEO - Sitemaps', 'others' => 'SEO - Others', 'breadcrumbs' => 'SEO - Breadcrumbs', 'socialsettings' => 'Social', 'editors' => 'Editors', 'importer' => 'Importers', 'redirections' => 'Redirections', 'manager404' => '404 manager', 'license' => 'Premium License', 'auditsettings' => 'Audit Settings', 'auditreports' => 'Audit Reports');
|
109 |
+
|
110 |
+
if ($psp_premium_valid) {
|
111 |
+
|
112 |
+
$psp_capabilities = array( 'metabox' => 'Platinum SEO MetaBox', 'analysis' => 'SEO Analysis', 'advancedseo' => 'Advanced SEO', 'basicsocial' => 'Basic Social', 'advancedsocial' => 'Advanced social', 'internallinks' => 'Internal Links', 'psp_general' => 'Platinum SEO & Social Pack', 'psp_home' => 'SEO - Home', 'psp_pt' => 'SEO - PostType', 'psp_taxonomy' => 'SEO - Taxonomy', 'psp_archive' => 'SEO - Archives', 'psp_permalink' => 'SEO - Permalinks', 'psp_sitemap' => 'SEO - Sitemaps', 'psp_others' => 'SEO - Others', 'psp_breadcrumb' => 'SEO - Breadcrumbs', 'psp_social' => 'Social', 'psp_robotstxt' => 'Editors', 'importer' => 'Importers', 'redirections' => 'Redirections', 'manager404' => '404 manager', 'adminbarmenu' => 'AdminBar Menu', 'auditsettings' => 'Audit Settings', 'auditreports' => 'Audit Reports');
|
113 |
+
} else {
|
114 |
+
|
115 |
+
$psp_capabilities = array( 'metabox' => 'Platinum SEO MetaBox', 'analysis' => 'SEO Analysis', 'advancedseo' => 'Advanced SEO', 'basicsocial' => 'Basic Social', 'advancedsocial' => 'Advanced social', 'internallinks' => 'Internal Links', 'psp_general' => 'Platinum SEO & Social Pack', 'psp_home' => 'SEO - Home', 'psp_pt' => 'SEO - PostType', 'psp_taxonomy' => 'SEO - Taxonomy', 'psp_archive' => 'SEO - Archives', 'psp_permalink' => 'SEO - Permalinks', 'psp_sitemap' => 'SEO - Sitemaps', 'psp_others' => 'SEO - Others', 'psp_breadcrumb' => 'SEO - Breadcrumbs', 'psp_social' => 'Social', 'psp_robotstxt' => 'Editors', 'importer' => 'Importers', 'redirections' => 'Redirections', 'manager404' => '404 manager', 'adminbarmenu' => 'AdminBar Menu');
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
$psp_excluded_roles = array('administrator', 'subscriber');
|
120 |
+
|
121 |
+
foreach ( $user_roles as $role => $details ) {
|
122 |
+
/***
|
123 |
+
if ($role === "administrator") {
|
124 |
+
continue;
|
125 |
+
}
|
126 |
+
***/
|
127 |
+
//$user_permissions = get_role( $role );
|
128 |
+
// Add a new capability to all roles
|
129 |
+
//$user_permissions->add_cap( 'psp_capability', true );
|
130 |
+
|
131 |
+
if ( in_array( $role, $psp_excluded_roles )) {
|
132 |
+
continue;
|
133 |
+
}
|
134 |
+
|
135 |
+
$rolename = translate_user_role( $details['name'] );
|
136 |
+
//add fields
|
137 |
+
$psp_role_cap_field = array (
|
138 |
+
'label_for' => 'psp_'.$role.'_id',
|
139 |
+
'option_name' => $psp_rcap_settings_name."[".$role."][]",
|
140 |
+
'option_value' => isset($psp_rcap_settings[$role]) ? ($psp_rcap_settings[$role]) : '',
|
141 |
+
'checkboxitems' => $psp_capabilities,
|
142 |
+
'option_description' => esc_html__( 'Enter your Platinum SEO and Social Premium Pack License Key. The license key is used for access to premium features and their upgrades.', 'platinum-seo-pack' ),
|
143 |
+
);
|
144 |
+
add_settings_field( 'psp_'.$role.'_id', $rolename, array( &$this, 'psp_add_cbx_array' ), $this->psp_role_cap_settings_group, 'psp_section_roles_capabilities', $psp_role_cap_field);
|
145 |
+
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
function psp_add_cbx_array(array $args) {
|
150 |
+
|
151 |
+
$option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
|
152 |
+
$id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
|
153 |
+
$option_array_value = isset($args['option_value']) ? (array) $args['option_value'] : array();
|
154 |
+
$option_array_value = array_map( 'esc_attr', $option_array_value );
|
155 |
+
$checkboxitems = isset($args['checkboxitems']) ? $args['checkboxitems'] : array();//array
|
156 |
+
//$option_description = isset($args['option_description']) ? esc_attr( $args['option_description'] ) : '';
|
157 |
+
|
158 |
+
$counter = 1;
|
159 |
+
$colcounter = 1;
|
160 |
+
|
161 |
+
//include renderer
|
162 |
+
echo '<div class="psp-bs cbxarr">';
|
163 |
+
foreach ( $checkboxitems as $checkboxitemkey => $checkboxitemvalue ) {
|
164 |
+
|
165 |
+
$checkbox_id = esc_attr($id."-cbx-item-".$counter);
|
166 |
+
$checked = in_array($checkboxitemkey, $option_array_value) ? 'checked="checked"' : '';
|
167 |
+
//echo "<input id='$checkbox_id' $checked type='checkbox' name='$option_name' value='$checkboxitem' /><label class='psp-radio-separator' for='$radio_id'>$checkboxitemvalue</label>";
|
168 |
+
|
169 |
+
|
170 |
+
if ( $colcounter === 1 ) echo '<div class="row">';
|
171 |
+
|
172 |
+
echo '<div class="cbx col-sm-4">';
|
173 |
+
echo "<li class='rcap'><input ".$checked." id='$checkbox_id' data-toggle='toggle' data-size='mini' data-onstyle='success' name='$option_name' value='".esc_attr($checkboxitemkey)."' type='checkbox' /><span> </span><span for='$id'>".esc_attr($checkboxitemvalue)."</span></li><br />";
|
174 |
+
echo '</div>';
|
175 |
+
|
176 |
+
if ( $colcounter === 3 ) {
|
177 |
+
echo '</div>';
|
178 |
+
$colcounter = 1;
|
179 |
+
} else {
|
180 |
+
$colcounter = $colcounter + 1;
|
181 |
+
}
|
182 |
+
|
183 |
+
$counter = $counter + 1;
|
184 |
+
|
185 |
+
}
|
186 |
+
echo '</div>';
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
+
function section_roles_capabilities_desc() {echo ''; }
|
191 |
+
|
192 |
+
function psp_sanitize_capabilities( $settings ) {
|
193 |
+
|
194 |
+
//error_log(print_r($settings, true));
|
195 |
+
|
196 |
+
//$psp_capabilities = array( 'metabox', 'basicseo', 'analysis', 'advancedseo', 'basicsocial', 'advancedsocial', 'internallinks', 'seosettings', 'general', 'home', 'posttype', 'taxonomy', 'archives', 'permalinks', 'sitemaps', 'others', 'breadcrumbs', 'socialsettings', 'editors', 'importer', 'redirections', 'manager404', 'license', 'auditsettings', 'auditreports' );
|
197 |
+
|
198 |
+
$psp_capabilities = array( 'metabox', 'basicseo', 'analysis', 'advancedseo', 'basicsocial', 'advancedsocial', 'internallinks', 'psp_general', 'psp_home', 'psp_pt', 'psp_taxonomy', 'psp_archive', 'psp_permalink', 'psp_sitemap', 'psp_others', 'psp_breadcrumb', 'psp_social', 'psp_robotstxt', 'importer', 'redirections', 'manager404', 'adminbarmenu', 'psp_pre_credentials', 'auditsettings', 'auditreports' );
|
199 |
+
|
200 |
+
$capabilities = array();
|
201 |
+
$role_capability_arr = array();
|
202 |
+
|
203 |
+
$user_roles = get_editable_roles();
|
204 |
+
$user_roles_arr = array();
|
205 |
+
|
206 |
+
foreach ( $user_roles as $role => $details ) {
|
207 |
+
//$user_roles_arr[] = $role;
|
208 |
+
if ( !empty ($settings[$role]) ) {
|
209 |
+
$capabilities = $settings[$role];
|
210 |
+
$role_capability_arr = array();
|
211 |
+
foreach ( $capabilities as $capability ) {
|
212 |
+
if ( in_array($capability, $psp_capabilities) ) {
|
213 |
+
$role_capability_arr[] = $capability;
|
214 |
+
}
|
215 |
+
}
|
216 |
+
$settings[$role] = $role_capability_arr;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
return $settings;
|
220 |
+
}
|
221 |
+
|
222 |
+
/*
|
223 |
+
* renders Plugin settings page, checks
|
224 |
+
* for the active tab and replaces key with the related
|
225 |
+
* settings key. Uses the plugin_options_tabs method
|
226 |
+
* to render the tabs.
|
227 |
+
*/
|
228 |
+
function psp_rolecap_options_page() {
|
229 |
+
$tab = isset( $_GET['psprolecaptab'] ) ? Sanitize_key($_GET['psprolecaptab']) : $this->psp_role_cap_settings_group;
|
230 |
+
$psp_button = "submit";
|
231 |
+
?>
|
232 |
+
<style>
|
233 |
+
li.rcap {
|
234 |
+
list-style-type: none;
|
235 |
+
background: #F0F2F4;
|
236 |
+
border: #74868d;
|
237 |
+
padding: 5px;
|
238 |
+
color: purple;/*#069de3*/
|
239 |
+
/*font-weight: bold;*/
|
240 |
+
}
|
241 |
+
.cbxarr {
|
242 |
+
padding-left: 20px !important;
|
243 |
+
margin-left: 10px !important;
|
244 |
+
}
|
245 |
+
.psp-bs .cbx {
|
246 |
+
padding: 5px !important;
|
247 |
+
}</style>
|
248 |
+
<div class="wrap">
|
249 |
+
<h1 style='line-height:30px;'><?php esc_html_e(' Techblissonline Platinum SEO - Role Manager', 'platinum-seo-pack') ?></h1>
|
250 |
+
<p style="color: red"><?php //esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
251 |
+
<?php $this->psp_rolecap_options_tabs(); ?>
|
252 |
+
<form name="platinum-seo-form1" method="post" action="options.php">
|
253 |
+
<?php wp_nonce_field( 'update-rcap-options' ); ?>
|
254 |
+
<?php settings_fields( $tab ); ?>
|
255 |
+
<?php settings_errors(); ?>
|
256 |
+
<?php do_settings_sections( $tab ); ?>
|
257 |
+
<?php submit_button('Save Capabilities', 'primary', $psp_button, true, 'id="submit"'); ?>
|
258 |
+
</form>
|
259 |
+
</div>
|
260 |
+
<?php
|
261 |
+
}
|
262 |
+
|
263 |
+
/*
|
264 |
+
* Renders our tabs in the plugin options page,
|
265 |
+
* walks through the object's tabs array and prints
|
266 |
+
* them one by one. Provides the heading for the
|
267 |
+
* psp_options_page method.
|
268 |
+
*/
|
269 |
+
function psp_rolecap_options_tabs() {
|
270 |
+
$current_tab = isset( $_GET['psprolecaptab'] ) ? Sanitize_key($_GET['psprolecaptab']) : $this->psp_role_cap_settings_group;
|
271 |
+
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
272 |
+
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
273 |
+
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
274 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
275 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
276 |
+
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
277 |
+
//screen_icon();
|
278 |
+
echo '<h2 class="nav-tab-wrapper" align="center">';
|
279 |
+
/***
|
280 |
+
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
281 |
+
$active = $current_tab == $tab_key ? 'nav-tab-active' : '';
|
282 |
+
echo '<a class="nav-tab ' . esc_attr($active) . '" href="?page=' . esc_attr($this->psp_plugin_options_key) . '&psprolecaptab=' . esc_attr($tab_key) . '">' . esc_attr($tab_caption) . '</a>';
|
283 |
+
}***/
|
284 |
+
echo 'Roles and Capabilities</h2>';
|
285 |
+
}
|
286 |
+
}
|
psp-include/settings/psp_settings.php
CHANGED
@@ -19,10 +19,12 @@ class PspSettings {
|
|
19 |
public $psp_wmt_instance;
|
20 |
public $psp_tools_instance;
|
21 |
public $psp_pre_instance;
|
|
|
22 |
public $psp_redirect_instance;
|
23 |
public $psp_social_instance;
|
24 |
public $psp_import_instance;
|
25 |
public $psp_sitemap_instance;
|
|
|
26 |
|
27 |
private $psp_helper;
|
28 |
private $sitename;
|
@@ -77,9 +79,12 @@ class PspSettings {
|
|
77 |
//$psp_wmt_instance = PspWebMasterToolSettings::get_instance();
|
78 |
//$this->psp_wmt_instance = $psp_wmt_instance;
|
79 |
|
80 |
-
$psp_pre_instance = PspPreSettings::get_instance();
|
81 |
$this->psp_pre_instance = $psp_pre_instance;
|
82 |
|
|
|
|
|
|
|
83 |
$psp_tools_instance = PspToolSettings::get_instance();
|
84 |
$this->psp_tools_instance = $psp_tools_instance;
|
85 |
|
@@ -94,6 +99,11 @@ class PspSettings {
|
|
94 |
|
95 |
$this->psp_sitemap_instance = PspSmSettings::get_instance();
|
96 |
|
|
|
|
|
|
|
|
|
|
|
97 |
$psp_do_rewrite_rules = false;
|
98 |
|
99 |
$cust_taxonomies = array();
|
@@ -163,6 +173,14 @@ class PspSettings {
|
|
163 |
//if (!$psp_premium_status) $this->psp_settings_tabs[$this->psp_social_settings_group] = 'Social';
|
164 |
$this->psp_settings_tabs[$this->psp_other_settings_group] = 'Others';
|
165 |
$this->psp_settings_tabs[$this->psp_breadcrumb_settings_group] = 'Breadcrumbs';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
|
168 |
//add extra fields to category edit form hook
|
@@ -173,6 +191,51 @@ class PspSettings {
|
|
173 |
|
174 |
}
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
/*
|
177 |
* Registers settings
|
178 |
*/
|
@@ -361,6 +424,7 @@ class PspSettings {
|
|
361 |
//$this->psp_home_settings = $psp_home_settings;
|
362 |
//register
|
363 |
register_setting( $this->psp_home_settings_group, $psp_home_settings_name, array( &$this, 'sanitize_home_settings' ) );
|
|
|
364 |
//add Section
|
365 |
add_settings_section( 'psp_section_home', esc_html__('Home Page SEO Settings', 'platinum-seo-pack' ), array( &$this, 'section_home_desc' ), $this->psp_home_settings_group );
|
366 |
//add fields
|
@@ -383,12 +447,14 @@ class PspSettings {
|
|
383 |
'label_for' => 'psp_home_title',
|
384 |
'option_name' => $psp_home_settings_name.'[title]',
|
385 |
'option_value' => isset($psp_home_settings['title']) ? stripcslashes(esc_attr($psp_home_settings['title'])) : '',
|
|
|
386 |
);
|
387 |
|
388 |
$desc_field = array (
|
389 |
'label_for' => 'psp_home_description',
|
390 |
'option_name' => $psp_home_settings_name.'[description]',
|
391 |
'option_value' => isset($psp_home_settings['description']) ? stripcslashes(esc_attr($psp_home_settings['description'])) : '',
|
|
|
392 |
);
|
393 |
|
394 |
$keywords_field = array (
|
@@ -450,6 +516,12 @@ class PspSettings {
|
|
450 |
}
|
451 |
|
452 |
function sanitize_home_settings($settings) {
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
|
454 |
if( isset( $settings['use_front_page'] ) ) {
|
455 |
$settings['use_front_page'] = !is_null(filter_var($settings['use_front_page'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_front_page'] : '';
|
@@ -581,6 +653,20 @@ class PspSettings {
|
|
581 |
|
582 |
//Fields
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
//Noindex subpages
|
585 |
$noindex_subpages_field = array (
|
586 |
'label_for' => 'psp_'.$setting_name.'_noindex_subpages',
|
@@ -655,7 +741,7 @@ class PspSettings {
|
|
655 |
);
|
656 |
|
657 |
$use_meta_noydir_field_id = 'psp_'.$setting_name.'_use_meta_noydir';
|
658 |
-
$use_meta_noydir_field_title = esc_html__( 'Use noydir: ', 'platinum-seo-pack' )
|
659 |
|
660 |
//add_settings_field( $use_meta_noydir_field_id, $use_meta_noydir_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $use_meta_noydir_field );
|
661 |
|
@@ -1049,6 +1135,16 @@ class PspSettings {
|
|
1049 |
}
|
1050 |
|
1051 |
function sanitize_general_settings($settings) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1052 |
|
1053 |
if( isset( $settings['separator'] ) ) {
|
1054 |
|
@@ -1797,7 +1893,7 @@ class PspSettings {
|
|
1797 |
'option_name' => $psp_settings_name.'[referrer_404]',
|
1798 |
'option_value' => isset($psp_settings['referrer_404']) ? $psp_settings['referrer_404'] : '',
|
1799 |
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
1800 |
-
'option_description' => esc_html__( 'Turn ON to track only 404 errors that occur due to a
|
1801 |
);
|
1802 |
|
1803 |
$psp_referrer_404_field_id = 'psp_referrer_404';
|
@@ -1874,6 +1970,12 @@ class PspSettings {
|
|
1874 |
}
|
1875 |
|
1876 |
function sanitize_permalink_settings($settings) {
|
|
|
|
|
|
|
|
|
|
|
|
|
1877 |
|
1878 |
if( isset( $settings['redirection'] ) ) {
|
1879 |
$settings['redirection'] = !is_null(filter_var($settings['redirection'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['redirection'] : '';
|
@@ -2738,7 +2840,7 @@ class PspSettings {
|
|
2738 |
$checked = '';
|
2739 |
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
2740 |
if($option_value) { $checked = ' checked="checked" '; }
|
2741 |
-
echo "<input ".esc_attr($checked)." id='".esc_attr($id)."' name='".esc_attr($option_name)."' type='checkbox' data-toggle='toggle'/><span> </span><span for='".esc_attr($id)."'>".wp_kses(html_entity_decode($checkbox_label), $desc_allowed_html)."</span><br /><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
2742 |
|
2743 |
}
|
2744 |
|
@@ -2772,7 +2874,7 @@ class PspSettings {
|
|
2772 |
//$selected = ($option_value==$val) ? 'selected="selected"' : '';
|
2773 |
//echo "<option value='$val' $selected>$key</option>";
|
2774 |
}
|
2775 |
-
echo "</select><p for='".esc_attr($id)."'> ".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
2776 |
|
2777 |
}
|
2778 |
|
@@ -2824,9 +2926,13 @@ class PspSettings {
|
|
2824 |
*/
|
2825 |
function add_admin_menus() {
|
2826 |
//add_options_page( 'Platinum SEO New Settings', 'My Settings', 'manage_options', $this->psp_plugin_options_key, array( &$this, 'psp_options_page' ) );
|
2827 |
-
|
|
|
|
|
2828 |
//add_menu_page(esc_html__('Techblissonline Platinum SEO and social Pack', 'platinum-seo-pack'), esc_html__('Platinum SEO and Social Pack', 'platinum-seo-pack'), 'manage_options', $this->psp_plugin_options_key, array($this, 'psp_options_page'), plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) )));
|
2829 |
-
|
|
|
|
|
2830 |
$psp_settings = get_option('psp_pre_setting');
|
2831 |
$psp_premium_valid = isset($psp_settings['premium']) ? $psp_settings['premium'] : '';
|
2832 |
$psp_premium_status = isset($psp_settings['psp_premium_license_key_status']) ? $psp_settings['psp_premium_license_key_status'] : '';
|
@@ -2835,13 +2941,22 @@ class PspSettings {
|
|
2835 |
//$psp_premium_valid = 1;
|
2836 |
//$psp_premium_status = 1;
|
2837 |
//if ($psp_premium_valid && $psp_premium_status)
|
2838 |
-
|
|
|
|
|
2839 |
//add_submenu_page($this->psp_plugin_options_key, __('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), __('SEO - Advanced', 'platinum-seo-pack'), 'manage_options', 'webmastertools', array($this->psp_wmt_instance, 'psp_wmt_options_page'));
|
2840 |
//add_submenu_page($this->psp_plugin_options_key, __('Techblissonline Platinum SEO Analytics', 'platinum-seo-pack'), __('SEO - Analytics', 'platinum-seo-pack'), 'manage_options', 'psp-gatracking-by-techblissonline', array($this->psp_ga_instance, 'psp_ga_options_page'));
|
2841 |
-
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2845 |
//add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), __('Techblissonline - SEO Tools', 'platinum-seo-pack'), 'manage_options', 'psp-seo-tools-by-techblissonline', array($this->psp_pre_instance, 'psp_pre_options_page'));
|
2846 |
if ($psp_premium_valid) add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-network"></span> '.esc_html__('Premium - Licenses', 'platinum-seo-pack'), 'manage_options', 'pspp-licenses', array($this->psp_pre_instance, 'psp_premium_options_page'));
|
2847 |
}
|
@@ -2899,7 +3014,7 @@ class PspSettings {
|
|
2899 |
//wp_nonce_field( 'do_psp_extra_category_fields', 'psp_extra_category_fields_nonce' );
|
2900 |
//$cat_meta = get_option( "psp_category_metas_$category_id");
|
2901 |
?>
|
2902 |
-
</table>
|
2903 |
<?php wp_nonce_field( 'do_psp_extra_category_fields', 'psp_extra_category_fields_nonce' );
|
2904 |
$psp_type = "taxonomy";
|
2905 |
//available tags array
|
@@ -2961,7 +3076,7 @@ class PspSettings {
|
|
2961 |
<li class="analysis"><a href="#analysis" title="SEO Analysis"><span class="dashicons dashicons-dashboard"></span><?php esc_html_e( ' Analysis', 'platinum-seo-pack' ); ?></a></li>
|
2962 |
<li class="advanced"><a href="#advanced" title="Advanced SEO"><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
2963 |
<li class="social"><a href="#bsocial" title="Basic Social"><span class="dashicons dashicons-share"></span><?php esc_html_e( ' Basic', 'platinum-seo-pack' ); ?></a></li>
|
2964 |
-
<li class="social"><a href="#asocial" title="Advanced Social"><span class="dashicons dashicons-
|
2965 |
<?php } ?>
|
2966 |
</ul>
|
2967 |
<br class="clear" />
|
@@ -3208,7 +3323,7 @@ class PspSettings {
|
|
3208 |
<?php if (!$psp_metabox_advanced_hidden || is_super_admin()) { ?>
|
3209 |
<li class="advanced"><a href="#advanced" title="Advanced SEO"><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3210 |
<li class="social"><a href="#bsocial" title="Basic Social"><span class="dashicons dashicons-share"></span><?php esc_html_e( ' Basic', 'platinum-seo-pack' ); ?></a></li>
|
3211 |
-
<li class="social"><a href="#asocial" title="Advanced Social"><span class="dashicons dashicons-
|
3212 |
<?php } ?>
|
3213 |
</ul>
|
3214 |
<br class="clear" />
|
@@ -3369,7 +3484,9 @@ class PspSettings {
|
|
3369 |
if (!$psp_post_metabox_hidden || is_super_admin()) {
|
3370 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'post', 'normal', 'high' );
|
3371 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'post', 'normal', 'high' );
|
3372 |
-
|
|
|
|
|
3373 |
}
|
3374 |
|
3375 |
$psp_page_settings = get_option("psp_page_settings");
|
@@ -3377,7 +3494,9 @@ class PspSettings {
|
|
3377 |
if (!$psp_page_metabox_hidden || is_super_admin()) {
|
3378 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'page', 'normal', 'high' );
|
3379 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'page', 'normal', 'high' );
|
3380 |
-
|
|
|
|
|
3381 |
}
|
3382 |
|
3383 |
$cust_post_types = array();
|
@@ -3392,7 +3511,9 @@ class PspSettings {
|
|
3392 |
if (!$psp_posttype_metabox_hidden || is_super_admin()) {
|
3393 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), $cust_post_type, 'normal', 'high' );
|
3394 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), $cust_post_type, 'normal', 'high' );
|
3395 |
-
|
|
|
|
|
3396 |
}
|
3397 |
}
|
3398 |
|
@@ -3405,8 +3526,9 @@ class PspSettings {
|
|
3405 |
}
|
3406 |
|
3407 |
//add metabox to post types
|
3408 |
-
function psp_do_seo_metabox() { //check for existing featured ID
|
3409 |
-
|
|
|
3410 |
global $post;
|
3411 |
//$psp_posttype_metabox_hidden = false;
|
3412 |
$psp_settings_name = "psp_".$post->post_type."_settings";
|
@@ -3584,6 +3706,9 @@ class PspSettings {
|
|
3584 |
|
3585 |
$psp_post_meta['preferred_term'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_preferred_term'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_preferred_term'][0]) : '';
|
3586 |
|
|
|
|
|
|
|
3587 |
$psp_post_disablers = !empty($wp_post_meta_data_arr['_techblissonline_psp_disable_flags'][0]) ? unserialize($wp_post_meta_data_arr['_techblissonline_psp_disable_flags'][0]) : array();
|
3588 |
//$psp_social_meta = unserialize($wp_post_meta_data_arr['_techblissonline_psp_social_data'][0]);
|
3589 |
|
@@ -3645,11 +3770,11 @@ class PspSettings {
|
|
3645 |
$psp_social_meta['sc_image'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_sc_image'][0]) ? esc_url_raw($wp_post_meta_data_arr['_techblissonline_psp_sc_image'][0]) : '';
|
3646 |
/******
|
3647 |
$psp_post_meta['disable_title'] = $psp_post_disablers['disable_title'];
|
3648 |
-
$psp_post_meta['disable_description'] = $psp_post_disablers['disable_description']
|
3649 |
-
$psp_post_meta['disable_keywords'] = $psp_post_disablers['disable_keywords']
|
3650 |
-
$psp_post_meta['disable_canonical'] = $psp_post_disablers['disable_canonical']
|
3651 |
-
$psp_post_meta['disable_title_format'] = $psp_post_disablers['disable_title_format']
|
3652 |
-
$psp_post_meta['disable_desc_format'] = $psp_post_disablers['disable_desc_format']
|
3653 |
$psp_post_meta['disable_psp'] = $psp_post_disablers['disable_psp'];
|
3654 |
********/
|
3655 |
//$psp_post_meta = array_merge($psp_post_meta, $psp_post_disablers, $psp_social_meta);
|
@@ -3658,6 +3783,14 @@ class PspSettings {
|
|
3658 |
//$psp_social_meta = array_merge((array)$psp_social_meta, (array)$psp_post_tw_data_images, (array)$psp_post_social_tw_label_data);
|
3659 |
//$psp_social_meta = array_merge($psp_social_meta, $psp_post_tw_data_images, $psp_post_social_tw_label_data, $psp_post_social_enablers);
|
3660 |
$this->psp_post_social_meta_original = $psp_social_meta;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3661 |
$psp_type = "posttype";
|
3662 |
|
3663 |
//Taxonomies for breadcrumb tags
|
@@ -3735,49 +3868,112 @@ class PspSettings {
|
|
3735 |
<div id="psp-meta-box-parent">
|
3736 |
<div id="psp-meta-box">
|
3737 |
<ul class="psp-metabox-tabs" id="psp-metabox-tabs">
|
3738 |
-
|
3739 |
-
|
|
|
|
|
|
|
|
|
3740 |
<?php if (!$psp_posttype_metabox_advanced_hidden || is_super_admin()) { ?>
|
3741 |
-
|
3742 |
-
|
3743 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3744 |
|
3745 |
<?php } ?>
|
3746 |
</ul>
|
3747 |
<br class="clear" />
|
3748 |
-
|
|
|
3749 |
<?php include_once( 'psp_basic_metabox_renderer.php' ); ?>
|
3750 |
</div>
|
3751 |
-
|
3752 |
-
|
3753 |
-
|
|
|
|
|
|
|
3754 |
<?php
|
3755 |
if (!$psp_posttype_metabox_advanced_hidden || is_super_admin()) {
|
3756 |
// if ($psp_posttype_metabox_advanced_hidden ) {
|
3757 |
?>
|
3758 |
-
|
3759 |
-
|
3760 |
-
|
3761 |
-
|
3762 |
-
|
3763 |
-
|
|
|
|
|
|
|
|
|
|
|
3764 |
<div id="asocial" class="psptab">
|
3765 |
<?php if ($psp_premium_valid && $psp_premium_status) {
|
3766 |
-
$metabox_template = apply_filters('psp_metabox_template', '
|
3767 |
-
if (empty($metabox_template))
|
3768 |
-
|
3769 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3770 |
} else { ?>
|
3771 |
<div class="psp-bs">
|
3772 |
<div class="container">
|
3773 |
<?php
|
3774 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
3775 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
3776 |
-
|
3777 |
</div></div>
|
3778 |
<?php }
|
3779 |
?>
|
3780 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3781 |
<?php
|
3782 |
}
|
3783 |
?>
|
@@ -3848,14 +4044,24 @@ class PspSettings {
|
|
3848 |
$psp_metabox_advanced_hidden = isset($psp_settings['hide_metabox_advanced']) ? $psp_settings['hide_metabox_advanced'] : '';
|
3849 |
|
3850 |
if (is_super_admin()) $psp_metabox_advanced_hidden = false;
|
3851 |
-
|
|
|
|
|
3852 |
if (!empty($this->psp_post_meta_original)) {
|
3853 |
$psp_post_seo_data_original = $this->psp_post_meta_original;
|
3854 |
}
|
3855 |
-
|
|
|
|
|
|
|
|
|
3856 |
if(!empty($this->psp_post_social_meta_original)) {
|
3857 |
$psp_post_social_data_original = $this->psp_post_social_meta_original;
|
3858 |
}
|
|
|
|
|
|
|
|
|
3859 |
|
3860 |
$psp_post_seo_data_current = !empty($_POST['psp_seo_meta']) ? $this->psp_sanitze_seo_data($_POST['psp_seo_meta']) : array();
|
3861 |
|
@@ -4197,6 +4403,15 @@ class PspSettings {
|
|
4197 |
delete_metadata( 'platinumseo', $post_id, '_techblissonline_psp_preferred_term');
|
4198 |
}
|
4199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4200 |
//update disable flags
|
4201 |
$psp_post_seo_data_disablers = array();
|
4202 |
|
@@ -4219,13 +4434,13 @@ class PspSettings {
|
|
4219 |
|
4220 |
/*******
|
4221 |
$psp_post_social_data['fb_title'] = $psp_post_seo_data['fb_title'];
|
4222 |
-
$psp_post_social_data['fb_description'] = $psp_post_seo_data['fb_description']
|
4223 |
$psp_post_social_data['fb_image'] = $psp_post_seo_data['fb_image'];
|
4224 |
$psp_post_social_data['tw_title'] = $psp_post_seo_data['tw_title'];
|
4225 |
-
$psp_post_social_data['tw_description'] = $psp_post_seo_data['tw_description']
|
4226 |
$psp_post_social_data['tw_image'] = $psp_post_seo_data['tw_image'];
|
4227 |
$psp_post_social_data['sc_title'] = $psp_post_seo_data['sc_title'];
|
4228 |
-
$psp_post_social_data['sc_description'] = $psp_post_seo_data['sc_description']
|
4229 |
$psp_post_social_data['sc_image'] = $psp_post_seo_data['sc_image'];
|
4230 |
************/
|
4231 |
/*******
|
@@ -4520,7 +4735,7 @@ class PspSettings {
|
|
4520 |
$excluded_ids = array();
|
4521 |
|
4522 |
if( !empty( $psp_sm_settings[$gsckey] ) ) {
|
4523 |
-
error_log(print_r($psp_sm_settings[$gsckey], true));
|
4524 |
$excluded_ids = explode(",", $psp_sm_settings[$gsckey]);
|
4525 |
}
|
4526 |
|
@@ -4541,7 +4756,7 @@ class PspSettings {
|
|
4541 |
|
4542 |
|
4543 |
if (($id = array_search($post_id, $excluded_ids)) !== false) {
|
4544 |
-
error_log(print_r($excluded_ids[$id], true));
|
4545 |
unset($excluded_ids[$id]);
|
4546 |
}
|
4547 |
if(!empty($excluded_ids)) {
|
@@ -4658,6 +4873,12 @@ class PspSettings {
|
|
4658 |
$psp_sanitized_seo_data['keywords'] = sanitize_text_field( $psp_seo_data['keywords'] );
|
4659 |
}
|
4660 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4661 |
$psp_sanitized_seo_data['noindex'] = '';
|
4662 |
if ( isset( $psp_seo_data['noindex'] ) ) {
|
4663 |
$psp_sanitized_seo_data['noindex'] = !is_null(filter_var($psp_seo_data['noindex'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $psp_seo_data['noindex'] : '';
|
@@ -5039,9 +5260,10 @@ class PspSettings {
|
|
5039 |
}
|
5040 |
?>
|
5041 |
<div class="wrap">
|
5042 |
-
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO
|
5043 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
5044 |
<?php $this->psp_options_tabs(); ?>
|
|
|
5045 |
<form name="platinum-seo-form" method="post" action="options.php">
|
5046 |
<?php wp_nonce_field( 'update-options' ); ?>
|
5047 |
<?php settings_fields( $tab ); ?>
|
@@ -5054,16 +5276,18 @@ class PspSettings {
|
|
5054 |
} else {do_settings_sections( $tab );} ?>
|
5055 |
<?php submit_button('Save Settings', 'primary', $psp_button); ?>
|
5056 |
</form>
|
|
|
|
|
|
|
5057 |
|
5058 |
<div class="sidebar-cta">
|
5059 |
<h2>
|
5060 |
-
<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
|
|
|
5061 |
</h2>
|
5062 |
<div class="container bg-info" id="tools" style="width:100%">
|
5063 |
-
<div class="row"><div class="h3 col-sm-12"><a class="
|
5064 |
-
</div>
|
5065 |
-
<a href="https://techblissonline.com/tools/" target="_blank">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
|
5066 |
-
<div class="container" style="width:100%"><a href="https://techblissonline.com/tools/" target="_blank"><span class="col-sm-12 dashicons dashicons-thumbs-up dashicons-psp"></span></a></div>
|
5067 |
</div>
|
5068 |
</div>
|
5069 |
<?php
|
@@ -5083,6 +5307,7 @@ class PspSettings {
|
|
5083 |
//refresh rewrite rules
|
5084 |
$this->psp_refresh_rewrite_rules();
|
5085 |
}
|
|
|
5086 |
if ($current_tab == $this->psp_home_settings_group) {
|
5087 |
$psp_cm_home_html_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/html', 'codemirror'=> array('autoRefresh' => true)));
|
5088 |
$psp_cm_home_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
@@ -5100,14 +5325,19 @@ class PspSettings {
|
|
5100 |
|
5101 |
}
|
5102 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
5103 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
|
|
5104 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
5105 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
5106 |
|
5107 |
//screen_icon();
|
|
|
5108 |
echo '<h2 class="nav-tab-wrapper">';
|
5109 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
5110 |
$psp_icon = '';
|
|
|
|
|
|
|
5111 |
if ($tab_key == $this->psp_home_settings_group) {
|
5112 |
$psp_icon = '<span class="dashicons dashicons-admin-home"></span> ';
|
5113 |
}
|
19 |
public $psp_wmt_instance;
|
20 |
public $psp_tools_instance;
|
21 |
public $psp_pre_instance;
|
22 |
+
public $psp_rcap_instance;
|
23 |
public $psp_redirect_instance;
|
24 |
public $psp_social_instance;
|
25 |
public $psp_import_instance;
|
26 |
public $psp_sitemap_instance;
|
27 |
+
public $psp_wizard_instance;
|
28 |
|
29 |
private $psp_helper;
|
30 |
private $sitename;
|
79 |
//$psp_wmt_instance = PspWebMasterToolSettings::get_instance();
|
80 |
//$this->psp_wmt_instance = $psp_wmt_instance;
|
81 |
|
82 |
+
$psp_pre_instance = PspPreSettings::get_instance();
|
83 |
$this->psp_pre_instance = $psp_pre_instance;
|
84 |
|
85 |
+
$psp_rcap_instance = PspRcapSettings::get_instance();
|
86 |
+
$this->psp_rcap_instance = $psp_rcap_instance;
|
87 |
+
|
88 |
$psp_tools_instance = PspToolSettings::get_instance();
|
89 |
$this->psp_tools_instance = $psp_tools_instance;
|
90 |
|
99 |
|
100 |
$this->psp_sitemap_instance = PspSmSettings::get_instance();
|
101 |
|
102 |
+
//$this->psp_wizard_instance = PspWizard::get_instance();
|
103 |
+
$this->psp_wizard_instance = PspWizardSettings::get_instance();
|
104 |
+
$this->psp_wizard_instance->psp_settings_instance = $this;
|
105 |
+
|
106 |
+
|
107 |
$psp_do_rewrite_rules = false;
|
108 |
|
109 |
$cust_taxonomies = array();
|
173 |
//if (!$psp_premium_status) $this->psp_settings_tabs[$this->psp_social_settings_group] = 'Social';
|
174 |
$this->psp_settings_tabs[$this->psp_other_settings_group] = 'Others';
|
175 |
$this->psp_settings_tabs[$this->psp_breadcrumb_settings_group] = 'Breadcrumbs';
|
176 |
+
//error_log(print_r($this->psp_settings_tabs, true));
|
177 |
+
foreach ($this->psp_settings_tabs as $psp_group => $psp_group_name) {
|
178 |
+
//Allow psp_capability
|
179 |
+
add_filter( 'option_page_capability_'.$psp_group, function( $capability ){
|
180 |
+
//error_log("psp const cap ".'psp_capability');
|
181 |
+
return 'edit_posts';
|
182 |
+
} );
|
183 |
+
}
|
184 |
|
185 |
|
186 |
//add extra fields to category edit form hook
|
191 |
|
192 |
}
|
193 |
|
194 |
+
/*
|
195 |
+
* Check user access capability
|
196 |
+
*/
|
197 |
+
protected function user_has_access ( $tab ) {
|
198 |
+
|
199 |
+
if ( is_super_admin() ) return true;
|
200 |
+
|
201 |
+
$psp_rcap_settings = get_option("psp_rolecap");
|
202 |
+
|
203 |
+
$currentuser_roles = array();
|
204 |
+
$capabilities = array();
|
205 |
+
|
206 |
+
if( is_user_logged_in() ) {
|
207 |
+
$user = wp_get_current_user();
|
208 |
+
$currentuser_roles = ( array ) $user->roles;
|
209 |
+
//error_log (print_r($currentuser_roles, true));
|
210 |
+
} else {
|
211 |
+
return false;
|
212 |
+
}
|
213 |
+
|
214 |
+
if ( !empty( $currentuser_roles ) ) {
|
215 |
+
|
216 |
+
foreach ( $currentuser_roles as $role ) {
|
217 |
+
|
218 |
+
if ( $role === "administrator" ) return true;
|
219 |
+
|
220 |
+
if ( !empty ($psp_rcap_settings[$role]) ) {
|
221 |
+
$capabilities = $psp_rcap_settings[$role];
|
222 |
+
|
223 |
+
if ( ! in_array($tab, $capabilities) ) {
|
224 |
+
return false;
|
225 |
+
} else {
|
226 |
+
return true;
|
227 |
+
}
|
228 |
+
|
229 |
+
} else {
|
230 |
+
return false;
|
231 |
+
}
|
232 |
+
|
233 |
+
}
|
234 |
+
} else {
|
235 |
+
return false;
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
/*
|
240 |
* Registers settings
|
241 |
*/
|
424 |
//$this->psp_home_settings = $psp_home_settings;
|
425 |
//register
|
426 |
register_setting( $this->psp_home_settings_group, $psp_home_settings_name, array( &$this, 'sanitize_home_settings' ) );
|
427 |
+
|
428 |
//add Section
|
429 |
add_settings_section( 'psp_section_home', esc_html__('Home Page SEO Settings', 'platinum-seo-pack' ), array( &$this, 'section_home_desc' ), $this->psp_home_settings_group );
|
430 |
//add fields
|
447 |
'label_for' => 'psp_home_title',
|
448 |
'option_name' => $psp_home_settings_name.'[title]',
|
449 |
'option_value' => isset($psp_home_settings['title']) ? stripcslashes(esc_attr($psp_home_settings['title'])) : '',
|
450 |
+
'option_description' => esc_html__( 'Enter a title in plain text. Do not use any tags.', 'platinum-seo-pack' )
|
451 |
);
|
452 |
|
453 |
$desc_field = array (
|
454 |
'label_for' => 'psp_home_description',
|
455 |
'option_name' => $psp_home_settings_name.'[description]',
|
456 |
'option_value' => isset($psp_home_settings['description']) ? stripcslashes(esc_attr($psp_home_settings['description'])) : '',
|
457 |
+
'option_description' => esc_html__( 'Enter a meta description in plain text. Do not use any tags.', 'platinum-seo-pack' )
|
458 |
);
|
459 |
|
460 |
$keywords_field = array (
|
516 |
}
|
517 |
|
518 |
function sanitize_home_settings($settings) {
|
519 |
+
|
520 |
+
if( ! empty( $settings['wizard'] ) ) {
|
521 |
+
|
522 |
+
return $settings;
|
523 |
+
|
524 |
+
}
|
525 |
|
526 |
if( isset( $settings['use_front_page'] ) ) {
|
527 |
$settings['use_front_page'] = !is_null(filter_var($settings['use_front_page'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_front_page'] : '';
|
653 |
|
654 |
//Fields
|
655 |
|
656 |
+
//Disable platinum seo
|
657 |
+
$platinum_seo_disable_field = array (
|
658 |
+
'label_for' => 'psp_'.$setting_name.'_disable_psp',
|
659 |
+
'option_name' => $psp_settings_name.'[disable_psp]',
|
660 |
+
'option_value' => isset($psp_settings['disable_psp']) ? $psp_settings['disable_psp'] : '',
|
661 |
+
'checkbox_label' => '<code>Disable</code>',
|
662 |
+
'option_description' => esc_html__( 'This will disable Platinum SEO titles, meta tags and structured data schema markups for all posts, pages, taxonomies and archives. You can however use the redirections, 404 error detection modules and sitemaps, if the corresponding modules are enabled in Platinum seo.', 'platinum-seo-pack' )
|
663 |
+
);
|
664 |
+
|
665 |
+
$platinum_seo_disable_id = 'psp_'.$setting_name.'_disable_psp';
|
666 |
+
$platinum_seo_disable_title = esc_html__( 'Platinum SEO: ', 'platinum-seo-pack' );
|
667 |
+
|
668 |
+
add_settings_field( $platinum_seo_disable_id, $platinum_seo_disable_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $platinum_seo_disable_field );
|
669 |
+
|
670 |
//Noindex subpages
|
671 |
$noindex_subpages_field = array (
|
672 |
'label_for' => 'psp_'.$setting_name.'_noindex_subpages',
|
741 |
);
|
742 |
|
743 |
$use_meta_noydir_field_id = 'psp_'.$setting_name.'_use_meta_noydir';
|
744 |
+
$use_meta_noydir_field_title = esc_html__( 'Use noydir: ', 'platinum-seo-pack' );
|
745 |
|
746 |
//add_settings_field( $use_meta_noydir_field_id, $use_meta_noydir_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $use_meta_noydir_field );
|
747 |
|
1135 |
}
|
1136 |
|
1137 |
function sanitize_general_settings($settings) {
|
1138 |
+
|
1139 |
+
//error_log(print_r( $settings, true ));
|
1140 |
+
|
1141 |
+
if( ! empty( $settings['wizard'] ) ) {
|
1142 |
+
|
1143 |
+
return $settings;
|
1144 |
+
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
//error_log('settings not returned' );
|
1148 |
|
1149 |
if( isset( $settings['separator'] ) ) {
|
1150 |
|
1893 |
'option_name' => $psp_settings_name.'[referrer_404]',
|
1894 |
'option_value' => isset($psp_settings['referrer_404']) ? $psp_settings['referrer_404'] : '',
|
1895 |
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
1896 |
+
'option_description' => esc_html__( 'Turn ON to track only 404 errors that occur due to a broken link reference from the site linking to your site.', 'platinum-seo-pack' ),
|
1897 |
);
|
1898 |
|
1899 |
$psp_referrer_404_field_id = 'psp_referrer_404';
|
1970 |
}
|
1971 |
|
1972 |
function sanitize_permalink_settings($settings) {
|
1973 |
+
|
1974 |
+
if( ! empty( $settings['wizard'] ) ) {
|
1975 |
+
|
1976 |
+
return $settings;
|
1977 |
+
|
1978 |
+
}
|
1979 |
|
1980 |
if( isset( $settings['redirection'] ) ) {
|
1981 |
$settings['redirection'] = !is_null(filter_var($settings['redirection'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['redirection'] : '';
|
2840 |
$checked = '';
|
2841 |
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
2842 |
if($option_value) { $checked = ' checked="checked" '; }
|
2843 |
+
echo "<div class='psp-bs'><input ".esc_attr($checked)." id='".esc_attr($id)."' name='".esc_attr($option_name)."' type='checkbox' data-toggle='toggle'/><span> </span><span for='".esc_attr($id)."'>".wp_kses(html_entity_decode($checkbox_label), $desc_allowed_html)."</span><br /><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p></div>";
|
2844 |
|
2845 |
}
|
2846 |
|
2874 |
//$selected = ($option_value==$val) ? 'selected="selected"' : '';
|
2875 |
//echo "<option value='$val' $selected>$key</option>";
|
2876 |
}
|
2877 |
+
echo "</select><p class='description' for='".esc_attr($id)."'> ".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
2878 |
|
2879 |
}
|
2880 |
|
2926 |
*/
|
2927 |
function add_admin_menus() {
|
2928 |
//add_options_page( 'Platinum SEO New Settings', 'My Settings', 'manage_options', $this->psp_plugin_options_key, array( &$this, 'psp_options_page' ) );
|
2929 |
+
if ($this->psp_helper->user_has_access('psp_general')) {
|
2930 |
+
add_menu_page(esc_html__('Techblissonline Platinum SEO and social Pack', 'platinum-seo-pack'), esc_html__('Platinum SEO and Social Pack', 'platinum-seo-pack'), 'edit_posts', $this->psp_plugin_options_key, array($this, 'psp_options_page'), plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) )), 5);
|
2931 |
+
}
|
2932 |
//add_menu_page(esc_html__('Techblissonline Platinum SEO and social Pack', 'platinum-seo-pack'), esc_html__('Platinum SEO and Social Pack', 'platinum-seo-pack'), 'manage_options', $this->psp_plugin_options_key, array($this, 'psp_options_page'), plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) )));
|
2933 |
+
if ($this->psp_helper->user_has_access('psp_general')) {
|
2934 |
+
add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO and social Pack', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-settings"></span> '.esc_html__('SEO', 'platinum-seo-pack'), 'edit_posts', $this->psp_plugin_options_key);
|
2935 |
+
}
|
2936 |
$psp_settings = get_option('psp_pre_setting');
|
2937 |
$psp_premium_valid = isset($psp_settings['premium']) ? $psp_settings['premium'] : '';
|
2938 |
$psp_premium_status = isset($psp_settings['psp_premium_license_key_status']) ? $psp_settings['psp_premium_license_key_status'] : '';
|
2941 |
//$psp_premium_valid = 1;
|
2942 |
//$psp_premium_status = 1;
|
2943 |
//if ($psp_premium_valid && $psp_premium_status)
|
2944 |
+
if ($this->psp_helper->user_has_access('psp_social')) {
|
2945 |
+
add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Social', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-settings"></span> '.esc_html__('Social', 'platinum-seo-pack'), 'edit_posts', 'psp-social-by-techblissonline', array($this->psp_social_instance, 'psp_social_options_page'));
|
2946 |
+
}
|
2947 |
//add_submenu_page($this->psp_plugin_options_key, __('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), __('SEO - Advanced', 'platinum-seo-pack'), 'manage_options', 'webmastertools', array($this->psp_wmt_instance, 'psp_wmt_options_page'));
|
2948 |
//add_submenu_page($this->psp_plugin_options_key, __('Techblissonline Platinum SEO Analytics', 'platinum-seo-pack'), __('SEO - Analytics', 'platinum-seo-pack'), 'manage_options', 'psp-gatracking-by-techblissonline', array($this->psp_ga_instance, 'psp_ga_options_page'));
|
2949 |
+
if ($this->psp_helper->user_has_access('psp_robotstxt')) {
|
2950 |
+
add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Tools', 'platinum-seo-pack'), '<span class="dashicons dashicons-edit"></span> '.esc_html__('SEO - Editors', 'platinum-seo-pack'), 'edit_posts', 'psp-tools-by-techblissonline', array($this->psp_tools_instance, 'psp_tools_options_page'));
|
2951 |
+
}
|
2952 |
+
add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-tools"></span> '.esc_html__(' SEO Tools', 'platinum-seo-pack'), 'edit_posts', 'psp-seo-tools-by-techblissonline', array( &$this, 'psp_pre_tools_display_page'));
|
2953 |
+
if ($this->psp_helper->user_has_access('redirections')) {
|
2954 |
+
$psp_redir_page = add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Redirections', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-tools"></span> '.esc_html__('Redirections', 'platinum-seo-pack'), 'edit_posts', 'redirectionmanager', array($this->psp_redirect_instance, 'redir_mgmtpage'));
|
2955 |
+
}
|
2956 |
+
if ($this->psp_helper->user_has_access('manager404')) {
|
2957 |
+
$psp_404_page = add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO 404 Manager', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-tools"></span> '.esc_html__('Manage 404 Errors', 'platinum-seo-pack'), 'edit_posts', 'manager404', array($this->psp_redirect_instance, 'manage_404_page'));
|
2958 |
+
}
|
2959 |
+
add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-network"></span> '.esc_html__('Role Manager', 'platinum-seo-pack'), 'manage_options', 'pspp-caps', array($this->psp_rcap_instance, 'psp_rolecap_options_page'));
|
2960 |
//add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), __('Techblissonline - SEO Tools', 'platinum-seo-pack'), 'manage_options', 'psp-seo-tools-by-techblissonline', array($this->psp_pre_instance, 'psp_pre_options_page'));
|
2961 |
if ($psp_premium_valid) add_submenu_page($this->psp_plugin_options_key, esc_html__('Techblissonline Platinum SEO Premium Pack', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-network"></span> '.esc_html__('Premium - Licenses', 'platinum-seo-pack'), 'manage_options', 'pspp-licenses', array($this->psp_pre_instance, 'psp_premium_options_page'));
|
2962 |
}
|
3014 |
//wp_nonce_field( 'do_psp_extra_category_fields', 'psp_extra_category_fields_nonce' );
|
3015 |
//$cat_meta = get_option( "psp_category_metas_$category_id");
|
3016 |
?>
|
3017 |
+
</table>
|
3018 |
<?php wp_nonce_field( 'do_psp_extra_category_fields', 'psp_extra_category_fields_nonce' );
|
3019 |
$psp_type = "taxonomy";
|
3020 |
//available tags array
|
3076 |
<li class="analysis"><a href="#analysis" title="SEO Analysis"><span class="dashicons dashicons-dashboard"></span><?php esc_html_e( ' Analysis', 'platinum-seo-pack' ); ?></a></li>
|
3077 |
<li class="advanced"><a href="#advanced" title="Advanced SEO"><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3078 |
<li class="social"><a href="#bsocial" title="Basic Social"><span class="dashicons dashicons-share"></span><?php esc_html_e( ' Basic', 'platinum-seo-pack' ); ?></a></li>
|
3079 |
+
<li class="social"><a href="#asocial" title="Advanced Social"><span class="dashicons dashicons-networking"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3080 |
<?php } ?>
|
3081 |
</ul>
|
3082 |
<br class="clear" />
|
3323 |
<?php if (!$psp_metabox_advanced_hidden || is_super_admin()) { ?>
|
3324 |
<li class="advanced"><a href="#advanced" title="Advanced SEO"><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3325 |
<li class="social"><a href="#bsocial" title="Basic Social"><span class="dashicons dashicons-share"></span><?php esc_html_e( ' Basic', 'platinum-seo-pack' ); ?></a></li>
|
3326 |
+
<li class="social"><a href="#asocial" title="Advanced Social"><span class="dashicons dashicons-networking"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3327 |
<?php } ?>
|
3328 |
</ul>
|
3329 |
<br class="clear" />
|
3484 |
if (!$psp_post_metabox_hidden || is_super_admin()) {
|
3485 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'post', 'normal', 'high' );
|
3486 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'post', 'normal', 'high' );
|
3487 |
+
if ( $this->psp_helper->user_has_access('metabox') ) {
|
3488 |
+
add_meta_box( 'postpsp', '<span align="left">'.'<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ).'</span>', array( &$this, 'psp_do_seo_metabox' ), 'post', 'normal', 'high' );
|
3489 |
+
}
|
3490 |
}
|
3491 |
|
3492 |
$psp_page_settings = get_option("psp_page_settings");
|
3494 |
if (!$psp_page_metabox_hidden || is_super_admin()) {
|
3495 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'page', 'normal', 'high' );
|
3496 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), 'page', 'normal', 'high' );
|
3497 |
+
if ( $this->psp_helper->user_has_access('metabox') ) {
|
3498 |
+
add_meta_box( 'postpsp', '<span align="left">'.'<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ).'</span>', array( &$this, 'psp_do_seo_metabox' ), 'page', 'normal', 'high' );
|
3499 |
+
}
|
3500 |
}
|
3501 |
|
3502 |
$cust_post_types = array();
|
3511 |
if (!$psp_posttype_metabox_hidden || is_super_admin()) {
|
3512 |
//add_meta_box( 'postpsp', esc_html__( 'Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), $cust_post_type, 'normal', 'high' );
|
3513 |
//add_meta_box( 'postpsp', '<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ), array( &$this, 'psp_do_seo_metabox' ), $cust_post_type, 'normal', 'high' );
|
3514 |
+
if ( $this->psp_helper->user_has_access('metabox') ) {
|
3515 |
+
add_meta_box( 'postpsp', '<span align="left">'.'<img src="'.esc_url(plugins_url( 'images/techblissonline-platinum-seo-pack.ico', dirname(dirname(__FILE__) ))).'" />'.esc_html__( ' Techblissonline Platinum SEO and Social Meta Box', 'platinum-seo-pack' ).'</span>', array( &$this, 'psp_do_seo_metabox' ), $cust_post_type, 'normal', 'high' );
|
3516 |
+
}
|
3517 |
}
|
3518 |
}
|
3519 |
|
3526 |
}
|
3527 |
|
3528 |
//add metabox to post types
|
3529 |
+
function psp_do_seo_metabox( $psp_object = NULL, $pspmeta = [], $saving = false ) { //check for existing featured ID
|
3530 |
+
//error_log(print_r($psp_object, true));
|
3531 |
+
//error_log(print_r($pspmeta, true));
|
3532 |
global $post;
|
3533 |
//$psp_posttype_metabox_hidden = false;
|
3534 |
$psp_settings_name = "psp_".$post->post_type."_settings";
|
3706 |
|
3707 |
$psp_post_meta['preferred_term'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_preferred_term'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_preferred_term'][0]) : '';
|
3708 |
|
3709 |
+
//linkingkeywords
|
3710 |
+
$psp_post_meta['linkingkeywords'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_linkingkeywords'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_linkingkeywords'][0]) : '';
|
3711 |
+
|
3712 |
$psp_post_disablers = !empty($wp_post_meta_data_arr['_techblissonline_psp_disable_flags'][0]) ? unserialize($wp_post_meta_data_arr['_techblissonline_psp_disable_flags'][0]) : array();
|
3713 |
//$psp_social_meta = unserialize($wp_post_meta_data_arr['_techblissonline_psp_social_data'][0]);
|
3714 |
|
3770 |
$psp_social_meta['sc_image'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_sc_image'][0]) ? esc_url_raw($wp_post_meta_data_arr['_techblissonline_psp_sc_image'][0]) : '';
|
3771 |
/******
|
3772 |
$psp_post_meta['disable_title'] = $psp_post_disablers['disable_title'];
|
3773 |
+
$psp_post_meta['disable_description'] = $psp_post_disablers['disable_description'];
|
3774 |
+
$psp_post_meta['disable_keywords'] = $psp_post_disablers['disable_keywords'];
|
3775 |
+
$psp_post_meta['disable_canonical'] = $psp_post_disablers['disable_canonical'];
|
3776 |
+
$psp_post_meta['disable_title_format'] = $psp_post_disablers['disable_title_format'];
|
3777 |
+
$psp_post_meta['disable_desc_format'] = $psp_post_disablers['disable_desc_format'];
|
3778 |
$psp_post_meta['disable_psp'] = $psp_post_disablers['disable_psp'];
|
3779 |
********/
|
3780 |
//$psp_post_meta = array_merge($psp_post_meta, $psp_post_disablers, $psp_social_meta);
|
3783 |
//$psp_social_meta = array_merge((array)$psp_social_meta, (array)$psp_post_tw_data_images, (array)$psp_post_social_tw_label_data);
|
3784 |
//$psp_social_meta = array_merge($psp_social_meta, $psp_post_tw_data_images, $psp_post_social_tw_label_data, $psp_post_social_enablers);
|
3785 |
$this->psp_post_social_meta_original = $psp_social_meta;
|
3786 |
+
$psp_original_meta = array();
|
3787 |
+
$psp_original_meta['seo_meta'] = $psp_seo_meta;
|
3788 |
+
$psp_original_meta['social_meta'] = $psp_social_meta;
|
3789 |
+
|
3790 |
+
if ($saving) {
|
3791 |
+
return $psp_original_meta;
|
3792 |
+
}
|
3793 |
+
|
3794 |
$psp_type = "posttype";
|
3795 |
|
3796 |
//Taxonomies for breadcrumb tags
|
3868 |
<div id="psp-meta-box-parent">
|
3869 |
<div id="psp-meta-box">
|
3870 |
<ul class="psp-metabox-tabs" id="psp-metabox-tabs">
|
3871 |
+
<?php if ( $this->psp_helper->user_has_access('metabox') ) { ?>
|
3872 |
+
<li class="basic"><a href="#basic" title="Generic SEO"><span class="dashicons dashicons-admin-generic"></span><?php esc_html_e( ' SEO', 'platinum-seo-pack' ); ?></a></li>
|
3873 |
+
<?php } ?>
|
3874 |
+
<?php if ( $this->psp_helper->user_has_access('analysis') ) { ?>
|
3875 |
+
<li class="analysis"><a href="#analysis" title="SEO Analysis"><span class="dashicons dashicons-dashboard"></span><?php esc_html_e( ' Analysis', 'platinum-seo-pack' ); ?></a></li>
|
3876 |
+
<?php } ?>
|
3877 |
<?php if (!$psp_posttype_metabox_advanced_hidden || is_super_admin()) { ?>
|
3878 |
+
<?php if ( $this->psp_helper->user_has_access('advancedseo') ) { ?>
|
3879 |
+
<li class="advanced"><a href="#advanced" title="Advanced SEO"><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3880 |
+
<?php } ?>
|
3881 |
+
<?php if ( $this->psp_helper->user_has_access('basicsocial') ) { ?>
|
3882 |
+
<li class="social"><a href="#bsocial" title="Basic Social"><span class="dashicons dashicons-share"></span><?php esc_html_e( ' Basic', 'platinum-seo-pack' ); ?></a></li>
|
3883 |
+
<?php } ?>
|
3884 |
+
<?php if ( $this->psp_helper->user_has_access('advancedsocial') ) { ?>
|
3885 |
+
<li class="social"><a href="#asocial" title="Advanced Social"><span class="dashicons dashicons-networking"></span><?php esc_html_e( ' Advanced', 'platinum-seo-pack' ); ?></a></li>
|
3886 |
+
<?php } ?>
|
3887 |
+
<?php if ( $this->psp_helper->user_has_access('internallinks') ) { ?>
|
3888 |
+
<li class="social"><a href="#ilinks" title="Internal Links"><span class="dashicons dashicons-admin-links"></span><?php esc_html_e( ' Internal Links', 'platinum-seo-pack' ); ?></a></li>
|
3889 |
+
<?php } ?>
|
3890 |
|
3891 |
<?php } ?>
|
3892 |
</ul>
|
3893 |
<br class="clear" />
|
3894 |
+
<?php if ( $this->psp_helper->user_has_access('metabox') ) { ?>
|
3895 |
+
<div id="basic" class="psptab">
|
3896 |
<?php include_once( 'psp_basic_metabox_renderer.php' ); ?>
|
3897 |
</div>
|
3898 |
+
<?php } ?>
|
3899 |
+
<?php if ( $this->psp_helper->user_has_access('analysis') ) { ?>
|
3900 |
+
<div id="analysis" class="psptab">
|
3901 |
+
<?php include_once( 'psp_analysis_metabox_renderer.php' ); ?>
|
3902 |
+
</div>
|
3903 |
+
<?php } ?>
|
3904 |
<?php
|
3905 |
if (!$psp_posttype_metabox_advanced_hidden || is_super_admin()) {
|
3906 |
// if ($psp_posttype_metabox_advanced_hidden ) {
|
3907 |
?>
|
3908 |
+
<?php if ( $this->psp_helper->user_has_access('advancedseo') ) { ?>
|
3909 |
+
<div id="advanced" class="hidden psptab wrap">
|
3910 |
+
<?php include_once( 'psp_advanced_metabox_renderer.php' ); ?>
|
3911 |
+
</div>
|
3912 |
+
<?php } ?>
|
3913 |
+
<?php if ( $this->psp_helper->user_has_access('basicsocial') ) { ?>
|
3914 |
+
<div id="bsocial" class="psptab">
|
3915 |
+
<?php include_once( 'psp_basic_social_metabox_renderer.php' ); ?>
|
3916 |
+
</div>
|
3917 |
+
<?php } ?>
|
3918 |
+
<?php if ( $this->psp_helper->user_has_access('advancedsocial') ) { ?>
|
3919 |
<div id="asocial" class="psptab">
|
3920 |
<?php if ($psp_premium_valid && $psp_premium_status) {
|
3921 |
+
$metabox_template = apply_filters('psp_metabox_template', '');
|
3922 |
+
if (empty($metabox_template)) { ?>
|
3923 |
+
<div class="psp-bs">
|
3924 |
+
<div class="container">
|
3925 |
+
<?php
|
3926 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
3927 |
+
$metabox_template = 'psp_premiumad_metabox_renderer.php';
|
3928 |
+
include( $metabox_template );
|
3929 |
+
//include( 'psp_premiumad_metabox_renderer.php' ); ?>
|
3930 |
+
</div>
|
3931 |
+
</div>
|
3932 |
+
<?php } else {
|
3933 |
+
include_once( $metabox_template );
|
3934 |
+
}
|
3935 |
} else { ?>
|
3936 |
<div class="psp-bs">
|
3937 |
<div class="container">
|
3938 |
<?php
|
3939 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
3940 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
3941 |
+
include( 'psp_premiumad_metabox_renderer.php' ); ?>
|
3942 |
</div></div>
|
3943 |
<?php }
|
3944 |
?>
|
3945 |
</div>
|
3946 |
+
<?php } ?>
|
3947 |
+
<?php if ( $this->psp_helper->user_has_access('internallinks') ) { ?>
|
3948 |
+
<div id="ilinks" class="psptab">
|
3949 |
+
<?php if ($psp_premium_valid && $psp_premium_status) {
|
3950 |
+
$metabox_template = apply_filters('psp_ilinks_template', '');
|
3951 |
+
if (empty($metabox_template)) { ?>
|
3952 |
+
<div class="psp-bs">
|
3953 |
+
<div class="container">
|
3954 |
+
<?php
|
3955 |
+
//error_log($metabox_template);
|
3956 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
3957 |
+
$metabox_template = 'psp_premiumad_metabox_renderer.php';
|
3958 |
+
include( $metabox_template );
|
3959 |
+
//include( 'psp_premiumad_metabox_renderer.php' ); ?>
|
3960 |
+
</div></div>
|
3961 |
+
<?php } else {
|
3962 |
+
//error_log($metabox_template);
|
3963 |
+
include_once( $metabox_template );
|
3964 |
+
}
|
3965 |
+
} else { ?>
|
3966 |
+
<div class="psp-bs">
|
3967 |
+
<div class="container">
|
3968 |
+
<?php
|
3969 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
3970 |
+
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
3971 |
+
include( 'psp_premiumad_metabox_renderer.php' ); ?>
|
3972 |
+
</div></div>
|
3973 |
+
<?php }
|
3974 |
+
?>
|
3975 |
+
</div>
|
3976 |
+
<?php } ?>
|
3977 |
<?php
|
3978 |
}
|
3979 |
?>
|
4044 |
$psp_metabox_advanced_hidden = isset($psp_settings['hide_metabox_advanced']) ? $psp_settings['hide_metabox_advanced'] : '';
|
4045 |
|
4046 |
if (is_super_admin()) $psp_metabox_advanced_hidden = false;
|
4047 |
+
|
4048 |
+
$psp_original_meta = $this->psp_do_seo_metabox( NULL, [], true );
|
4049 |
+
/**
|
4050 |
if (!empty($this->psp_post_meta_original)) {
|
4051 |
$psp_post_seo_data_original = $this->psp_post_meta_original;
|
4052 |
}
|
4053 |
+
**/
|
4054 |
+
if (!empty($psp_original_meta['seo_meta'])) {
|
4055 |
+
$psp_post_seo_data_original = $psp_original_meta['seo_meta'];
|
4056 |
+
}
|
4057 |
+
/***
|
4058 |
if(!empty($this->psp_post_social_meta_original)) {
|
4059 |
$psp_post_social_data_original = $this->psp_post_social_meta_original;
|
4060 |
}
|
4061 |
+
***/
|
4062 |
+
if (!empty($psp_original_meta['social_meta'])) {
|
4063 |
+
$psp_post_social_data_original = $psp_original_meta['social_meta'];
|
4064 |
+
}
|
4065 |
|
4066 |
$psp_post_seo_data_current = !empty($_POST['psp_seo_meta']) ? $this->psp_sanitze_seo_data($_POST['psp_seo_meta']) : array();
|
4067 |
|
4403 |
delete_metadata( 'platinumseo', $post_id, '_techblissonline_psp_preferred_term');
|
4404 |
}
|
4405 |
|
4406 |
+
//linkingkeywords
|
4407 |
+
if (!empty($psp_post_seo_data['linkingkeywords'])) {
|
4408 |
+
//update_post_meta( $post_id, '_techblissonline_psp_linkingkeywords', $psp_post_seo_data['linkingkeywords'] );
|
4409 |
+
update_metadata( 'platinumseo', $post_id, '_techblissonline_psp_linkingkeywords', $psp_post_seo_data['linkingkeywords'] );
|
4410 |
+
} else {
|
4411 |
+
//delete_post_meta( $post_id, '_techblissonline_psp_linkingkeywords');
|
4412 |
+
delete_metadata( 'platinumseo', $post_id, '_techblissonline_psp_linkingkeywords');
|
4413 |
+
}
|
4414 |
+
|
4415 |
//update disable flags
|
4416 |
$psp_post_seo_data_disablers = array();
|
4417 |
|
4434 |
|
4435 |
/*******
|
4436 |
$psp_post_social_data['fb_title'] = $psp_post_seo_data['fb_title'];
|
4437 |
+
$psp_post_social_data['fb_description'] = $psp_post_seo_data['fb_description'];
|
4438 |
$psp_post_social_data['fb_image'] = $psp_post_seo_data['fb_image'];
|
4439 |
$psp_post_social_data['tw_title'] = $psp_post_seo_data['tw_title'];
|
4440 |
+
$psp_post_social_data['tw_description'] = $psp_post_seo_data['tw_description'];
|
4441 |
$psp_post_social_data['tw_image'] = $psp_post_seo_data['tw_image'];
|
4442 |
$psp_post_social_data['sc_title'] = $psp_post_seo_data['sc_title'];
|
4443 |
+
$psp_post_social_data['sc_description'] = $psp_post_seo_data['sc_description'];
|
4444 |
$psp_post_social_data['sc_image'] = $psp_post_seo_data['sc_image'];
|
4445 |
************/
|
4446 |
/*******
|
4735 |
$excluded_ids = array();
|
4736 |
|
4737 |
if( !empty( $psp_sm_settings[$gsckey] ) ) {
|
4738 |
+
//error_log(print_r($psp_sm_settings[$gsckey], true));
|
4739 |
$excluded_ids = explode(",", $psp_sm_settings[$gsckey]);
|
4740 |
}
|
4741 |
|
4756 |
|
4757 |
|
4758 |
if (($id = array_search($post_id, $excluded_ids)) !== false) {
|
4759 |
+
//error_log(print_r($excluded_ids[$id], true));
|
4760 |
unset($excluded_ids[$id]);
|
4761 |
}
|
4762 |
if(!empty($excluded_ids)) {
|
4873 |
$psp_sanitized_seo_data['keywords'] = sanitize_text_field( $psp_seo_data['keywords'] );
|
4874 |
}
|
4875 |
|
4876 |
+
//linking keywords
|
4877 |
+
$psp_sanitized_seo_data['linkingkeywords'] = '';
|
4878 |
+
if ( isset( $psp_seo_data['linkingkeywords'] ) ) {
|
4879 |
+
$psp_sanitized_seo_data['linkingkeywords'] = sanitize_text_field( $psp_seo_data['linkingkeywords'] );
|
4880 |
+
}
|
4881 |
+
|
4882 |
$psp_sanitized_seo_data['noindex'] = '';
|
4883 |
if ( isset( $psp_seo_data['noindex'] ) ) {
|
4884 |
$psp_sanitized_seo_data['noindex'] = !is_null(filter_var($psp_seo_data['noindex'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $psp_seo_data['noindex'] : '';
|
5260 |
}
|
5261 |
?>
|
5262 |
<div class="wrap">
|
5263 |
+
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO - SEO Settings', 'platinum-seo-pack') ?></h1>
|
5264 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
5265 |
<?php $this->psp_options_tabs(); ?>
|
5266 |
+
<?php if ($this->psp_helper->user_has_access( $tab )) { ?>
|
5267 |
<form name="platinum-seo-form" method="post" action="options.php">
|
5268 |
<?php wp_nonce_field( 'update-options' ); ?>
|
5269 |
<?php settings_fields( $tab ); ?>
|
5276 |
} else {do_settings_sections( $tab );} ?>
|
5277 |
<?php submit_button('Save Settings', 'primary', $psp_button); ?>
|
5278 |
</form>
|
5279 |
+
<?php } else { ?>
|
5280 |
+
<p style="color: red"><?php esc_html_e('You do not have access to these Options (Settings) tab of Techblissonline Platinum SEO', 'platinum-seo-pack') ?></p>
|
5281 |
+
<?php } ?>
|
5282 |
|
5283 |
<div class="sidebar-cta">
|
5284 |
<h2>
|
5285 |
+
<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>
|
5286 |
+
<a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/platinum-seo-no.jpg'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO WordPress Tools"/></a>
|
5287 |
</h2>
|
5288 |
<div class="container bg-info" id="tools" style="width:100%">
|
5289 |
+
<div class="row"><div class="h3 col-sm-12 btn-primary psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for WordPress</a></div><div class="h3 col-sm-12 btn-success psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
|
5290 |
+
</div>
|
|
|
|
|
5291 |
</div>
|
5292 |
</div>
|
5293 |
<?php
|
5307 |
//refresh rewrite rules
|
5308 |
$this->psp_refresh_rewrite_rules();
|
5309 |
}
|
5310 |
+
|
5311 |
if ($current_tab == $this->psp_home_settings_group) {
|
5312 |
$psp_cm_home_html_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/html', 'codemirror'=> array('autoRefresh' => true)));
|
5313 |
$psp_cm_home_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
5325 |
|
5326 |
}
|
5327 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
5328 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
5329 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
5330 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
5331 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
5332 |
|
5333 |
//screen_icon();
|
5334 |
+
|
5335 |
echo '<h2 class="nav-tab-wrapper">';
|
5336 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
5337 |
$psp_icon = '';
|
5338 |
+
if (! $this->psp_helper->user_has_access( $tab_key )) {
|
5339 |
+
continue;
|
5340 |
+
}
|
5341 |
if ($tab_key == $this->psp_home_settings_group) {
|
5342 |
$psp_icon = '<span class="dashicons dashicons-admin-home"></span> ';
|
5343 |
}
|
psp-include/settings/psp_social_settings.php
CHANGED
@@ -435,8 +435,15 @@ class PspSocialSettings extends PspSettings {
|
|
435 |
$psp_button = "submitsocialshare";
|
436 |
$psp_nonce_field = "psp-social-share";
|
437 |
}
|
438 |
-
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Pack -
|
441 |
Social', 'platinum-seo-pack') ?></h1>
|
442 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
@@ -452,14 +459,15 @@ class PspSocialSettings extends PspSettings {
|
|
452 |
<?php } else { include_once( 'psp_premiumad_metabox_renderer.php' ); } ?>
|
453 |
<div class="sidebar-cta">
|
454 |
<h2>
|
455 |
-
<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
|
|
|
456 |
</h2>
|
457 |
<div class="container bg-info" id="tools" style="width:100%">
|
458 |
-
<div class="row"><div class="h3 col-sm-12"><a class="
|
459 |
-
</div>
|
460 |
-
<a href="https://techblissonline.com/tools/" target="_blank">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
|
461 |
-
<div class="container" style="width:100%"><a href="https://techblissonline.com/tools/" target="_blank"><span class="col-sm-10 dashicons dashicons-thumbs-up dashicons-psp"></span></a></div>
|
462 |
</div>
|
|
|
|
|
463 |
</div>
|
464 |
<?php
|
465 |
}
|
@@ -473,10 +481,11 @@ class PspSocialSettings extends PspSettings {
|
|
473 |
function psp_social_tabs() {
|
474 |
$current_tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
475 |
//$current_tab = $active_tab;
|
476 |
-
|
477 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
478 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
479 |
-
wp_enqueue_style("psp-settings-
|
|
|
480 |
//screen_icon();
|
481 |
echo '<h2 class="nav-tab-wrapper">';
|
482 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
435 |
$psp_button = "submitsocialshare";
|
436 |
$psp_nonce_field = "psp-social-share";
|
437 |
}
|
438 |
+
?><style>.nav-tab{background: #f1f1f1 !important; box-shadow: none !important} a.nav-tab{color:#111 !important} .description{margin-bottom: 15px !important;} .psp-bs{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif !important;} .psp-bs h1{font-size: 23px !important; font-weight:400 !important} body{background: #fff !important;} .psp-btn {
|
439 |
+
-webkit-box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(4,4,4,.9) !important;
|
440 |
+
-moz-box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(4,4,4,.9) !important;
|
441 |
+
box-shadow: 2px 3px 0 rgba(4, 4, 4, 0.3), inset 0 -4px 0 rgba(0,0,0,.9 ) !important;
|
442 |
+
border-radius:0 !important;
|
443 |
+
padding-bottom: 10px !important;
|
444 |
+
} </style>
|
445 |
+
<div class="psp-bs">
|
446 |
+
<div class="wrap">
|
447 |
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Pack -
|
448 |
Social', 'platinum-seo-pack') ?></h1>
|
449 |
<p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
|
459 |
<?php } else { include_once( 'psp_premiumad_metabox_renderer.php' ); } ?>
|
460 |
<div class="sidebar-cta">
|
461 |
<h2>
|
462 |
+
<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>
|
463 |
+
<a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/platinum-seo-no.jpg'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO WordPress Tools"/></a>
|
464 |
</h2>
|
465 |
<div class="container bg-info" id="tools" style="width:100%">
|
466 |
+
<div class="row"><div class="h3 col-sm-12 btn-primary psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for WordPress</a></div><div class="h3 col-sm-12 btn-success psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
|
467 |
+
</div>
|
|
|
|
|
468 |
</div>
|
469 |
+
|
470 |
+
</div>
|
471 |
</div>
|
472 |
<?php
|
473 |
}
|
481 |
function psp_social_tabs() {
|
482 |
$current_tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
483 |
//$current_tab = $active_tab;
|
484 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
485 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
486 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
487 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
488 |
+
//wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
489 |
//screen_icon();
|
490 |
echo '<h2 class="nav-tab-wrapper">';
|
491 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
psp-include/settings/psp_tools_settings.php
CHANGED
@@ -530,13 +530,12 @@ class PspToolSettings extends PspSettings {
|
|
530 |
|
531 |
<div class="sidebar-cta">
|
532 |
<h2>
|
533 |
-
<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
|
|
|
534 |
</h2>
|
535 |
<div class="container bg-info" id="tools" style="width:100%">
|
536 |
-
<div class="row"><div class="h3 col-sm-12"><a class="
|
537 |
-
</div>
|
538 |
-
<a href="https://techblissonline.com/tools/" target="_blank">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
|
539 |
-
<div class="container" style="width:100%"><a href="https://techblissonline.com/tools/" target="_blank"><span class="col-sm-12 dashicons dashicons-thumbs-up dashicons-psp"></span></a></div>
|
540 |
</div>
|
541 |
</div>
|
542 |
<?php
|
@@ -553,7 +552,8 @@ class PspToolSettings extends PspSettings {
|
|
553 |
//$current_tab = $active_tab;
|
554 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
555 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
556 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
|
|
557 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
558 |
//screen_icon();
|
559 |
echo '<h2 class="nav-tab-wrapper">';
|
530 |
|
531 |
<div class="sidebar-cta">
|
532 |
<h2>
|
533 |
+
<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>
|
534 |
+
<a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/platinum-seo-no.jpg'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO WordPress Tools"/></a>
|
535 |
</h2>
|
536 |
<div class="container bg-info" id="tools" style="width:100%">
|
537 |
+
<div class="row"><div class="h3 col-sm-12 btn-primary psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for WordPress</a></div><div class="h3 col-sm-12 btn-success psp-btn"><a class="col-sm-12" style="text-decoration:none;width:100%;color:white;" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
|
538 |
+
</div>
|
|
|
|
|
539 |
</div>
|
540 |
</div>
|
541 |
<?php
|
552 |
//$current_tab = $active_tab;
|
553 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
554 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
555 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
556 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ), array(), '2.2.1');
|
557 |
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
558 |
//screen_icon();
|
559 |
echo '<h2 class="nav-tab-wrapper">';
|
psp-include/sitemap/psp_sitemap_settings.php
CHANGED
@@ -146,18 +146,18 @@ class PspSmSettings extends PspSettings {
|
|
146 |
add_settings_field( $psp_sitemap_taxonomies_field_id, $psp_sitemap_taxonomies_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_taxonomies_list_field);
|
147 |
|
148 |
//SiteMaps for Post Types
|
149 |
-
$
|
150 |
|
151 |
$builtin_post_types = array("post", "page");
|
152 |
$custom_post_types = $this->custom_post_types;
|
153 |
$psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
|
154 |
-
$
|
155 |
|
156 |
$psp_posttypes_list_field = array (
|
157 |
'label_for' => 'psp_posttypes_list',
|
158 |
'option_name' => $psp_sm_settings_name.'[posttypes_list][]',
|
159 |
'option_value' => isset($psp_sm_settings['posttypes_list']) ? $psp_sm_settings['posttypes_list'] : '',
|
160 |
-
'checkboxitems' => $
|
161 |
'option_description' => esc_html__( 'Select the list of Post Types for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
|
162 |
);
|
163 |
|
@@ -267,6 +267,12 @@ class PspSmSettings extends PspSettings {
|
|
267 |
//function section_bl_mgmt_desc() {echo ''; }
|
268 |
|
269 |
function psp_sanitize_sm_settings( $settings ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
if ( isset( $settings['enable'] ) ) {
|
272 |
$settings['enable'] = !is_null(filter_var($settings['enable'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable'] : '';
|
@@ -323,7 +329,7 @@ class PspSmSettings extends PspSettings {
|
|
323 |
|
324 |
if(!empty($settings['taxonomies_list'])) {
|
325 |
if (count($settings['taxonomies_list']) != count(array_intersect($settings['taxonomies_list'], $psp_all_tax))) {
|
326 |
-
|
327 |
}
|
328 |
}
|
329 |
|
@@ -342,21 +348,28 @@ class PspSmSettings extends PspSettings {
|
|
342 |
|
343 |
if(!empty($settings['posttypes_list'])) {
|
344 |
if (count($settings['posttypes_list']) != count(array_intersect($settings['posttypes_list'], $psp_all_post_types))) {
|
345 |
-
|
346 |
}
|
347 |
}
|
348 |
|
349 |
}
|
350 |
|
351 |
//if( !empty( $settings['excluded_term_ids'] ) ) $settings['excluded_term_ids'] = sanitize_text_field( $settings['excluded_term_ids'] );
|
352 |
-
$excluded_term_ids =
|
353 |
-
|
354 |
-
if( !empty( $
|
|
|
|
|
|
|
355 |
|
356 |
-
//if( !empty( $settings['excluded_post_ids'] ) ) $settings['excluded_post_ids'] = sanitize_text_field( $settings['excluded_post_ids'] );
|
357 |
-
$excluded_post_ids =
|
358 |
-
|
359 |
-
if( !empty( $
|
|
|
|
|
|
|
|
|
360 |
|
361 |
return $settings;
|
362 |
}
|
146 |
add_settings_field( $psp_sitemap_taxonomies_field_id, $psp_sitemap_taxonomies_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_taxonomies_list_field);
|
147 |
|
148 |
//SiteMaps for Post Types
|
149 |
+
$psp_post_types = array();
|
150 |
|
151 |
$builtin_post_types = array("post", "page");
|
152 |
$custom_post_types = $this->custom_post_types;
|
153 |
$psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
|
154 |
+
$psp_post_types = array_combine($psp_all_posttypes, $psp_all_posttypes);
|
155 |
|
156 |
$psp_posttypes_list_field = array (
|
157 |
'label_for' => 'psp_posttypes_list',
|
158 |
'option_name' => $psp_sm_settings_name.'[posttypes_list][]',
|
159 |
'option_value' => isset($psp_sm_settings['posttypes_list']) ? $psp_sm_settings['posttypes_list'] : '',
|
160 |
+
'checkboxitems' => $psp_post_types,
|
161 |
'option_description' => esc_html__( 'Select the list of Post Types for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
|
162 |
);
|
163 |
|
267 |
//function section_bl_mgmt_desc() {echo ''; }
|
268 |
|
269 |
function psp_sanitize_sm_settings( $settings ) {
|
270 |
+
|
271 |
+
if( ! empty( $settings['wizard'] ) ) {
|
272 |
+
|
273 |
+
return $settings;
|
274 |
+
|
275 |
+
}
|
276 |
|
277 |
if ( isset( $settings['enable'] ) ) {
|
278 |
$settings['enable'] = !is_null(filter_var($settings['enable'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable'] : '';
|
329 |
|
330 |
if(!empty($settings['taxonomies_list'])) {
|
331 |
if (count($settings['taxonomies_list']) != count(array_intersect($settings['taxonomies_list'], $psp_all_tax))) {
|
332 |
+
$settings['taxonomies_list'] = array();
|
333 |
}
|
334 |
}
|
335 |
|
348 |
|
349 |
if(!empty($settings['posttypes_list'])) {
|
350 |
if (count($settings['posttypes_list']) != count(array_intersect($settings['posttypes_list'], $psp_all_post_types))) {
|
351 |
+
$settings['posttypes_list'] = array();
|
352 |
}
|
353 |
}
|
354 |
|
355 |
}
|
356 |
|
357 |
//if( !empty( $settings['excluded_term_ids'] ) ) $settings['excluded_term_ids'] = sanitize_text_field( $settings['excluded_term_ids'] );
|
358 |
+
$excluded_term_ids = array();
|
359 |
+
$excluded_term_ids = !empty( $settings['excluded_term_ids'] ) ? explode(",", $settings['excluded_term_ids']) : '';
|
360 |
+
if( !empty( $excluded_term_ids ) ) {
|
361 |
+
$excluded_term_ids = array_filter( $excluded_term_ids, 'absint' );
|
362 |
+
}
|
363 |
+
$settings['excluded_term_ids'] = !empty( $excluded_term_ids) ? implode(",", $excluded_term_ids) : '';
|
364 |
|
365 |
+
//if( !empty( $settings['excluded_post_ids'] ) ) $settings['excluded_post_ids'] = sanitize_text_field( $settings['excluded_post_ids'] );
|
366 |
+
$excluded_post_ids = array();
|
367 |
+
$excluded_post_ids = !empty( $settings['excluded_post_ids'] ) ? explode(",", $settings['excluded_post_ids']) : '';
|
368 |
+
if( !empty( $excluded_post_ids ) ) {
|
369 |
+
$excluded_post_ids = array_filter( $excluded_post_ids, 'absint' );
|
370 |
+
}
|
371 |
+
|
372 |
+
$settings['excluded_post_ids'] = !empty( $excluded_post_ids) ? implode(",", $excluded_post_ids) : '';
|
373 |
|
374 |
return $settings;
|
375 |
}
|
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.
|
23 |
|
24 |
public $sitename = "";
|
25 |
public $sitedescription = "";
|
@@ -83,6 +83,51 @@ class PspHelper {
|
|
83 |
$in = apply_filters('localization', $in);
|
84 |
return $in;
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
public function trim_excerpt_without_filters($text) {
|
88 |
$text = str_replace(']]>', ']]>', $text);
|
19 |
* as description. Touch only if you know what you're doing
|
20 |
*/
|
21 |
private $min_description_length = 1;
|
22 |
+
private $version = "2.2.1";
|
23 |
|
24 |
public $sitename = "";
|
25 |
public $sitedescription = "";
|
83 |
$in = apply_filters('localization', $in);
|
84 |
return $in;
|
85 |
}
|
86 |
+
|
87 |
+
/*
|
88 |
+
* Check user access capability
|
89 |
+
*/
|
90 |
+
public function user_has_access ( $tab ) {
|
91 |
+
|
92 |
+
if ( is_super_admin() ) return true;
|
93 |
+
|
94 |
+
$psp_rcap_settings = get_option("psp_rolecap");
|
95 |
+
|
96 |
+
$currentuser_roles = array();
|
97 |
+
$capabilities = array();
|
98 |
+
|
99 |
+
if( is_user_logged_in() ) {
|
100 |
+
$user = wp_get_current_user();
|
101 |
+
$currentuser_roles = ( array ) $user->roles;
|
102 |
+
//error_log (print_r($currentuser_roles, true));
|
103 |
+
} else {
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( !empty( $currentuser_roles ) ) {
|
108 |
+
|
109 |
+
foreach ( $currentuser_roles as $role ) {
|
110 |
+
|
111 |
+
if ( $role === "administrator" ) return true;
|
112 |
+
|
113 |
+
if ( !empty ($psp_rcap_settings[$role]) ) {
|
114 |
+
$capabilities = $psp_rcap_settings[$role];
|
115 |
+
|
116 |
+
if ( ! in_array($tab, $capabilities) ) {
|
117 |
+
return false;
|
118 |
+
} else {
|
119 |
+
return true;
|
120 |
+
}
|
121 |
+
|
122 |
+
} else {
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
}
|
127 |
+
} else {
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
}
|
131 |
|
132 |
public function trim_excerpt_without_filters($text) {
|
133 |
$text = str_replace(']]>', ']]>', $text);
|
psp-include/wizard/psp_wizard_finishbtn_renderer.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
wp_enqueue_script( 'psp-ajax-wizard-script', plugins_url( 'settings/js/psp_wizard.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.2.1', false );
|
11 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( 'settings/css/psp-settings-bs.css', PSP_PLUGIN_SETTINGS_URL ));
|
12 |
+
?>
|
13 |
+
|
14 |
+
<style>
|
15 |
+
body {
|
16 |
+
background: cyan;
|
17 |
+
font-family: 'Roboto Condensed', sans-serif;
|
18 |
+
}
|
19 |
+
|
20 |
+
.container {
|
21 |
+
position: fixed;
|
22 |
+
top: 0px;
|
23 |
+
left: 0px;
|
24 |
+
width: 100%;
|
25 |
+
height: 100%;
|
26 |
+
z-index: 0;
|
27 |
+
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
28 |
+
background: -moz-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
29 |
+
background: -ms-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
30 |
+
background: radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
.container .psp-bs .psp-start-btn {
|
35 |
+
position: fixed;
|
36 |
+
top: 50%;
|
37 |
+
left: 0;
|
38 |
+
width: 100%;
|
39 |
+
height: 100%;
|
40 |
+
z-index: 1000;
|
41 |
+
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
42 |
+
background: -moz-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
43 |
+
background: -ms-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
44 |
+
background: radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
45 |
+
}
|
46 |
+
**/
|
47 |
+
|
48 |
+
.container .psp-bs {
|
49 |
+
background-color: transparent !important;
|
50 |
+
}
|
51 |
+
|
52 |
+
.btn-purple {
|
53 |
+
background-color: purple !important;
|
54 |
+
color: white !important;
|
55 |
+
}
|
56 |
+
|
57 |
+
.content {
|
58 |
+
position: absolute;
|
59 |
+
width: 100%;
|
60 |
+
height: 100%;
|
61 |
+
left: 0px;
|
62 |
+
top: 0px;
|
63 |
+
z-index: 1000;
|
64 |
+
}
|
65 |
+
|
66 |
+
.container h2 {
|
67 |
+
position: absolute;
|
68 |
+
top: 50%;
|
69 |
+
line-height: 100px;
|
70 |
+
height: 100px;
|
71 |
+
margin-top: -50px;
|
72 |
+
font-size: 30px;
|
73 |
+
width: 100%;
|
74 |
+
text-align: center;
|
75 |
+
color: transparent;
|
76 |
+
animation: blurFadeInOut 3s ease-in backwards;
|
77 |
+
}
|
78 |
+
.container h2.frame-1 {
|
79 |
+
animation-delay: 0s;
|
80 |
+
}
|
81 |
+
.container h2.frame-2 {
|
82 |
+
animation-delay: 2.5s;
|
83 |
+
}
|
84 |
+
.container h2.frame-3 {
|
85 |
+
animation-delay: 5s;
|
86 |
+
animation: blurFadeIn 1s ease-in 5s backwards;
|
87 |
+
}
|
88 |
+
.container h2.frame-4 {
|
89 |
+
font-size: 200px;
|
90 |
+
animation-delay: 7.5s;
|
91 |
+
}
|
92 |
+
.container h2.frame-5 {
|
93 |
+
animation: none;
|
94 |
+
color: transparent;
|
95 |
+
text-shadow: 0px 0px 1px #fff;
|
96 |
+
}
|
97 |
+
.container h2.frame-5 span {
|
98 |
+
animation: blurFadeIn 3s ease-in 12s backwards;
|
99 |
+
color: transparent;
|
100 |
+
text-shadow: 0px 0px 1px #fff;
|
101 |
+
}
|
102 |
+
.container h2.frame-5 span:nth-child(2) {
|
103 |
+
animation-delay: 13s;
|
104 |
+
}
|
105 |
+
.container h2.frame-5 span:nth-child(3) {
|
106 |
+
animation-delay: 14s;
|
107 |
+
}
|
108 |
+
|
109 |
+
a.btn-purple:before {
|
110 |
+
display: inline-block;
|
111 |
+
content: "\00d7"; /* This will render the 'X' */
|
112 |
+
font-size: 30px;
|
113 |
+
}
|
114 |
+
|
115 |
+
@keyframes blurFadeInOut{
|
116 |
+
0%{
|
117 |
+
opacity: 0;
|
118 |
+
text-shadow: 0px 0px 40px #fff;
|
119 |
+
transform: scale(0.9);
|
120 |
+
}
|
121 |
+
20%,75%{
|
122 |
+
opacity: 1;
|
123 |
+
text-shadow: 0px 0px 1px #fff;
|
124 |
+
transform: scale(1);
|
125 |
+
}
|
126 |
+
100%{
|
127 |
+
opacity: 0;
|
128 |
+
text-shadow: 0px 0px 50px #fff;
|
129 |
+
transform: scale(0);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
@keyframes blurFadeIn{
|
133 |
+
0%{
|
134 |
+
opacity: 0;
|
135 |
+
text-shadow: 0px 0px 40px #fff;
|
136 |
+
transform: scale(1.3);
|
137 |
+
}
|
138 |
+
50%{
|
139 |
+
opacity: 0.5;
|
140 |
+
text-shadow: 0px 0px 10px #fff;
|
141 |
+
transform: scale(1.1);
|
142 |
+
}
|
143 |
+
100%{
|
144 |
+
opacity: 1;
|
145 |
+
text-shadow: 0px 0px 1px #fff;
|
146 |
+
transform: scale(1);
|
147 |
+
}
|
148 |
+
}
|
149 |
+
@keyframes fadeInBack{
|
150 |
+
0%{
|
151 |
+
opacity: 0;
|
152 |
+
transform: scale(0);
|
153 |
+
}
|
154 |
+
50%{
|
155 |
+
opacity: 0.4;
|
156 |
+
transform: scale(2);
|
157 |
+
}
|
158 |
+
100%{
|
159 |
+
opacity: 0.2;
|
160 |
+
transform: scale(5);
|
161 |
+
}
|
162 |
+
}
|
163 |
+
</style>
|
164 |
+
<!------ Include the above in your HEAD tag ---------->
|
165 |
+
<div class="container">
|
166 |
+
<div class="content">
|
167 |
+
<h2 class="frame-1"><?php esc_html_e('Congragulations!!!', 'platinum-seo-pack') ?></h2>
|
168 |
+
<h2 class="frame-2"><?php esc_html_e('You are done setting up the essential options in Platinum SEO', 'platinum-seo-pack') ?> </h2>
|
169 |
+
<h2 class="frame-3">
|
170 |
+
<div class="psp-bs">
|
171 |
+
<div class="psp-start-btn">
|
172 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>" class="btn btn-lg btn-purple" role="button"> <?php esc_html_e('Close this wizard and Go to Dashboard', 'platinum-seo-pack') ?></a>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
</h2>
|
176 |
+
</div>
|
177 |
+
</div>
|
psp-include/wizard/psp_wizard_importer.php
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$import_yoast_data_nonce = wp_create_nonce( 'import_yoast_data_nonce' );
|
11 |
+
// in JavaScript, object properties are accessed as ajax_object.ajax_url,
|
12 |
+
//wp_enqueue_script( 'psp-ajax-import-script', plugins_url( '/js/psp-importer.js', __FILE__ ), array('jquery') );
|
13 |
+
wp_enqueue_script( 'psp-ajax-import-script', plugins_url( 'settings/js/psp-importer.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.1.8' );
|
14 |
+
wp_localize_script( 'psp-ajax-import-script', 'psp_ajax_importer_object', array( 'ajax_url' => admin_url( 'admin-ajax.php'), 'pspnonce' => $import_yoast_data_nonce) );
|
15 |
+
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
16 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( 'settings/css/psp-settings-bs.css', PSP_PLUGIN_SETTINGS_URL ));
|
17 |
+
?>
|
18 |
+
<style>
|
19 |
+
/*.psp-sidebar{width:15%;background-color:#fff;position:fixed!important;z-index:1;overflow:auto}*/
|
20 |
+
.psp-sidebar{background-color:#fff;z-index:1;overflow:auto}
|
21 |
+
.psp-bar-block .psp-dropdown-hover .psp-button,.psp-bar-block .psp-dropdown-click .psp-button{width:100%;text-align:left;padding:8px 16px}
|
22 |
+
.psp-bar-block .psp-bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0;cursor:pointer;}
|
23 |
+
.psp-bar-block.psp-center .psp-bar-item{text-align:center}.psp-block{display:block;width:100%}
|
24 |
+
.psp-card,.psp-card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)}
|
25 |
+
.psp-card-4,.psp-hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)}
|
26 |
+
.psp-black,.psp-hover-black:hover{color:#fff!important;background-color:#000!important}
|
27 |
+
.psp-grey,.psp-hover-grey:hover,.psp-gray,.psp-hover-gray:hover{color:#000!important;background-color:#9e9e9e!important}
|
28 |
+
.psp-light-grey,.psp-hover-light-grey:hover,.psp-light-gray,.psp-hover-light-gray:hover{color:#000!important;background-color:#f1f1f1!important}
|
29 |
+
.psp-container:after,.psp-container:before,.psp-panel:after,.psp-panel:before,.psp-row:after,.psp-row:before,.psp-row-padding:after,.psp-row-padding:before,
|
30 |
+
/***animate***/
|
31 |
+
.psp-spin{animation:psp-spin 2s infinite linear}@keyframes psp-spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}
|
32 |
+
.psp-animate-fading{animation:fading 10s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}}
|
33 |
+
.psp-animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}}
|
34 |
+
.psp-animate-top{position:relative;animation:animatetop 0.4s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}
|
35 |
+
.psp-animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}}
|
36 |
+
.psp-animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}}
|
37 |
+
.psp-animate-bottom{position:relative;animation:animatebottom 0.4s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}}
|
38 |
+
.psp-animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}}
|
39 |
+
.psp-animate-input{transition:width 0.4s ease-in-out}.psp-animate-input:focus{width:100%!important}
|
40 |
+
.psp-opacity,.psp-hover-opacity:hover{opacity:0.60}.psp-opacity-off,.psp-hover-opacity-off:hover{opacity:1}
|
41 |
+
.psp-opacity-max{opacity:0.25}.psp-opacity-min{opacity:0.75}
|
42 |
+
/* Colors */
|
43 |
+
.psp-amber,.psp-hover-amber:hover{color:#000!important;background-color:#ffc107!important}
|
44 |
+
.psp-aqua,.psp-hover-aqua:hover{color:#000!important;background-color:#00ffff!important}
|
45 |
+
.psp-blue,.psp-hover-blue:hover{color:#fff!important;background-color:#2196F3!important}
|
46 |
+
.psp-light-blue,.psp-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important}
|
47 |
+
.psp-brown,.psp-hover-brown:hover{color:#fff!important;background-color:#795548!important}
|
48 |
+
.psp-cyan,.psp-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important}
|
49 |
+
.psp-blue-grey,.psp-hover-blue-grey:hover,.psp-blue-gray,.psp-hover-blue-gray:hover{color:#fff!important;background-color:#607d8b!important}
|
50 |
+
.psp-green,.psp-hover-green:hover{color:#fff!important;background-color:#4CAF50!important}
|
51 |
+
.psp-light-green,.psp-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important}
|
52 |
+
.psp-indigo,.psp-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important}
|
53 |
+
.psp-khaki,.psp-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important}
|
54 |
+
.psp-lime,.psp-hover-lime:hover{color:#000!important;background-color:#cddc39!important}
|
55 |
+
.psp-orange,.psp-hover-orange:hover{color:#000!important;background-color:#ff9800!important}
|
56 |
+
.psp-deep-orange,.psp-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important}
|
57 |
+
.psp-pink,.psp-hover-pink:hover{color:#fff!important;background-color:#e91e63!important}
|
58 |
+
.psp-import-class{margin-left:15%}
|
59 |
+
</style>
|
60 |
+
<h1><?php esc_html_e('Techblissonline Platinum SEO Importer', 'platinum-seo-pack'); ?></h1>
|
61 |
+
<div class="wrap">
|
62 |
+
<div class="psp-bs">
|
63 |
+
<div class="row">
|
64 |
+
<div class="psp-sidebar psp-bar-block psp-light-grey psp-card col-sm-2">
|
65 |
+
<button class="psp-bar-item psp-button psp-tab psp-cyan" onclick="openLink(event, 'Fade')">Yoast</button>
|
66 |
+
<button class="psp-bar-item psp-button psp-tab" onclick="openLink(event, 'Right')">RankMath</button>
|
67 |
+
<button class="psp-bar-item psp-button psp-tab" onclick="openLink(event, 'Bottom')">Yoast Indexable</button>
|
68 |
+
<button class="psp-bar-item psp-button psp-tab" onclick="openLink(event, 'Input')">All in One SEO</button>
|
69 |
+
<button class="psp-bar-item psp-button psp-tab" onclick="openLink(event, 'Zoom')">Platinum SEO</button>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div class="col-sm-10">
|
73 |
+
<div id="Fade" class="psp-container plugin psp-animate-opacity">
|
74 |
+
|
75 |
+
<h2><?php esc_html_e('Import Yoast SEO Data into Platinum SEO:', 'platinum-seo-pack'); ?></h2>
|
76 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"><?php esc_html_e('Platinum SEO WordPress Plugin', 'platinum-seo-pack') ?></a>
|
77 |
+
|
78 |
+
<br class="clear" />
|
79 |
+
<div id="pspimporter-1">
|
80 |
+
<table class="form-table">
|
81 |
+
<tr class="form-field">
|
82 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Titles and Descriptions: ', 'platinum-seo-pack'); ?></label>
|
83 |
+
<p class="description"><?php esc_html_e('This will import all your Titles and Descriptions from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
84 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_title" id="import_yoast_title_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-titles-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
85 |
+
</div>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
<tr class="form-field">
|
89 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Basic Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
90 |
+
<p class="description"><?php esc_html_e('This will import all your basic robots meta data (noindex, nofollow) from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
91 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_basicrobots" id="import_yoast_brobots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-basicrobots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
92 |
+
</div>
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr class="form-field">
|
96 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Advanced Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
97 |
+
<p class="description"><?php esc_html_e('This will import all your advanced robots meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
98 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_robots" id="import_yoast_robots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-robots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
99 |
+
</div>
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
+
<tr class="form-field">
|
103 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import other SEO and Social Meta Data: ', 'platinum-seo-pack'); ?></label>
|
104 |
+
<p class="description"><?php esc_html_e('This will import all your other SEO and Social meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
105 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_others" id="import_yoast_others_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-others-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
106 |
+
</div>
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
<tr class="form-field">
|
110 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import SEO and Social Meta Data for Terms: ', 'platinum-seo-pack'); ?></label>
|
111 |
+
<p class="description"><?php esc_html_e('This will import all your SEO and Social meta data for Terms (Categories and other Taxonomies) from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
112 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_terms" id="import_yoast_terms_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-terms-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
113 |
+
</div>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
<tr class="form-field">
|
117 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Yoast Premium Meta Data: ', 'platinum-seo-pack'); ?></label>
|
118 |
+
<p class="description"><?php esc_html_e('This will import all your Premium focus Keywords from your current Yoast Premium Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
119 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoast_premium" id="import_yoast_premium_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoast-premium-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
120 |
+
</div>
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
<tr class="form-field">
|
124 |
+
<th style="width:100%;" scope="row" valign="top"><label><?php esc_html_e('Set up the One time Configuration for Platinum SEO: ', 'platinum-seo-pack'); ?></label>
|
125 |
+
<p class="description"><?php esc_html_e('Platinum SEO sets up the default configuration on installation and activation. If you are done with Importing, you may go to SEO Settings and Social Settings to review and make any necessary changes', 'platinum-seo-pack'); ?></p><p><a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('SEO Settings', 'platinum-seo-pack') ?></a> | <a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=psp-social-by-techblissonline" ?>"> <?php esc_html_e('Social Settings', 'platinum-seo-pack') ?></a></p></th>
|
126 |
+
</tr>
|
127 |
+
</table>
|
128 |
+
</div>
|
129 |
+
|
130 |
+
<br class="clear" />
|
131 |
+
|
132 |
+
</div>
|
133 |
+
<div id="Right" class="psp-container plugin psp-animate-right" style="display:none">
|
134 |
+
|
135 |
+
<h2><?php esc_html_e('Import RankMath SEO Data into Platinum SEO:', 'platinum-seo-pack'); ?></h2>
|
136 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"><?php esc_html_e('Platinum SEO WordPress Plugin', 'platinum-seo-pack') ?></a>
|
137 |
+
|
138 |
+
<br class="clear" />
|
139 |
+
<div id="pspimporter-2">
|
140 |
+
<table class="form-table">
|
141 |
+
<tr class="form-field">
|
142 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Titles and Descriptions: ', 'platinum-seo-pack'); ?></label>
|
143 |
+
<p class="description"><?php esc_html_e('This will import all your Titles and Descriptions from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
144 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="rankmath_title" id="import_rm_title_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="rm-titles-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p></div>
|
145 |
+
</td>
|
146 |
+
</tr>
|
147 |
+
<tr class="form-field">
|
148 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
149 |
+
<p class="description"><?php esc_html_e('This will import all your robots meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
150 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="rankmath_robots" id="import_rm_robots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="rm-robots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p></div>
|
151 |
+
</td>
|
152 |
+
</tr>
|
153 |
+
<tr class="form-field">
|
154 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import other SEO and Social Meta Data: ', 'platinum-seo-pack'); ?></label>
|
155 |
+
<p class="description"><?php esc_html_e('This will import all your other SEO and Social meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
156 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="rankmath_others" id="import_rm_others_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="rm-others-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
157 |
+
</div>
|
158 |
+
</td>
|
159 |
+
</tr>
|
160 |
+
<tr class="form-field">
|
161 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import SEO and Social Meta Data for Terms: ', 'platinum-seo-pack'); ?></label>
|
162 |
+
<p class="description"><?php esc_html_e('This will import all your SEO and Social meta data for Terms (Categories and other Taxonomies) from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
163 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="rankmath_terms" id="import_rm_terms_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="rm-terms-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
164 |
+
</div>
|
165 |
+
</td>
|
166 |
+
</tr>
|
167 |
+
<tr class="form-field">
|
168 |
+
<th style="width:100%;" scope="row" valign="top"><label><?php esc_html_e('Set up the One time Configuration for Platinum SEO: ', 'platinum-seo-pack'); ?></label>
|
169 |
+
<p class="description"><?php esc_html_e('Platinum SEO sets up the default configuration on installation and activation. If you are done with Importing, you may go to SEO Settings and Social Settings to review and make any necessary changes', 'platinum-seo-pack'); ?></p><p><a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('SEO Settings', 'platinum-seo-pack') ?></a> | <a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=psp-social-by-techblissonline" ?>"> <?php esc_html_e('Social Settings', 'platinum-seo-pack') ?></a></p></th>
|
170 |
+
</tr>
|
171 |
+
</table>
|
172 |
+
</div>
|
173 |
+
|
174 |
+
<br class="clear" />
|
175 |
+
|
176 |
+
</div>
|
177 |
+
<div id="Bottom" class="psp-container plugin psp-animate-bottom" style="display:none">
|
178 |
+
|
179 |
+
<h2><?php esc_html_e('Import Yoast Indexable SEO Data into Platinum SEO:', 'platinum-seo-pack'); ?></h2>
|
180 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"><?php esc_html_e('Platinum SEO WordPress Plugin', 'platinum-seo-pack') ?></a>
|
181 |
+
|
182 |
+
<br class="clear" />
|
183 |
+
<div id="pspimporter-3">
|
184 |
+
<table class="form-table">
|
185 |
+
<tr class="form-field">
|
186 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Titles and Descriptions: ', 'platinum-seo-pack'); ?></label>
|
187 |
+
<p class="description"><?php esc_html_e('This will import all your Titles and Descriptions from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
188 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoastnew_title" id="import_yoastnew_title_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoastnew-titles-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
189 |
+
</div>
|
190 |
+
</td>
|
191 |
+
</tr>
|
192 |
+
<tr class="form-field">
|
193 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
194 |
+
<p class="description"><?php esc_html_e('This will import all your robots meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
195 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoastnew_robots" id="import_yoastnew_robots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoastnew-robots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
196 |
+
</div>
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
<tr class="form-field">
|
200 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import other SEO and Social Meta Data: ', 'platinum-seo-pack'); ?></label>
|
201 |
+
<p class="description"><?php esc_html_e('This will import all your other SEO and Social meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
202 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoastnew_others" id="import_yoastnew_others_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoastnew-others-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
203 |
+
</div>
|
204 |
+
</td>
|
205 |
+
</tr>
|
206 |
+
<tr class="form-field">
|
207 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import SEO and Social Meta Data for Terms: ', 'platinum-seo-pack'); ?></label>
|
208 |
+
<p class="description"><?php esc_html_e('This will import all your SEO and Social meta data for Terms (Categories and other Taxonomies) from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
209 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="yoastnew_terms" id="import_yoastnew_terms_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="yoastnew-terms-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
210 |
+
</div>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
<tr class="form-field">
|
214 |
+
<th style="width:100%;" scope="row" valign="top"><label><?php esc_html_e('Set up the One time Configuration for Platinum SEO: ', 'platinum-seo-pack'); ?></label>
|
215 |
+
<p class="description"><?php esc_html_e('Platinum SEO sets up the default configuration on installation and activation. If you are done with Importing, you may go to SEO Settings and Social Settings to review and make any necessary changes', 'platinum-seo-pack'); ?></p><p><a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('SEO Settings', 'platinum-seo-pack') ?></a> | <a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=psp-social-by-techblissonline" ?>"> <?php esc_html_e('Social Settings', 'platinum-seo-pack') ?></a></p></th>
|
216 |
+
</tr>
|
217 |
+
</table>
|
218 |
+
</div>
|
219 |
+
|
220 |
+
<br class="clear" />
|
221 |
+
|
222 |
+
</div>
|
223 |
+
<div id="Input" class="psp-container plugin psp-animate-input" style="display:none">
|
224 |
+
|
225 |
+
<h2><?php esc_html_e('Import ALL in One SEO Pack Data into Platinum SEO:', 'platinum-seo-pack'); ?></h2>
|
226 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"><?php esc_html_e('Platinum SEO WordPress Plugin', 'platinum-seo-pack') ?></a>
|
227 |
+
|
228 |
+
<br class="clear" />
|
229 |
+
<div id="pspimporter-4">
|
230 |
+
<table class="form-table">
|
231 |
+
<tr class="form-field">
|
232 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Titles and Descriptions: ', 'platinum-seo-pack'); ?></label>
|
233 |
+
<p class="description"><?php esc_html_e('This will import all your Titles and Descriptions from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
234 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="aioseop_title" id="import_aioseop_title_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="aioseop-titles-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
235 |
+
</div>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
<tr class="form-field">
|
239 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Basic Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
240 |
+
<p class="description"><?php esc_html_e('This will import all your basic robots meta data (noindex, nofollow) from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
241 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="aioseop_basicrobots" id="import_aioseop_brobots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="aioseop-basicrobots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
242 |
+
</div>
|
243 |
+
</td>
|
244 |
+
</tr>
|
245 |
+
<tr class="form-field">
|
246 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import other SEO and Social Meta Data: ', 'platinum-seo-pack'); ?></label>
|
247 |
+
<p class="description"><?php esc_html_e('This will import all your other SEO and Social meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
248 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="aioseop_others" id="import_aioseop_others_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="aioseop-others-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
249 |
+
</div>
|
250 |
+
</td>
|
251 |
+
</tr>
|
252 |
+
<tr class="form-field">
|
253 |
+
<th style="width:100%;" scope="row" valign="top"><label><?php esc_html_e('Set up the One time Configuration for Platinum SEO: ', 'platinum-seo-pack'); ?></label>
|
254 |
+
<p class="description"><?php esc_html_e('Platinum SEO sets up the default configuration on installation and activation. If you are done with Importing, you may go to SEO Settings and Social Settings to review and make any necessary changes', 'platinum-seo-pack'); ?></p><p><a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('SEO Settings', 'platinum-seo-pack') ?></a> | <a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=psp-social-by-techblissonline" ?>"> <?php esc_html_e('Social Settings', 'platinum-seo-pack') ?></a></p></th>
|
255 |
+
</tr>
|
256 |
+
</table>
|
257 |
+
</div>
|
258 |
+
<br class="clear" />
|
259 |
+
|
260 |
+
</div>
|
261 |
+
<div id="Zoom" class="psp-container plugin psp-animate-zoom" style="display:none">
|
262 |
+
|
263 |
+
<h2><?php esc_html_e('Import Platinum SEO Data into Platinum SEO V2.1.0 :', 'platinum-seo-pack'); ?></h2>
|
264 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=platinum-seo-social-pack-by-techblissonline" ?>"> <?php esc_html_e('Settings', 'platinum-seo-pack') ?></a> | <a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"><?php esc_html_e('Platinum SEO WordPress Plugin', 'platinum-seo-pack') ?></a>
|
265 |
+
|
266 |
+
<br class="clear" />
|
267 |
+
<div id="pspimporter-5">
|
268 |
+
<table class="form-table">
|
269 |
+
<tr class="form-field">
|
270 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import Robots Meta Data: ', 'platinum-seo-pack'); ?></label>
|
271 |
+
<p class="description"><?php esc_html_e('This will import all your robots meta data from into Platinum SEO PluginV2.1.0', 'platinum-seo-pack'); ?></p></th>
|
272 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="psp_robots" id="import_psp_robots_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="psp-robots-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
273 |
+
</div>
|
274 |
+
</td>
|
275 |
+
</tr>
|
276 |
+
<tr class="form-field">
|
277 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import All SEO and Social Meta Data: ', 'platinum-seo-pack'); ?></label>
|
278 |
+
<p class="description"><?php esc_html_e('This will import all your other SEO and Social meta data from your current SEO Plugin into Platinum SEO Plugin', 'platinum-seo-pack'); ?></p></th>
|
279 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="psp_others" id="import_psp_others_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="psp-others-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
280 |
+
</div>
|
281 |
+
</td>
|
282 |
+
</tr>
|
283 |
+
<tr class="form-field">
|
284 |
+
<th style="width:70%;" scope="row" valign="top"><label><?php esc_html_e('Import SEO and Social Meta Data for Terms: ', 'platinum-seo-pack'); ?></label>
|
285 |
+
<p class="description"><?php esc_html_e('This will import all your SEO and Social meta data for Terms (Categories and other Taxonomies) into Platinum SEO Plugin V2.1.0', 'platinum-seo-pack'); ?></p></th>
|
286 |
+
<td><div class="psp-bs alignright"><input style="display:block;margin:auto" name="psp_terms" id="import_psp_terms_data_btn" class="psp_importer btn btn-success" type="btn" value="Import" /><p class="psp-terms-loader hidden"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-video-loader.gif'; ?>" class="img-responsive" alt="Loading..."/></p>
|
287 |
+
</div>
|
288 |
+
</td>
|
289 |
+
</tr>
|
290 |
+
</table>
|
291 |
+
</div>
|
292 |
+
|
293 |
+
<br class="clear" />
|
294 |
+
|
295 |
+
</div>
|
296 |
+
</div>
|
297 |
+
|
298 |
+
</div>
|
299 |
+
</div>
|
300 |
+
</div>
|
psp-include/wizard/psp_wizard_settings.php
ADDED
@@ -0,0 +1,1738 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Techblissonline Platinum SEO and Social Pack
|
5 |
+
Description: Complete SEO and Social optimization solution for your Wordpress blog/site.
|
6 |
+
Text Domain: platinum-seo-pack
|
7 |
+
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
|
8 |
+
Author: Rajesh - Techblissonline
|
9 |
+
Author URI: https://techblissonline.com/
|
10 |
+
*/
|
11 |
+
|
12 |
+
class PspWizardSettings {
|
13 |
+
|
14 |
+
private static $obj_handle = null;
|
15 |
+
|
16 |
+
private $psp_helper;
|
17 |
+
|
18 |
+
public $custom_taxonomies = array();
|
19 |
+
public $custom_post_types = array();
|
20 |
+
public $psp_sm_settings = array();
|
21 |
+
|
22 |
+
public $psp_settings_instance;
|
23 |
+
|
24 |
+
private $psp_start_settings_group = 'psp_start_wizard';
|
25 |
+
private $psp_import_settings_group = 'psp_importer_wizard';
|
26 |
+
private $psp_general_settings_group = 'psp_general_wizard';
|
27 |
+
private $psp_home_settings_group = 'psp_home_wizard';
|
28 |
+
private $psp_permalink_settings_group = 'psp_permalink_wizard';
|
29 |
+
private $psp_social_settings_group = 'psp_social_wizard';
|
30 |
+
private $psp_sm_settings_group = 'psp_sitemap_wizard';
|
31 |
+
private $psp_finish_settings_group = 'psp_finish_wizard';
|
32 |
+
|
33 |
+
//protected $psp_plugin_options_key = 'platinum-seo-wizard';
|
34 |
+
protected $psp_plugin_options_key = 'platinum-seo-social-pack-by-techblissonline';
|
35 |
+
private $psp_settings_tabs = array();
|
36 |
+
|
37 |
+
public static function get_instance() {
|
38 |
+
|
39 |
+
if ( null == self::$obj_handle ) {
|
40 |
+
self::$obj_handle = new self;
|
41 |
+
}
|
42 |
+
|
43 |
+
return self::$obj_handle;
|
44 |
+
|
45 |
+
} // end get_instance;
|
46 |
+
|
47 |
+
|
48 |
+
function __construct() {
|
49 |
+
|
50 |
+
$psp_helper_instance = PspHelper::get_instance();
|
51 |
+
$this->psp_helper = $psp_helper_instance;
|
52 |
+
|
53 |
+
add_action('admin_menu', array(&$this, 'psp_wizard_admin_menu'));
|
54 |
+
|
55 |
+
add_action( 'admin_init', array( &$this, 'psp_admin_settings_init' ) );
|
56 |
+
//add_action( 'admin_menu', array( &$this, 'add_admin_menus' ), 9 );
|
57 |
+
|
58 |
+
foreach ($this->psp_settings_tabs as $psp_group => $psp_group_name) {
|
59 |
+
//Allow psp_capability
|
60 |
+
add_filter( 'option_page_capability_'.$psp_group, function( $capability ){
|
61 |
+
//error_log("psp const cap ".'psp_capability');
|
62 |
+
return 'edit_posts';
|
63 |
+
} );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/*
|
68 |
+
* Registers settings
|
69 |
+
*/
|
70 |
+
function psp_admin_settings_init() {
|
71 |
+
//$screen = get_current_screen();
|
72 |
+
//error_log(print_r($screen, true));
|
73 |
+
$this->register_general_settings('sitewide');
|
74 |
+
$this->register_home_settings();
|
75 |
+
$this->register_sm_settings();
|
76 |
+
$this->register_social_settings();
|
77 |
+
$this->register_permalink_settings();
|
78 |
+
//wp_enqueue_script( 'psp-ajax-wizard-script', plugins_url( 'settings/js/psp_wizard.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.2.1', false );
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
+
public function psp_wizard_admin_menu() {
|
83 |
+
|
84 |
+
remove_menu_page( 'index.php' );
|
85 |
+
|
86 |
+
$psp_wizard_page = add_submenu_page($this->psp_plugin_options_key, esc_html__('Platinum SEO Setup Wizard', 'platinum-seo-pack'), '<span class="dashicons dashicons-admin-tools"></span> '.esc_html__('Setup wizard', 'platinum-seo-pack'), 'manage_options', 'wizard', array($this, 'psp_wizard_page'));
|
87 |
+
//$psp_importer_page_2 = 'platinum-seo-and-social-pack_page_pspimporter';
|
88 |
+
//error_log('redir '. $psp_importer_page);
|
89 |
+
|
90 |
+
$cust_taxonomies = array();
|
91 |
+
|
92 |
+
if ( null == $this->custom_taxonomies ) {
|
93 |
+
$args = array(
|
94 |
+
'public' => true,
|
95 |
+
'_builtin' => false
|
96 |
+
);
|
97 |
+
$output = 'names'; // or objects
|
98 |
+
$operator = 'and'; // 'and' or 'or'
|
99 |
+
$cust_taxonomies = get_taxonomies( $args, $output, $operator );
|
100 |
+
$this->custom_taxonomies = $cust_taxonomies;
|
101 |
+
}
|
102 |
+
|
103 |
+
$cust_post_types = get_post_types( array ( '_builtin' => FALSE ) );
|
104 |
+
$this->custom_post_types = $cust_post_types;
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
/*
|
109 |
+
* Registers the Home SEO settings and appends the
|
110 |
+
* key to the plugin settings tabs array.
|
111 |
+
*/
|
112 |
+
private function register_home_settings() {
|
113 |
+
$this->psp_settings_tabs[$this->psp_home_settings_group] = 'Home';
|
114 |
+
$psp_home_settings_name = "psp_home_settings";
|
115 |
+
|
116 |
+
$psp_home_settings = get_option($psp_home_settings_name);
|
117 |
+
|
118 |
+
//$this->psp_home_settings = $psp_home_settings;
|
119 |
+
//register
|
120 |
+
register_setting( $this->psp_home_settings_group, $psp_home_settings_name, array( &$this, 'sanitize_home_settings' ) );
|
121 |
+
|
122 |
+
//add Section
|
123 |
+
add_settings_section( 'psp_section_home', esc_html__('Home Page SEO Settings', 'platinum-seo-pack' ), array( &$this, 'section_home_desc' ), $this->psp_home_settings_group );
|
124 |
+
//add fields
|
125 |
+
//canonical
|
126 |
+
$use_front_page_field = array (
|
127 |
+
'label_for' => 'psp_home_use_front_page',
|
128 |
+
'option_name' => $psp_home_settings_name.'[use_front_page]',
|
129 |
+
'option_value' => isset($psp_home_settings['use_front_page']) ? $psp_home_settings['use_front_page'] : '',
|
130 |
+
'option_description' => esc_html__( 'You don\'t have to enable this even if you use a Static Page as Home Page, unless you need it for other reasons. If you enable this, the Platinum SEO Attributes (SEO title, Description, Schema etc.) of the Page chose as Static Front Page will be used and the Home Page settings you enter below will be overridden (ignored). If this option is selected, you will have to make sure that the Canonical URL is correctly set for the page chosen as the Static page For Home. If needed, make sure that you set it correctly in the Platinum SEO Metabox of the page chosen as static Page.', 'platinum-seo-pack' ),
|
131 |
+
'checkbox_label' => esc_html__( 'Use the Static Front page\'s Platinum SEO Attributes', 'platinum-seo-pack' )
|
132 |
+
);
|
133 |
+
|
134 |
+
$use_front_page_field_id = 'psp_home_use_front_page';
|
135 |
+
$use_front_page_field_title = esc_html__( 'Use the Static Front page\'s Platinum SEO Attributes: ', 'platinum-seo-pack' );
|
136 |
+
|
137 |
+
//add_settings_field( $use_front_page_field_id, $use_front_page_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_home_settings_group, $section_id, $use_front_page_field );
|
138 |
+
|
139 |
+
//Home page title
|
140 |
+
$title_field = array (
|
141 |
+
'label_for' => 'psp_home_title',
|
142 |
+
'option_name' => $psp_home_settings_name.'[title]',
|
143 |
+
'option_value' => isset($psp_home_settings['title']) ? stripcslashes(esc_attr($psp_home_settings['title'])) : '',
|
144 |
+
'option_description' => esc_html__( 'Enter a title in plain text. Do not use any tags.', 'platinum-seo-pack' ),
|
145 |
+
);
|
146 |
+
|
147 |
+
$desc_field = array (
|
148 |
+
'label_for' => 'psp_home_description',
|
149 |
+
'option_name' => $psp_home_settings_name.'[description]',
|
150 |
+
'option_value' => isset($psp_home_settings['description']) ? stripcslashes(esc_attr($psp_home_settings['description'])) : '',
|
151 |
+
'option_description' => esc_html__( 'Enter a meta description in plain text. Do not use any tags.', 'platinum-seo-pack' ),
|
152 |
+
);
|
153 |
+
|
154 |
+
$keywords_field = array (
|
155 |
+
'label_for' => 'psp_home_keywords',
|
156 |
+
'option_name' => $psp_home_settings_name.'[keywords]',
|
157 |
+
'option_value' => isset($psp_home_settings['keywords']) ? stripcslashes(esc_attr($psp_home_settings['keywords'])) : '',
|
158 |
+
'option_description' => esc_html__( 'Google and most other Search engines do not use or support the meta keywords tag. If you still find it necessary to use this tag for any specific reason of yours, you may add comma separated primary entities or keywords for the Home page here.These will be displayed as meta keywords tag. Leaving it empty will disable this tag for the Home Page.', 'platinum-seo-pack' ),
|
159 |
+
);
|
160 |
+
|
161 |
+
$home_header_metas = isset($psp_home_settings['headers']) ? html_entity_decode(stripcslashes(esc_attr($psp_home_settings['headers']))) : '';
|
162 |
+
//validate headers
|
163 |
+
if( !empty( $home_header_metas ) ) {
|
164 |
+
|
165 |
+
$allowed_html = array(
|
166 |
+
'meta' => array(
|
167 |
+
'name' => array(),
|
168 |
+
'property' => array(),
|
169 |
+
'itemprop' => array(),
|
170 |
+
'content' => array(),
|
171 |
+
),
|
172 |
+
);
|
173 |
+
|
174 |
+
$home_header_metas = wp_kses($home_header_metas, $allowed_html);
|
175 |
+
}
|
176 |
+
|
177 |
+
$additional_headers_field = array (
|
178 |
+
'label_for' => 'psp_home_additional_headers',
|
179 |
+
'option_name' => $psp_home_settings_name.'[headers]',
|
180 |
+
'option_value' => $home_header_metas,
|
181 |
+
'option_description' => esc_html__( 'Here you may add all the webmaster tools verification meta tag codes for google, bing, yandex, alexa and for any other search engine.If you had already verified with the webmaster tools, you might choose to ignore adding them here. Check ', 'platinum-seo-pack' ).' <br> <a href="https://www.google.com/webmasters/verification/verification?hl=en&siteUrl='.trailingslashit(get_home_url()).'" target="_blank">Google Webmaster Tools</a><br> <a href="http://www.bing.com/webmaster/?rfp=1#/Dashboard/?url='.substr(get_home_url(), 8).'" target="_blank">Bing Webmaster Tools</a>;',
|
182 |
+
'parent_classname' => 'pspeditor',
|
183 |
+
);
|
184 |
+
|
185 |
+
$json_schema_string = isset($psp_home_settings['schema']) ? html_entity_decode(stripcslashes(esc_attr($psp_home_settings['schema']))) : '';
|
186 |
+
//validate it is a json object
|
187 |
+
$schema_obj = json_decode($json_schema_string);
|
188 |
+
if($schema_obj === null) {
|
189 |
+
$json_schema_string = 'Invalid JSON Schema';
|
190 |
+
}
|
191 |
+
|
192 |
+
$schema_field = array (
|
193 |
+
'label_for' => 'psp_home_schemas',
|
194 |
+
'option_name' => $psp_home_settings_name.'[schema]',
|
195 |
+
'option_value' => $json_schema_string,
|
196 |
+
'option_description' => esc_html__( 'Here you may add all the JSON Schemas for the Home page', 'platinum-seo-pack' ),
|
197 |
+
'parent_classname' => 'pspeditor',
|
198 |
+
);
|
199 |
+
|
200 |
+
add_settings_field( $use_front_page_field_id, $use_front_page_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_home_settings_group, 'psp_section_home', $use_front_page_field );
|
201 |
+
add_settings_field( 'psp_home_title', esc_html__('Home Page Title: ', 'platinum-seo-pack'), array( &$this, 'psp_add_field_text' ), $this->psp_home_settings_group, 'psp_section_home', $title_field);
|
202 |
+
add_settings_field( 'psp_home_description', esc_html__('Home Page Meta Description: ', 'platinum-seo-pack'), array( &$this, 'psp_add_field_textarea' ), $this->psp_home_settings_group, 'psp_section_home', $desc_field );
|
203 |
+
//add_settings_field( 'psp_home_keywords', esc_html__('Home Page Meta Keywords: ', 'platinum-seo-pack'), array( &$this, 'psp_add_field_text' ), $this->psp_home_settings_group, 'psp_section_home', $keywords_field );
|
204 |
+
//add_settings_field( 'psp_home_additional_headers', esc_html__('Additional Home Page Headers: ', 'platinum-seo-pack'), array( &$this, 'psp_add_field_textarea' ), $this->psp_home_settings_group, 'psp_section_home', $additional_headers_field );
|
205 |
+
//add_settings_field( 'psp_home_schemas', esc_html__('Schemas >> ', 'platinum-seo-pack').'<a href="https://techblissonline.com/tools/schema-markup-generator/" target="_blank">'.esc_html__('Generate here', 'platinum-seo-pack').'</a>', array( &$this, 'psp_add_field_textarea' ), $this->psp_home_settings_group, 'psp_section_home', $schema_field );
|
206 |
+
|
207 |
+
//wizard
|
208 |
+
$setting_name = "home";
|
209 |
+
|
210 |
+
$psp_wizard_field = array (
|
211 |
+
'label_for' => 'psp_'.$setting_name.'_wizard',
|
212 |
+
'option_name' => $psp_home_settings_name.'[wizard]',
|
213 |
+
'option_value' => 'wizard',
|
214 |
+
);
|
215 |
+
|
216 |
+
$psp_wizard_field_id = 'psp_'.$setting_name.'_wizard';
|
217 |
+
$psp_wizard_field_title = '';
|
218 |
+
|
219 |
+
add_settings_field( $psp_wizard_field_id, $psp_wizard_field_title, array( &$this, 'psp_add_field_hidden' ), $this->psp_home_settings_group, 'psp_section_home', $psp_wizard_field);
|
220 |
+
}
|
221 |
+
|
222 |
+
function sanitize_home_settings($settings) {
|
223 |
+
|
224 |
+
if( ! isset( $settings['wizard'] ) ) {
|
225 |
+
|
226 |
+
return $settings;
|
227 |
+
|
228 |
+
}
|
229 |
+
|
230 |
+
$psp_current_settings = get_option('psp_home_settings') ? get_option('psp_home_settings') : array();
|
231 |
+
|
232 |
+
if( isset( $settings['use_front_page'] ) ) {
|
233 |
+
$settings['use_front_page'] = !is_null(filter_var($settings['use_front_page'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_front_page'] : '';
|
234 |
+
} else {
|
235 |
+
$settings['use_front_page'] = '';
|
236 |
+
}
|
237 |
+
|
238 |
+
if( isset( $settings['title'] ) ) {
|
239 |
+
$settings['title'] = sanitize_text_field( $settings['title'] );
|
240 |
+
} else {
|
241 |
+
$settings['title'] = '';
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
if( isset( $settings['description'] ) ) {
|
246 |
+
$settings['description'] = sanitize_textarea_field( $settings['description'] );
|
247 |
+
} else {
|
248 |
+
$settings['description'] = '';
|
249 |
+
}
|
250 |
+
/***
|
251 |
+
if( isset( $settings['keywords'] ) ) $settings['keywords'] = sanitize_text_field( $settings['keywords'] );
|
252 |
+
//validate headers
|
253 |
+
if( isset( $settings['headers'] ) ) {
|
254 |
+
|
255 |
+
$allowed_html = array(
|
256 |
+
'meta' => array(
|
257 |
+
'name' => array(),
|
258 |
+
'property' => array(),
|
259 |
+
'itemprop' => array(),
|
260 |
+
'content' => array(),
|
261 |
+
),
|
262 |
+
);
|
263 |
+
|
264 |
+
$settings['headers'] = wp_kses($settings['headers'], $allowed_html);
|
265 |
+
$settings['headers'] = sanitize_textarea_field( htmlentities($settings['headers']) );
|
266 |
+
};
|
267 |
+
|
268 |
+
if ( isset( $settings['schema'] ) ) {
|
269 |
+
|
270 |
+
$json_schema_str = ( $settings['schema'] );
|
271 |
+
$schema_obj = json_decode(stripcslashes($json_schema_str));
|
272 |
+
//validate it is a json object
|
273 |
+
if($schema_obj === null) {
|
274 |
+
// $schema_obj is null because the json cannot be decoded
|
275 |
+
$settings['schema'] = '';
|
276 |
+
} else {
|
277 |
+
$settings['schema'] = sanitize_textarea_field( htmlentities($settings['schema']) );
|
278 |
+
|
279 |
+
}
|
280 |
+
}
|
281 |
+
***/
|
282 |
+
$psp_new_settings = array_merge( $psp_current_settings, $settings );
|
283 |
+
|
284 |
+
error_log(print_r( $psp_current_settings, true ));
|
285 |
+
error_log(print_r( $settings, true ));
|
286 |
+
|
287 |
+
//Remove sanitizing for adding
|
288 |
+
unset( $psp_new_settings[ 'wizard' ] );
|
289 |
+
remove_filter( "sanitize_option_psp_home_settings", array( $this->psp_settings_instance, 'sanitize_home_settings' ));
|
290 |
+
remove_filter( "sanitize_option_psp_home_settings", array( &$this, 'sanitize_home_settings' ));
|
291 |
+
|
292 |
+
$psp_new_settings = array_filter( $psp_new_settings, 'strlen' );
|
293 |
+
update_option( "psp_home_settings", $psp_new_settings);
|
294 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_sitemap_wizard";
|
295 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
296 |
+
exit();
|
297 |
+
}
|
298 |
+
|
299 |
+
/*
|
300 |
+
* Registers the general settings and appends the
|
301 |
+
* key to the plugin settings tabs array. -$others_name = sitewide_meta
|
302 |
+
*/
|
303 |
+
private function register_general_settings($setting_name) {
|
304 |
+
$this->psp_settings_tabs[$this->psp_general_settings_group] = 'General';
|
305 |
+
$psp_settings_name = "psp_".$setting_name."_settings";
|
306 |
+
$setting_name_text = str_replace( "_", " ", $setting_name );
|
307 |
+
$setting_name_text = ucwords($setting_name_text);
|
308 |
+
|
309 |
+
$psp_settings = get_option($psp_settings_name);
|
310 |
+
//$this->psp_settings_name = $psp_settings;
|
311 |
+
|
312 |
+
register_setting( $this->psp_general_settings_group, $psp_settings_name, array( &$this, 'sanitize_general_settings' ) );
|
313 |
+
|
314 |
+
//Section
|
315 |
+
$section_id = 'psp_separator_section';
|
316 |
+
$section_title = esc_html__( 'Sitewide Title Settings', 'platinum-seo-pack' );
|
317 |
+
add_settings_section( $section_id, $section_title, array( &$this, 'section_separator_desc' ), $this->psp_general_settings_group );
|
318 |
+
|
319 |
+
//field
|
320 |
+
$psp_separators = array ('' => 'None', '-' => '-', '–' => '–', '—' => '—', '·' => '·', '•' => '•', '*' => '*', '|' => '|', '~' => '~', '«' => '«', '»' => '»', '<' => '<', '>' => '>', '˜' => '˜', '♥' => '♥', '♣' => '♣', ':' => ':', '★' => '★');
|
321 |
+
|
322 |
+
$psp_separator_field = array (
|
323 |
+
'label_for' => 'psp_'.$setting_name.'_separator',
|
324 |
+
'option_name' => $psp_settings_name.'[separator]',
|
325 |
+
'option_value' => isset($psp_settings['separator']) ? $psp_settings['separator'] : '',
|
326 |
+
'radioitems' => $psp_separators,
|
327 |
+
'option_description' => esc_html__( ' Can be used in title and description formats by specifying ', 'platinum-seo-pack' ). '<code>%sep%</code>.',
|
328 |
+
);
|
329 |
+
|
330 |
+
$psp_separator_field_id = 'psp_'.$setting_name.'_separator';
|
331 |
+
$psp_separator_field_title = 'Title Separator: ';
|
332 |
+
|
333 |
+
add_settings_field( $psp_separator_field_id, $psp_separator_field_title, array( &$this, 'psp_add_field_radiobuttons' ), $this->psp_general_settings_group, $section_id, $psp_separator_field );
|
334 |
+
|
335 |
+
//paged title format
|
336 |
+
$psp_paged_title_field = array (
|
337 |
+
'label_for' => 'psp_'.$setting_name.'_paged_title_format',
|
338 |
+
'option_name' => $psp_settings_name.'[paged_title_format]',
|
339 |
+
'option_value' => isset($psp_settings['paged_title_format']) ? esc_attr($psp_settings['paged_title_format']) : '',
|
340 |
+
'option_description' => '<code>%page%</code>'.esc_html__( ' - Page number. "Page" is the pagination base and it can be changed to anything you want.', 'platinum-seo-pack' ),
|
341 |
+
);
|
342 |
+
|
343 |
+
$paged_title_field_id = 'psp_'.$setting_name.'_paged_title_format';
|
344 |
+
$paged_title_field_title = esc_html__( 'Paged title Format: ', 'platinum-seo-pack' );
|
345 |
+
|
346 |
+
add_settings_field( $paged_title_field_id, $paged_title_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_general_settings_group, $section_id, $psp_paged_title_field);
|
347 |
+
|
348 |
+
//add_settings_field( $use_meta_noydir_field_id, $use_meta_noydir_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $use_meta_noydir_field );
|
349 |
+
|
350 |
+
//autogenerate description
|
351 |
+
$autogenerate_desc_field = array (
|
352 |
+
'label_for' => 'psp_'.$setting_name.'_autogenerate_description',
|
353 |
+
'option_name' => $psp_settings_name.'[autogenerate_description]',
|
354 |
+
'option_value' => isset($psp_settings['autogenerate_description']) ? $psp_settings['autogenerate_description'] : '',
|
355 |
+
'checkbox_label' => esc_html__( 'Autogenerate description for all post types', 'platinum-seo-pack' ),
|
356 |
+
'option_description' => esc_html__( 'If no SEO description is set for any post, an auto-generated description will be set against the meta description tag for the Post or Page. Post Excerpt, if it exists, will be used. If not, the first few words from the Post or Page will be used.', 'platinum-seo-pack' )
|
357 |
+
);
|
358 |
+
|
359 |
+
$autogenerate_desc_field_id = 'psp_'.$setting_name.'_autogenerate_description';
|
360 |
+
$autogenerate_desc_field_title = esc_html__( 'Use description autogenerator: ', 'platinum-seo-pack' );
|
361 |
+
|
362 |
+
add_settings_field( $autogenerate_desc_field_id, $autogenerate_desc_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $autogenerate_desc_field );
|
363 |
+
|
364 |
+
//canonical
|
365 |
+
$use_meta_canonical_field = array (
|
366 |
+
'label_for' => 'psp_'.$setting_name.'_use_canonical',
|
367 |
+
'option_name' => $psp_settings_name.'[use_canonical]',
|
368 |
+
'option_value' => isset($psp_settings['use_canonical']) ? $psp_settings['use_canonical'] : '',
|
369 |
+
'checkbox_label' => esc_html__( 'Use canonical tags generated by Platinum SEO', 'platinum-seo-pack' )
|
370 |
+
);
|
371 |
+
|
372 |
+
$use_meta_canonical_field_id = 'psp_'.$setting_name.'_use_canonical';
|
373 |
+
$use_meta_canonical_field_title = esc_html__( 'Use canonical tags: ', 'platinum-seo-pack' );
|
374 |
+
|
375 |
+
add_settings_field( $use_meta_canonical_field_id, $use_meta_canonical_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_general_settings_group, $section_id, $use_meta_canonical_field );
|
376 |
+
|
377 |
+
//wizard
|
378 |
+
$psp_wizard_field = array (
|
379 |
+
'label_for' => 'psp_'.$setting_name.'_wizard',
|
380 |
+
'option_name' => $psp_settings_name.'[wizard]',
|
381 |
+
'option_value' => 'wizard',
|
382 |
+
);
|
383 |
+
|
384 |
+
$psp_wizard_field_id = 'psp_'.$setting_name.'_wizard';
|
385 |
+
$psp_wizard_field_title = '';
|
386 |
+
|
387 |
+
add_settings_field( $psp_wizard_field_id, $psp_wizard_field_title, array( &$this, 'psp_add_field_hidden' ), $this->psp_general_settings_group, $section_id, $psp_wizard_field);
|
388 |
+
|
389 |
+
}
|
390 |
+
|
391 |
+
function sanitize_general_settings($settings) {
|
392 |
+
|
393 |
+
if( ! isset( $settings['wizard'] ) ) {
|
394 |
+
|
395 |
+
return $settings;
|
396 |
+
|
397 |
+
}
|
398 |
+
|
399 |
+
$psp_settings_name = 'psp_sitewide_settings';
|
400 |
+
|
401 |
+
$psp_current_settings = get_option('psp_sitewide_settings') ? get_option('psp_sitewide_settings') : array();
|
402 |
+
|
403 |
+
if( isset( $settings['separator'] ) ) {
|
404 |
+
|
405 |
+
$settings['separator'] = sanitize_text_field( htmlentities($settings['separator']) );
|
406 |
+
|
407 |
+
//$psp_separators = array ( '-', '–', '—', '·', '•', '*', '|', '~', '«', '»', '<', '>', '˜', '♥', '♣');
|
408 |
+
$psp_separators = array ( '-', '–', '—', '·', '•', '*', '|', '~', '«', '»', '<', '>', '˜', '♥', '♣', ':', '★');
|
409 |
+
|
410 |
+
if (!in_array($settings['separator'], $psp_separators)) {
|
411 |
+
$settings['separator'] = '';
|
412 |
+
}
|
413 |
+
} else {
|
414 |
+
$settings['separator'] = '';
|
415 |
+
}
|
416 |
+
|
417 |
+
if( isset( $settings['paged_title_format'] ) ) {
|
418 |
+
$settings['paged_title_format'] = sanitize_text_field( $settings['paged_title_format'] );
|
419 |
+
} else {
|
420 |
+
$settings['paged_title_format'] = '';
|
421 |
+
}
|
422 |
+
|
423 |
+
if( isset( $settings['autogenerate_description'] ) ) {
|
424 |
+
$settings['autogenerate_description'] = !is_null(filter_var($settings['autogenerate_description'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['autogenerate_description'] : '';
|
425 |
+
} else {
|
426 |
+
$settings['autogenerate_description'] = '';
|
427 |
+
}
|
428 |
+
|
429 |
+
if( isset( $settings['use_canonical'] ) ) {
|
430 |
+
$settings['use_canonical'] = !is_null(filter_var($settings['use_canonical'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_canonical'] : '';
|
431 |
+
} else {
|
432 |
+
$settings['use_canonical'] = '';
|
433 |
+
}
|
434 |
+
|
435 |
+
$psp_new_settings = array_merge( $psp_current_settings, $settings );
|
436 |
+
|
437 |
+
//Remove sanitizing for adding
|
438 |
+
unset( $psp_new_settings[ 'wizard' ] );
|
439 |
+
remove_filter( "sanitize_option_psp_sitewide_settings", array( $this->psp_settings_instance, 'sanitize_general_settings' ));
|
440 |
+
remove_filter( "sanitize_option_psp_sitewide_settings", array( &$this, 'sanitize_general_settings' ));
|
441 |
+
|
442 |
+
$psp_new_settings = array_filter( $psp_new_settings, 'strlen' );
|
443 |
+
update_option( "psp_sitewide_settings", $psp_new_settings);
|
444 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_home_wizard";
|
445 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
446 |
+
exit();
|
447 |
+
}
|
448 |
+
|
449 |
+
|
450 |
+
/*
|
451 |
+
* Registers the permalinks settings for taxonomies and appends the
|
452 |
+
* key to the plugin settings tabs array.
|
453 |
+
*/
|
454 |
+
private function register_permalink_settings() {
|
455 |
+
$this->psp_settings_tabs[$this->psp_permalink_settings_group] = 'Permalinks';
|
456 |
+
$psp_settings_name = "psp_permalink_settings";
|
457 |
+
|
458 |
+
$psp_settings = get_option($psp_settings_name);
|
459 |
+
//$this->psp_settings_name = $psp_settings;
|
460 |
+
|
461 |
+
//register_setting( $this->psp_permalink_settings_group, $psp_settings_name );
|
462 |
+
register_setting( $this->psp_permalink_settings_group, $psp_settings_name, array( &$this, 'sanitize_permalink_settings' ));
|
463 |
+
|
464 |
+
//Redirection Section
|
465 |
+
$section_id = 'psp_redirection_section';
|
466 |
+
$section_title = esc_html__('Redirections', 'platinum-seo-pack');
|
467 |
+
|
468 |
+
add_settings_section( $section_id, $section_title, array( &$this, 'section_redirections_desc' ), $this->psp_permalink_settings_group );
|
469 |
+
|
470 |
+
//Fields
|
471 |
+
|
472 |
+
$redirection_field = array (
|
473 |
+
'label_for' => 'psp_redirection',
|
474 |
+
'option_name' => $psp_settings_name.'[redirection]',
|
475 |
+
'option_value' => isset($psp_settings['redirection']) ? $psp_settings['redirection'] : '',
|
476 |
+
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
477 |
+
'option_description' => esc_html__( 'Turn ON to enable redirections created using Platinum SEO (Recommended).', 'platinum-seo-pack' ),
|
478 |
+
);
|
479 |
+
|
480 |
+
$redirection_field_id = 'psp_redirection';
|
481 |
+
//$redirection_field_title = esc_html__('Redirection: ', 'platinum-seo-pack');
|
482 |
+
$redirection_field_title = esc_html__('Redirection: ', 'platinum-seo-pack').'<a href="https://techblissonline.com/redirection-in-wordpress/" target="_blank" rel="noopener">'.'<br>'.esc_html__('what does this do?', 'platinum-seo-pack').'</a>';
|
483 |
+
|
484 |
+
add_settings_field( $redirection_field_id, $redirection_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_permalink_settings_group, $section_id, $redirection_field );
|
485 |
+
|
486 |
+
$auto_redirection_field = array (
|
487 |
+
'label_for' => 'psp_auto_redirection',
|
488 |
+
'option_name' => $psp_settings_name.'[auto_redirection]',
|
489 |
+
'option_value' => isset($psp_settings['auto_redirection']) ? $psp_settings['auto_redirection'] : '',
|
490 |
+
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
491 |
+
'option_description' => esc_html__( 'Turn ON to enable automatics redirection of all Posts using Platinum SEO. this will automatically take care of changes in permalink format (Recommended).', 'platinum-seo-pack' ),
|
492 |
+
);
|
493 |
+
|
494 |
+
$auto_redirection_field_id = 'psp_auto_redirection';
|
495 |
+
//$auto_redirection_field_title = esc_html__('Automatically Redirect Posts: ', 'platinum-seo-pack');
|
496 |
+
$auto_redirection_field_title = esc_html__('Automatically Redirect Posts: ', 'platinum-seo-pack').'<a href="https://techblissonline.com/redirection-in-wordpress/#automatic-http-redirection-in-wordpress" target="_blank" rel="noopener">'.'<br>'.esc_html__('How does this help?', 'platinum-seo-pack').'</a>';
|
497 |
+
|
498 |
+
add_settings_field( $auto_redirection_field_id, $auto_redirection_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_permalink_settings_group, $section_id, $auto_redirection_field );
|
499 |
+
|
500 |
+
$psp_301_limit_field = array (
|
501 |
+
'label_for' => 'psp_301_limit',
|
502 |
+
'option_name' => $psp_settings_name.'[limit_301]',
|
503 |
+
'option_value' => isset($psp_settings['limit_301']) ? $psp_settings['limit_301'] : '',
|
504 |
+
'option_label' => esc_html__( 'Rows', 'platinum-seo-pack' ),
|
505 |
+
'option_description' => esc_html__( 'Set the max number of entries in Redirection log.(Highly Recommended)', 'platinum-seo-pack' ),
|
506 |
+
);
|
507 |
+
|
508 |
+
$psp_301_limit_field_id = 'psp_301_limit';
|
509 |
+
$psp_301_limit_field_title = esc_html__('Limit Redirection Log to: ', 'platinum-seo-pack');
|
510 |
+
|
511 |
+
add_settings_field( $psp_301_limit_field_id, $psp_301_limit_field_title, array( &$this, 'psp_add_field_text_number' ), $this->psp_permalink_settings_group, $section_id, $psp_301_limit_field);
|
512 |
+
|
513 |
+
//V2.0.8
|
514 |
+
$psp_disable_wp_404_guess_field = array (
|
515 |
+
'label_for' => 'psp_disable_wp_404_guess',
|
516 |
+
'option_name' => $psp_settings_name.'[disable_wp_404_guess]',
|
517 |
+
'option_value' => isset($psp_settings['disable_wp_404_guess']) ? $psp_settings['disable_wp_404_guess'] : '',
|
518 |
+
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
519 |
+
'option_description' => esc_html__( 'Turn ON to disable WordPress 404 Canonical Redirect Guessing (Recommended).', 'platinum-seo-pack' ),
|
520 |
+
);
|
521 |
+
|
522 |
+
$psp_disable_wp_404_guess_id = 'psp_disable_wp_404_guess';
|
523 |
+
$psp_disable_wp_404_guess_title = esc_html__('Disable WP 404 Redirect Guessing: ', 'platinum-seo-pack').'<a href="https://techblissonline.com/wordpress-canonical-redirect-for-404-errors/" target="_blank" rel="noopener">'.'<br>'.esc_html__('How does this work?', 'platinum-seo-pack').'</a>';
|
524 |
+
|
525 |
+
add_settings_field( $psp_disable_wp_404_guess_id, $psp_disable_wp_404_guess_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_permalink_settings_group, $section_id, $psp_disable_wp_404_guess_field );
|
526 |
+
|
527 |
+
//V2.0.8
|
528 |
+
|
529 |
+
//404 Section
|
530 |
+
$section_id = 'psp_404_section';
|
531 |
+
$section_title = esc_html__('404 Errors', 'platinum-seo-pack');
|
532 |
+
|
533 |
+
add_settings_section( $section_id, $section_title, array( &$this, 'section_404errors_desc' ), $this->psp_permalink_settings_group );
|
534 |
+
|
535 |
+
//Fields
|
536 |
+
|
537 |
+
$enable_404_field = array (
|
538 |
+
'label_for' => 'psp_enable_404',
|
539 |
+
'option_name' => $psp_settings_name.'[enable_404]',
|
540 |
+
'option_value' => isset($psp_settings['enable_404']) ? $psp_settings['enable_404'] : '',
|
541 |
+
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
542 |
+
'option_description' => esc_html__( 'Turn ON to monitor 404 errors using Platinum SEO.', 'platinum-seo-pack' ),
|
543 |
+
);
|
544 |
+
|
545 |
+
$psp_enable_404_field_id = 'psp_enable_404';
|
546 |
+
$psp_enable_404_field_title = esc_html__('Track 404 errors: ', 'platinum-seo-pack');
|
547 |
+
|
548 |
+
add_settings_field( $psp_enable_404_field_id, $psp_enable_404_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_permalink_settings_group, $section_id, $enable_404_field );
|
549 |
+
|
550 |
+
$bots_404_field = array (
|
551 |
+
'label_for' => 'psp_bots_404',
|
552 |
+
'option_name' => $psp_settings_name.'[bots_404]',
|
553 |
+
'option_value' => isset($psp_settings['bots_404']) ? $psp_settings['bots_404'] : '',
|
554 |
+
'checkbox_label' => esc_html__('', 'platinum-seo-pack'),
|
555 |
+
'option_description' => esc_html__( 'Turn ON to log 404/410 errors encountered on your site by Search Engine Bots only - Eg. Googlebot and Bingbot (Recommended).', 'platinum-seo-pack' ),
|
556 |
+
);
|
557 |
+
|
558 |
+
$psp_bots_404_field_id = 'psp_bots_404';
|
559 |
+
//$psp_bots_404_field_title = esc_html__('Log errors for Search Engine Bots only: ', 'platinum-seo-pack');
|
560 |
+
$psp_bots_404_field_title = esc_html__('Log errors for Search Engine Bots only: ', 'platinum-seo-pack').'<a href="https://techblissonline.com/http-404-error/#fix-404-errors" target="_blank" rel="noopener">'.'<br>'.esc_html__('How does this work?', 'platinum-seo-pack').'</a>';
|
561 |
+
|
562 |
+
add_settings_field( $psp_bots_404_field_id, $psp_bots_404_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_permalink_settings_group, $section_id, $bots_404_field );
|
563 |
+
|
564 |
+
$psp_404_limit_field = array (
|
565 |
+
'label_for' => 'psp_404_limit',
|
566 |
+
'option_name' => $psp_settings_name.'[limit_404]',
|
567 |
+
'option_value' => isset($psp_settings['limit_404']) ? $psp_settings['limit_404'] : '',
|
568 |
+
'option_label' => esc_html__( 'Rows', 'platinum-seo-pack' ),
|
569 |
+
'option_description' => esc_html__( 'Set the max number of entries in 404 log.(Highly Recommended)', 'platinum-seo-pack' ),
|
570 |
+
);
|
571 |
+
|
572 |
+
$psp_404_limit_field_id = 'psp_404_limit';
|
573 |
+
$psp_404_limit_field_title = esc_html__('Limit 404 Log to: ', 'platinum-seo-pack');
|
574 |
+
|
575 |
+
add_settings_field( $psp_404_limit_field_id, $psp_404_limit_field_title, array( &$this, 'psp_add_field_text_number' ), $this->psp_permalink_settings_group, $section_id, $psp_404_limit_field);
|
576 |
+
|
577 |
+
//wizard
|
578 |
+
$setting_name = "permalink";
|
579 |
+
|
580 |
+
$psp_wizard_field = array (
|
581 |
+
'label_for' => 'psp_'.$setting_name.'_wizard',
|
582 |
+
'option_name' => $psp_settings_name.'[wizard]',
|
583 |
+
'option_value' => 'wizard',
|
584 |
+
);
|
585 |
+
|
586 |
+
$psp_wizard_field_id = 'psp_'.$setting_name.'_wizard';
|
587 |
+
$psp_wizard_field_title = '';
|
588 |
+
|
589 |
+
add_settings_field( $psp_wizard_field_id, $psp_wizard_field_title, array( &$this, 'psp_add_field_hidden' ), $this->psp_permalink_settings_group, $section_id, $psp_wizard_field);
|
590 |
+
|
591 |
+
}
|
592 |
+
|
593 |
+
function sanitize_permalink_settings($settings) {
|
594 |
+
|
595 |
+
if( ! isset( $settings['wizard'] ) ) {
|
596 |
+
|
597 |
+
return $settings;
|
598 |
+
|
599 |
+
}
|
600 |
+
|
601 |
+
$psp_current_settings = get_option('psp_permalink_settings') ? get_option('psp_permalink_settings') : array();
|
602 |
+
|
603 |
+
if( isset( $settings['redirection'] ) ) {
|
604 |
+
$settings['redirection'] = !is_null(filter_var($settings['redirection'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['redirection'] : '';
|
605 |
+
} else {
|
606 |
+
$settings['redirection'] = '';
|
607 |
+
}
|
608 |
+
|
609 |
+
if( isset( $settings['auto_redirection'] ) ) {
|
610 |
+
$settings['auto_redirection'] = !is_null(filter_var($settings['auto_redirection'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['auto_redirection'] : '';
|
611 |
+
} else {
|
612 |
+
$settings['auto_redirection'] = '';
|
613 |
+
}
|
614 |
+
|
615 |
+
if ( isset( $settings['limit_301'] ) ) {
|
616 |
+
$settings['limit_301'] = sanitize_text_field( $settings['limit_301'] );
|
617 |
+
if (!filter_var($settings['limit_301'], FILTER_VALIDATE_INT) ) {
|
618 |
+
$settings['limit_301'] = '';
|
619 |
+
}
|
620 |
+
} else {
|
621 |
+
$settings['limit_301'] = '';
|
622 |
+
}
|
623 |
+
|
624 |
+
//V2.0.8
|
625 |
+
if( isset( $settings['disable_wp_404_guess'] ) ) {
|
626 |
+
$settings['disable_wp_404_guess'] = !is_null(filter_var($settings['disable_wp_404_guess'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['disable_wp_404_guess'] : '';
|
627 |
+
} else {
|
628 |
+
$settings['disable_wp_404_guess'] = '';
|
629 |
+
}
|
630 |
+
//V2.0.8
|
631 |
+
|
632 |
+
if( isset( $settings['enable_404'] ) ) {
|
633 |
+
$settings['enable_404'] = !is_null(filter_var($settings['enable_404'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable_404'] : '';
|
634 |
+
} else {
|
635 |
+
$settings['enable_404'] = '';
|
636 |
+
}
|
637 |
+
|
638 |
+
if( isset( $settings['bots_404'] ) ) {
|
639 |
+
$settings['bots_404'] = !is_null(filter_var($settings['bots_404'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['bots_404'] : '';
|
640 |
+
} else {
|
641 |
+
$settings['bots_404'] = '';
|
642 |
+
}
|
643 |
+
|
644 |
+
if ( isset( $settings['limit_404'] ) ) {
|
645 |
+
$settings['limit_404'] = sanitize_text_field( $settings['limit_404'] );
|
646 |
+
if (!filter_var($settings['limit_404'], FILTER_VALIDATE_INT) ) {
|
647 |
+
$settings['limit_404'] = '';
|
648 |
+
}
|
649 |
+
} else {
|
650 |
+
$settings['limit_404'] = '';
|
651 |
+
}
|
652 |
+
|
653 |
+
//return $settings;
|
654 |
+
$psp_new_settings = array_merge( $psp_current_settings, $settings );
|
655 |
+
|
656 |
+
//Remove sanitizing for adding
|
657 |
+
unset( $psp_new_settings[ 'wizard' ] );
|
658 |
+
remove_filter( "sanitize_option_psp_permalink_settings", array( $this->psp_settings_instance, 'sanitize_permalink_settings' ));
|
659 |
+
remove_filter( "sanitize_option_psp_permalink_settings", array( &$this, 'sanitize_permalink_settings' ));
|
660 |
+
|
661 |
+
$psp_new_settings = array_filter( $psp_new_settings, 'strlen' );
|
662 |
+
update_option( "psp_permalink_settings", $psp_new_settings);
|
663 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_finish_settings_group;
|
664 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
665 |
+
exit();
|
666 |
+
}
|
667 |
+
|
668 |
+
/*
|
669 |
+
* Registers the Home SEO settings and appends the
|
670 |
+
* key to the plugin settings tabs array.
|
671 |
+
*/
|
672 |
+
protected function register_sm_settings() {
|
673 |
+
$this->psp_settings_tabs[$this->psp_sm_settings_group] = 'SiteMap Settings';
|
674 |
+
$psp_sm_settings_name = "psp_sitemap";
|
675 |
+
|
676 |
+
$psp_sm_settings = get_option($psp_sm_settings_name);
|
677 |
+
if (!empty($psp_sm_settings)) $this->psp_sm_settings = $psp_sm_settings;
|
678 |
+
|
679 |
+
//wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ) );
|
680 |
+
//register
|
681 |
+
register_setting( $this->psp_sm_settings_group, $psp_sm_settings_name, array( &$this, 'sanitize_sm_settings' ) );
|
682 |
+
//add Section
|
683 |
+
add_settings_section( 'psp_sitemap_section', esc_html__('SiteMap Settings', 'platinum-seo-pack' ), array( &$this, 'section_sm_desc' ), $this->psp_sm_settings_group );
|
684 |
+
|
685 |
+
//add fields
|
686 |
+
|
687 |
+
//Enable siteMap
|
688 |
+
$sitemap_field = array (
|
689 |
+
'label_for' => 'psp_'.$psp_sm_settings_name.'_enable',
|
690 |
+
'option_name' => $psp_sm_settings_name.'[enable]',
|
691 |
+
'option_value' => isset($psp_sm_settings['enable']) ? $psp_sm_settings['enable'] : '',
|
692 |
+
//'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
|
693 |
+
'option_description' => esc_html__( 'This should always remain checked if you want to create sitemaps using Platinum SEO', 'platinum-seo-pack' ),
|
694 |
+
);
|
695 |
+
|
696 |
+
$sitemap_field_id = 'psp_'.$psp_sm_settings_name.'_enable';
|
697 |
+
$sitemap_field_title = esc_html__( 'Use Platinum SEO SiteMaps: ', 'platinum-seo-pack' );
|
698 |
+
|
699 |
+
add_settings_field( $sitemap_field_id, $sitemap_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_field );
|
700 |
+
|
701 |
+
//SiteMaps for Taxonomies
|
702 |
+
$psp_taxonomies = array();
|
703 |
+
|
704 |
+
$builtin_taxonomies = array("category", "post_tag");
|
705 |
+
$custom_taxonomies = $this->custom_taxonomies;
|
706 |
+
$psp_all_taxonomies = array_merge((array)$builtin_taxonomies, (array)$custom_taxonomies);
|
707 |
+
$psp_taxonomies = array_combine($psp_all_taxonomies, $psp_all_taxonomies);
|
708 |
+
|
709 |
+
$psp_taxonomies_list_field = array (
|
710 |
+
'label_for' => 'psp_taxonomies_list',
|
711 |
+
'option_name' => $psp_sm_settings_name.'[taxonomies_list][]',
|
712 |
+
'option_value' => isset($psp_sm_settings['taxonomies_list']) ? $psp_sm_settings['taxonomies_list'] : '',
|
713 |
+
'checkboxitems' => $psp_taxonomies,
|
714 |
+
'option_description' => esc_html__( 'Select the list of Taxonomies for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
|
715 |
+
);
|
716 |
+
|
717 |
+
$psp_sitemap_taxonomies_field_id = 'psp_taxonomies_list';
|
718 |
+
$psp_sitemap_taxonomies_field_title = esc_html__('Taxonomies: ', 'platinum-seo-pack');
|
719 |
+
|
720 |
+
add_settings_field( $psp_sitemap_taxonomies_field_id, $psp_sitemap_taxonomies_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_taxonomies_list_field);
|
721 |
+
|
722 |
+
//SiteMaps for Post Types
|
723 |
+
$psp_post_rypes = array();
|
724 |
+
|
725 |
+
$builtin_post_types = array("post", "page");
|
726 |
+
$custom_post_types = $this->custom_post_types;
|
727 |
+
$psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
|
728 |
+
$psp_post_rypes = array_combine($psp_all_posttypes, $psp_all_posttypes);
|
729 |
+
|
730 |
+
$psp_posttypes_list_field = array (
|
731 |
+
'label_for' => 'psp_posttypes_list',
|
732 |
+
'option_name' => $psp_sm_settings_name.'[posttypes_list][]',
|
733 |
+
'option_value' => isset($psp_sm_settings['posttypes_list']) ? $psp_sm_settings['posttypes_list'] : '',
|
734 |
+
'checkboxitems' => $psp_post_rypes,
|
735 |
+
'option_description' => esc_html__( 'Select the list of Post Types for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
|
736 |
+
);
|
737 |
+
|
738 |
+
$psp_sitemap_posttypes_field_id = 'psp_posttypes_list';
|
739 |
+
$psp_sitemap_posttypes_field_title = esc_html__('Post Types: ', 'platinum-seo-pack');
|
740 |
+
|
741 |
+
add_settings_field( $psp_sitemap_posttypes_field_id, $psp_sitemap_posttypes_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_posttypes_list_field);
|
742 |
+
|
743 |
+
//include last modified time in Post type SiteMaps
|
744 |
+
$sitemap_lastmod_field = array (
|
745 |
+
'label_for' => 'psp_'.$psp_sm_settings_name.'_include_lastmod',
|
746 |
+
'option_name' => $psp_sm_settings_name.'[include_lastmod]',
|
747 |
+
'option_value' => isset($psp_sm_settings['include_lastmod']) ? $psp_sm_settings['include_lastmod'] : '',
|
748 |
+
//'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
|
749 |
+
'option_description' => esc_html__( 'This should always remain checked if you want to include Last Modified DateTime in Post type sitemaps created using Platinum SEO', 'platinum-seo-pack' ),
|
750 |
+
);
|
751 |
+
|
752 |
+
$sitemap_lastmod_field_id = 'psp_'.$psp_sm_settings_name.'_include_lastmod';
|
753 |
+
$sitemap_lastmod_field_title = esc_html__( 'Include Last Modified DateTime: ', 'platinum-seo-pack' );
|
754 |
+
|
755 |
+
add_settings_field( $sitemap_lastmod_field_id, $sitemap_lastmod_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_lastmod_field );
|
756 |
+
|
757 |
+
//include images in Post type SiteMaps
|
758 |
+
$sitemap_image_field = array (
|
759 |
+
'label_for' => 'psp_'.$psp_sm_settings_name.'_include_images',
|
760 |
+
'option_name' => $psp_sm_settings_name.'[include_images]',
|
761 |
+
'option_value' => isset($psp_sm_settings['include_images']) ? $psp_sm_settings['include_images'] : '',
|
762 |
+
//'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
|
763 |
+
'option_description' => esc_html__( 'This should always remain checked if you want to include images in Post type sitemaps created using Platinum SEO', 'platinum-seo-pack' ),
|
764 |
+
);
|
765 |
+
|
766 |
+
$sitemap_image_field_id = 'psp_'.$psp_sm_settings_name.'_include_images';
|
767 |
+
$sitemap_image_field_title = esc_html__( 'Include Images: ', 'platinum-seo-pack' );
|
768 |
+
|
769 |
+
add_settings_field( $sitemap_image_field_id, $sitemap_image_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_image_field );
|
770 |
+
|
771 |
+
//Asc or Desc in Post type SiteMaps
|
772 |
+
$sitemap_sort_field = array (
|
773 |
+
'label_for' => 'psp_'.$psp_sm_settings_name.'_sort_order',
|
774 |
+
'option_name' => $psp_sm_settings_name.'[sort_order]',
|
775 |
+
'option_value' => isset($psp_sm_settings['sort_order']) ? $psp_sm_settings['sort_order'] : '',
|
776 |
+
'checkbox_on_value' => esc_html__( 'Ascending ', 'platinum-seo-pack' ),
|
777 |
+
'checkbox_off_value' => esc_html__( 'Descending ', 'platinum-seo-pack' ),
|
778 |
+
'checkbox_label' => esc_html__( 'Order of POST IDs', 'platinum-seo-pack' ),
|
779 |
+
'option_description' => esc_html__( 'Sort order of Post Entries included in Post Type SiteMaps created using Platinum SEO. The POST entries are always sorted by Ppost ID.', 'platinum-seo-pack' ),
|
780 |
+
);
|
781 |
+
|
782 |
+
$sitemap_sort_field_id = 'psp_'.$psp_sm_settings_name.'_sort_order';
|
783 |
+
$sitemap_sort_field_title = esc_html__( 'Posts Sort Order: ', 'platinum-seo-pack' );
|
784 |
+
|
785 |
+
//add_settings_field( $sitemap_sort_field_id, $sitemap_sort_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_sort_field );
|
786 |
+
|
787 |
+
//Enable siteMap for Authors
|
788 |
+
$sitemap_author_field = array (
|
789 |
+
'label_for' => 'psp_'.$psp_sm_settings_name.'_enable_authors',
|
790 |
+
'option_name' => $psp_sm_settings_name.'[enable_authors]',
|
791 |
+
'option_value' => isset($psp_sm_settings['enable_authors']) ? $psp_sm_settings['enable_authors'] : '',
|
792 |
+
'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
|
793 |
+
'option_description' => esc_html__( 'This should be checked only if you want to create sitemaps for Author Archives', 'platinum-seo-pack' ),
|
794 |
+
);
|
795 |
+
|
796 |
+
$sitemap_author_field_id = 'psp_'.$psp_sm_settings_name.'_enable_authors';
|
797 |
+
$sitemap_author_field_title = esc_html__( 'Platinum SEO SiteMap for Authors: ', 'platinum-seo-pack' );
|
798 |
+
|
799 |
+
//add_settings_field( $sitemap_author_field_id, $sitemap_author_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_author_field );
|
800 |
+
|
801 |
+
//Number of URLs per sitemap
|
802 |
+
$psp_url_limit_field = array (
|
803 |
+
'label_for' => 'psp_url_limit',
|
804 |
+
'option_name' => $psp_sm_settings_name.'[max_urls]',
|
805 |
+
'option_value' => isset($psp_sm_settings['max_urls']) ? $psp_sm_settings['max_urls'] : 2000,
|
806 |
+
'option_label' => esc_html__( 'URLs per SiteMap', 'platinum-seo-pack' ),
|
807 |
+
'option_description' => esc_html__( 'Set the max number of URLs for a sitemap.(Highly Recommended)', 'platinum-seo-pack' ),
|
808 |
+
);
|
809 |
+
|
810 |
+
$psp_url_limit_field_id = 'psp_url_limit';
|
811 |
+
$psp_url_limit_field_title = esc_html__('Limit number of URLs to: ', 'platinum-seo-pack');
|
812 |
+
|
813 |
+
//add_settings_field( $psp_url_limit_field_id, $psp_url_limit_field_title, array( &$this, 'psp_add_field_text_number' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_url_limit_field);
|
814 |
+
|
815 |
+
//Excluded Post IDs
|
816 |
+
$psp_sm_posts_field_title = esc_html__( 'Excluded Posts: ', 'platinum-seo-pack' );
|
817 |
+
|
818 |
+
$psp_sm_posts_field = array (
|
819 |
+
'label_for' => 'psp_sm_posts_id',
|
820 |
+
'option_name' => $psp_sm_settings_name.'[excluded_post_ids]',
|
821 |
+
'option_value' => isset($psp_sm_settings['excluded_post_ids']) ? esc_attr($psp_sm_settings['excluded_post_ids']) : '',
|
822 |
+
'option_description' => esc_html__( 'Enter a comma separated list of Post IDs to be excluded from SiteMap. This can be automatically updated via Platinum SEO Meta Box for individual Posts or Pages.NoIndex Pages are excluded from the sitemap by default and you need not have to enter them here again.', 'platinum-seo-pack' ),
|
823 |
+
);
|
824 |
+
//add_settings_field( 'psp_sm_posts_id', $psp_sm_posts_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_sm_posts_field);
|
825 |
+
|
826 |
+
|
827 |
+
//Excluded Term IDs
|
828 |
+
$psp_sm_terms_field_title = esc_html__( 'Excluded Terms (Category IDs/Term IDs): ', 'platinum-seo-pack' );
|
829 |
+
|
830 |
+
$psp_sm_terms_field = array (
|
831 |
+
'label_for' => 'psp_sm_terms_ids',
|
832 |
+
'option_name' => $psp_sm_settings_name.'[excluded_term_ids]',
|
833 |
+
'option_value' => isset($psp_sm_settings['excluded_term_ids']) ? esc_attr($psp_sm_settings['excluded_term_ids']) : '',
|
834 |
+
'option_description' => esc_html__( 'Enter a comma separated list of Term IDs to be excluded from SiteMap. This can be automatically updated via Platinum SEO Meta Box for individual Category or Taxonomy Terms. NoIndex Terms are excluded from the sitemap by default and you need not have to enter them here again.', 'platinum-seo-pack' ),
|
835 |
+
);
|
836 |
+
//add_settings_field( 'psp_sm_terms_ids', $psp_sm_terms_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_sm_terms_field);
|
837 |
+
|
838 |
+
//wizard
|
839 |
+
$setting_name = "sitemap";
|
840 |
+
|
841 |
+
$psp_wizard_field = array (
|
842 |
+
'label_for' => 'psp_'.$setting_name.'_wizard',
|
843 |
+
'option_name' => $psp_sm_settings_name.'[wizard]',
|
844 |
+
'option_value' => 'wizard',
|
845 |
+
);
|
846 |
+
|
847 |
+
$psp_wizard_field_id = 'psp_'.$setting_name.'_wizard';
|
848 |
+
$psp_wizard_field_title = '';
|
849 |
+
|
850 |
+
add_settings_field( $psp_wizard_field_id, $psp_wizard_field_title, array( &$this, 'psp_add_field_hidden' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_wizard_field);
|
851 |
+
|
852 |
+
}
|
853 |
+
|
854 |
+
function sanitize_sm_settings( $settings ) {
|
855 |
+
|
856 |
+
if( ! isset( $settings['wizard'] ) ) {
|
857 |
+
|
858 |
+
return $settings;
|
859 |
+
|
860 |
+
}
|
861 |
+
|
862 |
+
$psp_current_settings = get_option('psp_sitemap') ? get_option('psp_sitemap') : array();
|
863 |
+
|
864 |
+
if ( isset( $settings['enable'] ) ) {
|
865 |
+
$settings['enable'] = !is_null(filter_var($settings['enable'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable'] : '';
|
866 |
+
} else {
|
867 |
+
$settings['enable'] = '';
|
868 |
+
}
|
869 |
+
|
870 |
+
//global $wp_rewrite;
|
871 |
+
$wp_sitemaps = new PSP_Sitemaps();
|
872 |
+
|
873 |
+
if( isset( $settings['enable']) && $settings['enable'] ) {
|
874 |
+
$wp_sitemaps->register_rewrites();
|
875 |
+
//$wp_rewrite -> flush_rules();
|
876 |
+
flush_rewrite_rules( false );
|
877 |
+
} else {
|
878 |
+
$wp_sitemaps->unregister_rewrites();
|
879 |
+
//$wp_rewrite -> flush_rules();
|
880 |
+
flush_rewrite_rules( false );
|
881 |
+
}
|
882 |
+
/**
|
883 |
+
if ( isset( $settings['sort_order'] ) ) {
|
884 |
+
$settings['sort_order'] = !is_null(filter_var($settings['sort_order'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['sort_order'] : '';
|
885 |
+
|
886 |
+
}
|
887 |
+
**/
|
888 |
+
if ( isset( $settings['include_images'] ) ) {
|
889 |
+
$settings['include_images'] = !is_null(filter_var($settings['include_images'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['include_images'] : '';
|
890 |
+
|
891 |
+
} else {
|
892 |
+
$settings['include_images'] = '';
|
893 |
+
}
|
894 |
+
|
895 |
+
if ( isset( $settings['include_lastmod'] ) ) {
|
896 |
+
$settings['include_lastmod'] = !is_null(filter_var($settings['include_lastmod'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['include_lastmod'] : '';
|
897 |
+
|
898 |
+
} else {
|
899 |
+
$settings['include_lastmod'] = '';
|
900 |
+
}
|
901 |
+
/**
|
902 |
+
if ( isset( $settings['enable_authors'] ) ) {
|
903 |
+
$settings['enable_authors'] = !is_null(filter_var($settings['enable_authors'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable_authors'] : '';
|
904 |
+
}
|
905 |
+
|
906 |
+
if ( isset( $settings['max_urls'] ) ) {
|
907 |
+
$settings['max_urls'] = sanitize_text_field( $settings['max_urls'] );
|
908 |
+
if (!filter_var($settings['max_urls'], FILTER_VALIDATE_INT) ) {
|
909 |
+
$settings['max_urls'] = 2000;
|
910 |
+
}
|
911 |
+
}
|
912 |
+
**/
|
913 |
+
if ( isset( $settings['taxonomies_list'] ) ) {
|
914 |
+
|
915 |
+
$settings['taxonomies_list'] = array_map( 'sanitize_text_field', $settings['taxonomies_list'] );
|
916 |
+
|
917 |
+
$builtin_tax = array("category", "post_tag");
|
918 |
+
$custom_tax = array();
|
919 |
+
$psp_all_tax = array();
|
920 |
+
$custom_tax = $this->custom_taxonomies;
|
921 |
+
$psp_all_tax = array_merge((array)$builtin_tax, (array)$custom_tax);
|
922 |
+
|
923 |
+
if(!empty($settings['taxonomies_list'])) {
|
924 |
+
if (count($settings['taxonomies_list']) != count(array_intersect($settings['taxonomies_list'], $psp_all_tax))) {
|
925 |
+
$$settings['taxonomies_list'] = array();
|
926 |
+
}
|
927 |
+
}
|
928 |
+
|
929 |
+
} else {
|
930 |
+
$settings['taxonomies_list'] = array();
|
931 |
+
}
|
932 |
+
|
933 |
+
|
934 |
+
if ( isset( $settings['posttypes_list'] ) ) {
|
935 |
+
|
936 |
+
$settings['posttypes_list'] = array_map( 'sanitize_text_field', $settings['posttypes_list'] );
|
937 |
+
|
938 |
+
$builtin_post_types = array("post", "page");
|
939 |
+
$custom_post_types = array();
|
940 |
+
$psp_all_post_types = array();
|
941 |
+
$custom_post_types = $this->custom_post_types;
|
942 |
+
|
943 |
+
$psp_all_post_types = array_merge((array)$builtin_post_types, (array)$custom_post_types);
|
944 |
+
|
945 |
+
if(!empty($settings['posttypes_list'])) {
|
946 |
+
if (count($settings['posttypes_list']) != count(array_intersect($settings['posttypes_list'], $psp_all_post_types))) {
|
947 |
+
$$settings['posttypes_list'] = array();
|
948 |
+
}
|
949 |
+
}
|
950 |
+
|
951 |
+
} else {
|
952 |
+
$settings['posttypes_list'] = array();
|
953 |
+
}
|
954 |
+
|
955 |
+
$psp_new_settings = array_merge( $psp_current_settings, $settings );
|
956 |
+
|
957 |
+
//Remove sanitizing for adding
|
958 |
+
unset( $psp_new_settings[ 'wizard' ] );
|
959 |
+
remove_filter( "sanitize_option_psp_sitemap", array( $this->psp_settings_instance->psp_sitemap_instance, 'sanitize_sm_settings' ));
|
960 |
+
remove_filter( "sanitize_option_psp_sitemap", array( &$this, 'sanitize_sm_settings' ));
|
961 |
+
|
962 |
+
//$psp_new_settings = array_filter( $psp_new_settings, 'strlen' );
|
963 |
+
$psp_new_settings = $this->discard_empty( $psp_new_settings );
|
964 |
+
update_option( "psp_sitemap", $psp_new_settings);
|
965 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_social_wizard";
|
966 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
967 |
+
exit();
|
968 |
+
}
|
969 |
+
|
970 |
+
public function discard_empty ( $setting ) {
|
971 |
+
|
972 |
+
foreach ( $setting as $key => $value ) {
|
973 |
+
|
974 |
+
if ( empty( $value ) ) unset ($setting[$key]);
|
975 |
+
}
|
976 |
+
|
977 |
+
return $setting;
|
978 |
+
|
979 |
+
}
|
980 |
+
|
981 |
+
/*
|
982 |
+
* Registers the social settings for the various social sites and appends the
|
983 |
+
* key to the plugin settings tabs array.
|
984 |
+
*/
|
985 |
+
private function register_social_settings() {
|
986 |
+
$this->psp_settings_tabs[$this->psp_social_settings_group] = 'Social Settings';
|
987 |
+
$psp_settings_name = "psp_social_settings";
|
988 |
+
|
989 |
+
$psp_settings = get_option($psp_settings_name);
|
990 |
+
//$this->psp_settings_name = $psp_settings;
|
991 |
+
|
992 |
+
wp_enqueue_media();
|
993 |
+
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
994 |
+
wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ), '2.2.1' );
|
995 |
+
wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
996 |
+
|
997 |
+
register_setting( $this->psp_social_settings_group, $psp_settings_name,array( &$this, 'sanitize_social_settings' ) );
|
998 |
+
|
999 |
+
//Facebook Section
|
1000 |
+
$section_id = 'psp_facebook_section';
|
1001 |
+
$section_title = esc_html__('Facebook Open Graph Sitewide Settings', 'platinum-seo-pack');
|
1002 |
+
|
1003 |
+
add_settings_section( $section_id, $section_title, array( &$this, 'section_fb_desc' ), $this->psp_social_settings_group );
|
1004 |
+
|
1005 |
+
//Fields
|
1006 |
+
|
1007 |
+
$og_tags_field = array (
|
1008 |
+
'label_for' => 'psp_og_tags_enabled',
|
1009 |
+
'option_name' => $psp_settings_name.'[psp_og_tags_enabled]',
|
1010 |
+
'option_value' => isset($psp_settings['psp_og_tags_enabled']) ? esc_attr($psp_settings['psp_og_tags_enabled']) : '',
|
1011 |
+
'checkbox_label' => esc_html__('Enable Opengraph Tags for Facebook', 'platinum-seo-pack')
|
1012 |
+
);
|
1013 |
+
|
1014 |
+
$og_tags_field_id = 'psp_og_tags_enabled';
|
1015 |
+
$og_tags_field_title = esc_html__('Open Graph Tags: ', 'platinum-seo-pack');
|
1016 |
+
|
1017 |
+
add_settings_field( $og_tags_field_id, $og_tags_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_social_settings_group, $section_id, $og_tags_field );
|
1018 |
+
|
1019 |
+
//OG site name
|
1020 |
+
$psp_fb_site_name_field = array (
|
1021 |
+
'label_for' => 'psp_social_fb_site_name',
|
1022 |
+
'option_name' => $psp_settings_name.'[fb_site_name]',
|
1023 |
+
'option_value' => isset($psp_settings['fb_site_name']) ? esc_attr($psp_settings['fb_site_name']) : '',
|
1024 |
+
'option_description' => esc_html__( 'Enter the site name to use while sharing pages from this domain/site. For eg: "Tehblissonline" is the sitename used for the site http://techblissonline.com/. If this is left blank, then the default wordpress site name will be used.', 'platinum-seo-pack' ),
|
1025 |
+
);
|
1026 |
+
|
1027 |
+
$psp_fb_site_name_field_id = 'psp_social_fb_site_name';
|
1028 |
+
$psp_fb_site_name_field_title = esc_html__( 'Site Name: ', 'platinum-seo-pack' );
|
1029 |
+
|
1030 |
+
add_settings_field( $psp_fb_site_name_field_id, $psp_fb_site_name_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_social_settings_group, $section_id, $psp_fb_site_name_field);
|
1031 |
+
|
1032 |
+
//Facebook default image
|
1033 |
+
$psp_fb_defailt_img_field = array (
|
1034 |
+
'label_for' => 'psp_social_fb_default_img',
|
1035 |
+
'option_name' => $psp_settings_name.'[fb_default_image]',
|
1036 |
+
'option_value' => isset($psp_settings['fb_default_image']) ? esc_url($psp_settings['fb_default_image']) : '',
|
1037 |
+
'option_description' => esc_html__( 'Enter the image URL or upload an image to be used as a default image while sharing any post/page on facebook. This will be used if a post/page does not have any image', 'platinum-seo-pack' ),
|
1038 |
+
'button' => 1,
|
1039 |
+
);
|
1040 |
+
|
1041 |
+
$psp_fb_defailt_img_field_id = 'psp_social_fb_default_img';
|
1042 |
+
$psp_fb_defailt_img_field_title = esc_html__( 'Default image for sharing on facebook: ', 'platinum-seo-pack' );
|
1043 |
+
|
1044 |
+
add_settings_field( $psp_fb_defailt_img_field_id, $psp_fb_defailt_img_field_title, array( &$this, 'psp_add_field_text_url' ), $this->psp_social_settings_group, $section_id, $psp_fb_defailt_img_field);
|
1045 |
+
|
1046 |
+
//Twitter Section
|
1047 |
+
$section_id = 'psp_twitter_section';
|
1048 |
+
$section_title = esc_html__('Twitter Card Sitewide Settings', 'platinum-seo-pack');
|
1049 |
+
|
1050 |
+
add_settings_section( $section_id, $section_title, array( &$this, 'section_twitter_desc' ), $this->psp_social_settings_group );
|
1051 |
+
|
1052 |
+
$twitter_card_field = array (
|
1053 |
+
'label_for' => 'psp_twitter_card_enabled',
|
1054 |
+
'option_name' => $psp_settings_name.'[psp_twitter_card_enabled]',
|
1055 |
+
'option_value' => isset($psp_settings['psp_twitter_card_enabled']) ? esc_attr($psp_settings['psp_twitter_card_enabled']) : '',
|
1056 |
+
'checkbox_label' => esc_html__('Enable Twitter Card', 'platinum-seo-pack')
|
1057 |
+
);
|
1058 |
+
|
1059 |
+
$twitter_card_field_id = 'psp_twitter_card_enabled';
|
1060 |
+
$twitter_card_field_title = esc_html__('Twitter Card: ', 'platinum-seo-pack');
|
1061 |
+
|
1062 |
+
add_settings_field( $twitter_card_field_id, $twitter_card_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_social_settings_group, $section_id, $twitter_card_field );
|
1063 |
+
|
1064 |
+
//Twitter Card type
|
1065 |
+
$psp_tc_types = array ('' => 'Select a card type', 'summary' => 'summary', 'summary_large_image' => 'summary with large image');
|
1066 |
+
|
1067 |
+
$psp_tw_ct_type_field = array (
|
1068 |
+
'label_for' => 'psp_social_tw_ctype',
|
1069 |
+
'option_name' => $psp_settings_name.'[tw_ct_type]',
|
1070 |
+
'option_value' => isset($psp_settings['tw_ct_type']) ? esc_attr($psp_settings['tw_ct_type']) : '',
|
1071 |
+
'dditems' => $psp_tc_types,
|
1072 |
+
'option_description' => esc_html__( 'Enter the twitter card type to be used by default for individual posts/pages of your site. For eg., if your site is a blog, you can enter <code>summary</code> as the default twitter card type. Note that this can be overridden through <code>Social</code> settings for your individual post in "Techblissonline Platinum SEO and Social Meta Box" on your post editor. For complete reference of twitter card types refer <a href="https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started" target="_blank">twitter development document reference.</a>', 'platinum-seo-pack' ),
|
1073 |
+
);
|
1074 |
+
|
1075 |
+
$psp_tw_ct_type_field_id = 'psp_social_tw_ctype';
|
1076 |
+
$psp_tw_ct_type_field_title = esc_html__( 'Twitter CardType: ', 'platinum-seo-pack' );
|
1077 |
+
|
1078 |
+
add_settings_field( $psp_tw_ct_type_field_id, $psp_tw_ct_type_field_title, array( &$this, 'psp_add_field_dropdown' ), $this->psp_social_settings_group, $section_id, $psp_tw_ct_type_field);
|
1079 |
+
|
1080 |
+
//Twitter user
|
1081 |
+
$psp_tw_user_field = array (
|
1082 |
+
'label_for' => 'psp_social_tw_user',
|
1083 |
+
'option_name' => $psp_settings_name.'[tw_user]',
|
1084 |
+
'option_value' => isset($psp_settings['tw_user']) ? esc_attr($psp_settings['tw_user']) : '',
|
1085 |
+
'option_description' => esc_html__( 'The Twitter <code>@username</code> the card should be attributed to. This is usually the twitter handle created for your domain /website. However, You might even choose to use your personal twitter user id here. If you twitter user id is <code>@johndoe</code>, enter <code>johndoe</code> as the user id here. This user id is required for <a href="https://analytics.twitter.com/" target="_blank">Twitter Card analytics</a>', 'platinum-seo-pack' ),
|
1086 |
+
);
|
1087 |
+
|
1088 |
+
$psp_tw_user_field_id = 'psp_social_tw_user';
|
1089 |
+
$psp_tw_user_field_title = esc_html__( 'Twitter User: ', 'platinum-seo-pack' );
|
1090 |
+
|
1091 |
+
add_settings_field( $psp_tw_user_field_id, $psp_tw_user_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_social_settings_group, $section_id, $psp_tw_user_field);
|
1092 |
+
|
1093 |
+
//Twitter default image
|
1094 |
+
$psp_tw_defailt_img_field = array (
|
1095 |
+
'label_for' => 'psp_social_tw_default_img',
|
1096 |
+
'option_name' => $psp_settings_name.'[tw_default_image]',
|
1097 |
+
'option_value' => isset($psp_settings['tw_default_image']) ? esc_url($psp_settings['tw_default_image']) : '',
|
1098 |
+
'option_description' => esc_html__( 'Enter the image URL or upload an image to be used as a default image while sharing any post/page on twitter. This will be used if a post/page does not have any image', 'platinum-seo-pack' ),
|
1099 |
+
'button' => 1,
|
1100 |
+
);
|
1101 |
+
|
1102 |
+
$psp_tw_defailt_img_field_id = 'psp_social_tw_default_img';
|
1103 |
+
$psp_tw_defailt_img_field_title = esc_html__( 'Default image for sharing on twitter: ', 'platinum-seo-pack' );
|
1104 |
+
|
1105 |
+
add_settings_field( $psp_tw_defailt_img_field_id, $psp_tw_defailt_img_field_title, array( &$this, 'psp_add_field_text_url' ), $this->psp_social_settings_group, $section_id, $psp_tw_defailt_img_field);
|
1106 |
+
|
1107 |
+
//Schema.org Section
|
1108 |
+
//$section_id = 'psp_schema_org_section';
|
1109 |
+
//$section_title = esc_html__('Pinterest and Linkedin Settings', 'platinum-seo-pack');
|
1110 |
+
|
1111 |
+
//add_settings_section( $section_id, $section_title, array( &$this, 'section_schema_org_desc' ), $this->psp_social_settings_group );
|
1112 |
+
|
1113 |
+
//wizard
|
1114 |
+
$setting_name = "social";
|
1115 |
+
|
1116 |
+
$psp_wizard_field = array (
|
1117 |
+
'label_for' => 'psp_'.$setting_name.'_wizard',
|
1118 |
+
'option_name' => $psp_settings_name.'[wizard]',
|
1119 |
+
'option_value' => 'wizard',
|
1120 |
+
);
|
1121 |
+
|
1122 |
+
$psp_wizard_field_id = 'psp_'.$setting_name.'_wizard';
|
1123 |
+
$psp_wizard_field_title = '';
|
1124 |
+
|
1125 |
+
add_settings_field( $psp_wizard_field_id, $psp_wizard_field_title, array( &$this, 'psp_add_field_hidden' ), $this->psp_social_settings_group, $section_id, $psp_wizard_field);
|
1126 |
+
|
1127 |
+
}
|
1128 |
+
|
1129 |
+
function sanitize_social_settings($settings) {
|
1130 |
+
|
1131 |
+
if( ! isset( $settings['wizard'] ) ) {
|
1132 |
+
|
1133 |
+
return $settings;
|
1134 |
+
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
$psp_allowed_protocols = array('http','https');
|
1138 |
+
|
1139 |
+
$psp_current_settings = get_option('psp_social_settings') ? get_option('psp_social_settings') : array();
|
1140 |
+
|
1141 |
+
if ( isset( $settings['psp_og_tags_enabled'] ) ) {
|
1142 |
+
$settings['psp_og_tags_enabled'] = !is_null(filter_var($settings['psp_og_tags_enabled'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['psp_og_tags_enabled'] : '';
|
1143 |
+
} else {
|
1144 |
+
$settings['psp_og_tags_enabled'] = '';
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
if( isset( $settings['fb_site_name'] ) ) {
|
1148 |
+
$settings['fb_site_name'] = sanitize_text_field( $settings['fb_site_name'] );
|
1149 |
+
} else {
|
1150 |
+
$settings['fb_site_name'] = '';
|
1151 |
+
}
|
1152 |
+
|
1153 |
+
|
1154 |
+
if ( isset( $settings['fb_default_image'] ) ) {
|
1155 |
+
$settings['fb_default_image'] = esc_url_raw( $settings['fb_default_image'], $psp_allowed_protocols );
|
1156 |
+
} else {
|
1157 |
+
$settings['fb_default_image'] = '';
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
if ( isset( $settings['psp_twitter_card_enabled'] ) ) {
|
1161 |
+
$settings['psp_twitter_card_enabled'] = !is_null(filter_var($settings['psp_twitter_card_enabled'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['psp_twitter_card_enabled'] : '';
|
1162 |
+
} else {
|
1163 |
+
$settings['psp_twitter_card_enabled'] = '';
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
if ( isset( $settings['tw_ct_type'] ) ) {
|
1167 |
+
$settings['tw_ct_type'] = sanitize_text_field($settings['tw_ct_type']);
|
1168 |
+
|
1169 |
+
$tw_card_types = array ('summary', 'summary_large_image', 'player', 'app');
|
1170 |
+
|
1171 |
+
if (!in_array($settings['tw_ct_type'], $tw_card_types)) {
|
1172 |
+
$settings['tw_ct_type'] = '';
|
1173 |
+
}
|
1174 |
+
} else {
|
1175 |
+
$settings['tw_ct_type'] = '';
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
if( isset( $settings['tw_user'] ) ) {
|
1179 |
+
$settings['tw_user'] = sanitize_text_field( $settings['tw_user'] );
|
1180 |
+
} else {
|
1181 |
+
$settings['tw_user'] = '';
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
if ( isset( $settings['tw_default_image'] ) ) {
|
1185 |
+
$settings['tw_default_image'] = esc_url_raw( $settings['tw_default_image'], $psp_allowed_protocols );
|
1186 |
+
} else {
|
1187 |
+
$settings['tw_default_image'] = '';
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
$psp_new_settings = array_merge( $psp_current_settings, $settings );
|
1191 |
+
|
1192 |
+
//Remove sanitizing for adding
|
1193 |
+
unset( $psp_new_settings[ 'wizard' ] );
|
1194 |
+
remove_filter( "sanitize_option_psp_social_settings", array( $this->psp_settings_instance->psp_social_instance, 'sanitize_social_settings' ));
|
1195 |
+
remove_filter( "sanitize_option_psp_social_settings", array( &$this, 'sanitize_social_settings' ));
|
1196 |
+
|
1197 |
+
//$psp_new_settings = array_filter( $psp_new_settings, 'strlen' );
|
1198 |
+
$psp_new_settings = $this->discard_empty( $psp_new_settings );
|
1199 |
+
update_option( "psp_social_settings", $psp_new_settings);
|
1200 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_permalink_wizard";
|
1201 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
1202 |
+
exit();
|
1203 |
+
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
/*
|
1207 |
+
* The following methods provide descriptions
|
1208 |
+
* for their respective sections, used as callbacks
|
1209 |
+
* with add_settings_section
|
1210 |
+
*/
|
1211 |
+
function section_separator_desc() { echo esc_html__('The Title separator can be used in all Title formats and Description formats by specifying the tag - ', 'platinum-seo-pack').' %sep%'; }
|
1212 |
+
function section_home_desc() { echo '<a href="'.home_url().'" target=_blank">'. esc_html__('Home page SEO settings', 'platinum-seo-pack').'</a> - '.esc_html__('Set the title and meta description tags used on home page of your site here.', 'platinum-seo-pack');}
|
1213 |
+
function section_permalinks_desc() { echo esc_html__('These settings, if checked, will remove the base from taxonomies like Category and other custom taxonomies, if any. If "Remove base" is chosen for Category then the corresponding base will be removed from the permalink structure for categories.', 'platinum-seo-pack'). ' i.e. <code>Category</code>'; }
|
1214 |
+
function section_redirections_desc() {echo ''; }
|
1215 |
+
function section_404errors_desc() {echo ''; }
|
1216 |
+
function section_schema_desc() {echo esc_html__('The following settings are not necessary if you had added these schemas in the Home page and/or Contacts Page JSON Schema Editor settings of this plugin.', 'platinum-seo-pack'). ' i.e. <br /> 1. '.esc_html__('Schema for enabling Sitelink Search Box in Google and', 'platinum-seo-pack').' <br /> 2. '. esc_html__('Schema for Knowledge Graph', 'platinum-seo-pack'); }
|
1217 |
+
function section_sm_desc() {echo ''; }
|
1218 |
+
function section_fb_desc() {echo '';}
|
1219 |
+
function section_twitter_desc() {echo ''; }
|
1220 |
+
|
1221 |
+
/**Callback for number textfield **/
|
1222 |
+
function psp_add_field_text_number(array $args) {
|
1223 |
+
|
1224 |
+
$option_name = isset($args['option_name']) ? $args['option_name'] : '';
|
1225 |
+
$id = isset($args['label_for']) ? $args['label_for'] : '';
|
1226 |
+
$option_value = isset($args['option_value']) ? $args['option_value'] : '';
|
1227 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1228 |
+
$option_label = isset($args['option_label']) ? esc_html( $args['option_label'] ) : '';
|
1229 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1230 |
+
|
1231 |
+
echo "<input id='".esc_attr($id)."' name='".esc_attr($option_name)."' style='width:20%' type='number' min='1' maxlength='5' value='".esc_attr($option_value)."' /> ".$option_label."<br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";//<br /><span class='describe'>Describe title</span>";
|
1232 |
+
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
//callback for hidden field
|
1236 |
+
function psp_add_field_hidden(array $args) {
|
1237 |
+
|
1238 |
+
$option_name = isset($args['option_name']) ? $args['option_name'] : '';
|
1239 |
+
$id = isset($args['label_for']) ? $args['label_for'] : '';
|
1240 |
+
$option_value = isset($args['option_value']) ? $args['option_value'] : '';
|
1241 |
+
|
1242 |
+
echo "<input id='".esc_attr($id)."' name='".esc_attr($option_name)."' type='hidden' value='".esc_attr($option_value)."' /> ";
|
1243 |
+
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
/*
|
1247 |
+
* Callback for adding multiple checkboxes.
|
1248 |
+
*/
|
1249 |
+
function psp_add_multiple_checkbox(array $args) {
|
1250 |
+
|
1251 |
+
$option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
|
1252 |
+
$id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
|
1253 |
+
$option_array_value = isset($args['option_value']) ? (array) $args['option_value'] : array();
|
1254 |
+
$option_array_value = array_map( 'esc_attr', $option_array_value );
|
1255 |
+
$checkboxitems = isset($args['checkboxitems']) ? $args['checkboxitems'] : array();//array
|
1256 |
+
$option_description = isset($args['option_description']) ? esc_attr( $args['option_description'] ) : '';
|
1257 |
+
|
1258 |
+
$counter = 1;
|
1259 |
+
|
1260 |
+
//echo "<div id='$id' class='psp-separator'>";
|
1261 |
+
echo "<div id='$id'>";
|
1262 |
+
|
1263 |
+
foreach ( $checkboxitems as $checkboxitemkey => $checkboxitemvalue ) {
|
1264 |
+
|
1265 |
+
$checkbox_id = esc_attr($id."-cbx-item-".$counter);
|
1266 |
+
$checked = in_array($checkboxitemkey, $option_array_value) ? 'checked="checked"' : '';
|
1267 |
+
//echo "<input id='$checkbox_id' $checked type='checkbox' name='$option_name' value='$checkboxitem' /><label class='psp-radio-separator' for='$radio_id'>$checkboxitemvalue</label>";
|
1268 |
+
echo "<div class='psp-bs'><input ".$checked." id='$checkbox_id' name='$option_name' value='".esc_attr($checkboxitemkey)."' type='checkbox' data-toggle='toggle' /><span> </span><span for='$id'>".esc_attr($checkboxitemvalue)."</span></div><br />";
|
1269 |
+
|
1270 |
+
$counter = $counter + 1;
|
1271 |
+
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
echo "</div><br /><p class='description'>".esc_html($option_description)."</p>";
|
1275 |
+
|
1276 |
+
}
|
1277 |
+
|
1278 |
+
/*
|
1279 |
+
* Callback for adding a textfield.
|
1280 |
+
*/
|
1281 |
+
function psp_add_field_text(array $args) {
|
1282 |
+
|
1283 |
+
$option_name = isset($args['option_name']) ? $args['option_name'] : '';
|
1284 |
+
$id = isset($args['label_for']) ? $args['label_for'] : '';
|
1285 |
+
$option_value = isset($args['option_value']) ? $args['option_value'] : '';
|
1286 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1287 |
+
$option_button = isset($args['button']) ? esc_attr($args['button']) : '';
|
1288 |
+
$class_name = isset($args['class_name']) ? $args['class_name'] : '';
|
1289 |
+
$psp_tags = isset($args['psp_tags']) ? ( $args['psp_tags'] ) : '';
|
1290 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1291 |
+
|
1292 |
+
if (!$option_button) {
|
1293 |
+
//printf( '<input id="%1$s" name="%2$s" style="width:99%%" type="text" value="%3$s" /><br /><p class="description">%4$s</p>', $id, $option_name, $option_value,$option_description );
|
1294 |
+
if ($class_name) {
|
1295 |
+
echo "<input id='".esc_attr($id)."' name='".esc_attr($option_name)."' class='".esc_attr($class_name)."' style='width:99%' type='text' value='".esc_attr($option_value)."' readonly/><br/><p class='description'>".wp_kses(html_entity_decode($option_description),$desc_allowed_html)."</p>";//<br /><span class='describe'>Describe title</span>";
|
1296 |
+
if ( ! empty( $psp_tags ) ) : ?>
|
1297 |
+
<p><?php esc_html_e( 'Available tags:' , 'platinum-seo-pack'); ?></p>
|
1298 |
+
<ul role="list">
|
1299 |
+
<?php
|
1300 |
+
foreach ( $psp_tags as $tag ) {
|
1301 |
+
?>
|
1302 |
+
<li class="psp">
|
1303 |
+
<button type="button" data-added="<?php echo esc_attr( $tag ); ?>" data-id="<?php echo esc_attr( $id ); ?>"
|
1304 |
+
class="pspbutton button button-secondary">
|
1305 |
+
<?php echo '%' . esc_attr( $tag ) . '%'; ?>
|
1306 |
+
</button>
|
1307 |
+
</li>
|
1308 |
+
<?php
|
1309 |
+
}
|
1310 |
+
?>
|
1311 |
+
</ul>
|
1312 |
+
<?php endif;
|
1313 |
+
} else {
|
1314 |
+
echo "<input id='".esc_attr($id)."' name='".esc_attr($option_name)."' style='width:99%' type='text' value='".esc_attr($option_value)."' /><br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";//<br /><span class='describe'>Describe title</span>";
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
} else {
|
1318 |
+
echo "<input style='width:87%;' type='text' name='".esc_attr($option_name)."' id='".esc_attr($id)."' value='".esc_attr($option_value)."'><input style='font-size:small' class='upload_image_button' type='button' value='Upload' /><br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1319 |
+
}
|
1320 |
+
//echo "<input id='".$this->psp_home_settings_key['title']."' name='".$this->psp_home_settings_key['title']."' type='text' value='".esc_attr( $this->psp_home_settings['title'] )."' />";
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
/*
|
1324 |
+
* Callback for adding a textfield for adding URLs.
|
1325 |
+
*/
|
1326 |
+
function psp_add_field_text_url(array $args) {
|
1327 |
+
|
1328 |
+
$option_name = isset($args['option_name']) ? $args['option_name'] : '';
|
1329 |
+
$id = isset($args['label_for']) ? $args['label_for'] : '';
|
1330 |
+
$option_value = isset($args['option_value']) ? $args['option_value'] : '';
|
1331 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1332 |
+
$option_button = isset($args['button']) ? esc_attr($args['button']) : '';
|
1333 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1334 |
+
|
1335 |
+
if (!$option_button) {
|
1336 |
+
//printf( '<input id="%1$s" name="%2$s" style="width:99%%" type="text" value="%3$s" /><br /><p class="description">%4$s</p>', $id, $option_name, $option_value,$option_description );
|
1337 |
+
echo "<input id='".esc_attr($id)."' name='".esc_attr($option_name)."' style='width:99%' type='text' value='".esc_url($option_value)."' /><br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";//<br /><span class='describe'>Describe title</span>";
|
1338 |
+
} else {
|
1339 |
+
echo "<input style='width:87%;' type='text' name='".esc_attr($option_name)."' id='".esc_attr($id)."' value='".esc_url($option_value)."'><input style='font-size:small' class='upload_image_button' type='button' value='Upload' /><br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
}
|
1343 |
+
|
1344 |
+
/*
|
1345 |
+
* Callback for adding a textarea.
|
1346 |
+
*/
|
1347 |
+
function psp_add_field_textarea(array $args) {
|
1348 |
+
|
1349 |
+
$option_name = isset($args['option_name']) ? $args['option_name'] : '';
|
1350 |
+
$id = isset($args['label_for']) ? $args['label_for'] : '';
|
1351 |
+
$option_value = isset($args['option_value']) ? html_entity_decode(esc_textarea( $args['option_value'] )) : '';
|
1352 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1353 |
+
$class_name = isset($args['class_name']) ? $args['class_name'] : '';
|
1354 |
+
$parent_class_name = isset($args['parent_classname']) ? $args['parent_classname'] : '';
|
1355 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1356 |
+
|
1357 |
+
if(!empty($class_name)) {
|
1358 |
+
if(!empty($parent_class_name)) {
|
1359 |
+
echo "<div class='".esc_attr($parent_class_name)."'><textarea id='".esc_attr($id)."' name='".esc_attr($option_name)."' class='".esc_attr($class_name)."' rows='3' style='width:99%' type='textarea'>{$option_value}</textarea></div><br><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1360 |
+
} else {
|
1361 |
+
echo "<textarea id='".esc_attr($id)."' name='".esc_attr($option_name)."' class='".esc_attr($class_name)."' rows='3' style='width:99%' type='textarea'>{$option_value}</textarea><br><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1362 |
+
}
|
1363 |
+
} else {
|
1364 |
+
if(!empty($parent_class_name)) {
|
1365 |
+
echo "<div class='".esc_attr($parent_class_name)."'><textarea id='".esc_attr($id)."' name='".esc_attr($option_name)."' rows='3' style='width:99%' type='textarea'>{$option_value}</textarea><br><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1366 |
+
} else {
|
1367 |
+
echo "<textarea id='".esc_attr($id)."' name='".esc_attr($option_name)."' rows='3' style='width:99%' type='textarea'>{$option_value}</textarea><br><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
}
|
1371 |
+
//echo "<textarea rows='4' id='".$this->psp_home_settings_key['description']."' name='".$this->psp_home_settings_key['description']."'>".stripcslashes($this->psp_home_settings['description'])."</textarea>";
|
1372 |
+
}
|
1373 |
+
|
1374 |
+
/*
|
1375 |
+
* Callback for adding a checkbox.
|
1376 |
+
*/
|
1377 |
+
function psp_add_field_checkbox(array $args) {
|
1378 |
+
|
1379 |
+
$option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
|
1380 |
+
$id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
|
1381 |
+
$option_value = isset($args['option_value']) ? esc_attr( $args['option_value'] ) : '';
|
1382 |
+
//$option_value = esc_attr( $args['option_value'] );
|
1383 |
+
$checkbox_label = isset($args['checkbox_label']) ? esc_html($args['checkbox_label']) : '';
|
1384 |
+
$option_description = isset($args['option_description']) ? esc_html($args['option_description']) : '';
|
1385 |
+
$checked = '';
|
1386 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1387 |
+
if($option_value) { $checked = ' checked="checked" '; }
|
1388 |
+
echo "<div class='psp-bs'><input ".esc_attr($checked)." id='".esc_attr($id)."' name='".esc_attr($option_name)."' type='checkbox' data-toggle='toggle'/><span> </span><span for='".esc_attr($id)."'>".wp_kses(html_entity_decode($checkbox_label), $desc_allowed_html)."</span><br /><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p></div>";
|
1389 |
+
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
/*
|
1393 |
+
* Callback for adding a dropdown.
|
1394 |
+
*/
|
1395 |
+
function psp_add_field_dropdown(array $args) {
|
1396 |
+
|
1397 |
+
$option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
|
1398 |
+
$id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
|
1399 |
+
$option_value = isset($args['option_value']) ? htmlentities( $args['option_value'], ENT_COMPAT, 'UTF-8', false ) : '';
|
1400 |
+
$dditems = isset($args['dditems']) ? $args['dditems'] : array();
|
1401 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1402 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1403 |
+
|
1404 |
+
|
1405 |
+
//if($option_value) { $checked = ' checked="checked" '; }
|
1406 |
+
//echo "<input ".$checked." id='$id' name='$option_name' type='checkbox' /><label for='$id'>$checkbox_label</label><br /><p class='description'>$option_description</p>";
|
1407 |
+
|
1408 |
+
echo "<select id='".esc_attr($id)."' name='".esc_attr($option_name)."'>";
|
1409 |
+
/*foreach($dditems as $item) {
|
1410 |
+
$selected = ($option_value==$item) ? 'selected="selected"' : '';
|
1411 |
+
echo "<option value='$item' $selected>$item</option>";
|
1412 |
+
}*/
|
1413 |
+
//echo "<option value disabled selected>Select an option</option>";
|
1414 |
+
//echo "<option value=""></option>";
|
1415 |
+
//while (list($key, $val) = each($dditems)) {
|
1416 |
+
foreach($dditems as $key => $val) {
|
1417 |
+
$selected = ($option_value==$key) ? 'selected="selected"' : '';
|
1418 |
+
echo "<option value='".esc_attr($key)."' ".esc_attr($selected).">".esc_attr($val)."</option>";
|
1419 |
+
//$selected = ($option_value==$val) ? 'selected="selected"' : '';
|
1420 |
+
//echo "<option value='$val' $selected>$key</option>";
|
1421 |
+
}
|
1422 |
+
echo "</select><p for='".esc_attr($id)."'> ".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1423 |
+
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
/*
|
1427 |
+
* Callback for adding radio buttons.
|
1428 |
+
*/
|
1429 |
+
function psp_add_field_radiobuttons(array $args) {
|
1430 |
+
|
1431 |
+
$option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
|
1432 |
+
$id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
|
1433 |
+
$option_value = isset($args['option_value']) ? htmlentities( $args['option_value'], ENT_COMPAT, 'UTF-8', false ) : '';
|
1434 |
+
$radioitems = isset($args['radioitems']) ? $args['radioitems'] : array();//array ('-', '֧, 'ק, 'ק, 'է, '*', '?', '|', '~', '˧, 'ۧ, '<', '>');
|
1435 |
+
$option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
|
1436 |
+
$desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
|
1437 |
+
|
1438 |
+
$counter = 1;
|
1439 |
+
|
1440 |
+
echo "<div id='$id' class='psp-separator'>";
|
1441 |
+
|
1442 |
+
//while (list($key, $val) = each($radioitems)) {
|
1443 |
+
foreach($radioitems as $key => $val) {
|
1444 |
+
|
1445 |
+
$radio_id = $id."-radio-item-".$counter;
|
1446 |
+
$selected = ($option_value==$key) ? 'checked="checked"' : '';
|
1447 |
+
echo "<input id='".esc_attr($radio_id)."' ".esc_attr($selected)." type='radio' name='".esc_attr($option_name)."' value='".esc_attr($key)."' /><label class='psp-radio-separator' for='".esc_attr($radio_id)."'>".esc_attr($val)."</label>";
|
1448 |
+
|
1449 |
+
$counter = $counter + 1;
|
1450 |
+
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
/*foreach ( $radioitems as $radioitem ) {
|
1454 |
+
|
1455 |
+
$radio_id = $id."-radio-item-".$counter;
|
1456 |
+
$selected = ($option_value==$radioitem) ? 'checked="checked"' : '';
|
1457 |
+
echo "<input id='$radio_id' $selected type='radio' name='$option_name' value='$radioitem' /><label class='psp-radio-separator' for='$radio_id'>$radioitem</label>";
|
1458 |
+
|
1459 |
+
$counter = $counter + 1;
|
1460 |
+
|
1461 |
+
}*/
|
1462 |
+
|
1463 |
+
echo "</div><br /><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
|
1464 |
+
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
/*
|
1468 |
+
* renders Plugin settings page, checks
|
1469 |
+
* for the active tab and replaces key with the related
|
1470 |
+
* settings key. Uses the plugin_options_tabs method
|
1471 |
+
* to render the tabs.
|
1472 |
+
*/
|
1473 |
+
function psp_wizard_page() {
|
1474 |
+
$tab = isset( $_GET['psptab'] ) ? sanitize_key($_GET['psptab']) : $this->psp_start_settings_group;
|
1475 |
+
|
1476 |
+
if( $tab == $this->psp_start_settings_group ) {
|
1477 |
+
|
1478 |
+
include_once( PSP_PLUGIN_HOME . PSPINC . '/wizard/psp_wizard_startbtn_renderer.php' );
|
1479 |
+
return;
|
1480 |
+
|
1481 |
+
} else if ( $tab == $this->psp_finish_settings_group ) {
|
1482 |
+
|
1483 |
+
include_once( PSP_PLUGIN_HOME . PSPINC . '/wizard/psp_wizard_finishbtn_renderer.php' );
|
1484 |
+
return;
|
1485 |
+
|
1486 |
+
}
|
1487 |
+
$psp_default = "btn btn-default btn-circle";
|
1488 |
+
$psp_green = "btn btn-success btn-circle";
|
1489 |
+
|
1490 |
+
$btnclass_2 = $psp_default;
|
1491 |
+
$btnclass_3 = $psp_default;
|
1492 |
+
$btnclass_4 = $psp_default;
|
1493 |
+
$btnclass_5 = $psp_default;
|
1494 |
+
$btnclass_6 = $psp_default;
|
1495 |
+
|
1496 |
+
if ($tab == $this->psp_general_settings_group) {
|
1497 |
+
//$this->register_general_settings('sitewide');
|
1498 |
+
$skip = $this->psp_home_settings_group;
|
1499 |
+
$btnclass_2 = $psp_green;
|
1500 |
+
} else if ($tab == $this->psp_home_settings_group) {
|
1501 |
+
//$this->register_home_settings();
|
1502 |
+
$skip = $this->psp_sm_settings_group;
|
1503 |
+
$btnclass_2 = $psp_green;
|
1504 |
+
$btnclass_3 = $psp_green;
|
1505 |
+
} else if ($tab == $this->psp_sm_settings_group) {
|
1506 |
+
//$this->register_sm_settings();
|
1507 |
+
$skip = $this->psp_social_settings_group;
|
1508 |
+
$btnclass_2 = $psp_green;
|
1509 |
+
$btnclass_3 = $psp_green;
|
1510 |
+
$btnclass_4 = $psp_green;
|
1511 |
+
} else if ($tab == $this->psp_social_settings_group) {
|
1512 |
+
//$this->register_social_settings();
|
1513 |
+
$skip = $this->psp_permalink_settings_group;
|
1514 |
+
$btnclass_2 = $psp_green;
|
1515 |
+
$btnclass_3 = $psp_green;
|
1516 |
+
$btnclass_4 = $psp_green;
|
1517 |
+
$btnclass_5 = $psp_green;
|
1518 |
+
} else if ($tab == $this->psp_permalink_settings_group) {
|
1519 |
+
//$this->register_permalink_settings();
|
1520 |
+
$skip = $this->psp_finish_settings_group;
|
1521 |
+
$btnclass_2 = $psp_green;
|
1522 |
+
$btnclass_3 = $psp_green;
|
1523 |
+
$btnclass_4 = $psp_green;
|
1524 |
+
$btnclass_5 = $psp_green;
|
1525 |
+
$btnclass_6 = $psp_green;
|
1526 |
+
}
|
1527 |
+
$psp_button = "submit";
|
1528 |
+
?>
|
1529 |
+
<style>
|
1530 |
+
#wpcontent, #footer { margin-left: 0px !important; }
|
1531 |
+
#adminmenuback, #adminmenuwrap { display: none !important; }
|
1532 |
+
|
1533 |
+
body {
|
1534 |
+
/*margin-top:30px;*/
|
1535 |
+
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
1536 |
+
}
|
1537 |
+
.stepwizard-step p {
|
1538 |
+
margin-top: 0px;
|
1539 |
+
color:#666;
|
1540 |
+
}
|
1541 |
+
.stepwizard-row {
|
1542 |
+
display: table-row;
|
1543 |
+
}
|
1544 |
+
.stepwizard {
|
1545 |
+
display: table;
|
1546 |
+
width: 90%;
|
1547 |
+
position: relative;
|
1548 |
+
}
|
1549 |
+
.stepwizard-step button[disabled] {
|
1550 |
+
/*opacity: 1 !important;
|
1551 |
+
filter: alpha(opacity=100) !important;*/
|
1552 |
+
}
|
1553 |
+
.stepwizard .btn.disabled, .stepwizard .btn[disabled], .stepwizard fieldset[disabled] .btn {
|
1554 |
+
opacity:1 !important;
|
1555 |
+
color:#bbb;
|
1556 |
+
}
|
1557 |
+
.stepwizard-row:before {
|
1558 |
+
top: 14px;
|
1559 |
+
bottom: 0;
|
1560 |
+
position: absolute;
|
1561 |
+
content:" ";
|
1562 |
+
width: 100%;
|
1563 |
+
height: 1px;
|
1564 |
+
background-color: #ccc;
|
1565 |
+
z-index: 0;
|
1566 |
+
}
|
1567 |
+
.stepwizard-step {
|
1568 |
+
display: table-cell;
|
1569 |
+
text-align: center;
|
1570 |
+
position: relative;
|
1571 |
+
}
|
1572 |
+
.btn-circle {
|
1573 |
+
width: 30px;
|
1574 |
+
height: 30px;
|
1575 |
+
text-align: center;
|
1576 |
+
padding: 6px 0;
|
1577 |
+
font-size: 12px;
|
1578 |
+
line-height: 1.428571429;
|
1579 |
+
border-radius: 15px;
|
1580 |
+
}
|
1581 |
+
|
1582 |
+
.wizardbody {
|
1583 |
+
margin-left:10%;
|
1584 |
+
}
|
1585 |
+
.psp-bs {
|
1586 |
+
width: 92%;
|
1587 |
+
}
|
1588 |
+
.panel {
|
1589 |
+
/*width: 86%;*/
|
1590 |
+
margin-left: 5%;
|
1591 |
+
overflow: auto;
|
1592 |
+
}
|
1593 |
+
.psp-left{
|
1594 |
+
float:left;
|
1595 |
+
padding-left:10px;
|
1596 |
+
}
|
1597 |
+
.psp-right{
|
1598 |
+
float:right;
|
1599 |
+
padding-right:10px;
|
1600 |
+
}
|
1601 |
+
.wrap, .wrap psp-bs {
|
1602 |
+
width: 92%;
|
1603 |
+
background-color: #fff;
|
1604 |
+
}
|
1605 |
+
.psp-margin {
|
1606 |
+
margin-top: 10px;
|
1607 |
+
}
|
1608 |
+
.btn-orange {
|
1609 |
+
background-color: #EB931A !important;
|
1610 |
+
color: #FFF !important;
|
1611 |
+
border: none !important;
|
1612 |
+
font-weight: bold;
|
1613 |
+
}
|
1614 |
+
/***
|
1615 |
+
form[name="platinum-seo-form1"] {
|
1616 |
+
margin-left: 5%;
|
1617 |
+
}
|
1618 |
+
***/
|
1619 |
+
</style>
|
1620 |
+
<div align="center">
|
1621 |
+
<h1><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><br /><br /> PLATINUM SEO</h1>
|
1622 |
+
<small>This is a wizard that sets up the essential options. For full set of options under each head, go to WP Admin >> Platinum SEO & Social Pack >> SEO</small>
|
1623 |
+
</div>
|
1624 |
+
<div class="wizardbody">
|
1625 |
+
<div class="psp-bs">
|
1626 |
+
<div class="container">
|
1627 |
+
<div class="stepwizard">
|
1628 |
+
<div class="stepwizard-row setup-panel">
|
1629 |
+
<div class="stepwizard-step col-xs-2">
|
1630 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_import_settings_group ?>" type="button" class="btn btn-success btn-circle">1</a>
|
1631 |
+
<p><small>Importer</small></p>
|
1632 |
+
</div>
|
1633 |
+
<div class="stepwizard-step col-xs-2">
|
1634 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_general_settings_group ?>" type="button" class="<?php echo $btnclass_2 ?>">2</a>
|
1635 |
+
<p><small>General</small></p>
|
1636 |
+
</div>
|
1637 |
+
<div class="stepwizard-step col-xs-2">
|
1638 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_home_settings_group ?>" type="button" class="<?php echo $btnclass_3 ?>">3</a>
|
1639 |
+
<p><small>Home</small></p>
|
1640 |
+
</div>
|
1641 |
+
<div class="stepwizard-step col-xs-2">
|
1642 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_sm_settings_group ?>" type="button" class="<?php echo $btnclass_4 ?>">4</a>
|
1643 |
+
<p><small>Sitemaps</small></p>
|
1644 |
+
</div>
|
1645 |
+
<div class="stepwizard-step col-xs-2">
|
1646 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_social_settings_group ?>" type="button" class="<?php echo $btnclass_5 ?>">5</a>
|
1647 |
+
<p><small>Social</small></p>
|
1648 |
+
</div>
|
1649 |
+
<div class="stepwizard-step col-xs-2">
|
1650 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$this->psp_permalink_settings_group ?>" type="button" class="<?php echo $btnclass_6 ?>">6</a>
|
1651 |
+
<p><small>Permalinks</small></p>
|
1652 |
+
</div>
|
1653 |
+
</div>
|
1654 |
+
</div>
|
1655 |
+
</div> <?php //container ?>
|
1656 |
+
</div> <?php //psp-bs ?>
|
1657 |
+
<div class="wrap">
|
1658 |
+
<?php $this->psp_enqueue_scripts(); ?>
|
1659 |
+
<?php if ($this->psp_helper->user_has_access( $tab )) { ?>
|
1660 |
+
|
1661 |
+
<?php if ( $tab == $this->psp_import_settings_group) { ?>
|
1662 |
+
<div class="panel">
|
1663 |
+
<?php include_once( PSP_PLUGIN_HOME . PSPINC . '/wizard/psp_wizard_importer.php' ); ?>
|
1664 |
+
</div>
|
1665 |
+
<div class="psp-bs">
|
1666 |
+
<div class="container">
|
1667 |
+
<div class="stepwizard">
|
1668 |
+
<div class="pull-right">
|
1669 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_general_wizard" ?>" class="button btn-orange" role="button"> <?php esc_html_e('Next', 'platinum-seo-pack') ?></a>
|
1670 |
+
</div>
|
1671 |
+
</div>
|
1672 |
+
</div>
|
1673 |
+
</div>
|
1674 |
+
<?php } else { ?>
|
1675 |
+
<form name="platinum-seo-form1" method="post" action="options.php">
|
1676 |
+
<div class="panel">
|
1677 |
+
<?php settings_fields( $tab ); ?>
|
1678 |
+
<?php settings_errors(); ?>
|
1679 |
+
<?php do_settings_sections( $tab ); ?>
|
1680 |
+
</div>
|
1681 |
+
<div class="psp-bs">
|
1682 |
+
<div class="container">
|
1683 |
+
<div class="stepwizard">
|
1684 |
+
<div class="pull-left psp-margin">
|
1685 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=".$skip ?>" class="button btn-orange" role="button"> <?php esc_html_e('Skip & Continue', 'platinum-seo-pack') ?></a>
|
1686 |
+
</div>
|
1687 |
+
<div class="pull-right">
|
1688 |
+
<?php submit_button('Save & Continue', 'primary', $psp_button); ?>
|
1689 |
+
</div>
|
1690 |
+
</div>
|
1691 |
+
</div>
|
1692 |
+
</div>
|
1693 |
+
|
1694 |
+
<?php } ?>
|
1695 |
+
</form>
|
1696 |
+
<?php } else { ?>
|
1697 |
+
<p style="color: red"><?php esc_html_e('You do not have access to these Options (Settings) tab of Techblissonline Platinum SEO', 'platinum-seo-pack') ?></p>
|
1698 |
+
<?php } ?>
|
1699 |
+
</div>
|
1700 |
+
</div>
|
1701 |
+
<?php
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
/*
|
1705 |
+
* Renders our tabs in the plugin options page,
|
1706 |
+
* walks through the object's tabs array and prints
|
1707 |
+
* them one by one. Provides the heading for the
|
1708 |
+
* psp_options_page method.
|
1709 |
+
*/
|
1710 |
+
function psp_enqueue_scripts() {
|
1711 |
+
$current_tab = isset( $_GET['psptab'] ) ? sanitize_key($_GET['psptab']) : $this->psp_import_settings_group;
|
1712 |
+
|
1713 |
+
if ($current_tab == $this->psp_home_settings_group) {
|
1714 |
+
$psp_cm_home_html_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/html', 'codemirror'=> array('autoRefresh' => true)));
|
1715 |
+
$psp_cm_home_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
1716 |
+
wp_enqueue_script( 'psp-home-cm-editors', plugins_url( 'settings/js/cm-home.js', PSP_PLUGIN_SETTINGS_URL ),array( 'jquery' ), false, true);
|
1717 |
+
wp_localize_script('psp-home-cm-editors', 'psp_cm_home_html_settings', $psp_cm_home_html_settings);
|
1718 |
+
wp_localize_script('psp-home-cm-editors', 'psp_cm_home_json_settings', $psp_cm_home_json_settings);
|
1719 |
+
//$psp_icon = '<span class="dashicons dashicons-admin-home"></span>';
|
1720 |
+
|
1721 |
+
}
|
1722 |
+
|
1723 |
+
//wp_enqueue_style("psp-settings-bswide-css", plugins_url( 'settings/css/psp-settings-bswide.css', PSP_PLUGIN_SETTINGS_URL ));
|
1724 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( 'settings/css/psp-settings.css', PSP_PLUGIN_SETTINGS_URL ));
|
1725 |
+
wp_enqueue_style("psp-settings-css", plugins_url( 'settings/css/psp-settings.css', PSP_PLUGIN_SETTINGS_URL ), array(), '2.2.1');
|
1726 |
+
|
1727 |
+
//$psp_wizard_data_nonce = wp_create_nonce( 'psp_wizard_data_nonce' );
|
1728 |
+
|
1729 |
+
wp_enqueue_script( 'psp-ajax-wizard-script', plugins_url( 'settings/js/psp_wizard.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.2.1', false );
|
1730 |
+
//wp_localize_script( 'psp-ajax-wizard-script', 'psp_ajax_wizard_object', array( 'ajax_url' => admin_url( 'admin-ajax.php'), 'pspnonce' => $psp_wizard_data_nonce) );
|
1731 |
+
wp_enqueue_script( 'psp-bs-js', plugins_url( 'settings/js/pspbsjs.js', PSP_PLUGIN_SETTINGS_URL ) );
|
1732 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( 'settings/css/psp-settings-bs.css', PSP_PLUGIN_SETTINGS_URL ));
|
1733 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( 'settings/css/psp-settings.css', PSP_PLUGIN_SETTINGS_URL ));
|
1734 |
+
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( 'settings/js/pspbstoggler.js', PSP_PLUGIN_SETTINGS_URL ) );
|
1735 |
+
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( 'settings/css/psp-bs-toggle.css', PSP_PLUGIN_SETTINGS_URL ));
|
1736 |
+
|
1737 |
+
}
|
1738 |
+
};
|
psp-include/wizard/psp_wizard_startbtn_renderer.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
wp_enqueue_script( 'psp-ajax-wizard-script', plugins_url( 'settings/js/psp_wizard.js', PSP_PLUGIN_SETTINGS_URL ), array('jquery'), '2.2.1', false );
|
11 |
+
wp_enqueue_style("psp-settings-bs-css", plugins_url( 'settings/css/psp-settings-bs.css', PSP_PLUGIN_SETTINGS_URL ));
|
12 |
+
?>
|
13 |
+
|
14 |
+
<style>
|
15 |
+
body {
|
16 |
+
background: purple;
|
17 |
+
font-family: 'Roboto Condensed', sans-serif;
|
18 |
+
}
|
19 |
+
|
20 |
+
.container {
|
21 |
+
position: fixed;
|
22 |
+
top: 0px;
|
23 |
+
left: 0px;
|
24 |
+
width: 100%;
|
25 |
+
height: 100%;
|
26 |
+
z-index: 0;
|
27 |
+
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
28 |
+
background: -moz-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
29 |
+
background: -ms-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
30 |
+
background: radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
31 |
+
}
|
32 |
+
|
33 |
+
.content {
|
34 |
+
position: absolute;
|
35 |
+
width: 100%;
|
36 |
+
height: 100%;
|
37 |
+
left: 0px;
|
38 |
+
top: 0px;
|
39 |
+
z-index: 1000;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
.container .psp-bs .psp-start-btn {
|
44 |
+
position: fixed;
|
45 |
+
top: 50%;
|
46 |
+
left: 0;
|
47 |
+
width: 100%;
|
48 |
+
height: 100%;
|
49 |
+
z-index: 1000;
|
50 |
+
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
51 |
+
background: -moz-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
52 |
+
background: -ms-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
53 |
+
background: radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
|
54 |
+
}
|
55 |
+
**/
|
56 |
+
|
57 |
+
.container .psp-bs {
|
58 |
+
background-color: transparent !important;
|
59 |
+
}
|
60 |
+
|
61 |
+
.container h2 {
|
62 |
+
position: absolute;
|
63 |
+
top: 50%;
|
64 |
+
line-height: 100px;
|
65 |
+
height: 100px;
|
66 |
+
margin-top: -50px;
|
67 |
+
font-size: 30px;
|
68 |
+
width: 100%;
|
69 |
+
text-align: center;
|
70 |
+
color: transparent;
|
71 |
+
animation: blurFadeInOut 3s ease-in backwards;
|
72 |
+
}
|
73 |
+
.container h2.frame-1 {
|
74 |
+
animation-delay: 0s;
|
75 |
+
}
|
76 |
+
.container h2.frame-2 {
|
77 |
+
animation-delay: 2.5s;
|
78 |
+
}
|
79 |
+
.container h2.frame-3 {
|
80 |
+
animation-delay: 5s;
|
81 |
+
animation: blurFadeIn 1s ease-in 5s backwards;
|
82 |
+
}
|
83 |
+
.container h2.frame-4 {
|
84 |
+
font-size: 200px;
|
85 |
+
animation-delay: 7.5s;
|
86 |
+
}
|
87 |
+
.container h2.frame-5 {
|
88 |
+
animation: none;
|
89 |
+
color: transparent;
|
90 |
+
text-shadow: 0px 0px 1px #fff;
|
91 |
+
}
|
92 |
+
.container h2.frame-5 span {
|
93 |
+
animation: blurFadeIn 3s ease-in 12s backwards;
|
94 |
+
color: transparent;
|
95 |
+
text-shadow: 0px 0px 1px #fff;
|
96 |
+
}
|
97 |
+
.container h2.frame-5 span:nth-child(2) {
|
98 |
+
animation-delay: 13s;
|
99 |
+
}
|
100 |
+
.container h2.frame-5 span:nth-child(3) {
|
101 |
+
animation-delay: 14s;
|
102 |
+
}
|
103 |
+
|
104 |
+
@keyframes blurFadeInOut{
|
105 |
+
0%{
|
106 |
+
opacity: 0;
|
107 |
+
text-shadow: 0px 0px 40px #fff;
|
108 |
+
transform: scale(0.9);
|
109 |
+
}
|
110 |
+
20%,75%{
|
111 |
+
opacity: 1;
|
112 |
+
text-shadow: 0px 0px 1px #fff;
|
113 |
+
transform: scale(1);
|
114 |
+
}
|
115 |
+
100%{
|
116 |
+
opacity: 0;
|
117 |
+
text-shadow: 0px 0px 50px #fff;
|
118 |
+
transform: scale(0);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
@keyframes blurFadeIn{
|
122 |
+
0%{
|
123 |
+
opacity: 0;
|
124 |
+
text-shadow: 0px 0px 40px #fff;
|
125 |
+
transform: scale(1.3);
|
126 |
+
}
|
127 |
+
50%{
|
128 |
+
opacity: 0.5;
|
129 |
+
text-shadow: 0px 0px 10px #fff;
|
130 |
+
transform: scale(1.1);
|
131 |
+
}
|
132 |
+
100%{
|
133 |
+
opacity: 1;
|
134 |
+
text-shadow: 0px 0px 1px #fff;
|
135 |
+
transform: scale(1);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
@keyframes fadeInBack{
|
139 |
+
0%{
|
140 |
+
opacity: 0;
|
141 |
+
transform: scale(0);
|
142 |
+
}
|
143 |
+
50%{
|
144 |
+
opacity: 0.4;
|
145 |
+
transform: scale(2);
|
146 |
+
}
|
147 |
+
100%{
|
148 |
+
opacity: 0.2;
|
149 |
+
transform: scale(5);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
</style>
|
153 |
+
<!------ Include the above in your HEAD tag ---------->
|
154 |
+
<div class="container">
|
155 |
+
<div class="content">
|
156 |
+
<h2 class="frame-1"><?php esc_html_e('Thanks for choosing Techblissonline Platinum SEO for WordPress', 'platinum-seo-pack') ?></h2>
|
157 |
+
<h2 class="frame-2"><?php esc_html_e('Start this wizard to set up the essential options', 'platinum-seo-pack') ?> </h2>
|
158 |
+
<h2 class="frame-3">
|
159 |
+
<div class="psp-bs">
|
160 |
+
<div class="psp-start-btn">
|
161 |
+
<a href="<?php echo get_admin_url(get_current_blog_id())."admin.php?page=wizard&psptab=psp_importer_wizard" ?>" class="btn btn-lg btn-warning" role="button"> <?php esc_html_e('START PLATINUM SEO WIZARD', 'platinum-seo-pack') ?></a>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</h2>
|
165 |
+
</div>
|
166 |
+
</div>
|
psp_main.php
CHANGED
@@ -7,6 +7,7 @@ class PspMain {
|
|
7 |
|
8 |
protected $psp_settings_handle;
|
9 |
protected $psp_sitewide_settings = array();
|
|
|
10 |
protected $psp_helper;
|
11 |
protected $psp_social_handle;
|
12 |
protected $seo_title = "";
|
@@ -37,15 +38,18 @@ class PspMain {
|
|
37 |
$this->psp_redirect_instance = PspRedirections::get_instance();
|
38 |
|
39 |
$this->psp_sitemap_instance = PspSitemap::get_instance();
|
40 |
-
|
41 |
-
|
42 |
-
//get value for rss feeds indexing
|
43 |
$psp_settings = array();
|
44 |
$psp_settings = get_option("psp_sitewide_settings");
|
|
|
|
|
|
|
|
|
45 |
$noindex_feeds = isset($psp_settings['noindex_rss_feeds']) ? $psp_settings['noindex_rss_feeds'] : '';
|
46 |
//$noindex_feeds = $psp_settings['noindex_rss_feeds'];
|
47 |
|
48 |
$this->psp_sitewide_settings = $psp_settings;
|
|
|
49 |
|
50 |
//if ($psp_settings['rewrite_titles'] && $psp_settings['force_psp_titles']) {
|
51 |
//do nothing;
|
@@ -58,21 +62,24 @@ class PspMain {
|
|
58 |
if (!$psp_use_psp_template_script) {
|
59 |
add_action('wp_head', array(&$this, 'psp_head'), -99 );
|
60 |
}
|
61 |
-
*****/
|
62 |
-
$
|
63 |
-
$psp_force_psp_titles = isset($psp_settings['force_psp_titles']) ? $psp_settings['force_psp_titles'] : '';
|
64 |
-
if ($psp_rewrite_titles) {
|
65 |
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
} else {
|
69 |
-
add_action(
|
70 |
-
|
71 |
-
|
72 |
-
} else {
|
73 |
-
add_action('wp_head', array(&$this,'psp_tags_renderer'), 1);
|
74 |
-
}
|
75 |
-
|
76 |
|
77 |
if ($noindex_feeds) {
|
78 |
add_action('commentsrss2_head', array(&$this,'noindex_feed'));
|
@@ -205,12 +212,12 @@ class PspMain {
|
|
205 |
$callbacksforthetdaction = $wp_filter['template_redirect']->callbacks;
|
206 |
}
|
207 |
|
208 |
-
|
209 |
if (!empty($callbacksforthetdaction)) {
|
210 |
$template_redirect_priority = max(array_keys($callbacksforthetdaction)) + 10;
|
211 |
}
|
212 |
|
213 |
-
add_action( 'template_redirect', array( $this, 'psp_redirect' ), 1, 2); // do the redirects
|
214 |
//if($this->psp_redirect_instance) {
|
215 |
add_action( 'template_redirect', array($this->psp_redirect_instance, 'psp_do_log_404'), $template_redirect_priority, 2); // do the 404 logging
|
216 |
//}
|
@@ -240,14 +247,17 @@ class PspMain {
|
|
240 |
$psp_permalink_settings = get_option("psp_permalink_settings");
|
241 |
$psp_disable_wp_404_redirect_guessing = isset($psp_permalink_settings['disable_wp_404_guess']) ? $psp_permalink_settings['disable_wp_404_guess'] : '';
|
242 |
if($psp_disable_wp_404_redirect_guessing) {
|
243 |
-
|
244 |
-
remove_action( 'template_redirect', 'redirect_canonical' );
|
245 |
-
add_action( 'template_redirect', array( $this, 'psp_redirect_canonical' ), 10, 2);
|
246 |
}
|
247 |
|
248 |
add_action('admin_notices', array($this, 'platinum_seo_admin_notice__success'));
|
249 |
add_action('admin_init', array($this, 'platinum_seo_notice_dismissed'));
|
250 |
//v2.0.8
|
|
|
|
|
|
|
251 |
}
|
252 |
//v2.1.0
|
253 |
public function platinum_seo_notice_dismissed() {
|
@@ -263,14 +273,14 @@ class PspMain {
|
|
263 |
$user_id = get_current_user_id();
|
264 |
// Add the meta so that the notice is permanently dismissed.
|
265 |
//delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
|
266 |
-
update_user_meta( $user_id, 'psp_ignore_notice', "
|
267 |
};
|
268 |
};
|
269 |
}
|
270 |
|
271 |
public function platinum_seo_admin_notice__success() {
|
272 |
$user_id = get_current_user_id();
|
273 |
-
if ( "
|
274 |
global $pagenow;
|
275 |
$psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
|
276 |
if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
|
@@ -280,7 +290,7 @@ class PspMain {
|
|
280 |
'psp_ignore_notice' => '1',
|
281 |
'action' => 'psp_delete_adminnotice',
|
282 |
'nonce' => wp_create_nonce('psp_delete_adminnotice'),
|
283 |
-
] ) ) .'" 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.
|
284 |
</div>
|
285 |
<?php
|
286 |
}
|
@@ -369,10 +379,11 @@ class PspMain {
|
|
369 |
if ( isset( $title ) && isset( $href ) ) {
|
370 |
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '" />' . "\n";
|
371 |
}
|
372 |
-
}
|
373 |
|
374 |
-
public function psp_disable_404_redirect_guessing( $
|
375 |
-
return ( is_404() ) ? false : $url;
|
|
|
376 |
}
|
377 |
//v2.0.8
|
378 |
public static function get_instance() {
|
@@ -445,7 +456,7 @@ class PspMain {
|
|
445 |
function psp_plugins_loaded() {
|
446 |
|
447 |
global $wp_filter;
|
448 |
-
$callbacksforthefilter = array();
|
449 |
|
450 |
if (current_theme_supports('title-tag')) {
|
451 |
// do something special when title-tag is supported...
|
@@ -761,7 +772,8 @@ class PspMain {
|
|
761 |
}
|
762 |
$psp_redirect_to_url = esc_url_raw($psp_redirect_to_url);
|
763 |
//do wp redirect here
|
764 |
-
|
|
|
765 |
if (empty($psp_redirect_status_code)) $psp_redirect_status_code = "302";
|
766 |
wp_safe_redirect($psp_redirect_to_url,$psp_redirect_status_code);
|
767 |
exit();
|
@@ -1021,9 +1033,14 @@ class PspMain {
|
|
1021 |
|
1022 |
function psp_admin_bar_menu() {
|
1023 |
// If the current user can't write posts, this is all of no use, so let's not output an admin menu
|
|
|
1024 |
if ( ! current_user_can( 'edit_posts' ) ) {
|
1025 |
return;
|
1026 |
}
|
|
|
|
|
|
|
|
|
1027 |
|
1028 |
global $wp_admin_bar, $post;
|
1029 |
|
@@ -1539,8 +1556,28 @@ class PspMain {
|
|
1539 |
add_option("psp_breadcrumb_settings", $psp_breadcrumb_settings, "", "no");
|
1540 |
//}
|
1541 |
|
|
|
|
|
1542 |
}
|
1543 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1544 |
//register_deactivation_hook(__FILE__, 'psp_deactivate');
|
1545 |
public function psp_deactivate() {
|
1546 |
$psp_settings_instance = $this->psp_settings_handle;
|
7 |
|
8 |
protected $psp_settings_handle;
|
9 |
protected $psp_sitewide_settings = array();
|
10 |
+
protected $psp_permalink_settings = array();
|
11 |
protected $psp_helper;
|
12 |
protected $psp_social_handle;
|
13 |
protected $seo_title = "";
|
38 |
$this->psp_redirect_instance = PspRedirections::get_instance();
|
39 |
|
40 |
$this->psp_sitemap_instance = PspSitemap::get_instance();
|
41 |
+
|
|
|
|
|
42 |
$psp_settings = array();
|
43 |
$psp_settings = get_option("psp_sitewide_settings");
|
44 |
+
$psp_permalink_settings = array();
|
45 |
+
$psp_permalink_settings = get_option("psp_permalink_settings");
|
46 |
+
|
47 |
+
//get value for rss feeds indexing
|
48 |
$noindex_feeds = isset($psp_settings['noindex_rss_feeds']) ? $psp_settings['noindex_rss_feeds'] : '';
|
49 |
//$noindex_feeds = $psp_settings['noindex_rss_feeds'];
|
50 |
|
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;
|
62 |
if (!$psp_use_psp_template_script) {
|
63 |
add_action('wp_head', array(&$this, 'psp_head'), -99 );
|
64 |
}
|
65 |
+
*****/
|
66 |
+
$disable_psp = isset( $psp_settings['disable_psp'] ) && !empty ( $psp_settings['disable_psp'] ) ? $psp_settings['disable_psp'] : '';
|
|
|
|
|
67 |
|
68 |
+
if ( ! $disable_psp ) {
|
69 |
+
$psp_rewrite_titles = isset($psp_settings['rewrite_titles']) ? $psp_settings['rewrite_titles'] : '';
|
70 |
+
$psp_force_psp_titles = isset($psp_settings['force_psp_titles']) ? $psp_settings['force_psp_titles'] : '';
|
71 |
+
if ($psp_rewrite_titles) {
|
72 |
+
|
73 |
+
if ($psp_force_psp_titles) {
|
74 |
+
add_action('get_header', array(&$this, 'apply_forced_seo_title'), 999);
|
75 |
+
} else {
|
76 |
+
add_action( 'get_header', array(&$this, 'psp_plugins_loaded'), 999 );
|
77 |
+
//add_filter( 'wp_title', array(&$this,'psp_wp_title'), 99 );
|
78 |
+
}
|
79 |
} else {
|
80 |
+
add_action('wp_head', array(&$this,'psp_tags_renderer'), 1);
|
81 |
+
}
|
82 |
+
}
|
|
|
|
|
|
|
|
|
83 |
|
84 |
if ($noindex_feeds) {
|
85 |
add_action('commentsrss2_head', array(&$this,'noindex_feed'));
|
212 |
$callbacksforthetdaction = $wp_filter['template_redirect']->callbacks;
|
213 |
}
|
214 |
|
215 |
+
$template_redirect_priority = 999;
|
216 |
if (!empty($callbacksforthetdaction)) {
|
217 |
$template_redirect_priority = max(array_keys($callbacksforthetdaction)) + 10;
|
218 |
}
|
219 |
|
220 |
+
add_action( 'template_redirect', array( $this, 'psp_redirect' ), 1, 2); // do the redirects
|
221 |
//if($this->psp_redirect_instance) {
|
222 |
add_action( 'template_redirect', array($this->psp_redirect_instance, 'psp_do_log_404'), $template_redirect_priority, 2); // do the 404 logging
|
223 |
//}
|
247 |
$psp_permalink_settings = get_option("psp_permalink_settings");
|
248 |
$psp_disable_wp_404_redirect_guessing = isset($psp_permalink_settings['disable_wp_404_guess']) ? $psp_permalink_settings['disable_wp_404_guess'] : '';
|
249 |
if($psp_disable_wp_404_redirect_guessing) {
|
250 |
+
add_filter( 'do_redirect_guess_404_permalink', array($this, 'psp_disable_404_redirect_guessing' ) );
|
251 |
+
//remove_action( 'template_redirect', 'redirect_canonical' );
|
252 |
+
//add_action( 'template_redirect', array( $this, 'psp_redirect_canonical' ), 10, 2);
|
253 |
}
|
254 |
|
255 |
add_action('admin_notices', array($this, 'platinum_seo_admin_notice__success'));
|
256 |
add_action('admin_init', array($this, 'platinum_seo_notice_dismissed'));
|
257 |
//v2.0.8
|
258 |
+
|
259 |
+
//v2.2.1
|
260 |
+
add_action('admin_init', array($this, 'psp_redirect_to_wizard'));
|
261 |
}
|
262 |
//v2.1.0
|
263 |
public function platinum_seo_notice_dismissed() {
|
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_221" );
|
277 |
};
|
278 |
};
|
279 |
}
|
280 |
|
281 |
public function platinum_seo_admin_notice__success() {
|
282 |
$user_id = get_current_user_id();
|
283 |
+
if ( "v_221" === 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 |
'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.1'.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 |
}
|
379 |
if ( isset( $title ) && isset( $href ) ) {
|
380 |
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '" />' . "\n";
|
381 |
}
|
382 |
+
}
|
383 |
|
384 |
+
public function psp_disable_404_redirect_guessing( $guessing = true ) {
|
385 |
+
//return ( is_404() ) ? false : $url;
|
386 |
+
return false;
|
387 |
}
|
388 |
//v2.0.8
|
389 |
public static function get_instance() {
|
456 |
function psp_plugins_loaded() {
|
457 |
|
458 |
global $wp_filter;
|
459 |
+
$callbacksforthefilter = array();
|
460 |
|
461 |
if (current_theme_supports('title-tag')) {
|
462 |
// do something special when title-tag is supported...
|
772 |
}
|
773 |
$psp_redirect_to_url = esc_url_raw($psp_redirect_to_url);
|
774 |
//do wp redirect here
|
775 |
+
$enable_redirection = !empty( $this->psp_permalink_settings['redirection'] ) ? true : false;
|
776 |
+
if ($enable_redirection && !empty($psp_redirect_to_url)) {
|
777 |
if (empty($psp_redirect_status_code)) $psp_redirect_status_code = "302";
|
778 |
wp_safe_redirect($psp_redirect_to_url,$psp_redirect_status_code);
|
779 |
exit();
|
1033 |
|
1034 |
function psp_admin_bar_menu() {
|
1035 |
// If the current user can't write posts, this is all of no use, so let's not output an admin menu
|
1036 |
+
/***
|
1037 |
if ( ! current_user_can( 'edit_posts' ) ) {
|
1038 |
return;
|
1039 |
}
|
1040 |
+
***/
|
1041 |
+
if (! $this->psp_helper->user_has_access('adminbarmenu') ) {
|
1042 |
+
return;
|
1043 |
+
}
|
1044 |
|
1045 |
global $wp_admin_bar, $post;
|
1046 |
|
1556 |
add_option("psp_breadcrumb_settings", $psp_breadcrumb_settings, "", "no");
|
1557 |
//}
|
1558 |
|
1559 |
+
add_option('psp_do_activation_redirect', true);
|
1560 |
+
|
1561 |
}
|
1562 |
|
1563 |
+
public function psp_redirect_to_wizard() {
|
1564 |
+
if (! get_option('psp_do_activation_redirect', false)) {
|
1565 |
+
return;
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
delete_option('psp_do_activation_redirect');
|
1569 |
+
|
1570 |
+
// Bail if activating from network, or bulk
|
1571 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
1572 |
+
return;
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
$psp_redirect_to_url = get_admin_url(get_current_blog_id())."admin.php?page=wizard";
|
1576 |
+
wp_safe_redirect($psp_redirect_to_url,302);
|
1577 |
+
exit();
|
1578 |
+
|
1579 |
+
}
|
1580 |
+
|
1581 |
//register_deactivation_hook(__FILE__, 'psp_deactivate');
|
1582 |
public function psp_deactivate() {
|
1583 |
$psp_settings_instance = $this->psp_settings_handle;
|
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.
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 2.2.
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -72,6 +72,9 @@ Please read these **[FAQs](https://techblissonline.com/platinum-seo-pack-faq/)**
|
|
72 |
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
|
73 |
|
74 |
== Changelog ==
|
|
|
|
|
|
|
75 |
= 2.2.0 =
|
76 |
* 2020-09-06 - Fixed a bug that caused the Platinum SEO Meta Box not to render in Post type 'Post' and custom Post typeswhen the category name has a single quote or apostrophe.
|
77 |
|
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.1
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
72 |
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
|
73 |
|
74 |
== Changelog ==
|
75 |
+
= 2.2.1 =
|
76 |
+
* 2020-11-20 - Introduced a comprehensive Role Manager that can be used to control who (which role) can access which Platinum SEO Settings. Introduced a SetUp wizard to make it easy for users installing Platinum SEO WordPress Plugin to configure various settings. It also makes it easy for users migrating from other popular SEO plugin to platinum SEO, to setup the SEO configuration. Fixed a few bugs in sitemap settings. Made the 404 guessing workaround to be compatible with the latest changes in WordPress 5.5.0.
|
77 |
+
|
78 |
= 2.2.0 =
|
79 |
* 2020-09-06 - Fixed a bug that caused the Platinum SEO Meta Box not to render in Post type 'Post' and custom Post typeswhen the category name has a single quote or apostrophe.
|
80 |
|