<?php
if(!class_exists("WooDeliveryBase")) {
class WooDeliveryBase {
public $key = "BA4D01763DDDE31A";
private $product_id = "59";
private $product_base = "woodelivery";
private $server_host = "https://www.themelooks.com/wp-json/licensor/";
private $hasCheckUpdate=true;
private $isEncryptUpdate=false;
private $pluginFile;
private static $selfobj=null;
private $version="";
private $isTheme=false;
private $emailAddress = "";
private static $_onDeleteLicense=[];
function __construct($plugin_base_file='')
{
$this->pluginFile=$plugin_base_file;
$dir=dirname($plugin_base_file);
$dir=str_replace('\\','/',$dir);
if(strpos($dir,'wp-content/themes')!==FALSE){
$this->isTheme=true;
}
$this->version=$this->getCurrentVersion();
if($this->hasCheckUpdate) {
if(function_exists("add_action")){
add_action( 'admin_post_woodelivery_fupc', function(){
update_option('_site_transient_update_plugins','');
update_option('_site_transient_update_themes','');
set_site_transient('update_themes', null);
delete_transient($this->product_base."_up");
wp_redirect( admin_url( 'plugins.php' ) );
exit;
});
add_action( 'init', [$this,"initActionHandler"]);
}
if(function_exists("add_filter")) {
//
if($this->isTheme){
add_filter('pre_set_site_transient_update_themes', [$this, "PluginUpdate"]);
add_filter('themes_api', [$this, 'checkUpdateInfo'], 10, 3);
}else{
add_filter('pre_set_site_transient_update_plugins', [$this, "PluginUpdate"]);
add_filter('plugins_api', [$this, 'checkUpdateInfo'], 10, 3);
add_filter( 'plugin_row_meta', function($links, $plugin_file ){
if ( $plugin_file == plugin_basename( $this->pluginFile ) ) {
$links[] = " <a class='edit coption' href='" . esc_url( admin_url( 'admin-post.php' ) . '?action=woodelivery_fupc' ) . "'>Update Check</a>";
}
return $links;
}, 10, 2 );
add_action( "in_plugin_update_message-".plugin_basename( $this->pluginFile ), [$this,'updateMessageCB'], 20, 2 );
}
}
}
}
public function setEmailAddress( $emailAddress ) {
$this->emailAddress = $emailAddress;
}
function initActionHandler(){
$handler=hash("crc32b",$this->product_id.$this->key.$this->getDomain())."_handle";
if(isset($_GET['action']) && $_GET['action']==$handler){
$this->handleServerRequest();
exit;
}
}
function handleServerRequest(){
$type=isset($_GET['type'])?strtolower($_GET['type']):"";
switch ($type) {
case "rl": //remove license
$this->cleanUpdateInfo();
$this->removeOldWPResponse();
$obj = new stdClass();
$obj->product = $this->product_id;
$obj->status = true;
echo $this->encryptObj( $obj );
return;
case "rc": //remove license
$key = $this->getKeyName();
delete_option( $key );
$obj = new stdClass();
$obj->product = $this->product_id;
$obj->status = true;
echo $this->encryptObj( $obj );
return;
case "dl": //delete plugins
$obj = new stdClass();
$obj->product = $this->product_id;
$obj->status = false;
$this->removeOldWPResponse();
require_once( ABSPATH . 'wp-admin/includes/file.php' );
if ( $this->isTheme ) {
$res = delete_theme( $this->pluginFile );
if ( ! is_wp_error( $res ) ) {
$obj->status = true;
}
echo $this->encryptObj( $obj );
} else {
deactivate_plugins( [ plugin_basename( $this->pluginFile ) ] );
$res = delete_plugins( [ plugin_basename( $this->pluginFile ) ] );
if ( ! is_wp_error( $res ) ) {
$obj->status = true;
}
echo $this->encryptObj( $obj );
}
return;
default:
return;
}
}
/**
* @param callable $func
*/
static function addOnDelete( $func){
self::$_onDeleteLicense[]=$func;
}
function getCurrentVersion(){
if( !function_exists('get_plugin_data') ){
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
$data=get_plugin_data($this->pluginFile);
if(isset($data['Version'])){
return $data['Version'];
}
return 0;
}
public function cleanUpdateInfo(){
update_option('_site_transient_update_plugins','');
update_option('_site_transient_update_themes','');
delete_transient($this->product_base."_up");
}
public function updateMessageCB($data, $response){
if(is_array($data)){
$data=(object)$data;
}
if(isset($data->package) && empty($data->package)) {
if(empty($data->update_denied_type)) {
print "<br/><span style='display: block; border-top: 1px solid #ccc;padding-top: 5px; margin-top: 10px;'>Please <strong>active product</strong> or <strong>renew support period</strong> to get latest version</span>";
}elseif($data->update_denied_type=="L"){
print "<br/><span style='display: block; border-top: 1px solid #ccc;padding-top: 5px; margin-top: 10px;'>Please <strong>active product</strong> to get latest version</span>";
}elseif($data->update_denied_type=="S"){
print "<br/><span style='display: block; border-top: 1px solid #ccc;padding-top: 5px; margin-top: 10px;'>Please <strong>renew support period</strong> to get latest version</span>";
}
}
}
function __plugin_updateInfo(){
if(function_exists("wp_remote_get")) {
$response = get_transient( $this->product_base."_up" );
$oldFound = false;
if ( ! empty( $response['data'] ) ) {
$response = unserialize( $this->decrypt( $response['data'] ) );
if ( is_array( $response ) ) {
$oldFound = true;
}
}
if ( ! $oldFound ) {
$licenseInfo=self::GetRegisterInfo();
$url=$this->server_host . "product/update/" . $this->product_id;
if(!empty($licenseInfo->license_key)) {
$url.="/".$licenseInfo->license_key."/".$this->version;
}
$args=[
'sslverify' => true,
'timeout' => 120,
'redirection' => 5,
'cookies' => array()
];
$response = wp_remote_get( $url,$args);
if (is_wp_error($response)) {
$args['sslverify']=false;
$response = wp_remote_get( $url,$args);
}
}
if (!is_wp_error($response)) {
$body = $response['body'];
$responseJson = @json_decode( $body );
if ( ! $oldFound ) {
set_transient( $this->product_base."_up", [ "data" => $this->encrypt( serialize( [ 'body' => $body ] ) ) ], DAY_IN_SECONDS );
}
if(!(is_object( $responseJson ) && isset($responseJson->status )) && $this->isEncryptUpdate){
$body=$this->decrypt($body,$this->key);
$responseJson = json_decode( $body );
}
if ( is_object( $responseJson ) && ! empty( $responseJson->status ) && ! empty( $responseJson->data->new_version ) ) {
$responseJson->data->slug = plugin_basen
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v1.2.0.zip
共138个文件
php:51个
svg:23个
png:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 153 浏览量
2022-04-07
17:35:17
上传
评论
收藏 3.34MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v1.2.0 WooDelivery | Delivery & Pickup Date Time for WooCommerce Woodelivery | Woocommerce的交付和拾取日期时间" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v1.2.0.zip (138个子文件)
font-awesome.min.css 57KB
font-awesome.min.css 57KB
app.css 45KB
admin.css 27KB
mdtimepicker.css 17KB
fbMyAccount.css 10KB
license-style.css 2KB
custom.css 0B
fa-solid-900.eot 198KB
fa-solid-900.eot 198KB
fontawesome-webfont.eot 162KB
fa-brands-400.eot 130KB
fa-brands-400.eot 130KB
fa-regular-400.eot 34KB
fa-regular-400.eot 34KB
flexslider-icon.eot 2KB
cart.jpg 2KB
woodelivery.js 44KB
admin.js 10KB
mdtimepicker.min.js 10KB
location.js 2KB
installed.json 69B
LICENSE 1KB
the-little-dwarf-498.mp3 87KB
and-a-happy-new-year-sms-513.mp3 85KB
WooDeliveryBase.php 28KB
Woo_Hooks.php 22KB
Day_Based_Time.php 14KB
ClassLoader.php 13KB
Helper.php 12KB
woodelivery.php 12KB
Date_Time_Map.php 10KB
Ability_Checker_Form.php 8KB
Components_Ajax.php 6KB
autoload_static.php 5KB
Delivery_Settings_Tab.php 4KB
template-modal-cart-content.php 4KB
Hooks.php 4KB
autoload_classmap.php 4KB
Text.php 3KB
InstalledVersions.php 3KB
Location_Settings_Tab.php 3KB
enqueue.php 3KB
Admin_Templates_Map.php 3KB
ZipcodeMultiInput.php 3KB
kmFeeRepeater.php 3KB
Admin.php 2KB
Products_Ajax.php 2KB
Zipcode.php 2KB
Textrepeater.php 2KB
Settings_Fields_Base.php 2KB
LocationSearch.php 2KB
autoload_real.php 2KB
MultipleSelect.php 2KB
Tip_Settings_Tab.php 2KB
Location_Distance.php 2KB
Selectbox.php 2KB
MediaUpload.php 2KB
Text.php 2KB
Location_Visitor.php 2KB
Number.php 1KB
TimezoneSelect.php 1KB
Admin_Menu.php 1KB
Colorpicker.php 1KB
Checkbox.php 1KB
Timepicker.php 1KB
Textarea.php 1KB
template-modal-wrapper.php 1KB
Google_API.php 1KB
General_Settings_Tab.php 856B
template-modal-steps.php 768B
installed.php 436B
autoload_psr4.php 317B
template-modal-alert.php 190B
autoload.php 178B
autoload_namespaces.php 149B
smile.png 2KB
favicon.png 1KB
cart.png 1KB
pngfuel.com.png 1KB
located_me_icon.png 489B
[email protected] 344B
mapmarkar.png 251B
sort_both.png 201B
sort_asc.png 160B
sort_desc.png 158B
sort_asc_disabled.png 148B
sort_desc_disabled.png 146B
woodelivery.pot 13KB
fa-solid-900.svg 876KB
fa-solid-900.svg 876KB
fa-brands-400.svg 699KB
fa-brands-400.svg 699KB
fontawesome-webfont.svg 434KB
fa-regular-400.svg 141KB
fa-regular-400.svg 141KB
flexslider-icon.svg 2KB
共 138 条
- 1
- 2
资源评论
Lee达森
- 粉丝: 966
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功