update
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Lite: Category Protection
|
||||
*/
|
||||
?>
|
||||
|
||||
<h2 class="ppw-cat__title"> <?php echo esc_html__('PPWP Lite: Category Protection','password-protect-page');?></h2>
|
||||
<form method="post" id="ppwp_protect_category_form" class="ppw-cat__form">
|
||||
<input type="hidden" id="ppw_category_form_nonce" value="<?php echo esc_attr( wp_create_nonce(PPW_Constants::GENERAL_FORM_NONCE) ); ?>" />
|
||||
<div class="form__option-wrapper">
|
||||
<span class="form__option-switch-btn">
|
||||
<label class="pda_switch ppw-switch__wrapper" for="ppwp_is_protect_category">
|
||||
<input type="checkbox" id="ppwp_is_protect_category" <?php echo $is_protect ? 'checked' : '' ?> />
|
||||
<span class="pda-slider round ppw-switch--btn"></span>
|
||||
</label>
|
||||
</span>
|
||||
<span class="form__option-label">
|
||||
<?php echo esc_html__('Password Protect Categories', 'password-protect-page') ?>
|
||||
</span>
|
||||
</div>
|
||||
<p class="form__desc"><?php echo wp_kses_post( sprintf( '<a target="_blank" rel="noreferrer noopener" href="%1$s">%2$s</a> %3$s <a href="%4$s">%5$s</a>.', 'https://passwordprotectwp.com/docs/password-protect-wordpress-categories/?utm_source=user-website&utm_medium=category-protection&utm_campaign=ppwp-free', __( 'Protect all posts under protected categories', 'password-protect-page' ), __( 'with a single password. Customize the password form using', 'password-protect-page' ), admin_url( 'customize.php?autofocus[panel]=ppwp' ), __( 'WordPress Customizer', 'password-protect-page' ) ) ); ?></p>
|
||||
<p class="form__select-wrapper form__input-wrapper">
|
||||
<label class="form__label form__label-cats" for="ppwp-cat-select"><?php echo esc_html__('Select your private categories', 'password-protect-page') ?></label>
|
||||
<select class="form__select" id="ppwp_protected_categories_selected" multiple="multiple">
|
||||
<?php
|
||||
foreach ($categories as $category) {
|
||||
$selected = in_array($category->term_id, $protected_categories) ? 'selected' : '';
|
||||
echo '<option ' . esc_attr( $selected ) . ' value="' . esc_attr( $category->term_id ) . '">' . esc_html( $category->name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div id="ppwp_error_protected_categories_selected" style="display: none; color: red; position: absolute; font-size: 12px;">This field is required.</div>
|
||||
</p>
|
||||
<p class="form__input-wrapper">
|
||||
<label class="form__label form__label__pass" for="ppwp_categories_password"><?php echo esc_html__('Set a password', 'password-protect-page') ?></label>
|
||||
<input class="form__input" id="ppwp_categories_password" type="text" placeholder="Enter a password" value="<?php echo esc_html( $password ) ?>">
|
||||
<div id="ppwp_error_categories_password" style="display: none; color: red; position: absolute; font-size: 12px;">This field is required.</div>
|
||||
</p>
|
||||
<p class="form__btn-wrapper">
|
||||
<input type="submit" name="submit" id="ppwp-submit" class="button button-primary" value="Save Changes">
|
||||
</p>
|
||||
</form>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Password Protected Service
|
||||
*/
|
||||
$service = new PPW_Password_Services();
|
||||
$is_protected = $service->is_protected_content( $post_id );
|
||||
$icon_class = $is_protected ? 'dashicons-lock' : 'dashicons-unlock';
|
||||
$color_class = $is_protected ? 'ppw_protected_color' : 'ppw_unprotected_color';
|
||||
$status = $is_protected ? 'protected' : 'unprotected';
|
||||
$post = get_post( $post_id );
|
||||
?>
|
||||
|
||||
<div class="ppw-column">
|
||||
<span id="ppw-badge-protection_<?php echo esc_attr( $post_id ); ?>"
|
||||
class="ppw-badge-protection <?php echo esc_attr( $color_class ); ?>">
|
||||
<i class="dashicons <?php echo esc_attr( $icon_class ); ?>"></i> <?php echo esc_html( $status, 'password-protect-page' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-category.css
vendored
Normal file
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-category.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.ppw-cat__form{padding-bottom:0rem;margin-bottom:2rem;border-bottom:1px solid #bbb}.ppw-cat__form .ppw-switch__wrapper{margin:0 7px 0 0}.form__option-wrapper{display:flex;align-items:center}.form__option-wrapper .form__option-label{font-size:15px}.form__input-wrapper label{display:block;padding:2px 0}.form__input-wrapper input{width:95%}.form__input-wrapper{margin-bottom:2px !important}.form__btn-wrapper{margin-top:30px}.form__label__pass{margin-top:22px}
|
||||
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-category.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-category.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(p){if(t[p])return t[p].exports;var o=t[p]={i:p,l:!1,exports:{}};return e[p].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,p){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:p})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(p,o,function(t){return e[t]}.bind(null,o));return p},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}({8:function(e,t,r){"use strict";r.r(t);r(9);!function(e){e(function(){e("#ppwp_protected_categories_selected").select2({width:"95%"}),e("#ppwp_is_protect_category").change(function(){e(this).prop("checked")?(e(".form__input-wrapper").show(),e("#ppwp_categories_password").trigger("change")):(e(".form__input-wrapper").hide(),e("#ppwp_error_categories_password").hide(),e("#ppwp_error_protected_categories_selected").hide())}),e("#ppwp_is_protect_category").trigger("change"),e("#ppwp_protect_category_form").submit(function(t){t.preventDefault();var r=e("#ppwp_categories_password").val(),p=e("#ppwp_protected_categories_selected").val(),o=e("#ppwp_is_protect_category").prop("checked");o&&""===r?e(this).find("#ppwp_error_categories_password").show():e(this).find("#ppwp_error_categories_password").hide(),o&&0===p.length?e(this).find("#ppwp_error_protected_categories_selected").show():e(this).find("#ppwp_error_protected_categories_selected").hide();var c={ppwp_is_protect_category:e("#ppwp_is_protect_category").prop("checked"),ppwp_categories_password:e("#ppwp_categories_password").val(),ppwp_protected_categories_selected:e("#ppwp_protected_categories_selected").val()};c.ppwp_categories_password=c.ppwp_categories_password.trim(),(!o||""!==r&&0!==p.length)&&(e("#ppwp-submit").prop("disabled",!0),function(t,r){!function(t,r){e.ajax({url:ppw_category_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}({action:"ppw_free_update_category_settings",settings:t,security_check:e("#ppw_category_form_nonce").val()},r)}(c,function(t,r){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),setTimeout(function(){window.location.reload()},700)),r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite")),e("#ppwp-submit").prop("disabled",!1)}))})})}(jQuery)},9:function(e,t,r){}});
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-entire-site.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-entire-site.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var r={};function t(s){if(r[s])return r[s].exports;var p=r[s]={i:s,l:!1,exports:{}};return e[s].call(p.exports,p,p.exports,t),p.l=!0,p.exports}t.m=e,t.c=r,t.d=function(e,r,s){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var p in e)t.d(s,p,function(r){return e[r]}.bind(null,p));return s},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=2)}([function(e,r,t){"use strict";r.a=function(e){e("#ppw_subscribe_form").submit(function(r){r.preventDefault();const t=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)?(e("#ppw_subscribe_button").val("Saving..."),function(e,r,t){var s={action:"ppw_free_subscribe_request",settings:r,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,r,t){let s=!1;window.ppw_general_data?s=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(s=ppw_entire_site_data.ajax_url),s&&e.ajax({url:s,type:"POST",data:r,timeout:5e3,success:function(e){t(e,null)},error:function(e){t(null,e)}})}(e,s,t)}(e,{ppw_email:t},function(r,t){r?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):t&&(400===t.status?(e(".ppw_subscribe_error").text(t.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},,function(e,r,t){"use strict";t.r(r);var s=t(0);!function(e){e(function(){e(".ppwp_select2").select2({width:"100%"}),e("#ppwp_free_switch_exclude_page").change(function(){e(this).prop("checked")?e(".ppwp_free_wrap_select_exclude_page").show():e(".ppwp_free_wrap_select_exclude_page").hide()}),e("#ppwp_free_switch_exclude_page").trigger("change"),e("#ppwp_apply_password_for_entire_site").change(function(){e(this).prop("checked")?(e(".ppwp_logic_show_input_password").show(),e("#ppwp_password_for_entire_site").attr("required",!0),e("#ppwp_password_for_entire_site").trigger("change")):(e(".ppwp_logic_show_input_password").hide(),e("#submit").prop("disabled",!1),e("#ppwp_password_for_entire_site").attr("required",!1))}),e("#ppwp_apply_password_for_entire_site").trigger("change"),e("#ppwp_set_new_password_for_entire_site").change(function(){e(this).prop("checked")?(e("#ppwp_new_password_entire_site").show(),e("#ppwp_password_for_entire_site").attr("required",!0)):(e("#ppwp_new_password_entire_site").hide(),e("#ppwp_password_for_entire_site").val(""),e("#submit").prop("disabled",!1),e("#ppwp_password_for_entire_site").attr("required",!1))}),e("#ppwp_set_new_password_for_entire_site").trigger("change"),e("#ppwp_password_for_entire_site").change(function(){-1!==e(this).val().indexOf(" ")?(toastr.error("Please remove spaces in password!","Password Protect WordPress"),e("#submit").prop("disabled",!0)):e("#submit").prop("disabled",!1)}),e("#ppwp_password_for_entire_site").trigger("change"),Object(s.a)(e),e("#ppw_entire_site_form").submit(function(r){r.preventDefault(),function(r,t){!function(r,t){e("#submit").prop("disabled",!0),e.ajax({url:ppw_entire_site_data.ajax_url,type:"POST",data:r,success:function(e){t(e,null)},error:function(e){t(null,e)},timeout:5e3})}({action:"ppw_free_update_entire_site_settings",settings:r,security_check:e("#ppw_entire_site_form_nonce").val()},t)}({ppwp_apply_password_for_entire_site:e("#ppwp_apply_password_for_entire_site").prop("checked"),password_for_website:e("#ppwp_password_for_entire_site").val(),ppwp_set_new_password_for_entire_site:e("#ppwp_set_new_password_for_entire_site").prop("checked")},function(r,t){r&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),t&&(400===t.status?toastr.error(t.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite"),console.log("Data error",t),e("#submit").prop("disabled",!1))})})})}(jQuery)}]);
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-external-configuration.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-external-configuration.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var r={};function t(p){if(r[p])return r[p].exports;var a=r[p]={i:p,l:!1,exports:{}};return e[p].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=e,t.c=r,t.d=function(e,r,p){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:p})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var p=Object.create(null);if(t.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var a in e)t.d(p,a,function(r){return e[r]}.bind(null,a));return p},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=6)}({0:function(e,r,t){"use strict";r.a=function(e){e("#ppw_subscribe_form").submit(function(r){r.preventDefault();const t=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)?(e("#ppw_subscribe_button").val("Saving..."),function(e,r,t){var p={action:"ppw_free_subscribe_request",settings:r,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,r,t){let p=!1;window.ppw_general_data?p=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(p=ppw_entire_site_data.ajax_url),p&&e.ajax({url:p,type:"POST",data:r,timeout:5e3,success:function(e){t(e,null)},error:function(e){t(null,e)}})}(e,p,t)}(e,{ppw_email:t},function(r,t){r?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):t&&(400===t.status?(e(".ppw_subscribe_error").text(t.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},6:function(e,r,t){"use strict";t.r(r);var p=t(0);!function(e){function r(r,t){!function(r,t){e.ajax({url:ppw_external_data.ajax_url,type:"POST",data:r,timeout:5e3,success:function(e){t(e,null)},error:function(e){t(null,e)}})}({action:"ppw_free_update_external_settings",settings:r,security_check:e("#ppw_general_form_nonce").val()},t)}e(function(){Object(p.a)(e),e("#wpp_external_v2_form").submit(function(t){t.preventDefault();var p=e("#wpp_recaptcha_v2_checkbox_api_key").val().trim(),a=e("#wpp_recaptcha_v2_checkbox_api_secret").val().trim();if(a?e(this).find("#ppwp-error-require-v2-secret").hide():(e(this).find("#ppwp-error-require-v2-secret").show(),e(this).find("#wpp_recaptcha_v2_checkbox_api_secret").focus()),p?e(this).find("#ppwp-error-require-v2-key").hide():(e(this).find("#ppwp-error-require-v2-key").show(),e(this).find("#wpp_recaptcha_v2_checkbox_api_key").focus()),""!==p&&""!==a){r({wpp_recaptcha_v2_checkbox_api_key:e("#wpp_recaptcha_v2_checkbox_api_key").val(),wpp_recaptcha_v2_checkbox_api_secret:e("#wpp_recaptcha_v2_checkbox_api_secret").val()},function(r,t){r&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),t&&(400===t.status?toastr.error(t.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again!","PPWP Lite"),e("#v2_submit_btn").prop("disabled",!1))})}})}),e(function(){Object(p.a)(e),e("#wpp_external_v3_form").submit(function(t){t.preventDefault();var p=e("#wpp_recaptcha_api_key").val().trim(),a=e("#wpp_recaptcha_api_secret").val().trim();if(a?e(this).find("#ppwp-error-require-v3-secret").hide():(!1,e(this).find("#ppwp-error-require-v3-secret").show(),e(this).find("#wpp_recaptcha_api_secret").focus()),p?e(this).find("#ppwp-error-require-v3-key").hide():(!1,e(this).find("#ppwp-error-require-v3-key").show(),e(this).find("#wpp_recaptcha_api_key").focus()),""!==p&&""!==a){r({wpp_recaptcha_api_key:e("#wpp_recaptcha_api_key").val(),wpp_recaptcha_api_secret:e("#wpp_recaptcha_api_secret").val(),wpp_recaptcha_score:e("#wpp_recaptcha_score").val()},function(r,t){r&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),t&&(400===t.status?toastr.error(t.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again!","PPWP Lite"),e("#v3_submit_btn").prop("disabled",!1))})}})})}(jQuery)}});
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-external.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-external.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}({0:function(e,t,r){"use strict";t.a=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var n={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let n=!1;window.ppw_general_data?n=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(n=ppw_entire_site_data.ajax_url),n&&e.ajax({url:n,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,n,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},5:function(e,t,r){"use strict";r.r(t);var n=r(0);!function(e){e(function(){e(".ppw_select_types").select2({width:"100%"}),e("#wpp_use_recaptcha").change(function(){e(this).prop("checked")?(e("#wpp_recaptcha_options").show(),e("#wpp_recaptcha_password_types").attr("required",!0)):(e("#wpp_recaptcha_options").hide(),e("#wpp_recaptcha_password_types").attr("required",!1))}),Object(n.a)(e),e("#wpp_external_form").submit(function(t){t.preventDefault(),function(t,r){var n={action:"ppw_free_update_external_settings",settings:t,security_check:e("#ppw_general_form_nonce").val()};e("#submit").prop("disabled",!0),function(t,r){e.ajax({url:ppw_external_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(n,r)}(function(){var t=e("#wpp_use_recaptcha").prop("checked"),r={wpp_use_recaptcha:t};t&&(r.wpp_recaptcha_type=e("#wpp_recaptcha_type").val(),r.wpp_recaptcha_password_types=e("#wpp_recaptcha_password_types").val());return r}(),function(t,r){if(t)return toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),void location.reload(!0);r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite"),e("#submit").prop("disabled",!1))})})})}(jQuery)}});
|
||||
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-form-entire-site.css
vendored
Normal file
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-form-entire-site.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
body{background:#f1f1f1;min-width:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif}.pda-form-login h1{margin:0}.pda-form-login{width:320px;padding:8% 0 0;margin:auto}.pda-form-login a.ppw-swp-logo{width:85px;height:85px;margin:0 auto 25px;text-indent:-9999px;display:block}.pda-form-login form{padding:26px 24px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.13);box-sizing:border-box}.pda-form-login .button-login{padding:0.5rem;background:#0085ba;border-color:#0085ba;color:#fff;font-size:13px;cursor:pointer;border-style:solid;border-radius:3px;font-family:inherit;padding:0.5rem}.pda-form-login .input_wp_protect_password{background:#fbfbfb;width:100%;padding:9px;margin:10px 0;border:1px solid #ddd;background-color:#fff}.ppw-entire-site-password-error{color:#dc3232;font-size:13px;margin-bottom:1rem}
|
||||
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-form-entire-site.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-form-entire-site.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}({12:function(e,t,r){"use strict";r.r(t);r(13)},13:function(e,t,r){}});
|
||||
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general-wp-5-3.css
vendored
Normal file
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general-wp-5-3.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.ppw_main_container input[type=text],.ppw_main_container input[type=password]{height:35px}.ppw_main_container #pppw-copy-shortcode{height:34px}.ppw_main_container select{min-height:30px;margin-bottom:5px}.ppw_main_container .recaptcha-btn{margin-top:15px}.ppw_main_container .ppwp-title{margin-top:20px}.ppw_main_container .ppwp-recaptcha-input input{margin-bottom:2px}.ppw_main_container .ppw-recaptcha-score .ppw_main_container{margin-top:5px;min-height:35px !important;margin-bottom:7px !important}.ppw_main_container #wpp_external_v3_form .ppwp_settings_table{margin-bottom:15px}.ppw_main_container #recaptcha-score-container{margin-bottom:5px}.ppw_main_container .v3_submit_btn{margin-top:5px}
|
||||
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general-wp-5-3.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general-wp-5-3.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}({14:function(e,t,r){"use strict";r.r(t);r(15)},15:function(e,t,r){}});
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-general.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(s){if(t[s])return t[s].exports;var p=t[s]={i:s,l:!1,exports:{}};return e[s].call(p.exports,p,p.exports,r),p.l=!0,p.exports}r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var p in e)r.d(s,p,function(t){return e[t]}.bind(null,p));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";t.a=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var s={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let s=!1;window.ppw_general_data?s=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(s=ppw_entire_site_data.ajax_url),s&&e.ajax({url:s,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,s,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},,,function(e,t,r){"use strict";r.r(t);var s=r(0);!function(e){e(function(){e(".ppwp_select2").select2({width:"100%"}),e("#wpp_free_whitelist_roles").change(function(){"custom_roles"===e(this).val()?e("#wpp_free_roles_access").show():e("#wpp_free_roles_access").hide()}),e("#wpp_free_whitelist_roles").trigger("change"),e("#ppwp_free_apply_password_for_pages_posts").change(function(){e(this).prop("checked")?e(".ppwp-free-pages-posts-set-password").show():e(".ppwp-free-pages-posts-set-password").hide()}),e("#ppwp_free_apply_password_for_pages_posts").trigger("change"),e("#wpp_password_cookie_units").change(function(){!function(t){switch(t){case"days":e("#wpp_password_cookie_times").attr({max:365});break;case"hours":e("#wpp_password_cookie_times").attr({max:8760});break;case"minutes":e("#wpp_password_cookie_times").attr({max:525600});break;case"seconds":e("#wpp_password_cookie_times").attr({max:31536e3})}}(e(this).val())}),e("#ppw_select_custom_post_type_edit").change(function(){e(".ppw_hide_protect_content").hide();const t=e(this).val();if("page_post"===t){const t=["post","page"];t.forEach(function(t){!function(t){e(".ppw_wrap_"+t).show(),e("#ppw_hide_protected_"+t).change(function(){this.checked?function(t,r){e(t).show(),e(r).prop("required",!0)}("#ppw_wrap_hide_selected_"+t,"#ppw_hide_selected_"+t):function(t,r){e(t).hide(),e(r).prop("required",!1)}("#ppw_wrap_hide_selected_"+t,"#ppw_hide_selected_"+t)})}(t)})}}),e("#ppw_select_custom_post_type_edit").trigger("change"),Object(s.a)(e),e("#wp_protect_password_general_form").submit(function(t){t.preventDefault(),function(t,r){var s={action:"ppw_free_update_general_settings",settings:t,security_check:e("#ppw_general_form_nonce").val()};e("#submit").prop("disabled",!0),function(t,r){e.ajax({url:ppw_general_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(s,r)}(function(){let t={wpp_password_cookie_expired:e("#wpp_password_cookie_times").val()+" "+e("#wpp_password_cookie_units").val(),wpp_remove_data:e("#wpp_remove_data").prop("checked")};return["post","page"].map(function(t){return{["ppw_hide_protected_"+t]:e("#ppw_hide_protected_"+t).prop("checked"),["ppw_hide_selected_"+t]:e("#ppw_hide_selected_"+t).val()}}).forEach(function(e){Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}(),function(t,r){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite"),console.log("Data error",r),e("#submit").prop("disabled",!1))})})})}(jQuery)}]);
|
||||
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-meta-box.css
vendored
Normal file
2
wp-content/plugins/password-protect-page/includes/views/dist/ppw-meta-box.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.pda-pwd-tools{margin-bottom:0.5rem}.pda-pwd-tools input[type=radio].disabled,.pda-pwd-tools input[type=radio].disabled:checked:before,.pda-pwd-tools input[type=radio]:disabled,.pda-pwd-tools input[type=radio]:disabled:checked:before,.pda-pwd-tools input[type=checkbox].disabled,.pda-pwd-tools input[type=checkbox].disabled:checked:before,.pda-pwd-tools input[type=checkbox]:disabled,.pda-pwd-tools input[type=checkbox]:disabled:checked:before{opacity:1;cursor:inherit}.pda-pwd-tbl-actions{cursor:pointer}textarea[name="wpp_multiple_password"]{width:94%}#all_roles_select{margin-top:0;margin-bottom:5px}#all_roles_select span{border-radius:6px 0;padding:0rem 0.2rem;background:#FFFF00;cursor:pointer;transition:0.4s;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%;display:inline-block}div#passwords-roles-map label{display:block}.pda-selected-role-select2,input.post-protection-password,textarea[name="wpp_multiple_password"]{width:100%}.ppwp_set_password_type{width:70%}#ppwp_set_password_metabox .ppwp_apply_password{display:block;margin-bottom:5px}#ppwp_set_password_metabox .ppwp_show_hide_password_roles{margin-top:5px}#ppwp_set_password_metabox .ppwp_input_set_type_password{margin-top:5px}#ppwp_set_password_metabox .ppwp_default_hide_checkbox_roles{display:none}.ppwp-button-hide{float:right;padding:0;cursor:pointer;text-decoration:underline}.ppwp-button-submit{color:#555;border-color:#ccc;background:#f7f7f7;box-shadow:0 1px 0 #ccc;vertical-align:top;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-sizing:border-box}.ppwp-button-submit:hover{background:#fafafa;border-color:#999;color:#23282d}#passwords-roles-map .ppwp-wrap-submit-hide{margin-top:13px}.ppwp_multiple_password{width:100%}.ppwp_wrap_role_password{margin-top:5px}.pda-selected-role-select2{box-sizing:border-box}.ppwp-button-submit[disabled]{color:#a0a5aa;border-color:#ddd;background:#f7f7f7;box-shadow:none;text-shadow:0 1px 0 #fff;cursor:default}
|
||||
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-meta-box.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-meta-box.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var s={};function t(o){if(s[o])return s[o].exports;var r=s[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=s,t.d=function(e,s,o){t.o(e,s)||Object.defineProperty(e,s,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,s){if(1&s&&(e=t(e)),8&s)return e;if(4&s&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&s&&"string"!=typeof e)for(var r in e)t.d(o,r,function(s){return e[s]}.bind(null,r));return o},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,s){return Object.prototype.hasOwnProperty.call(e,s)},t.p="",t(t.s=10)}({10:function(e,s,t){"use strict";t.r(s);t(11);!function(e,s){function t(e){return-1===e.indexOf(" ")}function o(e){s(e).focus(function(){s("#save_password").prop("disabled",!1)})}s(function(){!function(){const e=s(".pda-selected-role-select2").val();if(e){const t=""===s("#post-protection-password-"+e).text()?"":s("#post-protection-password-"+e).text();s("#post-protection-password").val(t)}}(),function(){s("#post-protection-password").change(function(){-1!==s(this).val().indexOf(" ")?(toastr.error(save_password_data.error_message.space_password,"Password Protect WordPress"),s("#save_password").prop("disabled",!0)):s("#save_password").prop("disabled",!1)}),o("#post-protection-password"),s(".ppwp_multiple_password").change(function(){const e=s(this).val().split("\n").filter(e=>e.replace(/\s/g,"").length);return new Set(e).size!==e.length?(toastr.error(save_password_data.error_message.duplicate_password,"Password Protect WordPress"),void s("#save_password").prop("disabled",!0)):(s("#save_password").prop("disabled",!1),e.every(t)?void s("#save_password").prop("disabled",!1):(toastr.error(save_password_data.error_message.space_password,"Password Protect WordPress"),void s("#save_password").prop("disabled",!0)))}),o(".ppwp_multiple_password");let e={};s(".pda-selected-role-select2").on("focus",function(){let t=this.value;e[t]=s("#post-protection-password").val(),s("#"+t).val(s("#post-protection-password").val())}).change(function(){let t,o=s(".pda-selected-role-select2").val();t=void 0!==e[o]?e[o]:""===s("#post-protection-password-"+o).text()?"":s("#post-protection-password-"+o).text(),"global"===o?(s("#post-protection-password").hide(),s("#ppwp_multiple_password").show()):(s("#post-protection-password").show(),s("#ppwp_multiple_password").hide()),s("#post-protection-password").val(t),"global"===s("#is_role_selected").val()?s("#label-password-post").text("Passwords"):s("#label-password-post").text("Password")}),s(".pda-selected-role-select2").trigger("change"),s(".edit-post-protection").click(function(){s("#post-protection").show(),s(this).hide()}),s(".button-cancel").click(function(){s("#post-protection").hide(),s(".edit-post-protection").show()})}(),s("#save_password").click(function(e){e.preventDefault();const o=s(".ppwp_multiple_password").val().split("\n").filter(e=>e.replace(/\s/g,"").length),r=s(".post-protection-password").val(),a=s("#is_role_selected").val();(function(e){if("global"!==s(".pda-selected-role-select2").val())return!1;if(!e.every(t))return toastr.error(save_password_data.error_message.space_password,"Password Protect WordPress"),s("#save_password").prop("disabled",!0),!0;if(new Set(e).size!==e.length)return toastr.error(save_password_data.error_message.duplicate_password,"Password Protect WordPress"),s("#save_password").prop("disabled",!0),!0})(o)||function(e,t){const o={action:"ppw_free_set_password",settings:e,security_check:s("#ppw_meta_box_nonce").val()};s("#save_password").text("Submitting"),s("#save_password").prop("disabled",!0),s.ajax({url:save_password_data.ajax_url,type:"POST",data:o,success:function(e){t(e,null)},error:function(e){t(null,e)},timeout:5e3})}({save_password:r,is_role_selected:a,id_page_post:s("#id_page_post").val(),ppwp_multiple_password:o.length<=0?"":o},function(e,t){s("#save_password").text("Submit"),s("#save_password").prop("disabled",!1);e&&(!function(e){const t=Object.keys(e).filter(function(s){return""!==e[s]}),o=t.map(function(e){return"<span>"+e+"</span>"}).join(" "),r=t.length>1?t.length+" roles":t.length+" role";s("#all_roles_select").html(o),s("#number_roles").text(r)}(e),"global"===a?s("#ppwp_multiple_password").val(o.join("\n")):s("#post-protection-password").val(r),toastr.success("Great! You’ve updated the password successfully.","PPWP Lite")),t&&(400===t.status?toastr.error(t.responseJSON.message,"PPWP Lite"):toastr.error("Opps! Something went wrong. Please try again.","PPWP Lite"),console.log("Data error",t))})})})}(window,jQuery)},11:function(e,s,t){}});
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-misc.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-misc.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(o,s,function(t){return e[t]}.bind(null,s));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";t.a=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var o={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let o=!1;window.ppw_general_data?o=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(o=ppw_entire_site_data.ajax_url),o&&e.ajax({url:o,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,o,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},,,,function(e,t,r){"use strict";r.r(t);var o=r(0);!function(e){var t="PPWP Lite";e(function(){e(".ppwp_select2").select2({width:"100%"}),Object(o.a)(e),e("#wpp_misc_common_form").submit(function(r){r.preventDefault(),function(t,r){var o={action:"ppw_free_update_misc_settings",settings:t,security_check:e("#ppw_misc_form_nonce").val()};e("#submit").prop("disabled",!0),function(t,r){e.ajax({url:ppw_misc_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(o,r)}(function(){let t={wpp_protect_excerpt:e("#wpp_protect_excerpt").prop("checked"),wpp_use_custom_form_action:!0,wpp_no_reload_page:e("#wpp_no_reload_page").prop("checked")};window.ppwMapAdvancedData&&"function"==typeof window.ppwMapAdvancedData&&(t=window.ppwMapAdvancedData(t));return t}(),function(r,o){r&&(toastr.success("Great! Your settings have been updated successfully.",t),location.reload(!0)),o&&(400===o.status?toastr.error(o.responseJSON.message,t):toastr.error("Oops! Something went wrong. Please try again.",t),console.log("Data error",o),e("#submit").prop("disabled",!1))})}),e("#ppw-restore-passwords").click(function(r){r.preventDefault(),function(r){r.prop("disabled",!0);var o={action:"ppw_free_restore_wp_passwords",security_check:e("#ppw_misc_form_nonce").val()};e.ajax({url:ppw_misc_data.ajax_url,type:"POST",data:o,timeout:5e3,success:function(e){console.log(e),toastr.success(e.message,t),r.prop("disabled",!1),location.reload()},error:function(e){400===e.status?toastr.error(e.responseJSON.message,t):toastr.error("Failed to start restoring the backup passwords.",t),r.prop("disabled",!1)}})}(e(this))})})}(jQuery)}]);
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-shortcodes.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-shortcodes.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}({0:function(e,t,r){"use strict";t.a=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var o={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let o=!1;window.ppw_general_data?o=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(o=ppw_entire_site_data.ajax_url),o&&e.ajax({url:o,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,o,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},7:function(e,t,r){"use strict";r.r(t);var o=r(0);!function(e){e(function(){e(".ppwp_select2").select2({width:"100%"}),Object(o.a)(e),e("#wpp_shortcode_form").submit(function(t){t.preventDefault(),function(t,r){var o={action:"ppw_free_update_shortcode_settings",settings:t,security_check:ppw_shortcode_data.nonce};e("#submit").prop("disabled",!0),function(t,r){e.ajax({url:ppw_shortcode_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(o,r)}({wpp_use_shortcode_page_builder:e("#wpp_use_shortcode_page_builder").prop("checked")},function(t,r){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite"),console.log("Data error",r),e("#submit").prop("disabled",!1))})})})}(jQuery)}});
|
||||
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-troubleshooting.js
vendored
Normal file
1
wp-content/plugins/password-protect-page/includes/views/dist/ppw-troubleshooting.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){!function(e){"use strict";e(function(){e(".ppw-collapse-title").click(function(){e(this).next().slideToggle()})})}(jQuery)}]);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Countdown
|
||||
*/
|
||||
$text_above = get_theme_mod('ppwp_sitewide_above_countdown');
|
||||
$text_below = get_theme_mod('ppwp_sitewide_below_countdown');
|
||||
$start_date = get_theme_mod('ppwp_sitewide_start_time');
|
||||
$end_date = get_theme_mod('ppwp_sitewide_end_time');
|
||||
$is_date_countdown = get_theme_mod('ppwp_sitewide_is_show_day');
|
||||
$time_unit = get_theme_mod( 'ppwp_sitewide_time_unit_countdown', 'default');
|
||||
$day_of_countdown = strip_tags(get_theme_mod( 'ppwp_countdown_day_text', 'Days' ));
|
||||
$hour_of_countdown = strip_tags(get_theme_mod( 'ppwp_countdown_hour_text', 'Hours' ));
|
||||
$minute_of_countdown = strip_tags(get_theme_mod( 'ppwp_countdown_minute_text', 'Mimutes' ));
|
||||
$second_of_countdown = strip_tags(get_theme_mod( 'ppwp_countdown_second_text', 'Seconds' ));
|
||||
?>
|
||||
<div class="ppwp-countdown-container">
|
||||
<div id="ppwp_desc_above_countdown"><?php echo wp_kses_post( $text_above ); ?></div>
|
||||
<div id="ppwp_sitewide_countdown" class="ppwp-sitewide-countdown"></div>
|
||||
<div id="ppwp_desc_below_countdown"><?php echo wp_kses_post( $text_below ); ?></div>
|
||||
</div>
|
||||
<script>
|
||||
const getCountdown = () => {
|
||||
const datetime = new Date().toString();
|
||||
const utcTime = (function() {
|
||||
let utc = '';
|
||||
let operator = '';
|
||||
if (datetime.indexOf('+') >= 0) {
|
||||
utc = datetime.split('+');
|
||||
operator = '+';
|
||||
} else {
|
||||
utc = datetime.split('-');
|
||||
operator = '-';
|
||||
}
|
||||
const utcNumber = utc[1].split(' ')[0];
|
||||
const hour = Math.floor(parseInt(utcNumber)/100);
|
||||
const min = (parseInt(utcNumber)%(hour*100))/60*100;
|
||||
return parseFloat(hour + '.' + min) - parseFloat("<?php echo get_option('gmt_offset'); ?>");
|
||||
})();
|
||||
const time_unit = "<?php echo esc_attr( $time_unit ); ?>"
|
||||
const end_date = "<?php echo esc_attr( $end_date ); ?>";
|
||||
const countDownDate = new Date(end_date).getTime();
|
||||
const start_date = "<?php echo esc_attr( $start_date ); ?>";
|
||||
const countDownDateStart = new Date(start_date).getTime();
|
||||
var getNow = new Date().getTime() - utcTime*3600*1000;
|
||||
const isShowCountdown = "<?php echo esc_attr( $is_show_countdown ); ?>";
|
||||
const isShowDateCountdown = "<?php echo esc_attr( $is_date_countdown ); ?>";
|
||||
let checkvalue = false;
|
||||
if (getNow < countDownDateStart) {
|
||||
const x = setInterval(function() {
|
||||
if( getNow < countDownDateStart ) {
|
||||
getNow = new Date().getTime() - utcTime*3600*1000;
|
||||
} else {
|
||||
checkvalue = true;
|
||||
if ( end_date ) {
|
||||
getDay();
|
||||
}
|
||||
clearInterval(x);
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
if ( end_date ) {
|
||||
getDay();
|
||||
}
|
||||
}
|
||||
|
||||
function getDay() {
|
||||
const x = setInterval(function() {
|
||||
const now = new Date().getTime() - utcTime*3600*1000;
|
||||
const distance = countDownDate - now;
|
||||
|
||||
const { hours, days, minutes, seconds } = (function(distance){
|
||||
const hours = Math.floor(distance % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
|
||||
const days = Math.floor(distance / (1000 * 60 * 60 *24));
|
||||
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
||||
|
||||
return { hours, days, minutes, seconds };
|
||||
})(distance);
|
||||
|
||||
if (isShowCountdown || isShowCountdown === '') {
|
||||
if (distance > 0) {
|
||||
if(days > 0) {
|
||||
document.getElementById("ppwp_sitewide_countdown").innerHTML = '<div class="ppwp_countdown_timer_day"><div class="ppwp_countdown_time">' + days + "</div><div class='ppwp_countdown_timer_unit'> <?php echo esc_attr( $day_of_countdown ); ?></div>" + '</div><div class="ppwp_coundown_colon_spacing">:</div><div class="ppwp_countdown_timer_hour"><div class="ppwp_countdown_time">' + hours + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $hour_of_countdown ); ?></div>"+ '</div><div class="ppwp_coundown_colon_spacing">:</div><div class="ppwp_countdown_timer_minute"><div class="ppwp_countdown_time">' + minutes + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $minute_of_countdown ); ?></div>"+ '</div><div class="ppwp_coundown_colon_spacing">:</div><div class="ppwp_countdown_timer_second"><div class="ppwp_countdown_time">' + seconds + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $second_of_countdown ); ?></div>" + '</div>';
|
||||
} else {
|
||||
const hours = Math.floor(distance / (1000 * 60 * 60));
|
||||
document.getElementById("ppwp_sitewide_countdown").innerHTML = '<div class="ppwp_countdown_timer_hour"><div class="ppwp_countdown_time">' + hours + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $hour_of_countdown ); ?></div>"+ '</div><div class="ppwp_coundown_colon_spacing">:</div><div class="ppwp_countdown_timer_minute"><div class="ppwp_countdown_time">' + minutes + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $minute_of_countdown ); ?></div>"+ '</div><div class="ppwp_coundown_colon_spacing">:</div><div class="ppwp_countdown_timer_second"><div class="ppwp_countdown_time">' + seconds + " </div><div class='ppwp_countdown_timer_unit'><?php echo esc_attr( $second_of_countdown ); ?></div>" + '</div>';
|
||||
}
|
||||
document.getElementById('ppwp_desc_above_countdown').style.display = 'block';
|
||||
document.getElementById('ppwp_desc_below_countdown').style.display = 'block';
|
||||
} else {
|
||||
clearInterval(x);
|
||||
document.getElementById('ppwp_sitewide_countdown').style.display = 'none';
|
||||
document.getElementById('ppwp_desc_above_countdown').style.display = 'none';
|
||||
document.getElementById('ppwp_desc_below_countdown').style.display = 'none';
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
getCountdown();
|
||||
</script>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Protected Entire Site
|
||||
*/
|
||||
?>
|
||||
<form class="ppw_main_container" id="ppw_entire_site_form">
|
||||
<input type="hidden"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::ENTIRE_SITE_FORM_NONCE ) ); ?>"
|
||||
id="ppw_entire_site_form_nonce"/>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<?php
|
||||
include PPW_DIR_PATH . 'includes/views/entire-site/view-ppw-set-password.php';
|
||||
include PPW_DIR_PATH . 'includes/views/entire-site/view-ppw-exclude-page.php';
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
submit_button();
|
||||
?>
|
||||
</form>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Exclude Protected page
|
||||
*/
|
||||
|
||||
$all_page_post = ppw_free_get_all_page_post();
|
||||
?>
|
||||
<tr class="ppwp_free_version ppwp_logic_show_input_password <?php echo esc_attr( $is_display ); ?>">
|
||||
<td></td>
|
||||
<td class="ppwp_set_height_for_password_entire_site">
|
||||
<div class="ppwp_wrap_new_password">
|
||||
<span class="feature-input"></span>
|
||||
<span class="ppwp-set-new-password-text">
|
||||
Exclude certain pages, posts and custom post types from site-wide protection. Available in Pro version.
|
||||
</span>
|
||||
</div>
|
||||
<div class="ppwp_free_wrap_select_exclude_page ppwp-hidden-password">
|
||||
<select multiple="multiple" class="ppwp_select2">
|
||||
<option value="ppwp_home_page">Home Page</option>
|
||||
<?php foreach ( $all_page_post as $page ) { ?>
|
||||
<option><?php echo esc_html( $page->post_title ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Form Password
|
||||
*/
|
||||
|
||||
$page_title = ppw_get_page_title();
|
||||
$password_label = _x( 'Password:', PPW_Constants::CONTEXT_SITEWIDE_PASSWORD_FORM, 'password-protect-page' );
|
||||
$password_placehoder = wp_kses_post( get_theme_mod( 'ppwp_pro_form_instructions_placeholder' ) );
|
||||
$btn_label = get_theme_mod( 'ppwp_pro_form_button_label', PPW_Constants::DEFAULT_SHORTCODE_BUTTON );
|
||||
$disable_logo = get_theme_mod( 'ppwp_pro_logo_disable', 0 ) ? 'none' : 'block';
|
||||
$form_transparency = get_theme_mod( 'ppwp_pro_form_enable_transparency' ) ? 'style="background: none!important; box-shadow: initial;"' : '';
|
||||
$is_wrong_password = isset( $_GET['action'] ) && $_GET['action'] === 'ppw_postpass' && isset( $_POST['input_wp_protect_password'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended -- We no need to handle nonce verification for render UI.
|
||||
$internal_css = '<link rel="stylesheet" href="' . PPW_VIEW_URL . 'dist/ppw-form-entire-site.css" type="text/css">' . PHP_EOL;
|
||||
$form_action = apply_filters( 'ppw_sitewide_form_action', '?action=ppw_postpass' );
|
||||
$err_msg = apply_filters( 'ppw_sitewide_error_message', esc_html__( 'Please enter the correct password!', 'password-protect-page' ) );
|
||||
$start_date = get_theme_mod( 'ppwp_sitewide_start_time' );
|
||||
$end_date = get_theme_mod( 'ppwp_sitewide_end_time' );
|
||||
$is_show_form = $end_date ? true : false;
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="viewport" content="width=device-width"/>
|
||||
<link rel="icon" href="<?php echo esc_attr( get_site_icon_url() ); ?>"/>
|
||||
<?php echo apply_filters( 'ppw_sitewide_external_css', $internal_css ); ?>
|
||||
<title><?php echo esc_attr( $page_title ); ?></title>
|
||||
<?php do_action( PPW_Constants::HOOK_CUSTOM_HEADER_FORM_ENTIRE_SITE ); ?>
|
||||
<style>
|
||||
<?php
|
||||
do_action( 'ppw_sitewide_custom_internal_css' );
|
||||
do_action( PPW_Constants::HOOK_CUSTOM_STYLE_FORM_ENTIRE_SITE );
|
||||
do_action( 'ppwp_sitewide_hide_password_form' );
|
||||
do_action( 'ppwp_countdown_timer_styles' );
|
||||
?>
|
||||
</style>
|
||||
<?php wp_custom_css_cb(); ?>
|
||||
</head>
|
||||
<body class="ppwp-sitewide-protection">
|
||||
<div class="pda-form-login ppw-swp-form-container">
|
||||
<h1>
|
||||
<a style="display: <?php echo esc_attr( $disable_logo ); ?>" title="<?php echo esc_attr__( 'This site is password protected by PPWP plugin', 'password-protect-page') ?>" class="ppw-swp-logo">Password Protect WordPress plugin</a>
|
||||
</h1>
|
||||
<?php
|
||||
do_action( 'ppw_sitewide_above_password_form_container' );
|
||||
?>
|
||||
<form <?php echo wp_kses_post( $form_transparency ); ?> class="ppw-swp-form" action="<?php echo esc_attr( $form_action ); ?>" method="post">
|
||||
<?php do_action( 'ppw_sitewide_above_password_form' ); ?>
|
||||
<label for="input_wp_protect_password"><?php echo esc_html( $password_label ); ?></label>
|
||||
<input class="input_wp_protect_password" type="password" id="input_wp_protect_password"
|
||||
name="input_wp_protect_password" placeholder="<?php echo esc_attr( $password_placehoder ); ?>"/>
|
||||
<?php
|
||||
if ( $is_wrong_password ) {
|
||||
?>
|
||||
<div id="ppw_entire_site_wrong_password" class="ppw-entire-site-password-error">
|
||||
<?php echo wp_kses_post( $err_msg ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
do_action( 'ppw_sitewide_above_submit_button' );
|
||||
?>
|
||||
<input type="submit" class="button button-primary button-login" value="<?php echo esc_html( $btn_label ); ?>">
|
||||
<?php do_action( 'ppw_sitewide_below_password_form' ); ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
do_action('ppwp_render_sitewide_countdown');
|
||||
?>
|
||||
<?php do_action( PPW_Constants::HOOK_CUSTOM_FOOTER_FORM_ENTIRE_SITE ); ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Set Password & Password Protect Entire Site
|
||||
*/
|
||||
$password_for_website = ppw_core_get_setting_entire_site_type_string( PPW_Constants::PASSWORD_ENTIRE_SITE );
|
||||
$is_protected = ppw_core_get_setting_entire_site_type_bool( PPW_Constants::IS_PROTECT_ENTIRE_SITE );
|
||||
$is_display = $is_protected ? '' : 'ppwp-hidden-password';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if ( $is_protected ) { ?>
|
||||
<label class="pda_switch" for="ppwp_apply_password_for_entire_site">
|
||||
<input type="checkbox" id="ppwp_apply_password_for_entire_site" checked/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
<?php } else { ?>
|
||||
<label class="pda_switch" for="ppwp_apply_password_for_entire_site">
|
||||
<input type="checkbox" id="ppwp_apply_password_for_entire_site"/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Password Protect Entire Site', PPW_Constants::DOMAIN ) ?></label>
|
||||
<?php echo esc_html__( 'Set passwords to ', 'password-protect-page' ); ?>
|
||||
<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/password-protect-wordpress-lite/?utm_source=user-website&utm_medium=sitewide-protection-general&utm_campaign=ppwp-free#sitewide">
|
||||
<?php echo esc_html__( 'protect your entire WordPress site', 'password-protect-page' ); ?></a>.
|
||||
<?php echo sprintf('%1$s<a href="%2$s">%3$s</a>', esc_html__('Customize password login form using ', 'password-protect-page' ), admin_url( 'customize.php?autofocus[panel]=ppwp_sitewide' ), __( 'WordPress Customizer', 'password-protect-page' ) ) ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( ! empty( $password_for_website ) ) { ?>
|
||||
<tr class="ppwp_logic_show_input_password <?php echo esc_attr( $is_display ) ?>">
|
||||
<td></td>
|
||||
<td class="ppwp_set_height_for_password_entire_site">
|
||||
<p><?php esc_html_e( 'You’ve set a password to protect your site.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<div class="ppwp_wrap_new_password_for_entire_site ppwp_wrap_new_password">
|
||||
<label class="pda_switch" for="ppwp_set_new_password_for_entire_site">
|
||||
<input type="checkbox" id="ppwp_set_new_password_for_entire_site"/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
<span class="ppwp-set-new-password-text">Set a new password</span>
|
||||
</div>
|
||||
<div class="ppwp_hidden_new_password_for_entire_site" id="ppwp_new_password_entire_site">
|
||||
<div class="ppwp_wrap_new_password">
|
||||
<label class="pda_switch"></label>
|
||||
<span class="ppwp-set-new-password-input">
|
||||
<input required type="text" autocomplete="off" placeholder="Enter new password"
|
||||
id="ppwp_password_for_entire_site" name="ppwp_password_for_entire_site">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr class="ppwp_logic_show_input_password <?php echo esc_attr( $is_display ) ?>">
|
||||
<td></td>
|
||||
<td class="ppwp_text_after_enter_password_succes">
|
||||
<p><?php echo esc_html__( 'Set a password', PPW_Constants::DOMAIN ) ?></p>
|
||||
<input required type="text" autocomplete="off" placeholder="Enter a password"
|
||||
id="ppwp_password_for_entire_site" name="ppwp_password_for_entire_site">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
116
wp-content/plugins/password-protect-page/includes/views/external/view-ppw-general-configuration.php
vendored
Normal file
116
wp-content/plugins/password-protect-page/includes/views/external/view-ppw-general-configuration.php
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* General Configuration Settings
|
||||
*/
|
||||
$api_key = PPW_Recaptcha::get_instance()->get_recaptcha_v3_api_key();
|
||||
$api_key_v2 = PPW_Recaptcha::get_instance()->get_recaptcha_v2_api_key();
|
||||
$api_secret = PPW_Recaptcha::get_instance()->get_recaptcha_v3_api_secret();
|
||||
$api_secret_v2 = PPW_Recaptcha::get_instance()->get_recaptcha_v2_api_secret();
|
||||
$score = PPW_Recaptcha::get_instance()->get_limit_score();
|
||||
|
||||
?>
|
||||
<div class="ppw_main_container" id="ppw_shortcodes_form">
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<td colspan="2">
|
||||
<div style="margin-bottom: 1rem">
|
||||
<h3 style="text-transform: none; margin-bottom: 0.5rem">
|
||||
<?php echo esc_html__('Configure reCAPTCHA key','password-protect-page'); ?></h3>
|
||||
<a rel="noopener" target="_blank" href="https://g.co/recaptcha/v3"><?php echo esc_html__('Get the Site Key and Secret Key','password-protect-page');?></a><?php echo esc_html__('from Google','password-protect-page')?>
|
||||
</div>
|
||||
</td>
|
||||
</table>
|
||||
<form id="wpp_external_v3_form" method="post">
|
||||
<input type="hidden" id="ppw_general_form_nonce"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::GENERAL_FORM_NONCE ) ); ?>"/>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<tr id="wpp_recaptcha_configs">
|
||||
<td class="feature-input">
|
||||
<span class="feature-input"></span>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'reCAPTCHA v3', 'password-protect-page' ) ?></label>
|
||||
</p>
|
||||
<span>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Site Key', 'password-protect-page' ) ?></label>
|
||||
</p>
|
||||
<span class="ppwp-recaptcha-input">
|
||||
<input id="<?php echo esc_attr( PPW_Constants::RECAPTCHA_API_KEY ); ?>" type="text"
|
||||
value="<?php echo esc_attr( $api_key ); ?>"/>
|
||||
<div id="ppwp-error-require-v3-key" style="display: none; color: red; position: absolute; font-size: 12px;">This field is required.</div>
|
||||
</span>
|
||||
<p>
|
||||
<label class="ppwp-title"><?php echo esc_html__( 'Secret Key', 'password-protect-page' ) ?></label>
|
||||
</p>
|
||||
<span class="ppwp-recaptcha-input">
|
||||
<input id="<?php echo esc_attr( PPW_Constants::RECAPTCHA_API_SECRET ); ?>" type="text"
|
||||
value="<?php echo esc_attr( $api_secret ); ?>"/>
|
||||
</span>
|
||||
<div id="ppwp-error-require-v3-secret" style="display: none; color: red; position: absolute; font-size: 12px;">This field is required.</div>
|
||||
<p id="recaptcha-score-container">
|
||||
<label class="ppwp-title"><?php echo esc_html__( 'Threshold', 'password-protect-page' ) ?></label>
|
||||
Define users' score that will pass reCAPTCHA protection
|
||||
<span class="ppw-recaptcha-score">
|
||||
<select class="ppw_main_container select"
|
||||
id="<?php echo esc_attr( PPW_Constants::RECAPTCHA_SCORE ); ?>">
|
||||
<?php
|
||||
for ( $i = 0; $i <= 10; $i ++ ) {
|
||||
$s = number_format( ( $i / 10 ), 1 );
|
||||
$selected = (double) $s === $score ? 'selected="selected"' : '';
|
||||
echo '<option value="' . esc_attr( $s ) . '"' . esc_html( $selected ) . '>' . esc_html( $s ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="v3_submit_btn" id="submit" class="button button-primary v3_submit_btn" value="Save Changes">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<form id="wpp_external_v2_form" method="post">
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<tr id="wpp_recaptcha_configs">
|
||||
<td class="feature-input">
|
||||
<span class="feature-input"></span>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'reCAPTCHA v2 - Checkbox', 'password-protect-page' ); ?></label>
|
||||
</p>
|
||||
<span>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Site Key', 'password-protect-page' ) ?></label>
|
||||
</p>
|
||||
<span class="ppwp-recaptcha-input">
|
||||
<input id="<?php echo esc_attr( PPW_Constants::RECAPTCHA_V2_CHECKBOX_API_KEY ); ?>" type="text"
|
||||
value="<?php echo esc_attr( $api_key_v2 ); ?>"/>
|
||||
</span>
|
||||
<div id="ppwp-error-require-v2-key" style="display: none; color: red; position: absolute; font-size: 12px;"><?php echo esc_html__('This field is required.','password-protect-page');?> </div>
|
||||
<p>
|
||||
<label class="ppwp-title"><?php echo esc_html__( 'Secret Key', 'password-protect-page' ) ?></label>
|
||||
</p>
|
||||
<span class="ppwp-recaptcha-input">
|
||||
<input id="<?php echo esc_attr( PPW_Constants::RECAPTCHA_V2_CHECKBOX_API_SECRET ); ?>" type="text"
|
||||
value="<?php echo esc_attr( $api_secret_v2 ); ?>"/>
|
||||
</span>
|
||||
<div id="ppwp-error-require-v2-secret" style="display: none; color: red; position: absolute; font-size: 12px;"><?php echo esc_html__('This field is required.','password-protect-page');?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="v2_submit_btn" id="submit" class="button button-primary recaptcha-btn" value="Save Changes">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
80
wp-content/plugins/password-protect-page/includes/views/external/view-ppw-general.php
vendored
Normal file
80
wp-content/plugins/password-protect-page/includes/views/external/view-ppw-general.php
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP General Settings
|
||||
*/
|
||||
$using_recaptcha = PPW_Recaptcha::get_instance()->using_recaptcha() ? 'checked' : '';
|
||||
$recaptcha_type = PPW_Recaptcha::get_instance()->get_recaptcha_type();
|
||||
$password_types = PPW_Recaptcha::get_instance()->get_password_types();
|
||||
$type_options = array(
|
||||
PPW_Recaptcha::RECAPTCHA_V3_TYPE => __( 'reCAPTCHA v3', 'password-protect-page' ),
|
||||
PPW_Recaptcha::RECAPTCHA_V2_CHECKBOX_TYPE => __( 'reCAPTCHA v2 - Checkbox', 'password-protect-page' ),
|
||||
);
|
||||
$password_type_options = array(
|
||||
PPW_Recaptcha::SINGLE_PASSWORD => __( 'Single password form', 'password-protect-page' ),
|
||||
PPW_Recaptcha::SITEWIDE_PASSWORD => __( 'Sitewide login form', 'password-protect-page' ),
|
||||
PPW_Recaptcha::PCP_PASSWORD => __( 'PCP password form', 'password-protect-page' ),
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="ppw_main_container" id="ppw_shortcodes_form">
|
||||
<form id="wpp_external_form" method="post">
|
||||
<input type="hidden" id="ppw_general_form_nonce"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::GENERAL_FORM_NONCE ) ); ?>"/>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( PPW_Constants::USING_RECAPTCHA ); ?>">
|
||||
<input type="checkbox"
|
||||
id="<?php echo esc_attr( PPW_Constants::USING_RECAPTCHA ); ?>" <?php echo esc_html( $using_recaptcha ); ?>>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p style="margin-bottom: 6px;">
|
||||
<label><?php esc_attr_e( 'Enable Google reCAPTCHA Protection', 'password-protect-page' ) ?></label>
|
||||
<a rel="noopener" target="_blank" href="https://passwordprotectwp.com/docs/add-google-recaptcha-wordpress-password-form/?utm_source=user-website&utm_medium=integration-recaptcha&utm_campaign=ppwp-free"><?php echo esc_html__('Protect
|
||||
your password form','password-protect-page')?></a>
|
||||
<?php echo esc_html__('from abuse and spam while allowing real user access only','password-protect-page');?>
|
||||
</p>
|
||||
<div
|
||||
<?php echo $using_recaptcha ? '' : 'style="display: none"'; ?>
|
||||
id="wpp_recaptcha_options">
|
||||
<div>
|
||||
<p><?php esc_attr_e( 'Choose reCAPTCHA type', 'password-protect-page' ); ?></p>
|
||||
<select
|
||||
class="ppw_main_container select"
|
||||
id="wpp_recaptcha_type">
|
||||
<?php
|
||||
foreach ( $type_options as $key => $value ) {
|
||||
$selected = $key === $recaptcha_type ? 'selected="selected"' : '';
|
||||
echo '<option value="' . esc_attr( $key ) . '" ' . esc_html( $selected ) . '>' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
<option value="recaptcha_v2_invisible"
|
||||
disabled><?php echo esc_html__( 'reCAPTCHA v2 - Invisible', 'password-protect-page' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="max-width: 25rem;">
|
||||
<p><?php esc_attr_e( 'Choose which password form to apply reCAPTCHA', 'password-protect-page' ); ?></p>
|
||||
<select id="wpp_recaptcha_password_types" class="ppw_main_container select ppw_select_types" required multiple="multiple">
|
||||
<?php
|
||||
foreach ( $password_type_options as $key => $value ) {
|
||||
$selected = in_array( $key, $password_types) ? 'selected="selected"' : '';
|
||||
echo '<option value="' . esc_attr( $key ) . '" ' . esc_html( $selected ) . '>' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Password Protect Child Pages
|
||||
*/
|
||||
?>
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label>
|
||||
<?php echo esc_html__( 'Password Protect Child Pages', PPW_Constants::DOMAIN ); ?>
|
||||
</label>
|
||||
<?php echo esc_html__( 'Automatically protect all child pages once their parent is protected. Available in Pro version.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$post_types = ppw_core_get_all_post_types();
|
||||
unset( $post_types['post'] );
|
||||
unset( $post_types['page'] );
|
||||
?>
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label>
|
||||
<?php echo esc_html__( 'Post Type Protection', PPW_Constants::DOMAIN ); ?>
|
||||
</label>
|
||||
<?php echo _e( '<a target="_blank" rel="noopener noreferrer" href="https://passwordprotectwp.com/docs/settings/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free#cpt">Select which custom post types</a> you want to password protect. Default: Pages & Posts.', PPW_Constants::DOMAIN ); // phpcs:ignore -- there is no value to escape. ?>
|
||||
</p>
|
||||
<div class="ppw_wrap_select_protection_selected">
|
||||
<div class="ppw_wrap_protection_selected">
|
||||
<span class="ppw_protection_selected">Pages</span>
|
||||
<span class="ppw_protection_selected">Posts</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,13 @@
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Error Message', PPW_Constants::DOMAIN ) ?></label>
|
||||
<?php echo _e( 'Customize the error message when users enter wrong passwords.<em> Available in Pro version only.</em>', PPW_Constants::DOMAIN ) ?>
|
||||
</p>
|
||||
<span>
|
||||
<input type="text"
|
||||
value="<?php echo esc_html( PPW_Constants::DEFAULT_WRONG_PASSWORD_MESSAGE ); ?>"/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
$password_cookie_expired = ppw_core_get_setting_type_string( PPW_Constants::COOKIE_EXPIRED );
|
||||
$time = 7;
|
||||
$units = 'days';
|
||||
$one_year = 365;
|
||||
$max = $one_year;
|
||||
if ( ! empty( $password_cookie_expired ) ) {
|
||||
$tmp = explode( ' ', $password_cookie_expired );
|
||||
if ( count( $tmp ) === 2 ) {
|
||||
$time = (int) $tmp[0];
|
||||
$units = $tmp[1];
|
||||
switch ( $units ) {
|
||||
case 'hours':
|
||||
$max = $one_year * 24;
|
||||
break;
|
||||
case 'minutes':
|
||||
$max = $one_year * 24 * 60;
|
||||
break;
|
||||
case 'seconds':
|
||||
$max = $one_year * 24 * 60 * 60;
|
||||
break;
|
||||
default:
|
||||
$max = $one_year;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Cookie Expiration Time', PPW_Constants::DOMAIN ); ?></label>
|
||||
<?php echo _e( 'By default, users won’t have to re-enter passwords until its cookie expires. You can also <a target="_blank" href="https://passwordprotectwp.com/docs/settings/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free#cookies">use session cookies</a> to log users out right after they close the browser.', PPW_Constants::DOMAIN ); // phpcs:ignore -- there is no value to escape. ?>
|
||||
</p>
|
||||
<input required value="<?php echo esc_attr( $time ); ?>" class="wpp_time_number" type="number"
|
||||
id="wpp_password_cookie_times" min="1" max="<?php echo esc_attr( $max ); ?>"/>
|
||||
<select id="wpp_password_cookie_units" class="wpp_password_cookie_units">
|
||||
<option value="days" <?php if ( 'days' === $units ) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo esc_html__( 'Days', PPW_Constants::DOMAIN ); ?></option>
|
||||
<option value="hours" <?php if ( 'hours' === $units ) {
|
||||
echo 'selected';
|
||||
} ?> ><?php echo esc_html__( 'Hours', PPW_Constants::DOMAIN ) ?>
|
||||
</option>
|
||||
<option value="minutes" <?php if ( 'minutes' === $units ) {
|
||||
echo 'selected';
|
||||
} ?> ><?php echo esc_html__( 'Minutes', PPW_Constants::DOMAIN ) ?>
|
||||
</option>
|
||||
<option value="seconds" <?php if ( 'seconds' === $units ) {
|
||||
echo 'selected';
|
||||
} ?> ><?php echo esc_html__( 'Seconds', PPW_Constants::DOMAIN ) ?>
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,10 @@
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Form Message', PPW_Constants::DOMAIN ) ?></label>
|
||||
<?php echo _e( 'Customize the message which displays above the password field.<em> Available in Pro version only.</em>', PPW_Constants::DOMAIN ) ?>
|
||||
</p>
|
||||
<input type="text" value="<?php echo esc_html( PPW_Constants::DEFAULT_FORM_MESSAGE ); ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,77 @@
|
||||
<form class="ppw_main_container" id="wp_protect_password_general_form">
|
||||
<input type="hidden" id="ppw_general_form_nonce"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::GENERAL_FORM_NONCE ) ); ?>"/>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<tr id="pda-password-protection">
|
||||
<td colspan="2">
|
||||
<h3><?php echo esc_html__( 'PASSWORD PROTECTION', 'password-protect-page' ); ?></h3>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-custom-column-permission.php';
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-expired-cookie.php';
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-whitelist-roles.php';
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-auto-protect-child-page.php';
|
||||
// include PPW_DIR_PATH . 'includes/views/general/view-ppw-protect-private-pages.php';
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-hide-protected-post.php';
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="wpp-password-form">
|
||||
<td colspan="2">
|
||||
<h3><?php echo esc_html__( 'PASSWORD FORM CUSTOMIZATION', 'password-protect-page' ); ?></h3>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<?php
|
||||
$link_error_message = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">error message & password form</a>',
|
||||
'https://passwordprotectwp.com/customize-password-form-wordpress-customizer/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free'
|
||||
);
|
||||
$link_customizer = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">WordPress Customizer</a>',
|
||||
'customize.php?autofocus[panel]=ppwp'
|
||||
);
|
||||
$form_message = sprintf(
|
||||
// translators: %s: Link to documentation.
|
||||
esc_html__( 'Customize the default %1$s including headline, description and button under %2$s.', 'password-protect-page' ),
|
||||
$link_error_message,
|
||||
$link_customizer
|
||||
);
|
||||
?>
|
||||
<?php echo wp_kses_post( $form_message ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
// include PPW_DIR_PATH . 'includes/views/general/view-ppw-form-message.php';
|
||||
// include PPW_DIR_PATH . 'includes/views/general/view-ppw-error-message.php';
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="wpp-password-form">
|
||||
<td colspan="2">
|
||||
<h3><?php echo esc_html__( 'ADVANCED OPTIONS', 'password-protect-page' ); ?></h3>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-remove-search-engine.php';
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-remove-data.php';
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
submit_button();
|
||||
?>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<?php
|
||||
include PPW_DIR_PATH . 'includes/views/general/view-ppw-notices-cache.php';
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$ppw_post_types = ppw_core_get_post_type_for_hide_protect_content();
|
||||
$link_description = sprintf( '<a target="_blank" rel="noopener" href="%s">Hide your password protected content</a>', 'https://passwordprotectwp.com/docs/how-to-hide-password-protected-wordpress-content/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free' );
|
||||
// translators: %s: Link to documentation.
|
||||
$link_description_rss = sprintf( '<a target="_blank" rel="noopener" href="%s">show protected content in RSS feeds</a>', 'https://passwordprotectwp.com/docs/display-protected-content-rss-feed/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free' );
|
||||
|
||||
$description = sprintf( esc_html__( '%s from selected views. Learn how to %s.', 'password-protect-page' ), $link_description, $link_description_rss );
|
||||
?>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Protected Content Visibility', 'password-protect-page' ); ?></label>
|
||||
<?php echo $description; // phpcs:ignore -- could not escape html ?>
|
||||
<p>Switch post types to customize their own visibility. Only Pages & Posts are available on Free version.</p>
|
||||
<select class="ppw_select_custom_post_type_edit" id="ppw_select_custom_post_type_edit">
|
||||
<?php
|
||||
foreach ( $ppw_post_types as $ppw_type ) {
|
||||
$ppw_disabled = apply_filters( PPW_Constants::HOOK_CUSTOM_OPTION_HIDE_PROTECT_CONTENT, 'page_post' === $ppw_type['value'] ? '' : 'disabled', $ppw_type['value'] );
|
||||
?>
|
||||
<option <?php echo esc_attr( $ppw_disabled ); ?>
|
||||
value="<?php echo esc_attr( $ppw_type['value'] ); ?>"><?php echo esc_attr( $ppw_type['label'] ); ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
ppw_core_check_logic_before_render_ui( $ppw_post_types );
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Caching Plugins & Server-side Caching', PPW_Constants::DOMAIN ); ?></label>
|
||||
<?php _e( 'If you’re using a caching plugin or server-side caching, you’ll need to <a rel="noopener noreferrer" target="_blank" href="https://passwordprotectwp.com/docs/caching-plugins-cache-servers-integration/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free">update your caching configurations</a> for our Password Protect Wordpress plugin to work properly.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$all_page_post = ppw_free_get_all_page_post();
|
||||
?>
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label>
|
||||
<?php echo esc_html__( 'Password Protect Private Pages', PPW_Constants::DOMAIN ) ?>
|
||||
</label>
|
||||
<?php echo _e( 'Set the same password to protect the following pages and posts. Available in Pro version.', PPW_Constants::DOMAIN ) ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="ppwp-free-pages-posts-set-password ppwp-hidden-password ppwp_free_version">
|
||||
<td></td>
|
||||
<td><p><?php echo esc_html__( 'Select your private pages or posts', PPW_Constants::DOMAIN ) ?></p>
|
||||
<select multiple="multiple" class="ppwp_select2">
|
||||
<?php foreach ( $all_page_post as $page ): ?>
|
||||
<option disabled="disabled"><?php echo esc_html( $page->post_title ) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="ppwp-free-pages-posts-set-password ppwp-hidden-password ppwp_free_version">
|
||||
<td></td>
|
||||
<td class="ppwp_wrap_set_new_password_for_pages_posts">
|
||||
<p><?php echo esc_html__( 'Set a password', PPW_Constants::DOMAIN ) ?></p>
|
||||
<input type="text" placeholder="Enter a password"/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$remove_checked = ppw_core_get_setting_type_bool( PPW_Constants::REMOVE_DATA ) ? 'checked' : '';
|
||||
$message = apply_filters( PPW_Constants::HOOK_CUSTOM_TEXT_FEATURE_REMOVE_DATA, array(
|
||||
'label' => 'Remove Data Upon Uninstall',
|
||||
'description' => 'Remove all your data created by Password Protect WordPress upon uninstall. You should <b>NOT</b> remove our Free when upgrading to our Pro version.'
|
||||
) );
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( PPW_Constants::REMOVE_DATA ); ?>">
|
||||
<input type="checkbox"
|
||||
id="<?php echo esc_attr( PPW_Constants::REMOVE_DATA ); ?>" <?php echo esc_attr( $remove_checked ); ?>/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( $message['label'], PPW_Constants::DOMAIN ) ?></label>
|
||||
<?php echo _e( $message['description'], PPW_Constants::DOMAIN ) ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,12 @@
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label>
|
||||
<?php echo esc_html__( 'Block Search Indexing', PPW_Constants::DOMAIN ); ?>
|
||||
</label>
|
||||
<?php echo _e( '<a target="_blank" rel="noopener noreferrer" href="https://passwordprotectwp.com/docs/settings/?utm_source=user-website&utm_medium=settings-general-tab&utm_campaign=ppwp-free#block-indexing">Prevent search engines from indexing</a> your password protected content. Available in Pro version.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$roles = get_editable_roles();
|
||||
?>
|
||||
<tr class="ppwp_free_version">
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<p>
|
||||
<label>
|
||||
<?php echo esc_html__( 'Whitelisted Roles', PPW_Constants::DOMAIN ) ?>
|
||||
</label>
|
||||
<?php echo _e( 'Select user roles who can access all protected content without having to enter passwords.', PPW_Constants::DOMAIN ) ?>
|
||||
</p>
|
||||
<select id="wpp_free_whitelist_roles">
|
||||
<option value="blank"><?php echo esc_html__( 'No one', PPW_Constants::DOMAIN ) ?></option>
|
||||
<option disabled value="admin_users"><?php echo esc_html__( 'Admin users', PPW_Constants::DOMAIN ) ?></option>
|
||||
<option disabled value="author"><?php echo esc_html__( 'The post\'s author', PPW_Constants::DOMAIN ) ?></option>
|
||||
<option disabled value="logged_users"><?php echo esc_html__( 'Logged-in users', PPW_Constants::DOMAIN ) ?></option>
|
||||
<option disabled value="custom_roles"><?php echo esc_html__( 'Choose custom roles', PPW_Constants::DOMAIN ) ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="wpp_free_roles_access" class="wpp_hide_role_access ppwp_free_version">
|
||||
<td></td>
|
||||
<td><p><?php echo esc_html__( 'Grant access to these user roles only', PPW_Constants::DOMAIN ); ?></p>
|
||||
<select multiple="multiple" class="wpp_roles_select ppwp_select2">
|
||||
<?php foreach ( $roles as $role_name => $role_info ) { ?>
|
||||
<option><?php echo esc_html( $role_name ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"ppw-master-passwords.css","sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
<div style="background-color: white; padding: 20px">
|
||||
<div id="ppw-master-passwords"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* All of the CSS for your admin-specific functionality should be
|
||||
* included in this file.
|
||||
*/
|
||||
.pda-pwd-tools {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.pda-pwd-tools input[type=radio].disabled, .pda-pwd-tools input[type=radio].disabled:checked:before, .pda-pwd-tools input[type=radio]:disabled, .pda-pwd-tools input[type=radio]:disabled:checked:before, .pda-pwd-tools input[type=checkbox].disabled, .pda-pwd-tools input[type=checkbox].disabled:checked:before, .pda-pwd-tools input[type=checkbox]:disabled, .pda-pwd-tools input[type=checkbox]:disabled:checked:before {
|
||||
opacity: 1;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
.pda-pwd-tbl-actions {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
Metabox css
|
||||
*/
|
||||
textarea[name="wpp_multiple_password"] {
|
||||
width: 94%;
|
||||
}
|
||||
|
||||
#all_roles_select {
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#all_roles_select span {
|
||||
border-radius: 6px 0;
|
||||
padding: 0rem 0.2rem;
|
||||
background: #FFFF00;
|
||||
cursor: pointer;
|
||||
transition: 0.4s;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div#passwords-roles-map label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pda-selected-role-select2,
|
||||
input.post-protection-password,
|
||||
textarea[name="wpp_multiple_password"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ppwp_set_password_type {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
#ppwp_set_password_metabox .ppwp_apply_password {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#ppwp_set_password_metabox .ppwp_show_hide_password_roles {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#ppwp_set_password_metabox .ppwp_input_set_type_password {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#ppwp_set_password_metabox .ppwp_default_hide_checkbox_roles {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ppwp-button-hide {
|
||||
float: right;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ppwp-button-submit {
|
||||
color: #555;
|
||||
border-color: #ccc;
|
||||
background: #f7f7f7;
|
||||
box-shadow: 0 1px 0 #ccc;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-size: 13px;
|
||||
line-height: 26px;
|
||||
height: 28px;
|
||||
margin: 0;
|
||||
padding: 0 10px 1px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 3px;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ppwp-button-submit:hover {
|
||||
background: #fafafa;
|
||||
border-color: #999;
|
||||
color: #23282d;
|
||||
}
|
||||
|
||||
#passwords-roles-map .ppwp-wrap-submit-hide {
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.ppwp_multiple_password {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ppwp_wrap_role_password {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.pda-selected-role-select2 {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
(function (window, $) {
|
||||
|
||||
$(function () {
|
||||
setDefaultPassword();
|
||||
handleChangeElement();
|
||||
|
||||
$("#save_password").click(function (evt) {
|
||||
evt.preventDefault();
|
||||
const passwords = $('.ppwp_multiple_password').val().split("\n").map(pass => pass.trim()).filter(pass => pass !== "");
|
||||
const rolePassword = $(".post-protection-password").val().trim();
|
||||
const roleSelected = $("#is_role_selected").val();
|
||||
if (isErrorPassword(passwords)) {
|
||||
return;
|
||||
}
|
||||
|
||||
savePassword({
|
||||
save_password: rolePassword,
|
||||
is_role_selected: roleSelected,
|
||||
id_page_post: $("#id_page_post").val(),
|
||||
ppwp_multiple_password: passwords.length <= 0 ? '' : passwords,
|
||||
}, function (result, error) {
|
||||
$('#save_password').text('Submit');
|
||||
$('#save_password').prop("disabled", false);
|
||||
const pluginName = 'PPWP Lite';
|
||||
if (result) {
|
||||
changeValueRoles(result);
|
||||
if (roleSelected === 'global') {
|
||||
$('#ppwp_multiple_password').val(passwords.join('\n'));
|
||||
} else {
|
||||
$('#post-protection-password').val(rolePassword);
|
||||
}
|
||||
toastr.success('Great! You’ve updated the password successfully.', pluginName);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
if (400 === error.status) {
|
||||
toastr.error(error.responseJSON.message, pluginName);
|
||||
} else {
|
||||
toastr.error('Opps! Something went wrong. Please try again.', pluginName);
|
||||
}
|
||||
console.log('Data error', error);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function checkPasswordNoSpace(password) {
|
||||
return password.indexOf(" ") === -1
|
||||
}
|
||||
|
||||
function handleChangeElement() {
|
||||
$("#post-protection-password").change(function () {
|
||||
if ($(this).val().trim().indexOf(" ") !== -1) {
|
||||
toastr.error(save_password_data.error_message.space_password, 'Password Protect WordPress');
|
||||
$('#save_password').prop("disabled", true);
|
||||
} else {
|
||||
$('#save_password').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
$(".ppwp_multiple_password").change(function () {
|
||||
const passwords = $(this).val().split("\n").map(pass => pass.trim()).filter(pass => pass !== "");
|
||||
|
||||
if ((new Set(passwords)).size !== passwords.length) {
|
||||
toastr.error(save_password_data.error_message.duplicate_password, 'Password Protect WordPress');
|
||||
$('#save_password').prop("disabled", true);
|
||||
return;
|
||||
} else {
|
||||
$('#save_password').prop("disabled", false);
|
||||
}
|
||||
|
||||
if (!passwords.every(checkPasswordNoSpace)) {
|
||||
toastr.error(save_password_data.error_message.space_password, 'Password Protect WordPress');
|
||||
$('#save_password').prop("disabled", true);
|
||||
return;
|
||||
} else {
|
||||
$('#save_password').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
let arrayPassword = {};
|
||||
$('.pda-selected-role-select2').on('focus', function () {
|
||||
let role = this.value;
|
||||
// Add Value to MAP
|
||||
arrayPassword[role] = $('#post-protection-password').val();
|
||||
$('#' + role).val($('#post-protection-password').val());
|
||||
}).change(function () {
|
||||
let role = $('.pda-selected-role-select2').val();
|
||||
|
||||
let value;
|
||||
if (typeof (arrayPassword[role]) !== 'undefined') {
|
||||
value = arrayPassword[role];
|
||||
} else {
|
||||
value = $('#post-protection-password-' + role).text() === "" ? "" : $('#post-protection-password-' + role).text();
|
||||
}
|
||||
|
||||
if (role === 'global') {
|
||||
$('#post-protection-password').hide();
|
||||
$('#ppwp_multiple_password').show();
|
||||
} else {
|
||||
$('#post-protection-password').show();
|
||||
$('#ppwp_multiple_password').hide();
|
||||
}
|
||||
|
||||
$('#post-protection-password').val(value);
|
||||
|
||||
if ($("#is_role_selected").val() === 'global') {
|
||||
$("#label-password-post").text("Passwords")
|
||||
} else {
|
||||
$("#label-password-post").text("Password")
|
||||
}
|
||||
});
|
||||
$('.pda-selected-role-select2').trigger('change');
|
||||
|
||||
|
||||
$('.edit-post-protection').click(function () {
|
||||
$('#post-protection').show();
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
$('.button-cancel').click(function () {
|
||||
$('#post-protection').hide();
|
||||
$('.edit-post-protection').show();
|
||||
});
|
||||
}
|
||||
|
||||
function setDefaultPassword() {
|
||||
const role = $('.pda-selected-role-select2').val();
|
||||
if (role) {
|
||||
const value = $('#post-protection-password-' + role).text() === "" ? "" : $('#post-protection-password-' + role).text();
|
||||
$('#post-protection-password').val(value);
|
||||
}
|
||||
}
|
||||
|
||||
function isErrorPassword(passwords) {
|
||||
const roleSelected = $('.pda-selected-role-select2').val();
|
||||
if (roleSelected !== 'global') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!passwords.every(checkPasswordNoSpace)) {
|
||||
toastr.error(save_password_data.error_message.space_password, 'Password Protect WordPress');
|
||||
$('#save_password').prop("disabled", true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((new Set(passwords)).size !== passwords.length) {
|
||||
toastr.error(save_password_data.error_message.duplicate_password, 'Password Protect WordPress');
|
||||
$('#save_password').prop("disabled", true);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function savePassword(settings, cb) {
|
||||
const _data = {
|
||||
action: 'ppw_free_set_password',
|
||||
settings: settings,
|
||||
security_check: $('#ppw_meta_box_nonce').val(),
|
||||
}
|
||||
$('#save_password').text('Submitting');
|
||||
$('#save_password').prop("disabled", true);
|
||||
$.ajax({
|
||||
url: save_password_data.ajax_url,
|
||||
type: 'POST',
|
||||
data: _data,
|
||||
success: function (data) {
|
||||
cb(data, null);
|
||||
},
|
||||
error: function (error) {
|
||||
cb(null, error);
|
||||
},
|
||||
timeout: 5000
|
||||
});
|
||||
}
|
||||
|
||||
function changeValueRoles(data) {
|
||||
const rolesFiltered = Object.keys(data)
|
||||
.filter(function (role) {
|
||||
return '' !== data[role];
|
||||
});
|
||||
const roles = rolesFiltered.map(function (role) {
|
||||
return "<span>" + role + "</span>";
|
||||
}).join(' ');
|
||||
const rolesText = rolesFiltered.length > 1 ? rolesFiltered.length + ' roles' : rolesFiltered.length + ' role';
|
||||
$("#all_roles_select").html(roles);
|
||||
$("#number_roles").text(rolesText);
|
||||
}
|
||||
|
||||
})(window, jQuery);
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
add_meta_box(
|
||||
'ppw_add_meta_box',
|
||||
__( 'Password Protect WordPress', PPW_Constants::DOMAIN ),
|
||||
apply_filters( PPW_Constants::HOOK_FUNCTION_HANDLE_META_BOX, 'ppw_free_feature_set_password_in_meta_box' ),
|
||||
apply_filters( PPW_Constants::HOOK_META_BOX_POSITION, array( 'page', 'post' ) ),
|
||||
'side',
|
||||
'high'
|
||||
);
|
||||
|
||||
/**
|
||||
* Function to render meta box set password for pages, posts in free version
|
||||
*
|
||||
* @param $post
|
||||
*/
|
||||
function ppw_free_feature_set_password_in_meta_box( $post ) {
|
||||
$raw_data = get_post_meta( $post->ID, PPW_Constants::POST_PROTECTION_ROLES, true );
|
||||
$protected_roles = ppw_free_fix_serialize_data( $raw_data );
|
||||
$multiple_passwords = get_post_meta( $post->ID, PPW_Constants::GLOBAL_PASSWORDS, true );
|
||||
$password = '';
|
||||
if ( ! empty( $multiple_passwords ) && is_array( $multiple_passwords ) ) {
|
||||
$password = esc_textarea( implode( "\n", $multiple_passwords ) );
|
||||
$global_password = implode( ' ', $multiple_passwords );
|
||||
$protected_roles['global'] = $global_password;
|
||||
}
|
||||
|
||||
$have_password_roles = array_keys( array_filter( $protected_roles, function ( $val ) {
|
||||
return $val !== '';
|
||||
} ) );
|
||||
|
||||
$no_have_password_roles = sizeof( $have_password_roles );
|
||||
|
||||
$no_roles = $no_have_password_roles > 1 ? $no_have_password_roles . ' roles' : $no_have_password_roles . ' role';
|
||||
|
||||
$roles = get_editable_roles();
|
||||
|
||||
?>
|
||||
<div id="passwords-roles-map" class="ppwp-post-protection">
|
||||
<input type="hidden" id="ppw_meta_box_nonce"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::META_BOX_NONCE ) ); ?>">
|
||||
<span id="post-protection-status"> Password protected by
|
||||
<span id="number_roles"><?php echo esc_html( $no_roles ); ?></span>
|
||||
</span><a href="#protection" class="edit-post-protection hide-if-no-js pup-tooltip" role="button"
|
||||
style="display: inline;">
|
||||
<span class="roles" aria-hidden="true">Edit</span>
|
||||
</a>
|
||||
<div style="display: none" id="post-protection">
|
||||
<p id="all_roles_select">
|
||||
<?php foreach ( $have_password_roles as $key => $role ): ?>
|
||||
<span><?php echo esc_html( $role ); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
<div>
|
||||
<?php foreach ( $protected_roles as $key => $value ): ?>
|
||||
<span style="display: none"
|
||||
id="post-protection-password-<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="post-protection-role">Role</label>
|
||||
<select class="pda-selected-role-select2" name="post-protection-role" id="is_role_selected">
|
||||
<option value="global">global</option>
|
||||
<?php foreach ( $roles as $role_name => $role_info ): ?>
|
||||
<option <?php echo esc_attr( in_array( $role_name, array() ) ? 'selected="selected"' : '' ); ?>" value="<?php echo esc_attr( $role_name ); ?>">
|
||||
<?php echo esc_html( $role_name ); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Region Data Save in HTML Tag START-->
|
||||
<?php foreach ( $roles as $role_name => $role_info ): ?>
|
||||
<?php $value = array_key_exists( $role_name, $protected_roles ) ? $protected_roles[ $role_name ] : ""; ?>
|
||||
<input type="hidden" id="<?php echo esc_attr( $role_name ); ?>"
|
||||
name="data[<?php echo esc_attr( $role_name ); ?>]"
|
||||
value="<?php echo esc_attr( $value ); ?>"/>
|
||||
<?php endforeach; ?>
|
||||
<!-- Region Data Save in HTML Tag END-->
|
||||
|
||||
<div class="ppwp_wrap_role_password">
|
||||
<label id="label-password-post">Passwords</label>
|
||||
<input autocomplete="off" type="text" class="password post-protection-password"
|
||||
placeholder="Enter password"
|
||||
name="post-protection-password"
|
||||
id="post-protection-password"/>
|
||||
<textarea rows="3" id="ppwp_multiple_password" class="ppwp_multiple_password"
|
||||
placeholder="<?php echo esc_attr( 'Enter one password per line', 'wp-protect-password' ); ?>"><?php echo esc_html( $password, 'wp-protect-password' ) ?></textarea>
|
||||
</div>
|
||||
<p class="ppwp-wrap-submit-hide">
|
||||
<input type="hidden" value="<?php echo esc_attr( $post->ID ); ?>" id="id_page_post">
|
||||
<button href="#protection" id="save_password" class="ppwp-button-submit">Submit</button>
|
||||
<a class="cancel-pda-protection-map button-cancel ppwp-button-hide">Hide</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$asset_services = new PPW_Asset_Services( '', '' );
|
||||
$asset_services->load_assets_for_meta_box();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="ppw_main_container wp_misc_tab">
|
||||
<form id="wpp_misc_common_form">
|
||||
<input type="hidden" id="ppw_misc_form_nonce"
|
||||
value="<?php echo esc_attr( wp_create_nonce( PPW_Constants::GENERAL_FORM_NONCE ) ); ?>"/>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<?php
|
||||
include PPW_DIR_PATH . 'includes/views/misc/view-ppw-protect-excerpt.php';
|
||||
include PPW_DIR_PATH . 'includes/views/misc/view-ppw-no-reload-page.php';
|
||||
do_action('ppwp_settings_advanced_top_options');
|
||||
?>
|
||||
</table>
|
||||
<?php submit_button();?>
|
||||
</form>
|
||||
<p>
|
||||
<hr>
|
||||
</p>
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<?php include PPW_DIR_PATH . 'includes/views/misc/view-ppw-restore-wp-password.php'; ?>
|
||||
</table>
|
||||
<?php do_action('ppw_render_misc_form'); ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$no_reload_page = PPW_Constants::NO_RELOAD_PAGE;
|
||||
$checked = ppw_core_get_setting_type_bool_by_option_name( $no_reload_page, PPW_Constants::MISC_OPTIONS ) ? 'checked' : '';
|
||||
$message = array(
|
||||
'label' => 'Unlock Protected Content without Page Refresh',
|
||||
'description' => '<a target="_blank" rel="noreferrer noopener" href="https://passwordprotectwp.com/docs/unlock-password-protected-content-without-page-refresh/?utm_source=user-website&utm_medium=settings-advanced-tab&utm_campaign=ppwp-free">Use Ajax to display protected content</a> without having to reload the entire page. It will help improve user experience and avoid server caching after users enter their passwords.'
|
||||
);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( $no_reload_page ); ?>">
|
||||
<input type="checkbox"
|
||||
id="<?php echo esc_attr( $no_reload_page ); ?>" <?php echo esc_attr( $checked ); ?>/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( $message['label'], $no_reload_page ); ?>
|
||||
</label>
|
||||
<?php echo __( $message['description'], $no_reload_page ) // phpcs:ignore -- There is no value to escape on description ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$checked = ppw_core_get_setting_type_bool_by_option_name( PPW_Constants::PROTECT_EXCERPT, PPW_Constants::MISC_OPTIONS ) ? 'checked' : '';
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( PPW_Constants::PROTECT_EXCERPT ); ?>">
|
||||
<input type="checkbox" id="<?php echo esc_attr( PPW_Constants::PROTECT_EXCERPT ); ?>" <?php echo esc_html( $checked ); ?>/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Show Post Excerpt', 'password-protect-page' ); ?></label>
|
||||
<?php echo wp_kses_post( __( '<a target="_blank" href="https://passwordprotectwp.com/docs/display-featured-image-password-protected-excerpt/?utm_source=user-website&utm_medium=settings-advanced-tab&utm_campaign=ppwp-free">Display excerpt</a> of password protected posts. You can also <a target="_blank" href="https://passwordprotectwp.com/docs/display-featured-image-password-protected-excerpt/?utm_source=user-website&utm_medium=settings-advanced-tab&utm_campaign=ppwp-free#customize-default">customize the default excerpt</a> using a custom code snippet.', 'password-protect-page' ) ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
global $password_recovery_service;
|
||||
|
||||
$num_wp_passwords = PPW_Repository_Passwords::get_instance()->count_wp_post_passwords();
|
||||
$is_running = $password_recovery_service->is_running();
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="feature-input"></span>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( 'Restore Default WordPress Passwords', 'password-protect-page' ); ?></label>
|
||||
<a target="_blank" rel="noopener noreferrer"
|
||||
href="https://passwordprotectwp.com/docs/password-migration/?utm_source=user-website&utm_medium=settings-advanced-tab&utm_campaign=ppwp-free#backup">Restore all your backup
|
||||
passwords</a> to maintain your content's protection status after plugin deactivation.
|
||||
<br>
|
||||
The process runs in the background. You will get a notification once it’s completed.
|
||||
<p>
|
||||
<?php
|
||||
if ( $is_running ) {
|
||||
echo esc_html__( 'Restoring ', 'password-protect-page' ) . '<b>' . esc_html( $num_wp_passwords ) . '</b>' . esc_html__( ' backup password(s)...', 'password-protect-page' );
|
||||
} else {
|
||||
echo esc_html__( 'There are ', 'password-protect-page' ) . '<b>' . esc_html( $num_wp_passwords ) . '</b>' . esc_html__( ' backup password(s).', 'password-protect-page' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</p>
|
||||
<p>
|
||||
<input id="ppw-restore-passwords" <?php echo ! $num_wp_passwords || $is_running ? 'disabled="true"' : '' ?>
|
||||
type="button"
|
||||
class="button button-primary"
|
||||
value="Restore Now"
|
||||
>
|
||||
<div class="ppw-warning">
|
||||
<strong><?php echo esc_html__( 'Warning', 'password-protect-page' ) ?></strong>: <?php echo esc_html__( 'Do not restore default WordPress
|
||||
passwords unless you are to deactivate our plugins', 'password-protect-page' ) ?>
|
||||
</div>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$checked = ppw_core_get_setting_type_bool_by_option_name( PPW_Constants::USE_CUSTOM_FORM_ACTION, PPW_Constants::MISC_OPTIONS ) ? 'checked' : '';
|
||||
$message = array(
|
||||
'label' => 'Use Custom Form Action',
|
||||
'description' => 'Enable this option when <a target="_blank" rel="noopener noreferrer" href="https://passwordprotectwp.com/docs/custom-login-page-compatibility/">the password protection doesn\'t work</a>, e.g. users get redirected to homepage or 404 error page.'
|
||||
);
|
||||
|
||||
?>
|
||||
<tr <?php echo $checked === 'checked' ? 'style="color: gray;"' : ''; ?>>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( PPW_Constants::USE_CUSTOM_FORM_ACTION ); ?>">
|
||||
<input type="checkbox"
|
||||
id="<?php echo esc_attr( PPW_Constants::USE_CUSTOM_FORM_ACTION ); ?>" <?php echo esc_attr( $checked ); ?> <?php echo $checked === 'checked' ? 'disabled' : ''; ?>/>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php echo esc_html__( $message['label'], PPW_Constants::USE_CUSTOM_FORM_ACTION ) ?></label>
|
||||
<?php echo _e( $message['description'], PPW_Constants::USE_CUSTOM_FORM_ACTION ) ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,361 @@
|
||||
<?php
|
||||
|
||||
// translators: %s: Link to documentation.
|
||||
$page_builder_link = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">work seamlessly with top page builders</a>',
|
||||
'https://passwordprotectwp.com/docs/protect-partial-content-page-builders/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free'
|
||||
);
|
||||
$page_builder_desc = sprintf(
|
||||
'Alternatively, use our built-in blocks for popular page builders, e.g. %s and %s.',
|
||||
'<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/password-protect-partial-content-elementor/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free">Elementor</a>',
|
||||
'<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/protect-partial-content-page-builders/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free#bb">Beaver Builder</a>'
|
||||
);
|
||||
|
||||
// translators: %s: Link to documentation.
|
||||
$pcp_desc = sprintf(
|
||||
'To track Partial Content Protection (PCP) password usage, please get %s and use %s instead.',
|
||||
'<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/extensions/password-statistics/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free">Statistics addon</a>',
|
||||
'<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free">PCP global passwords</a>'
|
||||
);
|
||||
|
||||
// translators: %s: Link to documentation.
|
||||
$pcp_notice = sprintf(
|
||||
'Use %s to %s.',
|
||||
'<a target="_blank" rel="noopener" href="' . admin_url( 'customize.php?autofocus[panel]=ppwp_pcp' ) . '">WordPress Customizer</a>',
|
||||
'<a target="_blank" href="https://passwordprotectwp.com/docs/customize-pcp-form-wordpress-customizer/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free" rel="noopener">customize PCP password form</a>'
|
||||
);
|
||||
$_get = wp_unslash( $_GET ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We no need to handle nonce verification for render UI.
|
||||
$page = isset( $_get['page'] ) ? $_get['page'] : null;
|
||||
$tab = isset( $_get['tab'] ) ? $_get['tab'] : null;
|
||||
$message = 'Great! You’ve successfully copied the shortcode to clipboard.';
|
||||
$use_shortcode_page_builder = ppw_core_get_setting_type_bool_by_option_name( PPW_Constants::USE_SHORTCODE_PAGE_BUILDER, PPW_Constants::SHORTCODE_OPTIONS ) ? 'checked' : '';
|
||||
?>
|
||||
<div class="ppw_main_container" id="ppw_shortcodes_form">
|
||||
<form id="wpp_shortcode_form" method="post">
|
||||
<table class="ppw-pcp-settings ppwp_settings_table" cellpadding="4">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="pda_switch" for="<?php echo esc_attr( PPW_Constants::USE_SHORTCODE_PAGE_BUILDER ); ?>">
|
||||
<input type="checkbox"
|
||||
id="<?php echo esc_attr( PPW_Constants::USE_SHORTCODE_PAGE_BUILDER ); ?>" <?php echo esc_html( $use_shortcode_page_builder ); ?>>
|
||||
<span class="pda-slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<label><?php esc_html_e( 'Use Shortcode within Page Builders', 'password-protect-page' ) ?></label>
|
||||
<?php esc_html_e( 'Allow our shortcode to', 'password-protect-page' ) ?>
|
||||
<?php echo $page_builder_link; // phpcs:ignore -- There are no value to escape on $page_builder_link ?><?php esc_html_e( ' without breaking the page structure.', 'password-protect-page' ) ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php if ( PPW_Asset_Services::is_partial_protection_submenu( $page, $tab ) ) { ?>
|
||||
<div>
|
||||
<div>
|
||||
<h2 style="margin-top: 0;">[ppwp] Shortcode</h2>
|
||||
<p>
|
||||
<?php esc_html_e( 'Use the following shortcode to', 'password-protect-page' ) ?>
|
||||
<a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/password-protect-wordpress-content-sections/?utm_source=user-website&utm_medium=pcp-general-tab&utm_campaign=ppwp-free">
|
||||
<?php esc_html_e( 'lock parts of your content', 'password-protect-page' ) ?></a>.
|
||||
<?php echo $page_builder_desc; // phpcs:ignore -- There are no value to escape on $page_builder_desc ?>
|
||||
</p>
|
||||
<p><?php echo $pcp_desc; // phpcs:ignore -- There are no value to escape on $pcp_desc ?></p>
|
||||
<p><?php echo $pcp_notice; // phpcs:ignore -- There are no value to escape on $pcp_notice?></p>
|
||||
<div class="ppwp-shortcodes-wrap">
|
||||
<textarea
|
||||
onclick="ppwUtils.copy('ppwp-shortcode', '<?php echo esc_attr__( $message, 'password-protect-page' ); ?>', '<?php echo esc_html__('PPWP Lite', 'password-protect-page'); ?>')"
|
||||
id="ppwp-shortcode" style="width: 100%" rows="3" cols="50" readonly>[ppwp passwords="password1 password2" whitelisted_roles="administrator, editor"] Your protected content [/ppwp]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Shortcode Attributes</h2>
|
||||
<p>Below are all attributes available with this shortcode. It's important to note that the shortcode is
|
||||
valid as long as it includes <b>at least</b> one of the <code>required*</code> attributes.</p>
|
||||
<div>
|
||||
<table class="ppw-shortcode-opt-table wp-list-table widefat fixed striped posts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attribute name</th>
|
||||
<th>Possible & Default values</th>
|
||||
<td></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">passwords</code>
|
||||
<p class="description">Shortcode <a target="_blank" href="https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free#define">
|
||||
Inline passwords</a>, which are used to unlock the protected section</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Each password is case-sensitive and no more than 100 characters, but doesn't
|
||||
contain [, ], ", ' and space characters
|
||||
</li>
|
||||
<li>Password(s) are separated by space(s)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>required*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">pwd</code>
|
||||
<p class="description">ID-based <a target="_blank" href="https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free#id">shortcode
|
||||
Global passwords</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Available in PPWP Pro only</li>
|
||||
<li>ID(s) are separated by comma(s)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>required*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">pwd_label</code>
|
||||
<p class="description">Label-based <a target="_blank" href="https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free#label">shortcode
|
||||
Global passwords</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Available in PPWP Pro only</li>
|
||||
<li>Label(s) separated by comma(s)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>required*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">whitelisted_roles</code>
|
||||
<p class="description">Define who can access protected sections directly without
|
||||
entering a password</p>
|
||||
</td>
|
||||
<td>Options: administrator, editor, author, contributor, subscriber</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">hidden_form_text</code>
|
||||
<p class="description"><a target="_blank" href="https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free#label">Hide
|
||||
password form</a> or display a text instead</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Available in PPWP Pro only</li>
|
||||
<li>Empty value or text</li>
|
||||
<li>Accept HTML tags</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">on</code>
|
||||
<p class="description">Show protected content automatically at a set time until the “off” time</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Format: <code>Y-m-d h:i:sa</code></li>
|
||||
<li>Sample: 2020/10/20 14:00:00</li>
|
||||
<li>Without "off" attribute, the content will be public since the “on” time </li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">off</code>
|
||||
<p class="description">Stop showing protected content without entering passwords</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Format: <code>Y-m-d h:i:sa</code></li>
|
||||
<li>Sample: 2020/10/30 14:00:00</li>
|
||||
<li>Require "on" attribute</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">headline</code>
|
||||
<p class="description">Headline of the password form</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>Restricted Content</code></li>
|
||||
<li>Accept HTML tags</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">description</code>
|
||||
<p class="description">Description above password form</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>To view this protected content, enter the password below:</code>
|
||||
</li>
|
||||
<li>Accept HTML tags</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">desc_below_form</code>
|
||||
<p class="description">Description below password form</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>empty</code>
|
||||
</li>
|
||||
<li>Accept HTML tags</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">desc_above_btn</code>
|
||||
<p class="description">Description above password form submit button</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>empty</code>
|
||||
</li>
|
||||
<li>Accept HTML tags (Inline)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">label</code>
|
||||
<p class="description">Label of the password field</p>
|
||||
</td>
|
||||
<td>
|
||||
Default: <code>Password:</code>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">placeholder</code>
|
||||
<p class="description">Placeholder of the password field</p>
|
||||
</td>
|
||||
<td>
|
||||
Default: <code>empty</code>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">loading</code>
|
||||
<p class="description">Loading text of the password form</p>
|
||||
</td>
|
||||
<td>
|
||||
Default: <code>Loading...</code>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">button</code>
|
||||
<p class="description">Button text of the password form</p>
|
||||
</td>
|
||||
<td>
|
||||
Default: <code>Enter</code>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">error_msg</code>
|
||||
<p class="description">The message which is shown when users enter a wrong password</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>Please enter the correct password!</code></li>
|
||||
<li>Accept HTML tags</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">cookie</code>
|
||||
<p class="description">Set cookie expiration time</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Available in PPWP Pro only</li>
|
||||
<li>Count by hours</li>
|
||||
</ul>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">download_limit</code>
|
||||
<p class="description">Set the maximum number of times users can <a target="_blank" href="https://passwordprotectwp.com/docs/how-to-password-protect-files-in-content/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free#download-limit">download
|
||||
a file embedded into content</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Available in PPWP Pro only</li>
|
||||
<li>Count by clicks</li>
|
||||
</ul>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">class</code>
|
||||
<p class="description">Style the password form based on class</p>
|
||||
</td>
|
||||
<td>CSS class name(s) separated by space(s)</td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">id</code>
|
||||
<p class="description">Style the password form based on id</p>
|
||||
</td>
|
||||
<td>Default: <code>empty</code></td>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code class="ppw-shortcode-attr">acf_field</code>
|
||||
<p class="description">Add <a target="_blank" href="https://passwordprotectwp.com/docs/add-additional-fields-pcp-form/?utm_source=user-website&utm_medium=pcp-shortcode-attributes-list&utm_campaign=ppwp-free">additional fields</a> to PCP password form</p>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Default: <code>empty</code></li>
|
||||
<li>Available in PPWP Suite only</li>
|
||||
</ul>
|
||||
<td>optional</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
var ppwUtils=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="./dist/",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(e,t,r){document.getElementById(e).select(),document.execCommand("copy"),toastr&&toastr.success(t,r)};var o=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var n={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let n=!1;window.ppw_general_data?n=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(n=ppw_entire_site_data.ajax_url),n&&e.ajax({url:n,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,n,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})};r.d(t,"copy",function(){return n}),function(e){e(function(){o(e)})}(jQuery)}]);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PPWP Restricted Content Form
|
||||
*/
|
||||
?>
|
||||
<div class="[PPW_FORM_CLASS] ppw-pcp-container" id="[PPW_FORM_ID]">
|
||||
<form method="post" autocomplete="off" action="[PPW_CURRENT_URL]" target="_top" class="post-password-form ppw-form ppw-pcp-password-form" data-submit="[PPW_AUTH]">
|
||||
<div class="ppw-headline ppw-pcp-pf-headline">[PPWP_FORM_HEADLINE]</div>
|
||||
<div class="ppw-description ppw-pcp-pf-desc">[PPWP_FORM_INSTRUCTIONS]</div>
|
||||
[PPWP_FORM_ABOVE_PASSWORD_INPUT]
|
||||
<p class="ppw-input">
|
||||
<input type="hidden" value="[AREA]" name="area" />
|
||||
<label class="ppw-pcp-password-label">[PPWP_FORM_PASSWORD_LABEL] <input placeholder="[PPW_PLACEHOLDER]" type="password" tabindex="1" name="[PPW_AUTH]" class="ppw-password-input ppw-pcp-pf-password-input" autocomplete="new-password">
|
||||
</label>
|
||||
<input class="ppw-page" type="hidden" value="[PPW_PAGE]" />[PPW_CHECKBOX]
|
||||
[SHORTCODE_DESC_ABOVE_BTN]
|
||||
<?php do_action('ppw_pcp_pf_desc_above_btn') ?>
|
||||
<input name="submit" type="submit" data-loading="[PPW_BUTTON_LOADING]" class="ppw-submit ppw-pcp-pf-submit-btn" value="[PPW_BUTTON_LABEL]"/>
|
||||
</p>
|
||||
[PPW_RECAPTCHA_INPUT]
|
||||
<div class="ppw-pcp-pf-desc-below-form">[SHORTCODE_DESC_BELOW_FORM]</div>
|
||||
[PPWP_FORM_BELOW_PASSWORD_INPUT]
|
||||
<div class="ppw-error ppw-pcp-pf-error-msg" style="color: <?php echo esc_attr( PPW_Constants::PPW_ERROR_MESSAGE_COLOR ); ?>">
|
||||
[PPW_ERROR_MESSAGE]
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
$html_link = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">lock parts of your content</a>',
|
||||
'https://passwordprotectwp.com/docs/password-protect-wordpress-content-sections/'
|
||||
);
|
||||
$desc = sprintf(
|
||||
// translators: %s: Link to documentation.
|
||||
esc_html__( 'Use the following shortcode to %s. Set as many passwords as you’d like to.', 'password-protect-page' ),
|
||||
$html_link
|
||||
);
|
||||
$link_shortcode = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">Use our built-in block</a>',
|
||||
'https://passwordprotectwp.com/docs/protect-partial-content-page-builders/?utm_source=user-website&utm_medium=plugin-settings&utm_content=shortcodes'
|
||||
);
|
||||
$message_shortcode = sprintf(
|
||||
// translators: %s: Link to documentation.
|
||||
__( '%s instead if you\'re using popular page builders, e.g. Elementor and Beaver Builder.', 'password-protect-page' ),
|
||||
$link_shortcode
|
||||
);
|
||||
$_get = wp_unslash( $_GET ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We no need to handle nonce verification for render UI.
|
||||
$page = isset( $_get['page'] ) ? $_get['page'] : null;
|
||||
$tab = isset( $_get['tab'] ) ? $_get['tab'] : null;
|
||||
|
||||
|
||||
|
||||
$message_shortcode_desc = '';
|
||||
// Only show this message when user has never installed and activated Pro version. Because we are having this kind of message in PCP Pro tab.
|
||||
if ( ! is_pro_active_and_valid_license() ) {
|
||||
$link_pcp = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">%s</a>',
|
||||
'https://passwordprotectwp.com/docs/manage-shortcode-global-passwords/',
|
||||
__( 'PCP global passwords', 'password-protect-page' )
|
||||
);
|
||||
|
||||
$link_stats_addon = sprintf(
|
||||
'<a target="_blank" rel="noopener" href="%s">%s</a>',
|
||||
'https://passwordprotectwp.com/extensions/password-statistics/',
|
||||
__( 'Statistics addon', 'password-protect-page' )
|
||||
);
|
||||
|
||||
$message_shortcode_desc = sprintf(
|
||||
/* translators: %1$s: Statistics link*/
|
||||
__( 'To track Partial Content Protection (PCP) password usage, please get %1$s and use %2$s instead.', 'password-protect-page' ),
|
||||
$link_stats_addon,
|
||||
$link_pcp
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$message = 'Great! You’ve successfully copied the shortcode to clipboard.';
|
||||
$use_shortcode_page_builder = ppw_core_get_setting_type_bool_by_option_name( PPW_Constants::USE_SHORTCODE_PAGE_BUILDER, PPW_Constants::SHORTCODE_OPTIONS ) ? 'checked' : '';
|
||||
|
||||
?>
|
||||
<div class="ppw_main_container" id="ppw_shortcodes_form">
|
||||
<form id="wpp_shortcode_form" method="post">
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<?php do_action( PPW_Constants::HOOK_SHORTCODE_SETTINGS_EXTENDS ); ?>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Dynamic Sidebar
|
||||
*
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="ppw_wrap_subscribe_form" id="ppwp_right_column_metaboxes">
|
||||
<?php
|
||||
|
||||
/* if transient is empty */
|
||||
if ( false === ( $ppwp_sidebar_content = get_transient( 'ppwp_sidebar_content' ) ) ) {
|
||||
|
||||
$response = wp_remote_get( PPWP_SIDEBAR_API );
|
||||
if ( is_array( $response ) && ! is_wp_error( $response ) ) {
|
||||
|
||||
$json = json_decode( $response['body'] );
|
||||
|
||||
$section_1 = !empty( $json->section_1 ) ? stripslashes( $json->section_1 ) : '';
|
||||
$section_2 = !empty( $json->section_2 ) ? stripslashes( $json->section_2 ) : '';
|
||||
$section_3 = !empty( $json->section_3 ) ? stripslashes( $json->section_3 ) : '';
|
||||
$ppwp_fss_expire = !empty( $json->ppwp_fss_expire ) ? (int) $json->ppwp_fss_expire : 1;
|
||||
|
||||
/* set the transient by api response */
|
||||
set_transient( 'ppwp_sidebar_content', $response['body'], DAY_IN_SECONDS * $ppwp_fss_expire );
|
||||
|
||||
if( !empty( $section_1 ) ){
|
||||
echo '<div class="main_container ppwp-section-1">'.$section_1.'</div>';
|
||||
}
|
||||
|
||||
if( !empty( $section_2 ) ){
|
||||
echo '<div class="main_container ppwp-section-2">'.$section_2.'</div>';
|
||||
}
|
||||
|
||||
if( !empty( $section_3 ) ){
|
||||
echo '<div class="main_container ppwp-section-3">'.$section_3.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* if transient is not empty */
|
||||
$response = get_transient( 'ppwp_sidebar_content' );
|
||||
$json = json_decode( $response );
|
||||
|
||||
if ( !empty( $json ) ) {
|
||||
|
||||
$section_1 = !empty( $json->section_1 ) ? stripslashes( $json->section_1 ) : '';
|
||||
$section_2 = !empty( $json->section_2 ) ? stripslashes( $json->section_2 ) : '';
|
||||
$section_3 = !empty( $json->section_3 ) ? stripslashes( $json->section_3 ) : '';
|
||||
|
||||
if( !empty( $section_1 ) ){
|
||||
echo '<div class="main_container ppwp-section-1">'.$section_1.'</div>';
|
||||
}
|
||||
|
||||
if( !empty( $section_2 ) ){
|
||||
echo '<div class="main_container ppwp-section-2">'.$section_2.'</div>';
|
||||
}
|
||||
|
||||
if( !empty( $section_3 ) ){
|
||||
echo '<div class="main_container ppwp-section-3">'.$section_3.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/**
|
||||
* Troubleshooting Tab
|
||||
*/
|
||||
?>
|
||||
<div class="ppw_main_container wp_troubleshoot_tab">
|
||||
<table class="ppwp_settings_table" cellpadding="4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="ppw-troubleshoot-header">
|
||||
<h3><?php esc_html_e( 'WordPress password protected page not working', PPW_Constants::DOMAIN ); ?></h3>
|
||||
<span><?php esc_html_e( 'Please follow the troubleshooting process below in case the password protection is not working on your website.', PPW_Constants::DOMAIN ); ?></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<h2><?php esc_html_e( 'Which types of content do you want to password protect?', PPW_Constants::DOMAIN ); ?></h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="ppw-radio-container">
|
||||
<input type="radio" name="level0" value="A" id="A" />
|
||||
<label for="A">Entire site</label>
|
||||
<div class="sub">
|
||||
<p><?php esc_html_e( 'This feature is available on both PPWP Free and Pro versions.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<p><?php esc_html_e( 'Check out ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/password-protect-entire-wordpress-site/">
|
||||
<?php esc_html_e( 'Password Protect Entire WordPress Site', PPW_Constants::DOMAIN ); ?></a>
|
||||
<?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ppw-radio-container">
|
||||
<input type="radio" name="level0" value="B" id="B" />
|
||||
<label for="B"><?php esc_html_e( 'Individual content, e.g. posts and pages', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub">
|
||||
<h3><?php esc_html_e( 'Which post types do you want to protect?', PPW_Constants::DOMAIN ); ?></h3>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="B0" id="B0" />
|
||||
<label for="B0">Posts</label>
|
||||
<div class="sub">
|
||||
<p><?php esc_html_e( 'Available on PPWP Free.', PPW_Constants::DOMAIN ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="" id="CPT" />
|
||||
<label for="CPT">Custom post types</label>
|
||||
<div class="sub">
|
||||
<p><?php esc_html_e( 'Available on PPWP Pro.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<p><?php esc_html_e( 'Check out how to ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/password-protect-wordpress-custom-post-types/">
|
||||
<?php esc_html_e( 'Password protect WordPress custom post types', PPW_Constants::DOMAIN ); ?></a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="B3" id="B3" />
|
||||
<label for="B3"><?php esc_html_e( 'Pages or content created by Page builder plugins', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub">
|
||||
<h3><?php esc_html_e( 'Which template are you using?', PPW_Constants::DOMAIN ); ?></h3>
|
||||
<p style="margin-bottom: 1rem"><?php esc_html_e( 'To determine what template you\'re using, check out selected template under “Page Attributes” section in editor page.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level3" value="B5" id="B5" />
|
||||
<label for="B5">Custom template</label>
|
||||
<div class="sub">
|
||||
<p><?php esc_html_e( 'WordPress and our plugin’s password protection feature works well with the default
|
||||
WordPress template, making use of the_content(), but not on a custom page template. Check out ', PPW_Constants::DOMAIN ); ?>
|
||||
<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/password-protect-wordpress-custom-page-template/">
|
||||
<?php esc_html_e( 'how to password protect WordPress custom page template', PPW_Constants::DOMAIN ); ?></a>
|
||||
<?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level3" value="B6" id="B6" />
|
||||
<label for="B6"><?php esc_html_e( 'WordPress default template', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub">
|
||||
<p><?php esc_html_e( 'It should be working with our PPWP Free version. Otherwise, please ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/support/"><?php esc_html_e( 'drop us a support request', PPW_Constants::DOMAIN ); ?></a>.
|
||||
<?php esc_html_e( ' We will be more than happy to help.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ppw-radio-container">
|
||||
<input type="radio" name="level0" value="B0" id="ACF" />
|
||||
<label for="ACF"><?php esc_html_e( 'ACF & WordPress custom fields', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub">
|
||||
<h3><?php esc_html_e( 'How do you want to protect your custom fields content?', PPW_Constants::DOMAIN ); ?></h3>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="C0" id="C0" />
|
||||
<label for="C0"><?php esc_html_e( 'Hide the entire custom fields under password form', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub2">
|
||||
<p><?php esc_html_e( 'This feature is available on both PPWP Free and Pro versions.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<p>
|
||||
<?php esc_html_e( 'By default, WordPress in general and our PPWP plugin in particular only protect
|
||||
a post’s content and excerpt. Their custom field data is not protected. In order
|
||||
to hide custom fields under password form, check out', PPW_Constants::DOMAIN ); ?>
|
||||
<a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/password-protect-wordpress-custom-page-template/">
|
||||
<?php esc_html_e( 'Password Protect WordPress Custom Fields', PPW_Constants::DOMAIN ); ?></a><?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="C1" id="C1" />
|
||||
<label for="C1"><?php esc_html_e( 'Protect part of custom field content', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub2">
|
||||
<p><?php esc_html_e( 'This feature is available on PPWP Pro only.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<p><?php esc_html_e( 'You will need to use our shortcode under your custom fields. Check out ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/how-to-password-protect-partial-content-custom-fields/">
|
||||
<?php esc_html_e( ' How to Password Protect Partial Content under Custom Fields', PPW_Constants::DOMAIN); ?></a>
|
||||
<?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ppw-radio-container">
|
||||
<input type="radio" name="level0" value="C" id="C" />
|
||||
<label for="C"><?php esc_html_e( 'Part of content, e.g. some content sections', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub1">
|
||||
<h3><?php esc_html_e( 'Where do you use our shortcode?', PPW_Constants::DOMAIN ); ?></h3>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="C0" id="PC0" />
|
||||
<label for="PC0">Page builders</label>
|
||||
<div class="sub2">
|
||||
<p><?php esc_html_e( 'Our shortcode is supported on top page builders such as Elementor, Beaver Builder
|
||||
and Divi Builder. Check out ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/protect-partial-content-page-builders/">
|
||||
<?php esc_html_e( 'how to password protect parts of content with WordPress page builders', PPW_Constants::DOMAIN ); ?></a>
|
||||
<?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="C1" id="PC1" />
|
||||
<label for="PC1">Custom post types</label>
|
||||
<div class="sub2">
|
||||
<p><?php esc_html_e( 'Available on PPWP Pro.', PPW_Constants::DOMAIN ); ?></p>
|
||||
<p><?php esc_html_e( 'Check this out on how to ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/password-protect-wordpress-custom-post-types/">
|
||||
<?php esc_html_e( 'Password protect WordPress custom post types', PPW_Constants::DOMAIN ); ?></a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-detail">
|
||||
<input type="radio" name="level1" value="C2" id="C2" />
|
||||
<label for="C2"><?php esc_html_e( 'ACF or WordPress custom fields', PPW_Constants::DOMAIN ); ?></label>
|
||||
<div class="sub2">
|
||||
<p><?php esc_html_e( 'Available on PPWP Pro.' ); ?></p>
|
||||
<p><?php esc_html_e( 'In order to place our shortcode under custom fields, check out ', PPW_Constants::DOMAIN ); ?><a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/how-to-password-protect-partial-content-custom-fields/">
|
||||
<?php esc_html_e( 'How to Password Protect Partial Content under Custom Fields', PPW_Constants::DOMAIN ); ?></a>
|
||||
<?php esc_html_e( ' for more information.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<h2>Checklist</h2>
|
||||
</td>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="ppw_troubleshoot_checklist">
|
||||
<ul>
|
||||
<li><?php echo wp_kses_post( __( 'Are you using <strong>the latest version</strong> of both Password Protect WordPress (PPWP) Free and Pro?', PPW_Constants::DOMAIN ) ); ?>
|
||||
</li>
|
||||
<li><?php esc_html_e( 'Are you using any caching methods?', PPW_Constants::DOMAIN ); ?></li>
|
||||
<li style="list-style: none"><?php esc_html_e( 'By default, both our Free and Pro versions ', PPW_Constants::DOMAIN ); ?>
|
||||
<a target="_blank" rel="noopener" href="https://passwordprotectwp.com/docs/caching-plugins-cache-servers-integration/?utm_source=user-website&utm_medium=settings-troubleshooting-tab&utm_campaign=ppwp-free">
|
||||
<?php esc_html_e( 'work well with popular cache plugins', PPW_Constants::DOMAIN ); ?></a>,
|
||||
<?php esc_html_e( 'including W3 Total Cache, WP Super Cache, and WP Fastest Cache.
|
||||
If you are using other cache plugins or server caching, please exclude our plugins
|
||||
cookies from being cached or ' ) ?><a target="_blank" rel="noopener" href="https://passwordprotectwp.com/support/?utm_source=user-website&utm_medium=settings-troubleshooting-tab&utm_campaign=ppwp-free">
|
||||
<?php esc_html_e( 'contact us for support', PPW_Constants::DOMAIN ); ?></a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-input"><span class="feature-input"></span></td>
|
||||
<td>
|
||||
<h2><?php esc_html_e( 'Other Questions', PPW_Constants::DOMAIN ); ?></h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="ppw-collapse-question">
|
||||
<div class="ppw-collapse-title">
|
||||
<?php esc_html_e( 'What if I want to show excerpts & featured images of protected content?' , PPW_Constants::DOMAIN ); ?>
|
||||
</div>
|
||||
<div class="ppw-collapse-content">
|
||||
<p><?php esc_html_e( 'Available on PPWP Pro. You will need to modfiy your child theme code with our Free version.', PPW_Constants::DOMAIN ); ?>
|
||||
</p>
|
||||
<p><?php esc_html_e( 'Most of WordPress themes will hide the post excerpt and featured image of password protected content by default. Check out ', PPW_Constants::DOMAIN ); ?>
|
||||
<a target="_blank" rel="noopener"
|
||||
href="https://passwordprotectwp.com/docs/display-featured-image-password-protected-excerpt/">
|
||||
<?php esc_html_e( 'how to show exceprt and featured image of password protected content', PPW_Constants::DOMAIN ); ?></a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user