Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
leonstafford committed Dec 4, 2020
2 parents 92f86ae + 2d078cf commit ed0f9d9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
php: [7.3.25, 7.4.13]
php: ["7.3", "7.4"]

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

Expand Down Expand Up @@ -43,4 +43,4 @@ jobs:
run: composer install --no-interaction

- name: Run our Linter and PHPStan
run: composer test
run: composer run-script test
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## WP2Static 7.1.6

- code quality improvements (thanks @szepeviktor)

## WP2Static 7.1.5

- fix PHP version check to 7.3>=
Expand Down
14 changes: 5 additions & 9 deletions src/DetectSitemapsURLs.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function detect( string $wp_site_url ) : array {
$parser = new SitemapParser( 'WP2Static.com', [ 'strict' => false ] );
$request = new Request();
$response = $request->getResponseCode( $wp_site_url . 'robots.txt' );
$robots_exits = $response === 200 ? true : false;
$robots_exits = $response === 200;

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

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

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

foreach ( $extract_sitemaps as $url => $tags ) {
$sitemap_url = str_replace(
$sitemaps_urls[] = '/' . str_replace(
$wp_site_url,
'',
$url
);

$sitemaps_urls[] = '/' . $sitemap_url;
}
}
}
} catch ( SitemapParserException $e ) {
WsLog::l(
$e->getMessage()
);
WsLog::l( $e->getMessage() );
throw new WP2StaticException( $e->getMessage(), 0, $e );
}

Expand Down
2 changes: 1 addition & 1 deletion src/ViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function renderDiagnosticsPage() : void {
$view['memoryLimit'] = ini_get( 'memory_limit' );
$view['coreOptions'] = CoreOptions::getAll();
$view['site_info'] = SiteInfo::getAllInfo();
$view['phpOutOfDate'] = PHP_VERSION < 7.3;
$view['phpOutOfDate'] = version_compare( PHP_VERSION, '7.3', '<' );
$view['uploadsWritable'] = SiteInfo::isUploadsWritable();
$view['maxExecutionTime'] = ini_get( 'max_execution_time' );
$view['curlSupported'] = SiteInfo::hasCURLSupport();
Expand Down
4 changes: 2 additions & 2 deletions wp2static.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP2Static
* Plugin URI: https://wp2static.com
* Description: Static site generator functionality for WordPress.
* Version: 7.1.5
* Version: 7.1.6
* Author: WP2Static
* Author URI: https://wp2static.com
* Text Domain: wp2static
Expand All @@ -15,7 +15,7 @@
die;
}

define( 'WP2STATIC_VERSION', '7.1.5' );
define( 'WP2STATIC_VERSION', '7.1.6' );
define( 'WP2STATIC_PATH', plugin_dir_path( __FILE__ ) );

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

0 comments on commit ed0f9d9

Please sign in to comment.