Changeset 1515533
- Timestamp:
- 10/15/2016 05:22:32 PM (9 years ago)
- Location:
- wp-plus/trunk
- Files:
-
- 13 added
- 5 deleted
- 3 edited
-
README.md (added)
-
alert (deleted)
-
css (added)
-
css/index.php (added)
-
css/nprogress.css (added)
-
css/plus_prism.css (added)
-
jdt (deleted)
-
jquery.min.js (deleted)
-
js (added)
-
js/global.js (added)
-
js/iedie.min.js (added)
-
js/index.php (added)
-
js/jquery-1.8.2.min.js (added)
-
js/notie.min.js (added)
-
js/nprogress.js (added)
-
js/plus_prism.js (added)
-
option.php (modified) (3 diffs)
-
plus_prism.css (deleted)
-
plus_prism.js (deleted)
-
readme.txt (modified) (3 diffs)
-
wp-plus.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-plus/trunk/option.php
r1496346 r1515533 1 1 <?php 2 2 defined('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 }18 3 if ($_POST['update_pluginoptions'] == 'true') { 19 4 plus_pluginoptions_update(); … … 26 11 echo plus_version; 27 12 ?>版本更新日志:<br /> 28 [新增]我也忘了我到底改了些什么,先凑合用,有啥问题再修好了。。。<br /> 13 [优化]更新 iedie<br /> 14 [优化]更新 notie<br /> 15 [优化]优化目录结构<br /> 16 [移除]插件回报逻辑 29 17 </div> 30 18 <form method="POST" action=""> … … 99 87 <input type="submit" class="button-primary" value="保存设置" style="margin: 20px 0;" /> WP-Plus 版本 <?php 100 88 echo plus_version; 101 ?> 插件作者 <a href="http ://lwl12.com">liwanglin12</a> <a href="http://blog.lwl12.com/read/wp-plus.html">点击获取最新版本 & 说明</a>89 ?> 插件作者 <a href="https://lwl12.com">liwanglin12</a> <a href="http://blog.lwl12.com/read/wp-plus.html">点击获取最新版本 & 说明</a> 102 90 </form> 103 91 104 <hr>105 106 <p>DEBUG中心</p>此处信息供出现问题时作者分析使用!请勿随意触动此处按钮!<br />107 <?php108 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>128 92 <?php 129 93 /* 插件设置验证*/ -
wp-plus/trunk/readme.txt
r1496346 r1515533 1 1 === WP-Plus === 2 2 Contributors: liwanglin12 3 Donate link: http ://lwl12.com/3 Donate link: https://lwl12.com/ 4 4 Tags: wordpressplus, wpplus, 增强, 优化, Enhancement, optimization 5 5 Requires at least: 3.0 6 Tested up to: 4. 56 Tested up to: 4.6 7 7 Stable tag: 1.3 8 8 License: GPLv2 or later … … 29 29 30 30 == Changelog == 31 = 1.72 = 32 [优化]更新 iedie 33 [优化]更新 notie 34 [优化]优化目录结构 35 [移除]插件回报逻辑 31 36 = 1.71 = 32 37 [新增]我也忘了我到底改了些什么,先凑合用,有啥问题再修好了。。。 … … 84 89 85 90 == Upgrade Notice == 91 = 1.72 = 92 [优化]更新 iedie 93 [优化]更新 notie 94 [优化]优化目录结构 95 [移除]插件回报逻辑 86 96 = 1.69 = 87 97 [优化]欢迎信息、版权提示采用全新提示框组件(感谢Github@egoist) -
wp-plus/trunk/wp-plus.php
r1496346 r1515533 5 5 Description: 优化和增强您的博客 6 6 Author: liwanglin12 7 Author URI: http ://lwl12.com8 Version: 1.7 17 Author URI: https://lwl12.com 8 Version: 1.72 9 9 */ 10 10 /*Exit if accessed directly:安全第一,如果是直接载入,就退出.*/ 11 11 defined('ABSPATH') or exit; 12 define("plus_version", "1.7 1");12 define("plus_version", "1.72"); 13 13 /* 插件初始化*/ 14 14 define('WP_PLUS_URL', plugin_dir_url(__FILE__)); 15 15 register_activation_hook(__FILE__, 'plus_plugin_activate'); 16 16 register_deactivation_hook(__FILE__, 'plus_plugin_deactivate'); 17 add_action('plus_hook_update', 'plus_updateinfo');18 17 add_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 28 19 29 20 function plus_plugin_redirect() 30 21 { 31 if (!wp_next_scheduled('plus_hook_update'))32 wp_schedule_event(time() + 60, 'hourly', 'plus_hook_update');33 22 if (get_option('do_activation_redirect', false)) { 34 23 delete_option('do_activation_redirect'); … … 84 73 function plus_wpn_enqueue() 85 74 { 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); 87 76 88 wp_enqueue_script('nprogress', WP_PLUS_URL . 'j dt/nprogress.js', array(77 wp_enqueue_script('nprogress', WP_PLUS_URL . 'js/nprogress.js?ver=' . plus_version, array( 89 78 'jquery' 90 79 ), '0.1.2', true); 91 wp_enqueue_script('wp-nprogress', WP_PLUS_URL . 'j dt/global.js', array(80 wp_enqueue_script('wp-nprogress', WP_PLUS_URL . 'js/global.js?ver=' . plus_version, array( 92 81 'jquery', 93 82 'nprogress' … … 304 293 $msg = welcome_msg(); 305 294 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>"; 307 296 } 308 297 } … … 318 307 function plus_ietip() 319 308 { 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]-->'; 321 310 } 322 311 add_action('wp_head', 'plus_ietip'); … … 366 355 function plus_add_prismjs() 367 356 { 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); 369 358 wp_enqueue_script('prismJS'); 370 359 } 371 360 function plus_add_prismcss() 372 361 { 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); 374 363 wp_enqueue_style('prismCSS'); 375 364 } … … 391 380 if (!is_admin()) { 392 381 wp_deregister_script('jquery'); 393 wp_register_script('jquery', (WP_PLUS_URL . 'j query.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); 394 383 wp_enqueue_script('jquery'); 395 384 } … … 408 397 function plus_copyright() 409 398 { 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>'; 411 400 if (is_single()) { 412 401 echo '<script>plus_copyright();</script>'; … … 429 418 $time = time() - get_the_modified_date('U'); 430 419 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>"; 432 421 } 433 422 } … … 471 460 ?> 472 461 <?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' => $action496 );497 498 $response = wp_remote_post('https://api.lwl12.com/wordpress/plugin/wpplus/post.php', array(499 'body' => $args500 ));501 502 if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200)503 return (false);504 else505 return (wp_remote_retrieve_body($response));506 }507 462 function plus_updateinfo() 508 463 { … … 510 465 } 511 466 function 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'); 513 468 wp_enqueue_script('notieJS'); 514 469 }
Note: See TracChangeset
for help on using the changeset viewer.