Skip to content

Commit ed0f9d9

Browse files
committed
Merge branch 'develop'
2 parents 92f86ae + 2d078cf commit ed0f9d9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

.github/workflows/codequality.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
php: [7.3.25, 7.4.13]
18+
php: ["7.3", "7.4"]
1919

2020
name: PHP-${{ matrix.php }}
2121

@@ -43,4 +43,4 @@ jobs:
4343
run: composer install --no-interaction
4444

4545
- name: Run our Linter and PHPStan
46-
run: composer test
46+
run: composer run-script test

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## WP2Static 7.1.6
2+
3+
- code quality improvements (thanks @szepeviktor)
4+
15
## WP2Static 7.1.5
26

37
- fix PHP version check to 7.3>=

src/DetectSitemapsURLs.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function detect( string $wp_site_url ) : array {
2020
$parser = new SitemapParser( 'WP2Static.com', [ 'strict' => false ] );
2121
$request = new Request();
2222
$response = $request->getResponseCode( $wp_site_url . 'robots.txt' );
23-
$robots_exits = $response === 200 ? true : false;
23+
$robots_exits = $response === 200;
2424

2525
try {
2626
$sitemaps = [];
@@ -32,7 +32,7 @@ public static function detect( string $wp_site_url ) : array {
3232
}
3333

3434
// if no sitemaps add known sitemaps
35-
if ( count( $sitemaps ) === 0 ) {
35+
if ( $sitemaps === [] ) {
3636
$sitemaps = [
3737
// we're assigning empty arrays to match sitemaps library
3838
$wp_site_url . 'sitemap.xml' => [], // normal sitemap
@@ -42,7 +42,7 @@ public static function detect( string $wp_site_url ) : array {
4242
}
4343

4444
// TODO: a more elegant mapping
45-
foreach ( $sitemaps as $sitemap => $unused ) {
45+
foreach ( array_keys( $sitemaps ) as $sitemap ) {
4646
if ( ! is_string( $sitemap ) ) {
4747
continue;
4848
}
@@ -61,20 +61,16 @@ public static function detect( string $wp_site_url ) : array {
6161
$extract_sitemaps = $parser->getSitemaps();
6262

6363
foreach ( $extract_sitemaps as $url => $tags ) {
64-
$sitemap_url = str_replace(
64+
$sitemaps_urls[] = '/' . str_replace(
6565
$wp_site_url,
6666
'',
6767
$url
6868
);
69-
70-
$sitemaps_urls[] = '/' . $sitemap_url;
7169
}
7270
}
7371
}
7472
} catch ( SitemapParserException $e ) {
75-
WsLog::l(
76-
$e->getMessage()
77-
);
73+
WsLog::l( $e->getMessage() );
7874
throw new WP2StaticException( $e->getMessage(), 0, $e );
7975
}
8076

src/ViewRenderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function renderDiagnosticsPage() : void {
3232
$view['memoryLimit'] = ini_get( 'memory_limit' );
3333
$view['coreOptions'] = CoreOptions::getAll();
3434
$view['site_info'] = SiteInfo::getAllInfo();
35-
$view['phpOutOfDate'] = PHP_VERSION < 7.3;
35+
$view['phpOutOfDate'] = version_compare( PHP_VERSION, '7.3', '<' );
3636
$view['uploadsWritable'] = SiteInfo::isUploadsWritable();
3737
$view['maxExecutionTime'] = ini_get( 'max_execution_time' );
3838
$view['curlSupported'] = SiteInfo::hasCURLSupport();

wp2static.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WP2Static
44
* Plugin URI: https://wp2static.com
55
* Description: Static site generator functionality for WordPress.
6-
* Version: 7.1.5
6+
* Version: 7.1.6
77
* Author: WP2Static
88
* Author URI: https://wp2static.com
99
* Text Domain: wp2static
@@ -15,7 +15,7 @@
1515
die;
1616
}
1717

18-
define( 'WP2STATIC_VERSION', '7.1.5' );
18+
define( 'WP2STATIC_VERSION', '7.1.6' );
1919
define( 'WP2STATIC_PATH', plugin_dir_path( __FILE__ ) );
2020

2121
if ( file_exists( WP2STATIC_PATH . 'vendor/autoload.php' ) ) {

0 commit comments

Comments
 (0)