WordPressプラグイン指摘事項修正

This commit is contained in:
2024-07-19 18:42:09 +09:00
parent 1390e315a6
commit 961a591e61
6 changed files with 44 additions and 30 deletions
@@ -3,9 +3,9 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! class_exists( 'cnv_protection_txt' ) ) {
if ( ! class_exists( 'conv_protection_txt' ) ) {
class cnv_protection_txt {
class conv_protection_txt {
public function __construct() {
add_action( 'admin_menu', array( $this, 'add_pages' ) );
@@ -27,17 +27,17 @@ if ( ! class_exists( 'cnv_protection_txt' ) ) {
}
public function show_text_option_page() {
$update_option = filter_input( INPUT_POST, '_cnv_protect_options', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
$update_option = filter_input( INPUT_POST, 'conv_protection_options', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
if ( ! empty( $update_option ) ) {
check_admin_referer( 'cnv_options' );
update_option( '_cnv_protect_options', $update_option );
include_once cnv_protection_txt_settings::TEMPLATE_DIR . 'success.php';
check_admin_referer( 'conv_options' );
update_option( 'conv_protection_options', $update_option );
include_once conv_protection_txt_settings::TEMPLATE_DIR . 'success.php';
}
include_once cnv_protection_txt_settings::TEMPLATE_DIR . 'cnv_protection_txt_form.php';
include_once conv_protection_txt_settings::TEMPLATE_DIR . 'conv_protection_txt_form.php';
}
public function edit_protected_word( $text ) {
$opt = get_option( '_cnv_protect_options' );
$opt = get_option( 'conv_protection_options' );
if ( isset( $opt['flag'] ) && $opt['flag'] == 2 ) {
return '%s';
}
@@ -47,21 +47,21 @@ if ( ! class_exists( 'cnv_protection_txt' ) ) {
//パスワード保護時のメッセージ
public function protect_password_form( $form_text ): string {
$opt = get_option( '_cnv_protect_options' );
$opt = get_option( 'conv_protection_options' );
if ( isset( $opt['text'] ) && ! empty( $opt['text'] ) ) {
$alert_text = $opt['text'];
} else {
$alert_text = cnv_protection_txt_settings::ALERT_TEXT;
$alert_text = conv_protection_txt_settings::ALERT_TEXT;
}
if ( isset( $opt['label'] ) && ! empty( $opt['label'] ) ) {
$btn_label = $opt['label'] . ' : ';
} else {
$btn_label = cnv_protection_txt_settings::BTN_LABEL . ' : ';
$btn_label = conv_protection_txt_settings::BTN_LABEL . ' : ';
}
if ( isset( $opt['btn'] ) && ! empty( $opt['btn'] ) ) {
$btn_text = $opt['btn'];
} else {
$btn_text = cnv_protection_txt_settings::BTN_TEXT;
$btn_text = conv_protection_txt_settings::BTN_TEXT;
}
return '
@@ -4,9 +4,9 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! class_exists( 'cnv_protection_txt_settings' ) ) {
if ( ! class_exists( 'conv_protection_txt_settings' ) ) {
class cnv_protection_txt_settings{
class conv_protection_txt_settings{
const ALERT_TEXT = 'このコンテンツはパスワードで保護されています。閲覧するには以下にパスワードを入力してください。';
const BTN_LABEL = 'パスワード';