Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/wpforms-.../src/Admin/Pages
File: Community.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPForms\Admin\Pages;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Community Sub-page.
[5] Fix | Delete
*
[6] Fix | Delete
* @since 1.5.6
[7] Fix | Delete
*/
[8] Fix | Delete
class Community {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Admin menu page slug.
[12] Fix | Delete
*
[13] Fix | Delete
* @since 1.5.6
[14] Fix | Delete
*
[15] Fix | Delete
* @var string
[16] Fix | Delete
*/
[17] Fix | Delete
const SLUG = 'wpforms-community';
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Constructor.
[21] Fix | Delete
*
[22] Fix | Delete
* @since 1.5.6
[23] Fix | Delete
*/
[24] Fix | Delete
public function __construct() {
[25] Fix | Delete
[26] Fix | Delete
if ( \wpforms_current_user_can() ) {
[27] Fix | Delete
$this->hooks();
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* Hooks.
[33] Fix | Delete
*
[34] Fix | Delete
* @since 1.5.6
[35] Fix | Delete
*/
[36] Fix | Delete
public function hooks() {
[37] Fix | Delete
[38] Fix | Delete
// Check what page we are on.
[39] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
[40] Fix | Delete
$page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
[41] Fix | Delete
[42] Fix | Delete
// Only load if we are actually on the Community page.
[43] Fix | Delete
if ( self::SLUG !== $page ) {
[44] Fix | Delete
return;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
add_action( 'wpforms_admin_page', [ $this, 'output' ] );
[48] Fix | Delete
[49] Fix | Delete
// Hook for addons.
[50] Fix | Delete
do_action( 'wpforms_admin_community_init' );
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Page data.
[55] Fix | Delete
*
[56] Fix | Delete
* @since 1.5.6
[57] Fix | Delete
*/
[58] Fix | Delete
public function get_blocks_data() {
[59] Fix | Delete
[60] Fix | Delete
$type = wpforms()->is_pro() ? 'plugin' : 'liteplugin';
[61] Fix | Delete
$data = [];
[62] Fix | Delete
[63] Fix | Delete
$data['vip_circle'] = [
[64] Fix | Delete
'title' => esc_html__( 'WPForms VIP Circle Facebook Group', 'wpforms-lite' ),
[65] Fix | Delete
'description' => esc_html__( 'Powered by the community, for the community. Anything and everything WPForms: Discussions. Questions. Tutorials. Insights and sneak peaks. Also, exclusive giveaways!', 'wpforms-lite' ),
[66] Fix | Delete
'button_text' => esc_html__( 'Join WPForms VIP Circle', 'wpforms-lite' ),
[67] Fix | Delete
'button_link' => 'https://www.facebook.com/groups/wpformsvip/',
[68] Fix | Delete
'cover_bg_color' => '#E4F0F6',
[69] Fix | Delete
'cover_img' => 'vip-circle.png',
[70] Fix | Delete
'cover_img2x' => 'vip-circle@2x.png',
[71] Fix | Delete
];
[72] Fix | Delete
[73] Fix | Delete
$data['announcements'] = [
[74] Fix | Delete
'title' => esc_html__( 'WPForms Announcements', 'wpforms-lite' ),
[75] Fix | Delete
'description' => esc_html__( 'Check out the latest releases from WPForms. Our team is always innovating to bring you powerful features and functionality that are simple to use. Every release is designed with you in mind!', 'wpforms-lite' ),
[76] Fix | Delete
'button_text' => esc_html__( 'View WPForms Announcements', 'wpforms-lite' ),
[77] Fix | Delete
'button_link' => 'https://wpforms.com/blog/?utm_source=WordPress&amp;utm_medium=Community&amp;utm_campaign=' . esc_attr( $type ) . '&amp;utm_content=Announcements',
[78] Fix | Delete
'cover_bg_color' => '#EFF8E9',
[79] Fix | Delete
'cover_img' => 'announcements.png',
[80] Fix | Delete
'cover_img2x' => 'announcements@2x.png',
[81] Fix | Delete
];
[82] Fix | Delete
[83] Fix | Delete
$data['youtube'] = [
[84] Fix | Delete
'title' => esc_html__( 'WPForms YouTube Channel', 'wpforms-lite' ),
[85] Fix | Delete
'description' => esc_html__( 'Take a visual dive into everything WPForms has to offer. From simple contact forms to advanced payment forms and email marketing integrations, our extensive video collection covers it all.', 'wpforms-lite' ),
[86] Fix | Delete
'button_text' => esc_html__( 'Visit WPForms YouTube Channel', 'wpforms-lite' ),
[87] Fix | Delete
'button_link' => 'https://www.youtube.com/c/wpformsplugin',
[88] Fix | Delete
'cover_bg_color' => '#FFE6E6',
[89] Fix | Delete
'cover_img' => 'youtube.png',
[90] Fix | Delete
'cover_img2x' => 'youtube@2x.png',
[91] Fix | Delete
];
[92] Fix | Delete
[93] Fix | Delete
$data['dev_docs'] = [
[94] Fix | Delete
'title' => esc_html__( 'WPForms Developer Documentation', 'wpforms-lite' ),
[95] Fix | Delete
'description' => esc_html__( 'Customize and extend WPForms with code. Our comprehensive developer resources include tutorials, snippets, and documentation on core actions, filters, functions, and more.', 'wpforms-lite' ),
[96] Fix | Delete
'button_text' => esc_html__( 'View WPForms Dev Docs', 'wpforms-lite' ),
[97] Fix | Delete
'button_link' => 'https://wpforms.com/developers/?utm_source=WordPress&amp;utm_medium=Community&amp;utm_campaign=' . esc_attr( $type ) . '&amp;utm_content=Developers',
[98] Fix | Delete
'cover_bg_color' => '#EBEBEB',
[99] Fix | Delete
'cover_img' => 'dev-docs.png',
[100] Fix | Delete
'cover_img2x' => 'dev-docs@2x.png',
[101] Fix | Delete
];
[102] Fix | Delete
[103] Fix | Delete
$data['wpbeginner'] = [
[104] Fix | Delete
'title' => esc_html__( 'WPBeginner Engage Facebook Group', 'wpforms-lite' ),
[105] Fix | Delete
'description' => esc_html__( 'Hang out with other WordPress experts and like minded website owners such as yourself! Hosted by WPBeginner, the largest free WordPress site for beginners.', 'wpforms-lite' ),
[106] Fix | Delete
'button_text' => esc_html__( 'Join WPBeginner Engage', 'wpforms-lite' ),
[107] Fix | Delete
'button_link' => 'https://www.facebook.com/groups/wpbeginner/',
[108] Fix | Delete
'cover_bg_color' => '#FCEDE4',
[109] Fix | Delete
'cover_img' => 'wpbeginner.png',
[110] Fix | Delete
'cover_img2x' => 'wpbeginner@2x.png',
[111] Fix | Delete
];
[112] Fix | Delete
[113] Fix | Delete
$data['suggest'] = [
[114] Fix | Delete
'title' => esc_html__( 'Suggest a Feature', 'wpforms-lite' ),
[115] Fix | Delete
'description' => esc_html__( 'Do you have an idea or suggestion for WPForms? If you have thoughts on features, integrations, addons, or improvements - we want to hear it! We appreciate all feedback and insight from our users.', 'wpforms-lite' ),
[116] Fix | Delete
'button_text' => esc_html__( 'Suggest a Feature', 'wpforms-lite' ),
[117] Fix | Delete
'button_link' => 'https://wpforms.com/features/suggest/?utm_source=WordPress&amp;utm_medium=Community&amp;utm_campaign=' . esc_attr( $type ) . '&amp;utm_content=Feature',
[118] Fix | Delete
'cover_bg_color' => '#FFF9EF',
[119] Fix | Delete
'cover_img' => 'suggest.png',
[120] Fix | Delete
'cover_img2x' => 'suggest@2x.png',
[121] Fix | Delete
];
[122] Fix | Delete
[123] Fix | Delete
return $data;
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
/**
[127] Fix | Delete
* Generate and output page HTML.
[128] Fix | Delete
*
[129] Fix | Delete
* @since 1.5.6
[130] Fix | Delete
*/
[131] Fix | Delete
public function output() {
[132] Fix | Delete
[133] Fix | Delete
?>
[134] Fix | Delete
<div id="wpforms-admin-community" class="wrap wpforms-admin-wrap">
[135] Fix | Delete
<h1 class="page-title"><?php esc_html_e( 'Community', 'wpforms-lite' ); ?></h1>
[136] Fix | Delete
<div class="items">
[137] Fix | Delete
<?php
[138] Fix | Delete
$data = $this->get_blocks_data();
[139] Fix | Delete
[140] Fix | Delete
foreach ( $data as $item ) {
[141] Fix | Delete
printf(
[142] Fix | Delete
'<div class="item">
[143] Fix | Delete
<a href="%6$s" target="_blank" rel="noopener noreferrer" class="item-cover" style="background-color: %s;" title="%4$s"><img class="item-img" src="%s" srcset="%s 2x" alt="%4$s"/></a>
[144] Fix | Delete
<h3 class="item-title">%s</h3>
[145] Fix | Delete
<p class="item-description">%s</p>
[146] Fix | Delete
<div class="item-footer">
[147] Fix | Delete
<a class="wpforms-btn button-primary wpforms-btn-blue" href="%s" target="_blank" rel="noopener noreferrer">%s</a>
[148] Fix | Delete
</div>
[149] Fix | Delete
</div>',
[150] Fix | Delete
esc_attr( $item['cover_bg_color'] ),
[151] Fix | Delete
esc_url( WPFORMS_PLUGIN_URL . 'assets/images/community/' . $item['cover_img'] ),
[152] Fix | Delete
esc_url( WPFORMS_PLUGIN_URL . 'assets/images/community/' . $item['cover_img2x'] ),
[153] Fix | Delete
esc_html( $item['title'] ),
[154] Fix | Delete
esc_html( $item['description'] ),
[155] Fix | Delete
esc_url( $item['button_link'] ),
[156] Fix | Delete
esc_html( $item['button_text'] )
[157] Fix | Delete
);
[158] Fix | Delete
}
[159] Fix | Delete
?>
[160] Fix | Delete
</div>
[161] Fix | Delete
</div>
[162] Fix | Delete
<?php
[163] Fix | Delete
}
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function