MK69988A
[LT]?php /* Plugin Name: WxSync Plugin URI: http://std.cloud Description: 标准云微信公众号文章免费采集、[LT]strong>任意公众号自动采集5元/月[LT]/strong> Version: 2.7.17 Author: 标准云(std.cloud) Author URI: http://std.cloud License: GPL */ if ( ! defined( ‘ABSPATH’ ) ) exit; if(!class_exists(‘simple_html_dom_node’)){ require_once(“simple_html_dom.php”); } register_activation_hook(__FILE__, ‘wxsync_install’); if(is_admin()){ add_action(‘admin_menu’, ‘wxsync_admin_menu’); } add_action(‘init’, ‘wxsync_onrequest’); add_filter(‘post_link’, ‘link_format_url’, 10, 2); $GLOBALS[‘wxsync_act_finish’] = 0; $GLOBALS[‘wxsync_tab’] = ”; $GLOBALS[‘wxsync_error’] = array(); $GLOBALS[‘wxsync_ver’] = ‘2.7.17’; $GLOBALS[‘wxsync_code’] = 0; $GLOBALS[‘wxsync_pageurl_open’] = 0; function wxsync_admin_menu() { if(current_user_can(‘level_1’)){ add_menu_page(“标准云微信公众号文章采集与同步”, “WxSync”, 1, “标准云微信公众号文章采集与同步”, “wxsync_admin”); } } function wxsync_admin(){ require_once ‘setting.php’; } function link_format_url($link, $post) { if(!$GLOBALS[‘wxsync_pageurl_open’]){ return $link; } $aa = get_post_meta($post->ID, ‘wxsync_pageurl’, true); if ($aa) { $link = $aa; } return $link; } function wxsync_onrequest(){ $req = array(); $keys = array(‘wxsync_tab’,’article_urls’,’wxsync_settoken’,’wxsync_token’,’article_thumbnail’ ,’urls’,’override’,’article_time’,’article_status’,’article_cate’,’article_source’,’article_style’,’wxsync_setsourcetxt’,’article_type’,’article_checkrepeat’ ,’wxsync_rmheadimg’,’wxsync_rmtailimg’,’wxsync_replace_words’,’article_imgurl’,’article_href’,’article_debug’,’article_raw’ ,’host’,’port’,’username’,’password’,’article_remotetag’,’article_remote_a_href’ ,’article_userid’,’article_removeblank’,’article_tags’ ); foreach ($keys as $one){ if(isset($_REQUEST[$one])){ if($one == ‘article_raw’){ $req[$one] = stripslashes($_REQUEST[$one]); }else if($one == ‘wxsync_replace_words’){ $req[$one] = stripslashes($_REQUEST[$one]); setcookie($one,$req[$one],time()+31536000); }else{ $req[$one] = sanitize_text_field($_REQUEST[$one]); $_COOKIE[$one] = $_REQUEST[$one]; setcookie($one,$_REQUEST[$one],time()+31536000); } } } wp_enqueue_style(‘wxsync_main_css’, plugins_url(‘/libs/wxsync.css’, __FILE__), array(), ‘1.0.2’, ‘screen’); if(empty($req[‘wxsync_tab’])){ return; } if(!empty($req[‘wxsync_rmheadimg’])){ $req[‘wxsync_rmheadimg’] = explode(‘#’,$req[‘wxsync_rmheadimg’]); } if(!empty($req[‘wxsync_rmtailimg’])){ $req[‘wxsync_rmtailimg’] = explode(‘#’,$req[‘wxs
