use wp_ajax in wordpress

  Wp Ajax – WordPress Hook to Handle Ajax Request wp_ajax is not a hook or callback, rather it is just a prefix of hooks or callbacks. Those callbacks  are usually available while making ajax call. When a browser or web-client request with an action query parameter to http://example.com/wp–admin/admin–ajax.php file, a hook becomes available to use. Which use wp_ajax_ as prefix. Brief …

use wp_ajax in wordpress Read More »

EDD Licence expired

  //licence is expired start here if ($response_body[‘license’] == ‘invalid’){ if(isset($response_body[‘error’])){ if($response_body[‘error’] == ‘expired’){ update_option( ‘WCGAAW_LICENSE_STATUS’,‘expired’); return true; } if($response_body[‘error’] == ‘no_activations_left’){ $expiredDate = strtotime(date(‘d-m-Y’, strtotime($response_body[‘expires’]))); $todayDate = strtotime(date(‘d-m-Y’)); if($expiredDate < $todayDate){ update_option( ‘WCGAAW_LICENSE_STATUS’,‘expired’); return true; } } } }

Create log file in php

  function wh_log($log_msg) {     date_default_timezone_set(‘Asia/Kolkata’); $log_filename = $_SERVER[‘DOCUMENT_ROOT’].“/log”; if (!file_exists($log_filename)) { // create directory/folder uploads. mkdir($log_filename, 0777, true); } $log_file_data = $log_filename.‘/log_’ . date(‘d-M-Y’) . ‘.log’; $log_msg = date(‘d-M-Y g:i a’).“–“.$log_msg; file_put_contents($log_file_data, $log_msg . “n“, FILE_APPEND); } wh_log(‘This is a log message’); mkdir( __DIR__ . ‘/logs/’, 0755, true ); $date = date(‘Y-m-d’); $datetime = …

Create log file in php Read More »