Edit File by line
/home/zeestwma/ajeebong.../wp-conte.../plugins/code-sni.../php/views
File: welcome.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* HTML for the welcome page.
[2] Fix | Delete
*
[3] Fix | Delete
* @package Code_Snippets
[4] Fix | Delete
* @subpackage Views
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace Code_Snippets;
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Loaded from the Welcome_Menu class.
[11] Fix | Delete
*
[12] Fix | Delete
* @var Welcome_Menu $this
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[16] Fix | Delete
return;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
$hero = $this->api->get_hero_item();
[20] Fix | Delete
[21] Fix | Delete
$changelog_sections = [
[22] Fix | Delete
'Added' => [
[23] Fix | Delete
'title' => __( 'New features', 'code-snippets' ),
[24] Fix | Delete
'icon' => 'lightbulb',
[25] Fix | Delete
],
[26] Fix | Delete
'Improved' => [
[27] Fix | Delete
'title' => __( 'Improvements', 'code-snippets' ),
[28] Fix | Delete
'icon' => 'chart-line',
[29] Fix | Delete
],
[30] Fix | Delete
'Fixed' => [
[31] Fix | Delete
'title' => __( 'Bug fixes', 'code-snippets' ),
[32] Fix | Delete
'icon' => 'buddicons-replies',
[33] Fix | Delete
],
[34] Fix | Delete
'Other' => [
[35] Fix | Delete
'title' => __( 'Other', 'code-snippets' ),
[36] Fix | Delete
'icon' => 'open-folder',
[37] Fix | Delete
],
[38] Fix | Delete
];
[39] Fix | Delete
[40] Fix | Delete
$plugin_types = [
[41] Fix | Delete
'core' => __( 'Core', 'code-snippets' ),
[42] Fix | Delete
'pro' => __( 'Pro', 'code-snippets' ),
[43] Fix | Delete
];
[44] Fix | Delete
[45] Fix | Delete
?>
[46] Fix | Delete
[47] Fix | Delete
<div class="csp-welcome-wrap">
[48] Fix | Delete
<div class="csp-welcome-header">
[49] Fix | Delete
<header>
[50] Fix | Delete
<img width="50px"
[51] Fix | Delete
src="<?php echo esc_url( plugins_url( 'assets/icon.svg', PLUGIN_FILE ) ); ?>"
[52] Fix | Delete
alt="<?php esc_attr_e( 'Code Snippets Logo', 'code-snippets' ); ?>">
[53] Fix | Delete
<h1>
[54] Fix | Delete
<?php echo wp_kses( __( "Resources and <span>What's New</span>", 'code-snippets' ), [ 'span' => [] ] ); ?>
[55] Fix | Delete
</h1>
[56] Fix | Delete
</header>
[57] Fix | Delete
<nav>
[58] Fix | Delete
<ul>
[59] Fix | Delete
<?php foreach ( $this->get_header_links() as $link_name => $link_info ) { ?>
[60] Fix | Delete
<li>
[61] Fix | Delete
<a href="<?php echo esc_url( $link_info['url'] ); ?>" target="_blank"
[62] Fix | Delete
class="csp-link-<?php echo esc_attr( $link_name ); ?>">
[63] Fix | Delete
<span><?php echo esc_html( $link_info['label'] ); ?></span>
[64] Fix | Delete
[65] Fix | Delete
<?php if ( 'discord' === $link_info['icon'] ) { ?>
[66] Fix | Delete
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36">
[67] Fix | Delete
<path d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z" />
[68] Fix | Delete
</svg>
[69] Fix | Delete
<?php } else { ?>
[70] Fix | Delete
<span class="dashicons dashicons-<?php echo esc_attr( $link_info['icon'] ); ?>"></span>
[71] Fix | Delete
<?php } ?>
[72] Fix | Delete
</a>
[73] Fix | Delete
</li>
[74] Fix | Delete
<?php } ?>
[75] Fix | Delete
</ul>
[76] Fix | Delete
</nav>
[77] Fix | Delete
</div>
[78] Fix | Delete
[79] Fix | Delete
<section class="csp-section-changes">
[80] Fix | Delete
<h1>📰 <?php esc_html_e( 'Latest news', 'code-snippets' ); ?></h1>
[81] Fix | Delete
<div class="csp-cards">
[82] Fix | Delete
<a class="csp-card" href="<?php echo esc_url( $hero['follow_url'] ); ?>" target="_blank"
[83] Fix | Delete
title="<?php esc_attr_e( 'Read more', 'code-snippets' ); ?>">
[84] Fix | Delete
<header>
[85] Fix | Delete
<span class="dashicons dashicons-external"></span>
[86] Fix | Delete
<h2><?php echo esc_html( $hero['name'] ); ?></h2>
[87] Fix | Delete
</header>
[88] Fix | Delete
<figure>
[89] Fix | Delete
<div id="csp-loading-spinner" class="csp-loading-spinner"></div>
[90] Fix | Delete
<img id="csp-changes-img"
[91] Fix | Delete
onload="hideLoadingAnimation()"
[92] Fix | Delete
src="<?php echo esc_url( $hero['image_url'] ); ?>"
[93] Fix | Delete
alt="<?php esc_attr_e( 'Latest news image', 'code-snippets' ); ?>);">
[94] Fix | Delete
</figure>
[95] Fix | Delete
</a>
[96] Fix | Delete
[97] Fix | Delete
<a class="csp-card csp-changelog-wrapper" href="https://wordpress.org/plugins/code-snippets/changelog" target="_blank"
[98] Fix | Delete
title="<?php esc_attr_e( 'Read the full changelog', 'code-snippets' ); ?>">
[99] Fix | Delete
<header>
[100] Fix | Delete
<span class="dashicons dashicons-external"></span>
[101] Fix | Delete
<h2><?php esc_html_e( 'Latest changes', 'code-snippets' ); ?></h2>
[102] Fix | Delete
</header>
[103] Fix | Delete
<div class="csp-section-changelog">
[104] Fix | Delete
<?php foreach ( $this->api->get_changelog() as $version => $version_changes ) { ?>
[105] Fix | Delete
<h3><?php echo esc_html( $version ); ?></h3>
[106] Fix | Delete
<article>
[107] Fix | Delete
<?php
[108] Fix | Delete
foreach ( $changelog_sections as $section_key => $section ) {
[109] Fix | Delete
if ( empty( $version_changes[ $section_key ] ) ) {
[110] Fix | Delete
continue;
[111] Fix | Delete
}
[112] Fix | Delete
?>
[113] Fix | Delete
<h4>
[114] Fix | Delete
<span class="dashicons dashicons-<?php echo esc_attr( $section['icon'] ); ?>"></span>
[115] Fix | Delete
<?php echo esc_html( $section['title'] ); ?>
[116] Fix | Delete
</h4>
[117] Fix | Delete
<ul>
[118] Fix | Delete
<?php
[119] Fix | Delete
foreach ( $plugin_types as $plugin_type => $type_label ) {
[120] Fix | Delete
if ( empty( $version_changes[ $section_key ][ $plugin_type ] ) ) {
[121] Fix | Delete
continue;
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
foreach ( $version_changes[ $section_key ][ $plugin_type ] as $change ) {
[125] Fix | Delete
?>
[126] Fix | Delete
<li>
[127] Fix | Delete
<span class="badge <?php echo esc_attr( $plugin_type ); ?>-badge">
[128] Fix | Delete
<?php echo esc_html( $type_label ); ?>
[129] Fix | Delete
</span>
[130] Fix | Delete
<span><?php echo esc_html( $change ); ?></span>
[131] Fix | Delete
</li>
[132] Fix | Delete
<?php
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
?>
[136] Fix | Delete
</ul>
[137] Fix | Delete
<?php } ?>
[138] Fix | Delete
</article>
[139] Fix | Delete
<?php } ?>
[140] Fix | Delete
</div>
[141] Fix | Delete
</a>
[142] Fix | Delete
</div>
[143] Fix | Delete
</section>
[144] Fix | Delete
[145] Fix | Delete
<section class="csp-section-articles csp-section-links">
[146] Fix | Delete
<h1>🛟 <?php esc_html_e( 'Helpful articles', 'code-snippets' ); ?></h1>
[147] Fix | Delete
<div class="csp-cards">
[148] Fix | Delete
<?php foreach ( $this->api->get_features() as $feature ) { ?>
[149] Fix | Delete
<a class="csp-card"
[150] Fix | Delete
href="<?php echo esc_url( $feature['follow_url'] ); ?>" target="_blank"
[151] Fix | Delete
title="<?php esc_attr_e( 'Read more', 'code-snippets' ); ?>">
[152] Fix | Delete
<figure>
[153] Fix | Delete
<img src="<?php echo esc_url( $feature['image_url'] ); ?>"
[154] Fix | Delete
alt="<?php esc_attr_e( 'Feature image', 'code-snippets' ); ?>">
[155] Fix | Delete
</figure>
[156] Fix | Delete
<header>
[157] Fix | Delete
<h2><?php echo esc_html( $feature['title'] ); ?></h2>
[158] Fix | Delete
<p class="csp-card-item-description"><?php echo esc_html( $feature['description'] ); ?></p>
[159] Fix | Delete
</header>
[160] Fix | Delete
<footer>
[161] Fix | Delete
<p class="csp-card-item-category"><?php echo esc_html( $feature['category'] ); ?></p>
[162] Fix | Delete
<span class="dashicons dashicons-external"></span>
[163] Fix | Delete
</footer>
[164] Fix | Delete
</a>
[165] Fix | Delete
<?php } ?>
[166] Fix | Delete
</div>
[167] Fix | Delete
</section>
[168] Fix | Delete
[169] Fix | Delete
<section class="csp-section-links csp-section-partners">
[170] Fix | Delete
<h1>🚀 <?php esc_html_e( 'Partners and apps', 'code-snippets' ); ?></h1>
[171] Fix | Delete
<div class="csp-cards">
[172] Fix | Delete
<?php foreach ( $this->api->get_partners() as $partner ) { ?>
[173] Fix | Delete
<a class="csp-card"
[174] Fix | Delete
href="<?php echo esc_url( $partner['follow_url'] ); ?>" target="_blank"
[175] Fix | Delete
title="<?php esc_attr_e( 'Go to Partner', 'code-snippets' ); ?>">
[176] Fix | Delete
<figure>
[177] Fix | Delete
<img src="<?php echo esc_url( $partner['image_url'] ); ?>"
[178] Fix | Delete
alt="<?php esc_attr_e( 'Partner image', 'code-snippets' ); ?>">
[179] Fix | Delete
</figure>
[180] Fix | Delete
<header>
[181] Fix | Delete
<span class="dashicons dashicons-external"></span>
[182] Fix | Delete
<h2><?php echo esc_html( $partner['title'] ); ?></h2>
[183] Fix | Delete
</header>
[184] Fix | Delete
</a>
[185] Fix | Delete
<?php } ?>
[186] Fix | Delete
</div>
[187] Fix | Delete
</section>
[188] Fix | Delete
</div>
[189] Fix | Delete
[190] Fix | Delete
<script type="text/javascript">
[191] Fix | Delete
function hideLoadingAnimation() {
[192] Fix | Delete
const spinner = document.getElementById<HTMLDivElement>('csp-loading-spinner')
[193] Fix | Delete
const image = document.getElementById<HTMLDivElement>('csp-changes-img')
[194] Fix | Delete
[195] Fix | Delete
spinner.style.display = 'none'
[196] Fix | Delete
image.style.display = 'block'
[197] Fix | Delete
}
[198] Fix | Delete
</script>
[199] Fix | Delete
[200] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function