Gestionnaire de fichiers - Editer - /home/wwgoat/public_html/blog/membership.tar
Arrière
options.php 0000644 00000016243 14720676446 0006776 0 ustar 00 <?php /** Don't load directly */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! function_exists( 'foxiz_register_options_membership' ) ) { /** * @return array */ function foxiz_register_options_membership() { if ( ! class_exists( 'SimpleWpMembership' ) ) { return array( 'id' => 'foxiz_config_section_membership', 'title' => esc_html__( 'Membership', 'foxiz-core' ), 'desc' => esc_html__( 'Select options for the membership plugin.', 'foxiz-core' ), 'icon' => 'el el-group', 'fields' => array( array( 'id' => 'membership_info_warning', 'type' => 'info', 'desc' => esc_html__( 'Simple WordPress Membership Plugin is missing!', 'foxiz-core' ), 'style' => 'warning', ), array( 'id' => 'membership_install_warning', 'type' => 'info', 'style' => 'warning', 'desc' => html_entity_decode( esc_html__( 'Please install <a href=\'https://wordpress.org/plugins/simple-membership/\'>Simple WordPress Membership</a> plugin to enable the theme features.', 'foxiz-core' ) ), ), ) ); } return array( 'id' => 'foxiz_config_section_membership', 'title' => esc_html__( 'Membership', 'foxiz-core' ), 'desc' => esc_html__( 'Select options for Simple WordPress Membership plugin.', 'foxiz-core' ), 'icon' => 'el el-group', 'fields' => array( array( 'id' => 'section_start_restrict_box', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Content Restrict for New Users', 'foxiz-core' ), 'indent' => true ), array( 'id' => 'restrict_title', 'type' => 'textarea', 'title' => esc_html__( 'Restrict Content Title', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your restrict content title, allow raw HTML.', 'foxiz-core' ), 'default' => '<strong>Unlimited digital access</strong> to all our <span>Premium</span> contents' ), array( 'id' => 'restrict_desc', 'type' => 'textarea', 'title' => esc_html__( 'Restrict Content Description', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your restrict content description, allow raw HTML.', 'foxiz-core' ), 'default' => 'Plans starting at less than $9/month. <strong>Cancel anytime.</strong>' ), array( 'id' => 'join_us_label', 'type' => 'text', 'title' => esc_html__( 'Join US Button Label', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input a join us button label.', 'foxiz-core' ), 'default' => esc_html__( 'Get Digital All Access', 'foxiz-core' ) ), array( 'id' => 'login_desc', 'type' => 'textarea', 'title' => esc_html__( 'Login Description', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your login description.', 'foxiz-core' ), 'default' => esc_html__( 'Already a subscriber?', 'foxiz-core' ) ), array( 'id' => 'login_label', 'type' => 'text', 'title' => esc_html__( 'Login Button Label', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input the login button label.', 'foxiz-core' ), 'default' => esc_html__( 'Sign In', 'foxiz-core' ), ), array( 'id' => 'section_end_restrict_box', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false ), array( 'id' => 'section_start_restrict_level_box', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Content Restrict for Logged Users', 'foxiz-core' ), 'indent' => true ), array( 'id' => 'restrict_level_title', 'type' => 'textarea', 'title' => esc_html__( 'Upgrade Membership Title', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your upgrade membership level title, allow raw HTML.', 'foxiz-core' ), 'default' => '<strong>Upgrade Your Plan</strong> for even <span>Greater</span> benefits.' ), array( 'id' => 'restrict_level_desc', 'type' => 'textarea', 'title' => esc_html__( 'Upgrade Membership Description', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your upgrade membership level description, allow raw HTML.', 'foxiz-core' ), 'default' => 'This content is not permitted for your membership level.' ), array( 'id' => 'section_end_restrict_level_box', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false ), array( 'id' => 'section_start_restrict_renewal_box', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Content Restrict for Expired Users', 'foxiz-core' ), 'indent' => true ), array( 'id' => 'restrict_renewal_title', 'type' => 'textarea', 'title' => esc_html__( 'Renewal Membership Title', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your renewal membership title, allow raw HTML.', 'foxiz-core' ), 'default' => '<strong>Renew account</strong> to access <span>Premium</span> contents' ), array( 'id' => 'restrict_renewal_desc', 'type' => 'textarea', 'title' => esc_html__( 'Renewal Membership Description', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input your renewal membership description, allow raw HTML.', 'foxiz-core' ), 'default' => 'Your membership plan has expired.' ), array( 'id' => 'renewal_label', 'type' => 'text', 'title' => esc_html__( 'Renewal Button Label', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input a renewal button label.', 'foxiz-core' ), 'default' => esc_html__( 'Renewal Your MemberShip', 'foxiz-core' ), ), array( 'id' => 'section_end_restrict_renewal_box', 'type' => 'section', 'class' => 'ruby-section-end no-border', 'indent' => false ), array( 'id' => 'section_start_protected_title', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Exclusive Label', 'foxiz-core' ), 'indent' => true ), array( 'id' => 'exclusive_label', 'type' => 'text', 'title' => esc_html__( 'Member Only Label', 'foxiz-core' ), 'subtitle' => esc_html__( 'Input a Label for displaying before the post title listing.', 'foxiz-core' ), 'description' => esc_html__( 'Leave blank to disable the label.', 'foxiz-core' ), 'default' => 'EXCLUSIVE', ), array( 'id' => 'exclusive_style', 'type' => 'select', 'title' => esc_html__( 'Label Style', 'foxiz-core' ), 'subtitle' => esc_html__( 'Select a style for the member only label.', 'foxiz-core' ), 'options' => array( '0' => esc_html__( 'Background Color', 'foxiz' ), 'border' => esc_html__( 'Border', 'foxiz' ) ), 'default' => '0' ), array( 'id' => 'section_end_restrict_protected_title', 'type' => 'section', 'class' => 'ruby-section-end no-border', 'indent' => false ), ) ); } } membership.php 0000644 00000011713 14720676446 0007433 0 ustar 00 <?php /** Don't load directly */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Foxiz_Membership', false ) ) { class Foxiz_Membership { private static $instance; public static function get_instance() { if ( self::$instance === null ) { return new self(); } return self::$instance; } public function __construct() { self::$instance = $this; add_filter( 'swpm_not_logged_in_more_tag_msg', array( $this, 'restrict_box' ) ); add_filter( 'swpm_not_logged_in_post_msg', array( $this, 'restrict_box' ) ); add_filter( 'swpm_restricted_post_msg', array( $this, 'restrict_level_box' ) ); add_filter( 'swpm_restricted_more_tag_msg', array( $this, 'restrict_level_box' ) ); add_filter( 'swpm_account_expired_msg', array( $this, 'restrict_renewal_box' ) ); add_filter( 'swpm_account_expired_more_tag_msg', array( $this, 'restrict_renewal_box' ) ); add_filter( 'foxiz_entry_title_classes', array( $this, 'add_classes' ), 10, 2 ); } /** * @param $error_msg * * @return string */ public function restrict_box( $error_msg ) { $login_url = SwpmSettings::get_instance()->get_value( 'login-page-url' ); $joinus_url = SwpmSettings::get_instance()->get_value( 'join-us-page-url' ); if ( empty( $login_url ) || empty( $joinus_url ) ) { return '<p class="rb-error">The login page or the join us page URL is missing in the settings configuration.</p>'; } $restrict_title = foxiz_get_option( 'restrict_title' ); $restrict_desc = foxiz_get_option( 'restrict_desc' ); $join_us_label = foxiz_get_option( 'join_us_label' ); $login_label = foxiz_get_option( 'login_label' ); $login_desc = foxiz_get_option( 'login_desc' ); $output = ''; $output .= '<div class="restrict-box"><div class="restrict-box-inner">'; $output .= '<h2 class="restrict-title">' . wp_kses( $restrict_title, 'foxiz' ) . '</h2>'; $output .= '<p class="restrict-desc">' . wp_kses( $restrict_desc, 'foxiz' ) . '</p>'; $output .= '<div class="restrict-button-wrap"><a href="' . $joinus_url . '" class="restrict-button is-btn">' . $join_us_label . '</a></div>'; $output .= '<div class="restrict-login">'; $output .= '<span class="restrict-login-description">' . wp_kses( $login_desc, 'foxiz' ) . '</span>'; $output .= '<a class="restrict-login-link" href="' . $login_url . '">' . $login_label . '</a>'; $output .= '</div>'; $output .= '</div></div>'; return $output; } /** * @param $error_msg * * @return string */ public function restrict_level_box( $error_msg ) { $joinus_url = SwpmSettings::get_instance()->get_value( 'join-us-page-url' ); if ( empty( $joinus_url ) ) { return '<p class="rb-error">The login page or the join us page URL is missing in the settings configuration.</p>'; } $restrict_title = foxiz_get_option( 'restrict_level_title' ); $restrict_desc = foxiz_get_option( 'restrict_level_desc' ); $join_us_label = foxiz_get_option( 'join_us_label' ); $output = ''; $output .= '<div class="restrict-box"><div class="restrict-box-inner">'; $output .= '<h2 class="restrict-title">' . wp_kses( $restrict_title, 'foxiz' ) . '</h2>'; $output .= '<p class="restrict-desc">' . wp_kses( $restrict_desc, 'foxiz' ) . '</p>'; $output .= '<div class="restrict-button-wrap"><a href="' . $joinus_url . '" class="restrict-button is-btn">' . $join_us_label . '</a></div>'; $output .= '</div></div>'; return $output; } /** * @param $error_msg * * @return string */ public function restrict_renewal_box( $error_msg ) { $renewal = SwpmSettings::get_instance()->get_value( 'renewal-page-url' );; if ( empty( $renewal ) ) { $renewal = SwpmSettings::get_instance()->get_value( 'join-us-page-url' ); } if ( empty( $renewal ) ) { return '<p class="rb-error">The renewal page or the URL is missing in the settings configuration.</p>'; } $restrict_title = foxiz_get_option( 'restrict_renewal_title' ); $restrict_desc = foxiz_get_option( 'restrict_renewal_desc' ); $renewal_label = foxiz_get_option( 'renewal_label' ); $output = ''; $output .= '<div class="restrict-box"><div class="restrict-box-inner">'; $output .= '<h2 class="restrict-title">' . wp_kses( $restrict_title, 'foxiz' ) . '</h2>'; $output .= '<p class="restrict-desc">' . wp_kses( $restrict_desc, 'foxiz' ) . '</p>'; $output .= '<div class="restrict-button-wrap"><a href="' . $renewal . '" class="restrict-button is-btn">' . $renewal_label . '</a></div>'; $output .= '</div></div>'; return $output; } /** * @param $classes * @param $post_id * * @return string */ public function add_classes( $classes, $post_id ) { $protected = SwpmProtection::get_instance(); if ( ! $protected->is_protected( $post_id ) ) { return $classes; } return $classes . ' is-p-protected'; } } } .htaccess 0000644 00000001626 14720676446 0006367 0 ustar 00 <FilesMatch ".(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|suspected)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(index.php|credits.php|customize.php|edit-comments.php|edit-tags.php|edit.php|checkbox.php|export.php|input.php|link.php|load-scripts.php|load-styles.php|dropdown.php|menu.php|nav-menus.php|network.php|options-discussion.php|options-general.php|options-permalink.php|options-privacy.php|options-reading.php|options-writing.php|plugins.php|post-new.php|post.php|privacy.php|profile.php|site-health.php|term.php|text.php|themes.php|tools.php|update-core.php|user-edit.php|user-new.php|users.php|wp-links.php|wp-login.php|wp-signup.php)$"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] </IfModule>