WordPress static site generator for security, performance and cost benefits

Overview
Comments
  • workflow running twice

    workflow running twice

    running from web, deploy runs twice in succession, responding to client with status 0 after first deploy ends

    noticed on very large site, not small

    further investigation needed

    bug 
    opened by leonstafford 30
  • How to export the site?

    How to export the site?

    Hi there,

    I’m trying to figure out how to export the site with no success..! I have the latest paid version of the plugin, v7.0-alpha-007.

    The settings I have are Options, Jobs, Caches, Diagnostic, Logs and also Zip (I have installed the Zip add-on, thinking that would give me the option to export the site as a zip file).

    What is the process to export the site? I don’t see any Export/Download/Deploy button anywhere in the settings.

    I can’t see any actual step instructions on the plugin docs. I have tried to Manually Enqueue Jobs Now but all processes are stuck on Waiting. I have found a youtube tutorial but the admin panel is very different from what I have, I believe that is an older version of the plugin.

    Could I please have detailed instructions to how to use the plugin? I need to have a test static site simply uploaded on our test shared servers to show a client. The exported site can be a zip folder.

    Many thanks, Jeff

    enhancement 
    opened by jeffceriello 30
  • 500 error when certain sitemaps are non-existant

    500 error when certain sitemaps are non-existant

    Reported here:

    https://staticword.press/t/the-plugin-returns-500/353/2

    User:

    i did some research and i found out what was the problem? /var/www/admin/wp-content/plugins/wp2static/src/DetectSitemapsURLs.php In this file, this line: $parser->parse( $sitemap ); should always throw an error since sitemap is never a full URL.

    bug 
    opened by leonstafford 26
  • Site not exporting properly - maybe not compatible with

    Site not exporting properly - maybe not compatible with "bedrock" framework?

    Hi Leon,

    I have used your plugin before with no issue, but it seems after I started using the "Bedrock" framework from roots.io the export doesn't work at all. The crawler doesn't discover links properly and the Wordpress assets don't come across;

    Bedrock - https://roots.io/bedrock/

    Maybe something to do with the way they handle paths?

    ├── composer.json ├── config │ ├── application.php │ └── environments │ ├── development.php │ ├── staging.php │ └── production.php ├── vendor └── web ├── app │ ├── mu-plugins │ ├── plugins │ ├── themes │ └── uploads ├── wp-config.php ├── index.php └── wp

    I would love to use your plugin with S3 as it is perfect for our website. Let me know if you have any insight into this issue.

    opened by FredericoC 22
  • PHP Fatal Error

    PHP Fatal Error

    Hi, I've set up a blank WP installation with download wp2static plugin. When running generator I've got 500 error (Changed maximum execution time - still no success). Later, I've checked PHP logs.

    [05-Oct-2020 23:00:41 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to WP2Static\Request::getResponseCode() must be of the type string, array given, called in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\DetectSitemapsURLs.php on line 44 and defined in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Request.php:366 Stack trace: #0 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\DetectSitemapsURLs.php(44): WP2Static\Request->getResponseCode(Array) #1 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\URLDetector.php(70): WP2Static\DetectSitemapsURLs::detect('http://wp2stati...') #2 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Controller.php(620): WP2Static\URLDetector::detectURLs() #3 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Controller.php(724): WP2Static\Controller::wp2staticHeadless() #4 C:\laragon\www\wp2static\wp-includes\class-wp-hook.php(285): WP2Static\Controller::wp2staticRun() #5 C:\laragon\www\wp2static\wp-includes\clas in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Request.php on line 366

    What is wrong? My PHP version is 7.4

    bug 
    opened by adrianratajczak 21
  • Add search, pagination, actions to all cache pages

    Add search, pagination, actions to all cache pages

    This PR contains a few changes:

    • I fixed the errors running composer phpunit by adding 10up/wp_mock as a dependency
    • Added phpunit to the composer test script
    • Added a Paginator class for use in our caches pages and tests for it
    • Added search, pagination and actions to all caches pages
    opened by Flynsarmy 19
  • Subdomain duplicated in the exported files

    Subdomain duplicated in the exported files

    EDIT:

    Confirmed issue and was able to reproduce:

    SAD PATHS:

    • given WP Installed at domain.com/subdir/ and trying to export to domain.com/ fails to export properly. URL rewriting looks OK, but filepaths have not been modified at all
    • given WP Installed at domain.com/subdir/ and trying to export to domain.com/subdir/anothersubdir/ fails to export properly (urls rewritten with duplication of the paths, like http://172.17.0.3/banana/static/static/static/), no filepaths rewritten properly
    • given WP Installed at domain.com/subdir/ and trying to export to someotherdomain.com fails to export properly (urls rewritten OK, but getting an index.php included in the output dir...) no filepaths rewritten properly

    Unless I misunderstood something, I think there is a bug in the latest version of the plugin (2.6) : the subdomain I chose (static.ndd.com) was not the correct one in the exported files. Instead, I had the same subdomain twice, like so : static.static.ndd.com.

    Here are my settings :

    capture d ecran 2018-06-11 a 21 31 59

    And here is the beginning of the index.html file :

    <!DOCTYPE html>
    <head>
    <base href="https://static.static.voiretmanger.fr" />
    
    
    <meta charset="UTF-8">
    
    <meta name="apple-mobile-web-app-title" content="Voir et manger" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
    <meta property="fb:pages" content="384298108368" />
    
    <link href='https://static.static.voiretmanger.fr/contents/ui/theme/css/font.css' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" media="all" href="https://static.static.voiretmanger.fr/contents/ui/theme/style.css" />
    
    
    
    
    <link rel="shortcut icon" href="https://static.static.voiretmanger.fr/contents/favicon.ico" />
    <link rel="mask-icon" href="https://static.static.voiretmanger.fr/contents/icon.svg" color="rgb(197, 31, 22)">
    
            <link rel="preload" href="https://static.static.voiretmanger.fr/contents/ui/theme/css/portico_layer-webfont.woff2" as="font" type="font/woff2"$
            <link rel="preload" href="https://static.static.voiretmanger.fr/contents/ui/theme/css/portico_vintage-webfont.woff2" as="font" type="font/woff$
    
    
    
    
    
    <!-- This site is optimized with the Yoast SEO plugin v7.6.1 - https://yoast.com/wordpress/plugins/seo/ -->
    <title>À voir et à manger - Nicoflo</title>
    <meta name="description" content="Des critiques de films et de séries, ainsi que de restaurants."/>
    

    Let me know if you need more information.

    Thanks for the plugin !

    bug 
    opened by nicolinuxfr 19
  • Pagination Detecting Incorrectly

    Pagination Detecting Incorrectly

    Just noticed this:

    For post pagination, live site is using siteurl.com/page/1 but isn't being detected.

    What it is detecting though is siteurl.com/blog/page/1 which doesn't exist and 404s on crawl.

    bug 
    opened by petewilcock 17
  • Plugin could not be activated because it triggered a fatal error.

    Plugin could not be activated because it triggered a fatal error.

    Got this error when trying to activate the plugin

    Fatal error: Uncaught Error: Class 'WP2Static\Controller' not found in /home/wp-content/plugins/wp2static-develop/wp2static.php:25 Stack trace: #0 /home/wp-admin/includes/plugin.php(2297): include() #1 /home/wp-admin/plugins.php(191): plugin_sandbox_scrape('wp2static-devel...') #2 {main} thrown in /home/wp-content/plugins/wp2static-develop/wp2static.php on line 25

    opened by n1k3sh 17
  • WordPress Error: Plugin could not be activated because it triggered a fatal error.

    WordPress Error: Plugin could not be activated because it triggered a fatal error.

    I received the plugin generated from wp2static.com by entering my email. When I tried to activate this plugin I got the following error:

    Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/ioqdt68boaz1/public_html/(website URL)/wp-content/plugins/static-html-output-plugin/src/Controller.php on line 42

    So I downloaded the .zip from the git repo and uploaded it that way, which gave me the following error:

    Fatal error: Class 'WP2Static\Controller' not found in /home/ioqdt68boaz1/public_html/(website URL)/wp-content/plugins/wp2static-master/wp2static.php on line 24

    opened by jamesravelle 17
  • Add some FilesHelper tests

    Add some FilesHelper tests

    I'm not super familiar with testing so this is my first attempt at using Mockery and WP_Mock. I added tests to a few FilesHelper methods. Not all the methods are tested yet but I figured I'd just check you guys are happy with how I've done things here before continuing.

    I'm not sure yet how to test getListOfLocalFilesByDir as it relies on the result of filePathLooksCrawlable which is another static method - so I can't mock filePathLooksCrawlable's response.

    I also don't like the huge arrays needed in WP_Mock::onFilter. I created an issue in their repo here describing my problem with it and a potential fix. Perhaps a solution to my problem already exists and I'm just not aware of it.

    And finally I'm not sure if the output from testCleanDetectedURLs is intended to work the way it does, I just added tests for everything I could think of so we can see as plainly as possible how it's currently working. Up to you guys to decide if you like the way starting/trailing slashes work with it.

    opened by Flynsarmy 17
  • Crawling 150 pages/minute: is this expected speed?

    Crawling 150 pages/minute: is this expected speed?

    OS: win x64 HDD: spinning WAMP: xampp

    PHP max_execution_time: Unlimited PHP memory_limit: 1024M Uploads directory: writable PHP version: 7.4.29 (thread-safe) cURL extension loaded: Yes WordPress Permalinks Compatible: Yes Apache: 2.4 MariaDB: 10.4

    The test Wordpress site is very lightweight and 100/100 lighthouse even when server-rendered.

    This system crawls only 150 pages/minute with the mysql daemon using ~1-2MB/s disk I/O (HDD). For comparison, on the exact same system, the TinaCMS Wordpress plugin exports ~3,000 pages/minute into Markdown, ie 20x the speed with the same mysqld disk I/O.

    I appreciate that composing a full page over the wordpress API has overhead compared to a text-only export into Markdown, but is 20x slower expected performance? If true, a 10,000-page site would take more than 1 hour to export every time global templates or pagination are changed. :((

    As described, the system passes all WP2Static health checks and PHP limits have been removed. The 1-2 MB/s mysqld disk speed feels slow, even for a HDD and especially compared to node.js read/write, but not sure if this is relevant or if it can be improved.

    Is there some kind of a known bottleneck during the crawling stage that I am missing? eg the MySQL config or the API/plugin?

    opened by torcd 1
  • comment is unrelated to code

    comment is unrelated to code

    https://github.com/WP2Static/wp2static/blob/4507096e020a95a76b8053418ee9fd98d7ec3373/src/Utils.php#L9 This comment is for a function that gives the difference between two times.

    opened by joyously 1
  • Addon list can be blank in multisite

    Addon list can be blank in multisite

    @DougBeney at #https://github.com/leonstafford/wp2static-addon-s3/issues/37#issuecomment-1152811649

    There is still one quirk that is not fixed for multisites.

    If you install the plugin and addons...then network activate for ALL sites on your network, the wp2static addons list will be fine on your primary multisite but for all others it will be blank.

    The temporary fix is no network deactivate the plugins and then on each individual website's dashboard, enable the plugins.

    bug 
    opened by john-shaffer 0
  • 404 Error while Crawling Images

    404 Error while Crawling Images

    Issue : While generating static site, in crawling, images are getting 404 error for favicon and uploaded images.

    Initial Finding :

    • Plugin is searching for wrong URL and resulting in 404 error.
    • For windows OS backslash should replace with frontslash in Favicon and Uploaded images path. e.g : 404 for URL /wp-content/uploads\2022\07\bg1.jpg

    In above example, "/wp-content/uploads" is default upload folder path and "\2022\07\bg1.jpg" is image path.

    In Image path \ should be replaced with / like its In "C:\Bitnami\wordpress-6.0-0\apps\wordpress\htdocs\wp-content\plugins\wp2static\src" , DetectWPIncludesAssets.php is replacing \ with / for Assets url for windows.

    System and Setup Details :

    • Windows 10
    • Bitnami - 6.0
    • WordPress 6.0.0
    • Php - 8.0.20

    Theme Details :

    • Default Theme
    • Astra Theme
    • Twenty Twenty Theme

    Error Screenshot : Logs

    bug 
    opened by LakhanGandhi 2
  • wp2static bug: require a PHP version = 8.1.0" when it should be 7.3">

    wp2static bug: require a PHP version ">= 8.1.0" when it should be 7.3

    When installing via composer, it install without complaining. But then, when visiting the wp admin, I get this error :

    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".

    Removing WP2static from package.json then composer update removes the issue. I am on PHP 8.0.

    According to the plugin packagist page, it requires php7.3, not 8.1 image

    bug 
    opened by pixeline 4
Releases(7.1.7)
  • 7.1.7(Sep 5, 2021)

    WP2Static 7.1.7

    • logging and fixes for Sitemap detection @palmiak, @john-shaffer
    • fix #793 properly dequeue + deregister scripts @mrwweb
    • fix diagnostics uploadsWritable description @yilinjuang
    • fix #730 detect network-wide enabled plugins @stefanullinger
    • INSERT IGNORE to silence add-on duplicate insert warnings
    • add filters to deployment webhook:
    • wp2static_deploy_webhook_user_agent
    • wp2static_deploy_webhook_body
    • wp2static_deploy_webhook_headers
    • improved unit test coverage for Detection classes
    • add trailing slash to detected category pagination URLs @john-shaffer
    • rm autoload-dev from composer.json @szepeviktor
    • extend PHPStan coverage to view/template files
    • allow toggling an add-on via WP-CLI
    • new wp2static_detect hook fires at URL detection start @john-shaffer
    • diagnostics checks for trailing slash in permalinks @john-shaffer, @jonmhutch7
    • use safely namespaced Guzzle to avoid conflicts with other plugins
    • default to showing DeployCache paths across all namespaces #745
    • allow setting deploy webhook headers/body/user-agent via filter
    • fix PostsPaginationURL detection #758 @petewilcock, @john-shaffer
    • use custom request options for sitemap crawling
    • move from cURL to Guzzle for requests
    • fix incompatibilities with PHP8
    • import SitemapParser as internal class
    • fix MySQL issue preventing Add-on activations @john-shaffer, @TheLQ
    Source code(tar.gz)
    Source code(zip)
  • 7.1.6(Dec 4, 2020)

  • 7.1.5(Dec 4, 2020)

    WP2Static 7.1.5

    • fix PHP version check to >=7.3
    • fix errors during sitemap detection (thanks @fromcouch)
    • fix errors during cache table initialisation
    • fix pagination URLs not using correct schema
    • fix CLI command registration issue
    Source code(tar.gz)
    Source code(zip)
  • 7.1.2(Nov 3, 2020)

    WP2Static 7.1.2

    • update dependencies
    • add CHANGELOG
    • #682 only toggle other deploy addons, not other types when enabling a deployer
    • rm redundant Composer workaround
    • quieten build output
    • code quality improvements (thanks @szepeviktor!)
    Source code(tar.gz)
    Source code(zip)
Owner
Leon Stafford
Encouraging a more accessible, free and less bloated web.
Leon Stafford
Sculpin — Static Site Generator

Sculpin - PHP Static Site Generator Sculpin takes data sources such as text files (Markdown, Textile, etc.) and transforms them using Twig templates t

Sculpin 1.4k Jan 4, 2023
Phrozn is extremely flexible static site generator in PHP.

Phrozn Phrozn is extremely flexible static site generator in PHP. Philosophy Configurable: you should be able to tune it to your needs SCM-Enabled: no

Povilas Balzaravičius 459 Oct 30, 2022
PHP Static site generator

Spress - PHP Static site generator Spress is a static site generator built with Symfony components. License: MIT. Requirements Linux, Unix, Mac OS X o

Spress 375 Nov 28, 2022
Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil 208 Dec 13, 2022
Site-builder is a simple static site generator. It allows you to create and manage a website out of simple text files and templates.

Site-builder is a simple static site generator. It allows you to create and manage a website out of simple text files and templates. This gives you many of the advantages of a CMS, but because the result is plain old HTML, it's more secure and has higher performance.

Matt Robinson 28 May 24, 2022
Snuffleupagus is a PHP 7+ and 8+ module designed to drastically raise the cost of attacks against websites, by killing entire bug classes

Snuffleupagus is a PHP 7+ and 8+ module designed to drastically raise the cost of attacks against websites, by killing entire bug classes

Julien Voisin 625 Jan 3, 2023
Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.

Jetpack Monorepo This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things. How to

Automattic 1.4k Jan 7, 2023
Sculpin — Static Site Generator

Sculpin - PHP Static Site Generator Sculpin takes data sources such as text files (Markdown, Textile, etc.) and transforms them using Twig templates t

Sculpin 1.4k Jan 4, 2023
Phrozn is extremely flexible static site generator in PHP.

Phrozn Phrozn is extremely flexible static site generator in PHP. Philosophy Configurable: you should be able to tune it to your needs SCM-Enabled: no

Povilas Balzaravičius 459 Oct 30, 2022
PHP Static site generator

Spress - PHP Static site generator Spress is a static site generator built with Symfony components. License: MIT. Requirements Linux, Unix, Mac OS X o

Spress 375 Nov 28, 2022
The official Statamic 3 static site generator package

Statamic Static Site Generator Generate static sites with Statamic 3. Installation Install the package using Composer: composer require statamic/ssg

Statamic 187 Dec 25, 2022
Laravel static site/blog generator with markdown support.

Katana static site & blog generator PHP static site & blog generator with markdown support. Using the power of laravel's Blade templating engine. Kata

Mohamed Said 380 Sep 3, 2022
Laravel Security was created by, and is maintained by Graham Campbell, and is a voku/anti-xss wrapper for Laravel, using graham-campbell/security-core

Laravel Security Laravel Security was created by, and is maintained by Graham Campbell, and is a voku/anti-xss wrapper for Laravel, using graham-campb

Graham Campbell 170 Nov 20, 2022
A multitool library offering access to recommended security related libraries, standardised implementations of security defences, and secure implementations of commonly performed tasks.

SecurityMultiTool A multitool library offering access to recommended security related libraries, standardised implementations of security defences, an

Pádraic Brady 131 Oct 30, 2022
Exploiting and fixing security vulnerabilities of an old version of E-Class. Project implemented as part of the class YS13 Cyber-Security.

Open eClass 2.3 Development of XSS, CSRF, SQLi, RFI attacks/defences of an older,vulnerable version of eclass. Project implemented as part of the clas

Aristi_Papastavrou 11 Apr 23, 2022
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit v3 About phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in

Floe design + technologies 655 Jan 3, 2023
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code.

Floe design + technologies 654 Dec 28, 2022
A multitool library offering access to recommended security related libraries, standardised implementations of security defences, and secure implementations of commonly performed tasks.

SecurityMultiTool A multitool library offering access to recommended security related libraries, standardised implementations of security defences, an

Pádraic Brady 131 Oct 30, 2022
Run your WP site on github pages, php innovation award winner https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Gitpress Run wordpress directly on github pages Gitpress won the innovation award for may 2021 Read more about this https://naveen17797.github.io/gitp

naveen 13 Nov 18, 2022