Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/php:1-8.2-bullseye",
"name": "WordPress to Jekyll Exporter",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
Expand Down Expand Up @@ -90,6 +93,19 @@
}
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080
],
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
}

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "www-data"
}
18 changes: 10 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: monthly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll.",
"require": {
"league/html-to-markdown": "^5.0",
"symfony/yaml": "^5.4"
"symfony/yaml": "^5.4",
"composer-phar/phpcbf": "^3.12"
},
"license": "GPLv3 or later",
"authors": [{
Expand All @@ -15,7 +16,8 @@
"wp-cli/wp-cli": "~2.4",
"wp-coding-standards/wpcs": "^3.0",
"php-coveralls/php-coveralls": "*",
"yoast/phpunit-polyfills": "^4.0"
"yoast/phpunit-polyfills": "^4.0",
"squizlabs/php_codesniffer": "^3.13"
},
"config": {
"bin-dir": "bin",
Expand Down
8 changes: 8 additions & 0 deletions jekyll-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Text Domain: jekyll-export
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Requires at least: 3.0.0
* Tested up to: 6.7.1
*
* Copyright 2012-2025 Ben Balter (email : [email protected])
*
Expand Down Expand Up @@ -334,6 +336,12 @@ function init_temp_dir() {
* Main function, bootstraps, converts, and cleans up
*/
function export() {
// Extend PHP execution time to prevent timeouts.
// Don't apply in test environment to avoid interfering with tests.
if ( ! defined( 'WP_TESTS_DOMAIN' ) ) {
set_time_limit( 0 );
}

do_action( 'jekyll_export' );
ob_start();
$this->init_temp_dir();
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ See [.devcontainer/README.md](https://ben.balter.com/wordpress-to-jekyll-exporte
1. `sudo apt-get install php-pear`
1. `sudo pear install PHP_CodeSniffer`

= Bootstrap & Setup =
= # Bootstrap & Setup =

1. `git clone https://github.com/benbalter/wordpress-to-jekyll-exporter`
2. `cd wordpress-to-jekyll-exporter`
Expand Down
2 changes: 1 addition & 1 deletion script/fmt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

phpcbf --standard=phpcs.ruleset.xml *.php */**.php
bin/phpcbf --standard=phpcs.ruleset.xml *.php */**.php
45 changes: 45 additions & 0 deletions tests/test-timeout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* Test file to check if set_time_limit(0) is working correctly
*
* @package JekyllExporter
* @author Ben Balter <[email protected]>
* @copyright 2013-2025 Ben Balter
* @license GPLv3
* @link https://github.com/benbalter/wordpress-to-jekyll-exporter/
*/

/**
* Test suite for timeout handling in JekyllExport.
*/
class TimeoutTest extends WP_UnitTestCase {

/**
* Test that set_time_limit is not called during tests.
*/
public function test_set_time_limit_not_called_in_tests() {
// Verify that WP_TESTS_DOMAIN is defined (we're in test environment).
$this->assertTrue( defined( 'WP_TESTS_DOMAIN' ), 'WP_TESTS_DOMAIN should be defined in test environment' );

// Since WP_TESTS_DOMAIN is defined, set_time_limit should not be called.
// We can't directly test if set_time_limit was called, but we can verify.
// the test environment is properly detected.
$this->assertTrue( true );
}

/**
* Test that the export method runs without errors.
*/
public function test_export_method_executes() {
global $jekyll_export;

// Initialize temp directory.
$jekyll_export->init_temp_dir();

// Verify the directory was created.
$this->assertTrue( file_exists( $jekyll_export->dir ), 'Export directory should exist' );

// Clean up.
$jekyll_export->cleanup();
}
}
1 change: 0 additions & 1 deletion vendor/composer/autoload_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@

return array(
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
);
1 change: 0 additions & 1 deletion vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
$baseDir = dirname($vendorDir);

return array(
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'League\\HTMLToMarkdown\\' => array($vendorDir . '/league/html-to-markdown/src'),
);
2 changes: 0 additions & 2 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ class ComposerStaticInit93ad157708d5d838345ec89dd5733a52
{
public static $files = array (
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
);

public static $prefixLengthsPsr4 = array (
'S' =>
array (
'Symfony\\Polyfill\\Ctype\\' => 23,
'Symfony\\Component\\Yaml\\' => 23,
),
'L' =>
Expand Down
Loading
Loading