Skip to content

Commit

Permalink
Clone wp post
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 16, 2024
1 parent 677975d commit b6b200e
Show file tree
Hide file tree
Showing 18 changed files with 2,944 additions and 2,377 deletions.
308 changes: 31 additions & 277 deletions dist/combined_styles.css

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-ar.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-cs.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-de.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-es.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-fr.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-it.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-ja.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-ko.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-pl.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-pt.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-ru.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-tr.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-zh-CN.html

Large diffs are not rendered by default.

338 changes: 202 additions & 136 deletions dist/index-zh-TW.html

Large diffs are not rendered by default.

263 changes: 70 additions & 193 deletions dist/index.html

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions wordpress-cloning-css-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import requests
from requests.auth import HTTPBasicAuth
from bs4 import BeautifulSoup
import re


def clone_css_files(environment, wordpress_staging_username, wordpress_staging_password):
# Define the base URL based on the environment
Expand All @@ -16,7 +18,7 @@ def clone_css_files(environment, wordpress_staging_username, wordpress_staging_p
f"{base_url}wp-content/uploads/theplus_gutenberg/plus-global.css",
f"{base_url}wp-content/uploads/theplus_gutenberg/plus-css-25163.css",
# f"{base_url}wp-content/plugins/elementor/assets/css/frontend-msie.min.css",
f"{base_url}test-homepage-test", # Add HTML file URL here
f"{base_url}", # Add HTML file URL here
]

# Set up authentication if not in production environment
Expand All @@ -37,7 +39,15 @@ def clone_css_files(environment, wordpress_staging_username, wordpress_staging_p
response = requests.get(url, headers=headers, auth=auth)
if response.status_code == 200:
file.write(f"/* CSS from {url} */\n")
file.write(response.text + "\n\n")
data = response.text
# Remove css issues on the original CSS
data = re.sub(r'@charset "UTF-8";\s*', '', response.text)
data = re.sub(r'\*/\s*/\* ROB 10/07/22', '/* ROB 10/07/22', data)

# Remove the error with the original CSS
print(f"Successfully added CSS from {url} to combined_styles.css")

file.write(data + "\n\n")
print(f"Successfully added CSS from {url} to combined_styles.css")
else:
print(f"Failed to fetch {url}: HTTP {response.status_code}")
Expand All @@ -63,4 +73,6 @@ def clone_css_files(environment, wordpress_staging_username, wordpress_staging_p
env = sys.argv[1]
wordpress_staging_username = sys.argv[2]
wordpress_staging_password = sys.argv[3]


clone_css_files(env, wordpress_staging_username, wordpress_staging_password)
2 changes: 1 addition & 1 deletion wordpress-cloning-purgecss-script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
content: ['dist/index.html'],
css: ['dist/combined_styles.css'],
safelist: [':where(.wp-block-button__link)'],
// safelist: [':where(.wp-block-button__link)'],
output: 'dist/combined_styles.css',
}

0 comments on commit b6b200e

Please sign in to comment.