View artzustudio.com.har
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"log": { | |
"version": "1.2", | |
"creator": { | |
"name": "WebInspector", | |
"version": "537.36" | |
}, | |
"pages": [ | |
{ |
View LightSail WordPress Cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Welcome to the lightsail-wordpress-cluster wiki! | |
## Instructions, commands and code snippets to use and follow along the Video Tutorial on YouTube. | |
## Create Four LightSail Ubuntu Servers with the appropriate sizing. Name Three instances WP1, WP2, WP3, and name 4th instance LoadBalancer | |
## | |
## Open Ports 443 and 9443 (on LoadBalancer and WP1 in the LightSail Instance networking section) | |
## Run all commands with root (sudo su) | |
### Run following on each of the 3 WordPress instances | |
`ufw allow 80,443,9443,3306,4444,4567,4568/tcp;` |
View import_json_appsscript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import_json_appsscript.js | |
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4 | |
// | |
// Changelog: | |
// (Oct. 16 2019) tag: allenyllee-20191016 | |
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times | |
// (Jul. 16 2018) tag: allenyllee-20180716 | |
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member." | |
// (Nov. 30 2017) tag: allenyllee-20171130 | |
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index |
View facebook_export_json_decode.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
** 使用方式:在下載回來解壓的最上層目錄,執行 php -f facebook_export_json_decode.php 會將目錄下所有 JSON 檔案都轉檔編碼過。 | |
**/ | |
function glob_recursive($pattern, $flags = 0) { | |
$files = glob($pattern, $flags); | |
foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { | |
$files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags)); | |
} | |
return $files; |
View wordpress_fake_post_method.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_fake_post($content, $title = 'Slider Revolution') { | |
$post = new stdClass(); | |
$post->ID = -1; | |
$post->post_author = get_current_user_id(); | |
$post->post_date = current_time('mysql'); | |
$post->post_date_gmt = current_time('mysql', 1); | |
$post->post_title = $title; | |
$post->post_content = $content; | |
$post->post_status = 'publish'; |
View WPBakery_js_composer_hack.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//修正 wp-content/plugins/js_composer/include/classes/core/class-vc-post-admin.php 中 saveAjaxFe 方法的權限補強,補強在方法第一行 | |
$user = wp_get_current_user(); | |
// 僅限制「編輯」、「管理員」與「商店管理員」等級開放編輯,若有其他角色,自行補充 | |
$allowed_roles = array('editor', 'administrator', 'shop_manager'); | |
if (empty(array_intersect($allowed_roles, $user->roles))) { | |
wp_send_json_error(); | |
exit; | |
} |
View get_instagram_media.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 使用 Instagram (Facebook) API 取得用戶圖文的方法,翻譯自原文: https://www.gsarigiannidis.gr/instagram-feed-api-after-june-2020/ | |
* | |
* @param $token // 存取權杖 | |
* @param $user // 用戶編號,查詢工具: https://developers.facebook.com/tools/debug/accesstoken/ | |
* @param int $limit // 查詢圖文筆數(不建議設定太多). | |
* @param string $fields // 其他欄位參考: https://developers.facebook.com/docs/instagram-basic-display-api/reference/media | |
* @param array $restrict // 取得媒體類型: IMAGE, VIDEO, CAROUSEL_ALBUM | |
* |
View find_first_img_to_set_cover.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'wp-load.php'; | |
set_time_limit(0); | |
ini_set('memory_limit', '256M'); | |
add_action('after_setup_theme', function () { | |
add_filter('intermediate_image_sizes', '__return_empty_array'); | |
add_filter('wp_get_attachment_image_src', function ($image, $attachment_id, $size, $icon) { | |
// get a thumbnail or intermediate image if there is one | |
$image = image_downsize($attachment_id, 'full'); |
View fail2ban-wordpress-filter.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Definition] | |
failregex = ^<HOST>.*POST.*wp-admin/.*HTTP\.*\" (500|503|400|403|404).* | |
^<HOST>.*POST.*\" (500|503|400|403|404).* | |
^<HOST>.*POST.*wp-content/.*(php|js|jpg|png).* | |
^<HOST>.*POST.*wp-include/.*(php|js|jpg|png).* |
View mxp-google-adsense-management-with-line-notify.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../vendor/autoload.php'; | |
define('TOKEN_FILENAME', '/PATH/TO/YOUR/TOKENFILE.dat', true); | |
$client = new Google_Client(); | |
$client->addScope('https://www.googleapis.com/auth/adsense.readonly'); | |
$client->setAccessType('offline'); | |
$client->setApprovalPrompt('force'); | |
$client->setAuthConfig('/PATH/TO/YOUR/client_secrets.json'); | |
$auth = ""; |
NewerOlder