sudo npm install -g localtunnel
Запустить тунель в интернет на локальный хост http://127.0.0.1:8000
lt --port 8000
lt -l sitename.local --port 80
<?php | |
/** | |
* !@note Проверка что запрос к api был с того же источника что и сам роут | |
*/ | |
function validate_request_origin(/* WP_REST_Request $request */) { | |
$request_origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : ''; | |
$site_url = parse_url(get_site_url()); | |
if (parse_url($request_origin, PHP_URL_HOST) === $site_url['host']) { |
<?php | |
function write_csv_register_rest_route() | |
{ | |
register_rest_route('write_csv/v1', '/process', array( | |
'methods' => 'POST', | |
'callback' => 'write_csv_process_callback', | |
'permission_callback' => 'validate_request_origin' | |
)); | |
} |
sudo npm install -g localtunnel
lt --port 8000
lt -l sitename.local --port 80
let tags = ['TITLE', 'META', 'SCRIPT', 'HEAD', 'LINK', 'STYLE']
document.querySelectorAll('*').forEach(function(node) {
if (!tags.includes(node.tagName)) {
if (window.getComputedStyle(node).display === 'none' || window.getComputedStyle(node).visibility === 'hidden') {
console.log(node)
node.style.display = 'block';
node.style.visibility = 'visible';
node.style.border = '3px solid red';
node.style.position = 'fixed';