Skip to content
Open
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
48 changes: 17 additions & 31 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
// 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": "Existing Docker Compose (Extend)",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yml",
"docker-compose.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "wordpress",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
"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",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
// 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"
}
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 @@ -327,6 +329,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 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
34 changes: 34 additions & 0 deletions tests/test-timeout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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/
*/

/**
* Create a mock instance of the class.
*/
class TimeoutTestExporter extends Jekyll_Export {

/**
* Test the export method to ensure it doesn't timeout.
*/
public function test_export() {
// Call the export method with output buffering.
ob_start();
$this->export();
ob_end_clean();

echo "Export completed successfully without timeout.\n";
}
}

// Create an instance and test.
$test_exporter = new TimeoutTestExporter();
$test_exporter->test_export();

echo "Test completed.\n";
5 changes: 1 addition & 4 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
throw new RuntimeException($err);
}

require_once __DIR__ . '/composer/autoload_real.php';
Expand Down
20 changes: 19 additions & 1 deletion vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;

/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
Expand Down Expand Up @@ -322,6 +328,18 @@ public static function reload($data)
self::$installedIsLocalDir = false;
}

/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}

return self::$selfDir;
}

/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
Expand All @@ -336,7 +354,7 @@ private static function getInstalled()
$copiedLocalDir = false;

if (self::$canGetVendors) {
$selfDir = strtr(__DIR__, '\\', '/');
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
Expand Down
Loading
Loading