'pfm',
'google' => 'gfm',
'free' => 'glfree',
];
/**
* Generates the main part of the Support page.
*
* @since 3.2.0
*/
public function display() {
$this->add_data_storage();
$this->support_page();
}
/**
* Renders the Support page.
*/
private function support_page() {
echo '
';
}
/**
* Renders the content of the Support page.
*/
private function support_content() {
$this->getting_started_card();
$this->user_guide_card();
$this->need_support_card();
if ( 'free' === WPPFM_PLUGIN_VERSION_ID ) { // The check-in card is only for the free version
$this->get_google_shopping_checklist_card();
$this->google_shopping_checklist_popup();
}
$this->show_your_love_card();
$this->documentation_card();
// $this->join_our_community_card(); // Switched off until the community funnel is ready
$this->join_our_facebook_group_card();
$this->request_a_feature_card();
}
/**
* Renders the card header of a card for the Support page.
*
* @param string $header_text the header of the card.
*/
private function card_header( $header_text ) {
echo
'
' . esc_html( $header_text ) . '
';
}
/**
* Renders the content part of a card for the Support page.
*
* @param string $content_html the content of the card.
*/
private function card_content( $content_html ) {
$allowed_tags = array(
'p' => array(),
'div' => array(
'class' => array(),
'id' => array(),
),
'iframe' => array(
'src' => array(),
'class' => array(),
'target' => array(),
'id' => array(),
),
'ul' => array(),
'li' => array(),
'a' => array(
'class' => array(),
'id' => array(),
'href' => array(),
'target' => array(),
),
'input' => array(
'class' => array(),
'name' => array(),
'id' => array(),
'type' => array(),
'placeholder' => array(),
),
);
echo
'
' .
wp_kses( $content_html, $allowed_tags ) .
'
';
}
/**
* Renders a card icon for the Support page.
*
* @param $icon
*
* @return void
*/
private function card_icon( $icon = null ): void {
if ( null === $icon ) {
return;
}
echo
'
';
}
/**
* Renders the action part of a card in the Support page.
*
* @param string $action_text the action text.
* @param string $action_url the action url.
*/
private function card_action( $action_text, $action_url ) {
$card_action_id = 'wppfm-' . str_replace( ' ', '-', strtolower( $action_text ) ) . '-button';
echo
'';
}
/**
* Renders a getting started card for the Support page.
*/
private function getting_started_card() {
$content_html = '
' . esc_html__( 'Getting started with your WooCommerce Product Feed Manager is easier than you could imagine. All our customers are not feed marketeers and we want to make your life easier.', 'wp-product-feed-manager' ) . '
';
$content_html .= '
';
$content_html .= '';
$content_html .= '
';
echo '
';
$this->card_header( esc_html__( 'Getting Started With Product Feed Manager', 'wp-product-feed-manager' ) );
$this->card_content( $content_html );
echo '
';
}
/**
* Renders a user guide card for the Support page.
*/
private function user_guide_card() {
$sanitized_edd_store_url = esc_url( WPPFM_EDD_SL_STORE_URL );
$content_html = '
' . esc_html__( 'Please check the following articles to get started with your WooCommerce Product Feed Manager.', 'wp-product-feed-manager' ) . '
';
}
/**
* Renders a pop-up card that acknowledges the user's subscription to the Free Google Shopping Checklist.
*
* @since 3.11.0
*/
private function google_shopping_checklist_popup() {
$first_centence_html = __( 'Thank you for requesting the Google Shopping Checklist: The Complete Guide. Please check your email for the download link.', 'wp-product-feed-manager' );
$second_centence_html = __( 'If you don\'t see it in your inbox, kindly check your spam or junk folder.', 'wp-product-feed-manager' );
echo '
';
}
/**
* Renders a Show your Love card for the Support page.
*/
private function show_your_love_card() {
$content_html = '
' . esc_html__( 'We need your help to keep developing the plugin. Please review it and spread the love to keep us motivated.', 'wp-product-feed-manager' ) . '
';
// }
/**
* Renders the Join Our Facebook Group card for the Support page.
*
* @since 3.14.0.
*/
private function join_our_facebook_group_card() {
$content_html = '
' . esc_html__( 'Join our Facebook page for free expert marketing tips and strategies to boost your web shop sales!', 'wp-product-feed-manager' ) . '
';
}
/**
* Renders the Request a feature card for the Settings page.
*/
private function request_a_feature_card() {
$content_html = '
' . esc_html__( 'If you need any feature on your WooCommerce Product Feed Manager that we currently do not have, please send us a request with your wishes and requirements.', 'wp-product-feed-manager' ) . '
';
}
/**
* Stores data in the DOM for the Feed Manager Settings page
*
* @since 3.11.0 - Added the first-name and last-name data.
*/
private function add_data_storage() {
$current_user = wp_get_current_user();
echo
'