Skip to content

Instantly share code, notes, and snippets.

View autocircled's full-sized avatar

Moktadir Rahman autocircled

  • TIC Limited
  • Rajshahi, bangladesh
  • 14:31 (UTC +06:00)
View GitHub Profile
#!/bin/sh
#ionCube Extension installer for PHP 8.1 LiteSpeed Servers
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -zxvf ioncube_loaders_lin_x86-64.tar.gz
cp ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20200930/
rm ioncube_loaders_lin_x86-64.tar.gz
rm -rf ioncube
#sudo echo "extension=ioncube_loader_lin_8.1.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/01-ioncube.ini
sudo echo "zend_extension=ioncube_loader_lin_8.1.so" >> /etc/php/8.1/cli/php.ini
sudo systemctl restart lsws
@autocircled
autocircled / functions.php
Created December 20, 2023 12:47
Checkout page customize
// Make postal code optional
add_filter( 'woocommerce_default_address_fields', 'customize_extra_fields', 1000, 1 );
function customize_extra_fields( $address_fields ) {
$address_fields['postcode']['required'] = false; //Postcode
return $address_fields;
}
// Hide checkout fields
function reorder_billing_fields($fields) {
$billing_order = [
@autocircled
autocircled / demo.php
Created September 7, 2022 11:11
Recursively remote call using wp_remote_post
<?php
// Increase day by 1 to call the API for next day
$current_date = date( 'Y-m-d', strtotime( $current_date . '+1 day' ));
// Checking if everything is working fine
$file = plugin_dir_path( __FILE__ ) . '/text.txt'; // This line is not tested yet! So careful before use
file_put_contents( $file, $this->fetched_day_counter . ': Current Date: ' . $current_date . "\n\n", FILE_APPEND );
// Ready for the next day
$this->fetched_day_counter += 1;
@autocircled
autocircled / GoogleIndexing.py
Created January 21, 2022 13:30 — forked from alucard001/GoogleIndexing.py
Google Indexing API V3 Working example with Python 3
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
import json
import pandas as pd
# https://developers.google.com/search/apis/indexing-api/v3/prereqs#header_2
JSON_KEY_FILE = "json_key_file_downloaded_after_creating_your_google_service_account_see_above_details_on_how_to_do.json"
SCOPES = ["https://www.googleapis.com/auth/indexing"]
@autocircled
autocircled / gist:e2271aa3da7b7dd7a2be4b55d38e3f0b
Created October 15, 2021 14:57 — forked from 345161974/gist:63573abdf1dc9c303d6740fb29496657
Python Code for adding posts to WordPress remotely
import urllib
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods import posts
import xmlrpclib
from wordpress_xmlrpc.compat import xmlrpc_client
from wordpress_xmlrpc.methods import media, posts
import os
########################### Read Me First ###############################
'''
------------------------------------------In DETAIL--------------------------------
if( !function_exists( 'load_terms_by_ajax' ) ) {
function load_terms_by_ajax(){
$ky = isset( $_GET['q'] ) && !empty( $_GET['q'] ) ? $_GET['q'] : '';
$term_name = isset( $_GET['key'] ) && !empty( $_GET['key'] ) ? $_GET['key'] : '';
$taxonomy_sarch_args = array('hide_empty' => true,'orderby' => 'name','order' => 'ASC', 'name__like' => $ky, );
$tax_obj = get_terms( $term_name, $taxonomy_sarch_args );
$arr['results'] = array();
if( count( $tax_obj ) > 0 ){
foreach( $tax_obj as $item ){
@autocircled
autocircled / script.js
Created July 22, 2020 13:41
Replace old codes with this javascript codes to wp-content/plugins/favorite-plugin/assets/script.js Only line no. 31 has been added in this file.
jQuery(document).ready(function($){
$(document).on('click', '.wpt-favorite-button', function(){
var $this = $(this);
var product_id = $(this).data('product_id');
var user_id = $(this).data('user_id');
var status = $(this).attr('data-status');
$('.message-favorite-button-' + product_id).html("Loading...");
$.ajax({
type: 'POST',
url: myAjax.ajaxurl,// + get_data,
@autocircled
autocircled / init.php
Last active July 22, 2020 13:42
Add below this code to bottom of the wp-content/plugins/favorite-plugin/init.php
if( !function_exists( 'fav_table_wrapper_class' ) ){
function fav_table_wrapper_class($wrapper_class_arr, $table_ID){
if( $table_ID == get_option( 'favorite_table_id' ) ){
array_push($wrapper_class_arr, 'fav_table_list');
}
return $wrapper_class_arr;
}
add_filter('wpto_wrapper_tag_class_arr', 'fav_table_wrapper_class', 10, 2 );
}
/**
* Plugin Name: ACircle Plugins
* Plugin URI:
* Description: The <code><strong>ACircle</strong></code> plugin allows .....
* Author: AutoCircle
* Author URI: https://devhelp.us/
* Text Domain: acircle-plugins
* Domain Path: /languages/
*
* Version: 1.0.0