Plugin Directory

Changeset 1515533


Ignore:
Timestamp:
10/15/2016 05:22:32 PM (9 years ago)
Author:
liwanglin12
Message:

1.72

[Optimize] Update iedie
[Optimize] Update notie
[Optimize] Optimizes the directory structure
[Remove] Plugin report logic

Location:
wp-plus/trunk
Files:
13 added
5 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • wp-plus/trunk/option.php

    r1496346 r1515533  
    11<?php
    22defined('ABSPATH') or exit;
    3 if ($_POST['plus_empty_cron'] == 'true') {
    4     echo '<div id="message" class="updated"><h4>操作已完成!';
    5     var_dump(wp_clear_scheduled_hook('plus_hook_update'));
    6     echo '</h4></div>';
    7 }
    8 if ($_POST['plus_update_info'] == 'true') {
    9     echo '<div id="message" class="updated"><h4>操作已完成!';
    10     var_dump(plus_updateinfo());
    11     echo '</h4></div>';
    12 }
    13 if ($_POST['plus_post_open'] == 'true') {
    14     echo '<div id="message" class="updated"><h4>操作已完成!';
    15     var_dump(plus_post("activate"));
    16     echo '</h4></div>';
    17 }
    183if ($_POST['update_pluginoptions'] == 'true') {
    194    plus_pluginoptions_update();
     
    2611echo plus_version;
    2712?>版本更新日志:<br />
    28 [新增]我也忘了我到底改了些什么,先凑合用,有啥问题再修好了。。。<br />
     13[优化]更新 iedie<br />
     14[优化]更新 notie<br />
     15[优化]优化目录结构<br />
     16[移除]插件回报逻辑
    2917</div>
    3018<form method="POST" action="">
     
    9987    <input type="submit" class="button-primary" value="保存设置" style="margin: 20px 0;" /> &nbsp; WP-Plus 版本 <?php
    10088    echo plus_version;
    101     ?> &nbsp; 插件作者 <a href="http://lwl12.com">liwanglin12</a> &nbsp; <a href="http://blog.lwl12.com/read/wp-plus.html">点击获取最新版本 & 说明</a>
     89    ?> &nbsp; 插件作者 <a href="https://lwl12.com">liwanglin12</a> &nbsp; <a href="http://blog.lwl12.com/read/wp-plus.html">点击获取最新版本 & 说明</a>
    10290</form>
    10391
    104 <hr>
    105 
    106 <p>DEBUG中心</p>此处信息供出现问题时作者分析使用!请勿随意触动此处按钮!<br />
    107 <?php
    108 echo ("下次报告时间");
    109 var_dump(wp_next_scheduled('plus_hook_update'));
    110 echo ("<br />");
    111 echo ("UUID");
    112 var_dump(get_option('wp_plus_uuid'));
    113 echo ("<br />");
    114 ?>
    115 <form method="POST" action="">
    116     <input type="hidden" name="plus_empty_cron" value="true" />
    117     <input type="submit" class="button" value="清空计划任务设置"  style="margin: 10px 0;" />
    118 </form>
    119 <form method="POST" action="">
    120     <input type="hidden" name="plus_update_info" value="true" />
    121     <input type="submit" class="button" value="发送信息刷新事件"  style="margin: 10px 0;" />
    122 </form>
    123 <form method="POST" action="">
    124     <input type="hidden" name="plus_post_open" value="true" />
    125     <input type="submit" class="button" value="发送插件启用事件"  style="margin: 10px 0;" />
    126 </form>
    127 </div>
    12892<?php
    12993/* 插件设置验证*/
  • wp-plus/trunk/readme.txt

    r1496346 r1515533  
    11=== WP-Plus ===
    22Contributors: liwanglin12
    3 Donate link: http://lwl12.com/
     3Donate link: https://lwl12.com/
    44Tags: wordpressplus, wpplus, 增强, 优化, Enhancement, optimization
    55Requires at least: 3.0
    6 Tested up to: 4.5
     6Tested up to: 4.6
    77Stable tag: 1.3
    88License: GPLv2 or later
     
    2929
    3030== Changelog ==
     31= 1.72 =
     32[优化]更新 iedie
     33[优化]更新 notie
     34[优化]优化目录结构
     35[移除]插件回报逻辑
    3136= 1.71 =
    3237[新增]我也忘了我到底改了些什么,先凑合用,有啥问题再修好了。。。
     
    8489
    8590== Upgrade Notice ==
     91= 1.72 =
     92[优化]更新 iedie
     93[优化]更新 notie
     94[优化]优化目录结构
     95[移除]插件回报逻辑
    8696= 1.69 =
    8797[优化]欢迎信息、版权提示采用全新提示框组件(感谢Github@egoist)
  • wp-plus/trunk/wp-plus.php

    r1496346 r1515533  
    55Description: 优化和增强您的博客
    66Author: liwanglin12
    7 Author URI: http://lwl12.com
    8 Version: 1.71
     7Author URI: https://lwl12.com
     8Version: 1.72
    99*/
    1010/*Exit if accessed directly:安全第一,如果是直接载入,就退出.*/
    1111defined('ABSPATH') or exit;
    12 define("plus_version", "1.71");
     12define("plus_version", "1.72");
    1313/* 插件初始化*/
    1414define('WP_PLUS_URL', plugin_dir_url(__FILE__));
    1515register_activation_hook(__FILE__, 'plus_plugin_activate');
    1616register_deactivation_hook(__FILE__, 'plus_plugin_deactivate');
    17 add_action('plus_hook_update', 'plus_updateinfo');
    1817add_action('admin_init', 'plus_plugin_redirect');
    19 function plus_plugin_activate()
    20 {
    21     add_option('do_activation_redirect', true);
    22     for ($i = 0; $i <= 10; $i++) {
    23         if (plus_post("activate") == "success") {
    24             break;
    25         }
    26     }
    27 }
     18
    2819
    2920function plus_plugin_redirect()
    3021{
    31     if (!wp_next_scheduled('plus_hook_update'))
    32         wp_schedule_event(time() + 60, 'hourly', 'plus_hook_update');
    3322    if (get_option('do_activation_redirect', false)) {
    3423        delete_option('do_activation_redirect');
     
    8473    function plus_wpn_enqueue()
    8574    {
    86         wp_enqueue_style('nprogresss', WP_PLUS_URL . 'jdt/nprogress.css');
     75        wp_enqueue_style('nprogresss', WP_PLUS_URL . 'css/nprogress.css?ver=' . plus_version);
    8776       
    88         wp_enqueue_script('nprogress', WP_PLUS_URL . 'jdt/nprogress.js', array(
     77        wp_enqueue_script('nprogress', WP_PLUS_URL . 'js/nprogress.js?ver=' . plus_version, array(
    8978            'jquery'
    9079        ), '0.1.2', true);
    91         wp_enqueue_script('wp-nprogress', WP_PLUS_URL . 'jdt/global.js', array(
     80        wp_enqueue_script('wp-nprogress', WP_PLUS_URL . 'js/global.js?ver=' . plus_version, array(
    9281            'jquery',
    9382            'nprogress'
     
    304293        $msg = welcome_msg();
    305294        if ($msg !== false) {
    306             echo "<script>notie('info', '$msg', true)</script>";
     295            echo "<script>notie('$msg', {type:'info', autoHide:true, timeout: 5000,width:200})</script>";
    307296        }
    308297    }
     
    318307    function plus_ietip()
    319308    {
    320         echo '<!--[if lt IE 10]><script src="//wuyongzhiyong.b0.upaiyun.com/iedie/v1.1/script.min.js"></script><![endif]-->';
     309        echo '<!--[if lt IE 10]><script src="' . WP_PLUS_URL . 'js/iedie.min.js"></script><![endif]-->';
    321310    }
    322311    add_action('wp_head', 'plus_ietip');
     
    366355    function plus_add_prismjs()
    367356    {
    368         wp_register_script('prismJS', WP_PLUS_URL . 'plus_prism.js');
     357        wp_register_script('prismJS', WP_PLUS_URL . 'js/plus_prism.js?ver=' . plus_version);
    369358        wp_enqueue_script('prismJS');
    370359    }
    371360    function plus_add_prismcss()
    372361    {
    373         wp_register_style('prismCSS', WP_PLUS_URL . 'plus_prism.css');
     362        wp_register_style('prismCSS', WP_PLUS_URL . 'css/plus_prism.css?ver=' . plus_version);
    374363        wp_enqueue_style('prismCSS');
    375364    }
     
    391380        if (!is_admin()) {
    392381            wp_deregister_script('jquery');
    393             wp_register_script('jquery', (WP_PLUS_URL . 'jquery.min.js'), false, null, true);
     382            wp_register_script('jquery', (WP_PLUS_URL . 'js/jquery-1.8.2.min.js?ver=' . plus_version), false, null, true);
    394383            wp_enqueue_script('jquery');
    395384        }
     
    408397    function plus_copyright()
    409398    {
    410         echo '<script>function plus_copyright(){document.body.addEventListener("copy", function (e) { if (window.getSelection().toString().length > '. get_option("wp_plus_copyright_num") .') { setClipboardText(e); notie("error", "商业转载请联系作者获得授权,非商业转载请注明出处", true); } }); function setClipboardText(event) { event.preventDefault(); var htmlData = "" + "著作权归作者所有。<br>" + "商业转载请联系作者获得授权,非商业转载请注明出处。<br>" + "作者:' . get_the_author() . '<br>" + "链接:" + window.location.href + "<br>" + "来源:' . get_bloginfo('name') . '<br><br>" + window.getSelection().toString(); var textData = "" + "著作权归作者所有。\n" + "商业转载请联系作者获得授权,非商业转载请注明出处。\n" + "作者:' . get_the_author() . '\n" + "链接:" + window.location.href + "\n" + "来源:' . get_bloginfo('name') . '\n\n" + window.getSelection().toString(); if (event.clipboardData) { event.clipboardData.setData("text/html", htmlData); event.clipboardData.setData("text/plain",textData); } else if (window.clipboardData) { return window.clipboardData.setData("text", textData); } }}</script>';
     399        echo '<script>function plus_copyright(){document.body.addEventListener("copy", function (e) { if (window.getSelection().toString().length > '. get_option("wp_plus_copyright_num") .') { setClipboardText(e); notie("商业转载请联系作者获得授权,非商业转载请注明出处", {type:"error", autoHide:true, timeout: 5000,width:200}); } }); function setClipboardText(event) { event.preventDefault(); var htmlData = "" + "著作权归作者所有。<br>" + "商业转载请联系作者获得授权,非商业转载请注明出处。<br>" + "作者:' . get_the_author() . '<br>" + "链接:" + window.location.href + "<br>" + "来源:' . get_bloginfo('name') . '<br><br>" + window.getSelection().toString(); var textData = "" + "著作权归作者所有。\n" + "商业转载请联系作者获得授权,非商业转载请注明出处。\n" + "作者:' . get_the_author() . '\n" + "链接:" + window.location.href + "\n" + "来源:' . get_bloginfo('name') . '\n\n" + window.getSelection().toString(); if (event.clipboardData) { event.clipboardData.setData("text/html", htmlData); event.clipboardData.setData("text/plain",textData); } else if (window.clipboardData) { return window.clipboardData.setData("text", textData); } }}</script>';
    411400        if (is_single()) {
    412401            echo '<script>plus_copyright();</script>';
     
    429418            $time = time() - get_the_modified_date('U');
    430419            if ($time > get_option("wp_plus_oldpost_num") * 86400) {
    431                 return $content . "<script>window.plus_oldpost = function(){notie('warning', '此文章最后修订于 ". floor($time / 86400) ." 天前,其中的信息可能已经有所发展或是发生改变', true);};plus_oldpost();</script>";
     420                return $content . "<script>window.plus_oldpost = function(){notie('此文章最后修订于 ". floor($time / 86400) ." 天前,其中的信息可能已经有所发展或是发生改变', {type:'warning', autoHide:true, timeout: 5000,width:200});};plus_oldpost();</script>";
    432421            }
    433422        }
     
    471460?>
    472461<?php
    473 /**
    474  * [plus_post 用于向LWL插件统计API发送数据]
    475  * @param  [text] $action [动作]
    476  * @return [type]         [成功返回返回内容,失败返回false]
    477  * 请勿修改或删除此段代码,这非常重要!
    478  */
    479 function plus_post($action)
    480 {
    481     if (get_option('wp_plus_uuid', "") == "") {
    482         $chars = md5(uniqid(mt_rand(), true));
    483         $uuid  = substr($chars, 0, 8) . '-';
    484         $uuid .= substr($chars, 8, 4) . '-';
    485         $uuid .= substr($chars, 12, 4) . '-';
    486         $uuid .= substr($chars, 16, 4) . '-';
    487         $uuid .= substr($chars, 20, 12);
    488         add_option('wp_plus_uuid', "wp_plus_" . $uuid);
    489     }
    490     $args = array(
    491         'uuid' => get_option('wp_plus_uuid'),
    492         'url' => get_bloginfo('url'),
    493         'name' => get_bloginfo('name'),
    494         'version' => plus_version,
    495         'action' => $action
    496     );
    497    
    498     $response = wp_remote_post('https://api.lwl12.com/wordpress/plugin/wpplus/post.php', array(
    499         'body' => $args
    500     ));
    501    
    502     if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200)
    503         return (false);
    504     else
    505         return (wp_remote_retrieve_body($response));
    506 }
    507462function plus_updateinfo()
    508463{
     
    510465}
    511466function plus_loadalert(){
    512     wp_register_script('notieJS', WP_PLUS_URL . 'alert/notie.js');
     467    wp_register_script('notieJS', WP_PLUS_URL . 'js/notie.min.js');
    513468    wp_enqueue_script('notieJS');
    514469}
Note: See TracChangeset for help on using the changeset viewer.