https://drive.google.com/file/d/1ZAGpMNAeXrIOj7yIm2nbUXq9mBmBWEOM/view?usp=sharing
https://www.codetab.org/tutorial/wordpress-plugin-development/unit-test/advanced-unit-tests/
https://codesymphony.co/writing-wordpress-plugin-unit-tests/
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# https://www.nginx.com/resources/wiki/start/ | |
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ | |
# https://wiki.debian.org/Nginx/DirectoryStructure | |
# | |
# In most cases, administrators will remove this file from sites-enabled/ and | |
# leave it as reference inside of sites-available where it will continue to be | |
# updated by the nginx packaging team. |
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
define( 'WP_ACCESSIBLE_HOSTS', '*.wordpress.org, *.samyarcloud2.ir' );
<?php | |
/** | |
* Get Post Ids With GROUP_CONCAT | |
* https://stackoverflow.com/questions/11140647/mysql-concat-two-fields-and-use-them-in-where-clause | |
* https://makitweb.com/how-to-concatenate-multiple-columns-in-mysql/ | |
* https://stackoverflow.com/questions/9693099/using-group-concat-in-my-sql-query-with-wp-usermeta-table | |
*/ | |
// User Table {ID, name, user_email} |
<?php | |
$route = 'https://www.quiz24.ir/api/v1/xxxx'; | |
$argument = array( | |
CURLOPT_URL => $route, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 15, | |
CURLOPT_FOLLOWLOCATION => true, |
<?php | |
$post_input_data = json_decode(file_get_contents("php://input"), true); | |
if (isset($post_input_data['woocommerce_order']) and !empty($post_input_data['woocommerce_order'])) { | |
$array = $post_input_data['woocommerce_order']; | |
$data = json_encode($array, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK); | |
file_put_contents(getcwd() . "/order.json", $data); | |
echo 'File is Saved'; | |
exit; | |
} |
<?php | |
// Set digits Plugin Phone Number | |
$phoneNonZero = ltrim($user_login, '0'); | |
update_user_meta($user_id, 'digt_countrycode', '+98'); | |
update_user_meta($user_id, 'digits_phone', '+98' . $phoneNonZero); | |
update_user_meta($user_id, 'digits_phone_no', $phoneNonZero); |
<?php | |
/* | |
* Plugin Name: Login a User | |
*/ | |
add_action('init', function(){ | |
if(isset($_GET['_login_user'])) { | |
// Get By Users ID | |
$user_id = 'Khazaeimilad'; | |
$user = get_user_by( 'login', $user_id ); |
<?php | |
$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
$log = "User: " . $_SERVER['REMOTE_ADDR'] . ' - ' . date("F j, Y, g:i a") . "\n" . | |
"Url: " . $url . "\n" . | |
"Method: " . $_SERVER['REQUEST_METHOD'] . "\n" . | |
"------" . "\n"; | |
//Save string to log, use FILE_APPEND to append. | |
file_put_contents(getcwd() . '/log_user.log', $log, FILE_APPEND); |
// https://wpml.org/forums/topic/get-current-language-3/ | |
// https://wpml.org/faq/how-to-get-current-language-with-wpml/ | |
// https://wpml.org/wpml-hook/wpml_display_language_names/ | |
// https://wpml.org/wpml-hook/wpml_active_languages/ | |
<?php | |
$_lang = apply_filters( 'wpml_current_language', NULL ); | |
if($_lang == "en") { | |
echo 'Language'; | |
} else { |