Skip to content

Commit

Permalink
Merge pull request #362 from rtCamp/refactor/develop-branch
Browse files Browse the repository at this point in the history
Adds code refactoring for develop branch.
  • Loading branch information
Vedant-Gandhi authored Oct 21, 2024
2 parents f253ae8 + 989d1a0 commit fbc7c4e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions admin/class-nginx-helper-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public function nginx_helper_get_feeds() {

}
?>
<ul role="list">
<ul role="list">
<?php
if ( 0 === $maxitems ) {
echo '<li role="listitem">' . esc_html_e( 'No items', 'nginx-helper' ) . '.</li>';
Expand All @@ -430,7 +430,7 @@ public function nginx_helper_get_feeds() {
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) {
?>
<li role="listitem">
<li role="listitem">
<?php
printf(
'<a href="%s" title="%s">%s</a>',
Expand All @@ -439,12 +439,12 @@ public function nginx_helper_get_feeds() {
esc_html( $item->get_title() )
);
?>
</li>
</li>
<?php
}
}
?>
</ul>
</ul>
<?php
die();

Expand Down Expand Up @@ -809,7 +809,7 @@ private function preload_cache_from_sitemap() {
$all_urls = array();

foreach ( $sitemap_urls as $sitemap_url ) {
$urls = $this->extract_sitemap_urls( $sitemap_url );
$urls = $this->extract_sitemap_urls( $sitemap_url );
$all_urls = array_merge( $all_urls, $urls );
}

Expand Down Expand Up @@ -865,7 +865,7 @@ private function extract_sitemap_urls( $sitemap_url ) {

$urls = array();

if ( $xml === false ) {
if ( false === $xml ) {
return $urls;
}

Expand All @@ -875,12 +875,12 @@ private function extract_sitemap_urls( $sitemap_url ) {

return $urls;
}
/**
* Determines if the current request is for importing Posts/ WordPress content.
*
* @return bool True if the request is for importing, false otherwise.
*/
/**
* Determines if the current request is for importing Posts/ WordPress content.
*
* @return bool True if the request is for importing, false otherwise.
*/
public function is_import_request() {
$import_query_var = sanitize_text_field( wp_unslash( $_GET['import'] ?? '' ) ); //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce is already in the admin dashboard.
$has_import_started = did_action( 'import_start' );
Expand Down
14 changes: 7 additions & 7 deletions admin/partials/nginx-helper-general-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'purge_page_on_deleted_comment',
'purge_feeds',
'smart_http_expire_form_nonce',
'preload_cache',
'preload_cache',
);

$all_inputs = array();
Expand Down Expand Up @@ -127,12 +127,12 @@
<label for="enable_purge"><?php esc_html_e( 'Enable Purge', 'nginx-helper' ); ?></label>
</td>
</tr>
<tr valign="top">
<td>
<input type="checkbox" value="1" id="preload_cache" name="preload_cache" <?php checked( $nginx_helper_settings['preload_cache'], 1 ); ?> />
<label for="preload_cache"><?php esc_html_e( 'Preload Cache', 'nginx-helper' ); ?></label>
</td>
</tr>
<tr valign="top">
<td>
<input type="checkbox" value="1" id="preload_cache" name="preload_cache" <?php checked( $nginx_helper_settings['preload_cache'], 1 ); ?> />
<label for="preload_cache"><?php esc_html_e( 'Preload Cache', 'nginx-helper' ); ?></label>
</td>
</tr>
</table>
</div> <!-- End of .inside -->
</div>
Expand Down

0 comments on commit fbc7c4e

Please sign in to comment.