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
// place this before any script you want to calculate time | |
$time_start = microtime(true); | |
// Check Time Spend | |
$time_end = microtime(true); | |
$execution_time = ($time_end - $time_start); | |
// Echo Date | |
echo date("H:i:s",$endtime-$starttime); |
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
// Check From Cache Option | |
if ($cache) { | |
$option = get_option('wp_hami_products'); | |
if (!empty($option) and is_array($option) and isset($option['list']) and isset($option['expire']) and is_numeric($option['expire']) and $option['expire'] >= current_time('timestamp')) { | |
return [ | |
'status' => true, | |
'list' => $option['list'], | |
'code' => $option['code'], |
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
``` | |
mysqldump --column-statistics=0 --no-tablespaces --host="localhost" --user="xxxx" --password="xxx" "db_name" | gzip > ~/.backup-database/db_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.sql.gz | |
``` | |
``` | |
wget -q -O - https://xxxx.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 | |
``` | |
``` | |
wget -O /dev/null --spider --no-cache "https://xxx.com/?_sepidar_cron=product" >/dev/null 2>&1 |
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 | |
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']); | |
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']); |
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 | |
/* | |
* Plugin Name: Activate Plugins | |
*/ | |
add_filter( 'option_active_plugins', function ( $plugins ) { | |
$actual_link = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
if(strtoupper($_SERVER['REQUEST_METHOD']) == "POST" and strpos($actual_link, 'admin-ajax.php') !== false and isset($_POST['action']) and $_POST['action'] == "irk_quick_cart"){ |
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 | |
add_action('wp', 'add_custom_wc_cron_job'); | |
function add_custom_wc_cron_job() | |
{ | |
if (!wp_next_scheduled('remove_cancelled_wc_orders')) { | |
wp_schedule_event(time(), 'hourly', 'remove_cancelled_wc_orders'); | |
} | |
} |
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 | |
/* | |
* Plugin Name: Disable WordPress Emails | |
*/ | |
add_filter('pre_wp_mail', '__return_true'); |
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 | |
/* | |
* Plugin Name: Disable Comment Post | |
*/ | |
add_action( 'pre_comment_on_post', function($comment_post_id) { | |
if(preg_match("/[a-z]/i", $_POST['author'])){ | |
wp_die("نام خود را به فارسی وارد نمایید"); |
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 | |
@ini_set('log_errors','Off'); // enable or disable php error logging (use 'On' or 'Off') | |
@ini_set('display_errors','Off'); |
NewerOlder