Skip to content

Instantly share code, notes, and snippets.

View autocircled's full-sized avatar

Moktadir Rahman autocircled

  • TIC Limited
  • Rajshahi, bangladesh
  • 15:38 (UTC +06:00)
View GitHub Profile
@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