From acacb543a31877c354e795b568aa7442b889ea42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E5=B7=9D=20=E7=9E=B3?= <61381142+mirai-mamori@users.noreply.github.com> Date: Sat, 22 Aug 2020 14:22:58 +0800 Subject: [PATCH 1/2] Seventh Moon Update Step 1 --- footer.php | 2 +- inc/decorate.php | 13 ++- inc/login.css | 8 +- style.css | 221 ++++++++++++++++++++++++----------------------- 4 files changed, 128 insertions(+), 116 deletions(-) diff --git a/footer.php b/footer.php index 5ef6bbe2..e76872c5 100644 --- a/footer.php +++ b/footer.php @@ -32,7 +32,7 @@
- Theme Sakurairo by Hitomi + Theme Sakurairo by Fuukei diff --git a/inc/decorate.php b/inc/decorate.php index 0fedb62c..79b6563b 100644 --- a/inc/decorate.php +++ b/inc/decorate.php @@ -111,6 +111,10 @@ function customizer_css() { ?> .sorry li a:hover { color: ; } +.header-info p:hover { + color: ; + transition: all .4s; +} .post-tags a:hover { color: } @@ -395,6 +399,12 @@ function customizer_css() { ?> .the-feature a { color: ; } +#moblieGoTop:hover, +#changskin:hover { + color: ; + background-color: #fff; + opacity: .8; +} .menu-list li:hover { background-color: ; } @@ -956,7 +966,8 @@ function customizer_css() { ?> html,#main-container,.pattern-center:after,#mo-nav,.headertop-bar::after,.comments,.site-footer,.pattern-center-blank,.yya,.blank,.toc,.search-form input,.wrapper,.site-footer,.site-wrapper,#moblieGoTop:hover,#changskin:hover,.post-list-show,.post-list hr,.post-date,.float-content i:hover{transition:background 1s;} .entry-content p,.entry-content ul,.entry-content ol,.comments .body p,.float-content,.post-list p,.link-title{transition:color 1s;} h1.fes-title,h1.main-title{transition:color 1s;transition:border 1s;} -.header-info p, .header-info, .focusinfo .header-tou img, .top-social img, .center-text{transition:color 1s;transition:background 1s;} +.header-info, .focusinfo .header-tou img, .top-social img, .center-text{transition:color 1s;transition:background 1s;} +.header-info p {transition:color .4s;} /*字重*/ diff --git a/inc/login.css b/inc/login.css index 0e1b7856..864bcb88 100644 --- a/inc/login.css +++ b/inc/login.css @@ -152,7 +152,7 @@ color: #676767 !important} font-size:16px; text-align:center; color:#FFF; - /*background:#EE9CA7;*/ + /*background:#FB98C0;*/ font-weight:normal; cursor:pointer; box-shadow: none; @@ -285,7 +285,7 @@ input[type=checkbox]:checked:before { background: #fff; z-index: 3; cursor: move; - /*color: #EE9CA7;*/ + /*color: #FB98C0;*/ font-size: 38px; font-weight: 900; border-radius: 12px; @@ -301,7 +301,7 @@ input[type=checkbox]:checked:before { font-style: oblique; color: #FFF; border-radius: 12px; - /*background-color: #EE9CA7;*/ + /*background-color: #FB98C0;*/ line-height: 46px; text-align: center; z-index: 2; @@ -360,7 +360,7 @@ input[type=checkbox]:checked:before { } /*.forgetmenot input:checked + label { - background: #EE9CA7; + background: #FB98C0; }*/ .forgetmenot input:checked + label:after { diff --git a/style.css b/style.css index 28210282..2dc4f07f 100644 --- a/style.css +++ b/style.css @@ -3,10 +3,10 @@ /* Theme Name: Sakurairo Theme URI: https://github.com/mirai-mamori/Sakurairo -Author: Hitomi , Ukenn , Spirit , Bymoye , Mashiro +Author: made by FUUKEI Author URI: https://asuhe.jp/ Description: A colorful, Easy-to-use, Perfect Experience, and Powerful Customizable WordPress Theme (Based on Theme Sakura) -Version: 1.20.1 +Version: 1.20.7 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: sakurairo @@ -323,7 +323,7 @@ button, input, select, textarea { - color: #EE9CA7; + color: #FB98C0; font-size: 15px; line-height: 1.5 } @@ -361,7 +361,7 @@ blockquote:before { position: absolute; top: -25px; left: 12px; - color: #EE9CA7; + color: #FB98C0; font-family: FontAwesome } @@ -371,7 +371,7 @@ blockquote:after { position: absolute; bottom: -25px; right: -5px; - color: #EE9CA7; + color: #FB98C0; font-family: FontAwesome } @@ -547,7 +547,7 @@ input[type=url], input[type=week], textarea { color: #666; - border: 1px solid #EE9CA7; + border: 1px solid #FB98C0; border-radius: 15px } @@ -609,7 +609,7 @@ a { a:active, a:focus, a:hover { - color: #EE9CA7 + color: #FB98C0 } a:focus { @@ -619,7 +619,7 @@ a:focus { a:active, a:hover { outline: 0; - color: #EE9CA7 + color: #FB98C0 } .site-top { @@ -844,7 +844,7 @@ a:hover { font-size: 16px; outline: 0; background-color: #fff; - color: #EE9CA7; + color: #FB98C0; cursor: pointer; padding: 15px; border-radius: 10px; @@ -863,7 +863,7 @@ a:hover { font-size: 16px; outline: 0; background-color: #fff; - color: #EE9CA7; + color: #FB98C0; cursor: pointer; padding: 15px; border-radius: 10px; @@ -1035,7 +1035,7 @@ a:hover { .yya { position: fixed; left: 0; - background: rgba(255, 250, 250, .92); + background: rgba(255, 255, 255, .75); box-shadow: 0 1px 40px -8px rgba(255, 221, 225, .4) } @@ -1046,7 +1046,7 @@ a:hover { } .site-header:hover { - background-color: #fffafa + background-color: rgba(255, 255, 255, .9); } .sabit { @@ -1072,7 +1072,7 @@ a:hover { } .site-title a:hover { - color: #EE9CA7 + color: #FB98C0 } .site-title img { @@ -1152,11 +1152,11 @@ a:hover { .site-top ul li a { padding: 10px 0; display: inline-block; - color: #EE9CA7 + color: #FB98C0 } .site-top ul li a:hover { - color: #EE9CA7 + color: #FB98C0 } .site-top ul li a:after { @@ -1223,7 +1223,7 @@ a:hover { width: 28px; margin-left: -15px; height: 2px; - background: #EE9CA7; + background: #FB98C0; -webkit-transition: all .2s ease } @@ -1404,7 +1404,7 @@ a:hover { } .entry-title a:hover { - color: #EE9CA7 + color: #FB98C0 } .p-time { @@ -1447,7 +1447,7 @@ i.iconfont.hotpost { .post-more i { font-size: 25px; - color: #EE9CA7 + color: #FB98C0 } .post-more i:hover { @@ -1559,7 +1559,7 @@ i.iconfont.hotpost { width: max-content; padding: 2px 7px 2px 7px; border-radius: 6px; - color: #EE9CA7; + color: #FB98C0; } .post-meta, @@ -1629,7 +1629,7 @@ i.iconfont.hotpost { .float-content i { font-size: 25px; - color: #EE9CA7 + color: #FB98C0 } .float-content p { @@ -1790,8 +1790,8 @@ i.iconfont.hotpost { .navigator i:hover { color: #fff; - background: #EE9CA7; - border: 2px solid #EE9CA7; + background: #FB98C0; + border: 2px solid #FB98C0; -webkit-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; @@ -1816,7 +1816,7 @@ i.iconfont.hotpost { } .site-info a:hover { - color: #EE9CA7 + color: #FB98C0 } .footertext p { @@ -1876,7 +1876,7 @@ h1.page-title { font-weight: 400; border: 1px dashed #ddd; padding: 10px 15px; - color: #EE9CA7; + color: #FB98C0; margin-bottom: 30px } @@ -1919,7 +1919,7 @@ h1.page-title.mb- { } .post-tags a:hover { - color: #EE9CA7 + color: #FB98C0 } .post-tags i { @@ -1993,7 +1993,7 @@ h1.page-title.mb- { } .post-share ul li a:hover { - color: #EE9CA7 + color: #FB98C0 } .post-share .show-share { @@ -2781,7 +2781,7 @@ h1.works-title { #archives-temp h2 { font-weight: 400; - color: #EE9CA7; + color: #FB98C0; padding-bottom: 15px; border-bottom: 1px dashed #F1F1F1; text-align: center @@ -2792,7 +2792,7 @@ h1.works-title { font-style: italic; font-size: 20px; font-weight: 400; - color: #EE9CA7; + color: #FB98C0; margin-left: 30px; margin-top: 50px } @@ -2823,7 +2823,7 @@ span.time { .ar-time i { padding: 10px; border-radius: 100px; - background: #EE9CA7; + background: #FB98C0; color: #fff } @@ -2853,7 +2853,7 @@ span.time { span.ar-circle { height: 10px; width: 10px; - background: #EE9CA7; + background: #FB98C0; display: inline-block; position: absolute; left: -5px; @@ -2876,7 +2876,7 @@ h1.cat-title { font-weight: 400; padding-right: 15px; border-right: 1px dashed #ddd; - color: #EE9CA7 + color: #FB98C0 } .cat-des p { @@ -2906,7 +2906,7 @@ header.page-header { .links ul li { width: 32%; float: left; - border: 1px solid #EE9CA7; + border: 1px solid #FB98C0; padding: 10px 15px; margin: 4px 4px; position: relative; @@ -2918,7 +2918,7 @@ header.page-header { .links ul li img { float: left; - box-shadow: inset 0 0 10px #EE9CA7; + box-shadow: inset 0 0 10px #FB98C0; padding: 5px; opacity: 1; transform: rotate(0); @@ -2949,7 +2949,7 @@ span.sitename { font-size: 20px; margin-top: 85px; margin-left: 8px; - color: #EE9CA7; + color: #FB98C0; padding-bottom: 10px; display: block; -webkit-transition: all .3s; @@ -2965,7 +2965,7 @@ span.sitename { font-size: 14px; padding: 4px 0; margin-left: 8px; - border-top: 1px dotted #EE9CA7; + border-top: 1px dotted #FB98C0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -2984,12 +2984,12 @@ span.sitename { .link-title span.link-fix { padding-left: 10px; - border-left: 3px solid #EE9CA7; + border-left: 3px solid #FB98C0; } .links ul li:before { content: ""; - background-color: #EE9CA7; + background-color: #FB98C0; -webkit-transform: skew(45deg, 0); transform: skew(45deg, 0); width: 0; @@ -3004,7 +3004,7 @@ span.sitename { .links ul li:hover { color: #27323A; - border: 1px solid #EE9CA7 + border: 1px solid #FB98C0 } .links ul li:hover:before { @@ -3179,7 +3179,7 @@ a.page-numbers { } .comment .body .comment-at { - color: #EE9CA7; + color: #FB98C0; text-decoration: none } @@ -3328,7 +3328,7 @@ a.page-numbers { } .comment h4 a:hover { - color: #EE9CA7 + color: #FB98C0 } .comment hr { @@ -3466,7 +3466,7 @@ a.page-numbers { } .commentbody:focus { - border-color: #EE9CA7; + border-color: #FB98C0; transition: border-color .25s } @@ -3483,7 +3483,7 @@ a.page-numbers { .commentbody:not(:placeholder-shown)~.input-label, .commentbody:focus~.input-label { color: #fff; - background-color: #EE9CA7; + background-color: #FB98C0; transform: scale(.75) translate(-2px, -37px); border-radius: 3px } @@ -3661,7 +3661,7 @@ a.page-numbers { h1.fes-title, h1.main-title { - color: #EE9CA7; + color: #FB98C0; font-size: 18px; font-weight: 400; padding-bottom: 10px; @@ -3890,7 +3890,7 @@ li.feature-2 { } .focusinfo .header-tou img { - box-shadow: inset 0 0 10px #EE9CA7; + box-shadow: inset 0 0 10px #FB98C0; padding: 5px; opacity: 1; transform: rotate(0); @@ -3990,7 +3990,7 @@ li.feature-2 { width: 63%; margin: auto; font-size: 16px; - color: #EE9CA7; + color: #FB98C0; background: rgba(255, 250, 250, 0.92); padding: 15px; margin-top: 22px; @@ -4020,7 +4020,8 @@ li.feature-2 { font-family: Ubuntu, sans-serif; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap + white-space: nowrap; + transition:color .4s; } .top-social { @@ -4138,7 +4139,7 @@ li.feature-2 { } i.iconfont.js-toggle-search.iconsearch { - color: #EE9CA7; + color: #FB98C0; cursor: pointer; font-size: 20px; -webkit-transition: all .3s ease-in-out; @@ -4202,7 +4203,7 @@ i.iconfont.js-toggle-search.iconsearch { .search_close:after, .search_close:before { - background-color: #EE9CA7; + background-color: #FB98C0; position: absolute; content: ""; width: 30px; @@ -4246,19 +4247,19 @@ i.iconfont.js-toggle-search.iconsearch { } .search-form input::-webkit-input-placeholder { - color: #EE9CA7 + color: #FB98C0 } .search-form input:-moz-placeholder { - color: #EE9CA7 + color: #FB98C0 } .search-form input::-moz-placeholder { - color: #EE9CA7 + color: #FB98C0 } .search-form input:-ms-input-placeholder { - color: #EE9CA7 + color: #FB98C0 } .s-search { @@ -4282,7 +4283,7 @@ i.iconfont.js-toggle-search.iconsearch { font-size: 32px; font-size: 1.5rem; line-height: 1; - color: #EE9CA7; + color: #FB98C0; position: absolute; bottom: 12px; margin-top: -16px; @@ -4348,7 +4349,7 @@ i.iconfont.js-toggle-search.iconsearch { .ins-section .fa { font-size: 18px; - color: #EE9CA7; + color: #FB98C0; bottom: unset; left: 12px; margin-top: -3px; @@ -4377,9 +4378,9 @@ body.dark .ins-section .fa { text-align: center; padding: 8px 15px; z-index: 1; - color: #EE9CA7; - border-bottom: 3px solid #EE9CA7; - border-color: #EE9CA7; + color: #FB98C0; + border-bottom: 3px solid #FB98C0; + border-color: #FB98C0; } .ins-section .ins-search-item header, @@ -4414,7 +4415,7 @@ body.dark .ins-section .fa { .ins-section .ins-search-item.active .ins-search-preview, .ins-section .ins-search-item:hover header, .ins-section .ins-search-item:hover .iconfont { - color: #EE9CA7; + color: #FB98C0; } .sorry ul { @@ -4423,11 +4424,11 @@ body.dark .ins-section .fa { } .sorry li a { - color: #EE9CA7 + color: #FB98C0 } .sorry { - color: #EE9CA7; + color: #FB98C0; margin-bottom: 80px } @@ -4436,12 +4437,12 @@ body.dark .ins-section .fa { } .sorry li a:hover { - color: #EE9CA7 + color: #FB98C0 } .sorry-inner { padding: 20px; - border: 1px solid #EE9CA7 + border: 1px solid #FB98C0 } .error-img { @@ -4455,15 +4456,15 @@ body.dark .ins-section .fa { .err-button.back a { padding: 10px 30px; margin: 0 10px; - border: 1px solid #EE9CA7; - color: #EE9CA7; + border: 1px solid #FB98C0; + color: #FB98C0; -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px } #gohome { - background: #EE9CA7; + background: #FB98C0; color: #fff } @@ -4854,7 +4855,7 @@ object { } #nprogress .bar { - background: #EE9CA7; + background: #FB98C0; position: fixed; z-index: 1031; top: 0; @@ -4869,7 +4870,7 @@ object { right: 0; width: 100px; height: 100%; - box-shadow: 0 0 10px #EE9CA7, 0 0 5px #EE9CA7; + box-shadow: 0 0 10px #FB98C0, 0 0 5px #FB98C0; opacity: 1; -webkit-transform: rotate(3deg) translate(0, -4px); -ms-transform: rotate(3deg) translate(0, -4px); @@ -4893,8 +4894,8 @@ object { height: 20px; box-sizing: border-box; border: solid 3px transparent; - border-top-color: #EE9CA7; - border-left-color: #EE9CA7; + border-top-color: #FB98C0; + border-left-color: #FB98C0; border-radius: 50%; -webkit-animation: nprogress-spinner .4s linear infinite; animation: nprogress-spinner .4s linear infinite @@ -5020,8 +5021,8 @@ i.iconfont.down { } #pagination a:hover { - border: 1px solid #EE9CA7; - color: #EE9CA7 + border: 1px solid #FB98C0; + color: #FB98C0 } #pagination .loading, @@ -5203,7 +5204,7 @@ i.iconfont.down { display: none } .links ul li:hover .sitename { - color: #EE9CA7 + color: #FB98C0 } .links ul li:hover .linkdes { color: #949494; @@ -5303,14 +5304,14 @@ i.iconfont.down { position: absolute; width: 30px; height: 3px; - background-color: #EE9CA7; + background-color: #FB98C0; top: 30px; left: 20px } .openNav .icon:after, .openNav .icon:before { transition-duration: .5s; - background-color: #EE9CA7; + background-color: #FB98C0; position: absolute; content: ""; width: 30px; @@ -5401,7 +5402,7 @@ i.iconfont.down { text-align: left } #mo-nav ul li a { - color: #EE9CA7; + color: #FB98C0; font-size: 15px } #mo-nav li ul { @@ -5418,7 +5419,7 @@ i.iconfont.down { } #mo-nav ul li a:hover { cursor: pointer; - color: #EE9CA7 + color: #FB98C0 } .we-content li { height: 250px @@ -5467,7 +5468,7 @@ i.iconfont.down { } ::-webkit-scrollbar-thumb { - background-color: #EE9CA7 + background-color: #FB98C0 } @keyframes poi-deg { @@ -5749,8 +5750,8 @@ i.iconfont.down { .ex-login input.login-button:hover, .ex-register input.register-button:hover { - background-color: #EE9CA7; - border-color: #EE9CA7; + background-color: #FB98C0; + border-color: #FB98C0; color: #fff } @@ -5863,7 +5864,7 @@ i.iconfont.down { .herder-user-name { font-size: 12px; padding: 10px 10px; - color: #EE9CA7; + color: #FB98C0; border-radius: 4px 4px 0 0 } @@ -5888,7 +5889,7 @@ i.iconfont.down { margin: 2px 0; width: 110px; text-align: left; - color: #EE9CA7; + color: #FB98C0; font-size: 13px; text-align: center } @@ -5906,7 +5907,7 @@ i.iconfont.down { .no-logged a { display: initial; - color: #EE9CA7; + color: #FB98C0; font-size: 14px; padding: 0 5px; text-decoration: underline @@ -6352,7 +6353,7 @@ button.botui-actions-buttons-button { } .logolink a { - color: #EE9CA7; + color: #FB98C0; float: left; font-size: 25px; font-weight: 800; @@ -6756,7 +6757,7 @@ input[type=radio]:checked:before { @media (min-width:861px) { .hide-live2d { - background-color: #EE9CA7; + background-color: #FB98C0; bottom: 156px; visibility: visible; min-height: 38.75px @@ -6845,7 +6846,7 @@ input[type=radio]:checked:before { border: 0; outline: 0; background-color: #fff; - color: #EE9CA7; + color: #FB98C0; cursor: pointer; padding: 15px; border-radius: 10px; @@ -7237,7 +7238,7 @@ li>ol { } .art .art-content #archives a:hover { - color: #EE9CA7 + color: #FB98C0 } .art .art-content #archives .al_year { @@ -7247,7 +7248,7 @@ li>ol { .art .art-content .al_mon_list .al_post_list>li, .art-content #archives .al_mon_list .al_mon { position: relative; - color: #EE9CA7; + color: #FB98C0; } .art-content #archives .al_mon_list .al_mon, @@ -7255,7 +7256,7 @@ li>ol { padding: 0; border-radius: 0; margin: 0; - color: #ee9CA7; + color: #FB98C0; background: 0 0; font-weight: 400 } @@ -7282,7 +7283,7 @@ li>ol { .art .art-content .al_mon_list .al_post_list>li:after { position: absolute; left: 118px; - background: #EE9CA7; + background: #FB98C0; height: 8px; width: 8px; border-radius: 6px; @@ -7304,7 +7305,7 @@ li>ol { .art-content #archives .al_mon_list .al_mon:after { position: absolute; left: 116px; - background: #EE9CA7; + background: #FB98C0; height: 12px; width: 12px; border-radius: 6px; @@ -7325,7 +7326,7 @@ li>ol { max-height: 100%; height: 100%; width: 4px; - background: #EE9CA7; + background: #FB98C0; position: absolute; left: 120px; content: ""; @@ -7340,7 +7341,7 @@ li>ol { .art .art-content .al_mon_list .al_post_list>li:after, .art-content #archives .al_mon_list .al_mon:after { - background: #EE9CA7 + background: #FB98C0 } .toc-container { @@ -7423,7 +7424,7 @@ a.toc-link { } .is-active-link::before { - background-color: #EE9CA7/*!important*/ + background-color: #FB98C0/*!important*/ /*mark*/ } @@ -7589,11 +7590,11 @@ a.toc-link { .motion-switcher-table th:hover { background-color: rgba(245, 245, 245, .5); - color: #EE9CA7 + color: #FB98C0 } .motion-switcher-table .on-hover { - color: #EE9CA7 + color: #FB98C0 } .motion-container { @@ -7638,7 +7639,7 @@ a.toc-link { margin: 3px 3px; display: inline-block; border-radius: 4px; - color: #EE9CA7 + color: #FB98C0 } .menhera-container .emoji-item:hover { @@ -7671,7 +7672,7 @@ a.toc-link { position: fixed; top: 0; height: 3px; - background: #EE9CA7; + background: #FB98C0; transiton-property: width, background; transition-duration: 1s, 1s; z-index: 99999 @@ -7882,8 +7883,8 @@ a.toc-link { } .insert-image-tips:hover { - color: #EE9CA7; - border: 1px solid #EE9CA7 + color: #FB98C0; + border: 1px solid #FB98C0 } .insert-image-button { @@ -7898,8 +7899,8 @@ a.toc-link { } .insert-image-tips-hover { - color: #EE9CA7; - border: 1px solid #EE9CA7 + color: #FB98C0; + border: 1px solid #FB98C0 } .upload-image-preview { @@ -7948,7 +7949,7 @@ a.toc-link { } .the-feature a { - color: #EE9CA7 + color: #FB98C0 } .the-feature a:hover { @@ -8300,7 +8301,7 @@ td.hljs-ln-numbers { .skin-menu { position: fixed; left: auto; - bottom: 10px; + bottom: 12px; right: -50px; height: auto; width: 220px; @@ -8351,7 +8352,7 @@ td.hljs-ln-numbers { cursor: pointer } .menu-list li:hover { - background-color: #EE9CA7; + background-color: #FB98C0; color: #fff } .skin-menu .row-container.font-family-controls { @@ -8363,7 +8364,7 @@ td.hljs-ln-numbers { border-radius: 5px; padding: 5px 5px; height: 43px; - color: #EE9CA7; + color: #FB98C0; width: calc(50% - 11px); font-size: 15px; font-weight: 400; @@ -8376,11 +8377,11 @@ td.hljs-ln-numbers { cursor: pointer } .font-family-controls button.selected { - background-color: #EE9CA7; + background-color: #FB98C0; color: #fff } .font-family-controls button:hover { - background-color: #EE9CA7; + background-color: #FB98C0; color: #fff } .control-btn-serif { @@ -8451,7 +8452,7 @@ td.hljs-ln-numbers { left: 0 !important } #aplayer-float .aplayer-lrc-current { - color: #EE9CA7; + color: #FB98C0; font-size: 15px; font-weight: 700 } @@ -8631,7 +8632,7 @@ h6[id*=toc-head]::before { width: 100%; height: 100%; border-radius: 50%; - background-color: #EE9CA7; + background-color: #FB98C0; opacity: 0.6; position: absolute; top: 0; @@ -8849,7 +8850,7 @@ h6[id*=toc-head]::before { height: 100%; } .bangumi-next i { - color: #EE9CA7; + color: #FB98C0; } .shortcodestyle { margin: 20px 0px !important; From a2935b4c3d25e81db76025a6b9b46bfa411a3b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=93=E5=B7=9D=20=E7=9E=B3?= <61381142+mirai-mamori@users.noreply.github.com> Date: Sun, 23 Aug 2020 16:12:02 +0800 Subject: [PATCH 2/2] Seventh Moon Update Step 2 --- README.md | 2 +- options.php | 12 +- update-checker/.editorconfig | 15 ++ update-checker/Puc/v4/Factory.php | 2 +- .../Puc/{v4p9 => v4p10}/Autoloader.php | 22 ++- .../{v4p9 => v4p10}/DebugBar/Extension.php | 25 ++- .../Puc/{v4p9 => v4p10}/DebugBar/Panel.php | 6 +- .../DebugBar/PluginExtension.php | 8 +- .../{v4p9 => v4p10}/DebugBar/PluginPanel.php | 6 +- .../{v4p9 => v4p10}/DebugBar/ThemePanel.php | 6 +- .../Puc/{v4p9 => v4p10}/Factory.php | 69 ++++++++- .../Puc/{v4p9 => v4p10}/InstalledPackage.php | 6 +- .../Puc/{v4p9 => v4p10}/Metadata.php | 4 +- .../Puc/{v4p9 => v4p10}/OAuthSignature.php | 4 +- .../Puc/{v4p9 => v4p10}/Plugin/Info.php | 6 +- .../Puc/{v4p9 => v4p10}/Plugin/Package.php | 10 +- .../Puc/{v4p9 => v4p10}/Plugin/Ui.php | 6 +- .../Puc/{v4p9 => v4p10}/Plugin/Update.php | 20 +-- .../{v4p9 => v4p10}/Plugin/UpdateChecker.php | 50 +++--- .../Puc/{v4p9 => v4p10}/Scheduler.php | 44 +++++- .../Puc/{v4p9 => v4p10}/StateStore.php | 18 +-- .../Puc/{v4p9 => v4p10}/Theme/Package.php | 4 +- .../Puc/{v4p9 => v4p10}/Theme/Update.php | 8 +- .../{v4p9 => v4p10}/Theme/UpdateChecker.php | 30 ++-- update-checker/Puc/{v4p9 => v4p10}/Update.php | 4 +- .../Puc/{v4p9 => v4p10}/UpdateChecker.php | 142 +++++++++++++----- .../Puc/{v4p9 => v4p10}/UpgraderStatus.php | 4 +- update-checker/Puc/{v4p9 => v4p10}/Utils.php | 4 +- .../Puc/{v4p9 => v4p10}/Vcs/Api.php | 14 +- .../Puc/{v4p9 => v4p10}/Vcs/BaseChecker.php | 6 +- .../Puc/{v4p9 => v4p10}/Vcs/BitBucketApi.php | 24 +-- .../Puc/{v4p9 => v4p10}/Vcs/GitHubApi.php | 18 +-- .../Puc/{v4p9 => v4p10}/Vcs/GitLabApi.php | 16 +- .../Vcs/PluginUpdateChecker.php | 21 ++- .../Puc/{v4p9 => v4p10}/Vcs/Reference.php | 4 +- .../Vcs/ThemeUpdateChecker.php | 18 +-- update-checker/composer.json | 2 +- .../languages/plugin-update-checker-ca.mo | Bin 1186 -> 0 bytes .../languages/plugin-update-checker-ca.po | 48 ------ .../languages/plugin-update-checker-cs_CZ.mo | Bin 1077 -> 0 bytes .../languages/plugin-update-checker-cs_CZ.po | 45 ------ .../languages/plugin-update-checker-da_DK.mo | Bin 1010 -> 0 bytes .../languages/plugin-update-checker-da_DK.po | 42 ------ .../languages/plugin-update-checker-de_DE.mo | Bin 980 -> 0 bytes .../languages/plugin-update-checker-de_DE.po | 38 ----- .../languages/plugin-update-checker-es_ES.mo | Bin 1178 -> 0 bytes .../languages/plugin-update-checker-fa_IR.mo | Bin 1128 -> 0 bytes .../languages/plugin-update-checker-fa_IR.po | 38 ----- .../languages/plugin-update-checker-fr_CA.mo | Bin 1208 -> 0 bytes .../languages/plugin-update-checker-fr_CA.po | 48 ------ .../languages/plugin-update-checker-fr_FR.mo | Bin 1066 -> 0 bytes .../languages/plugin-update-checker-fr_FR.po | 42 ------ .../languages/plugin-update-checker-hu_HU.mo | Bin 982 -> 0 bytes .../languages/plugin-update-checker-hu_HU.po | 41 ----- .../languages/plugin-update-checker-it_IT.mo | Bin 989 -> 0 bytes .../languages/plugin-update-checker-it_IT.po | 38 ----- .../languages/plugin-update-checker-ja.mo | Bin 1454 -> 0 bytes .../languages/plugin-update-checker-ja.po | 57 ------- .../languages/plugin-update-checker-nl_BE.mo | Bin 1211 -> 0 bytes .../languages/plugin-update-checker-nl_BE.po | 48 ------ .../languages/plugin-update-checker-nl_NL.mo | Bin 1211 -> 0 bytes .../languages/plugin-update-checker-nl_NL.po | 48 ------ .../languages/plugin-update-checker-pt_BR.mo | Bin 1014 -> 0 bytes .../languages/plugin-update-checker-pt_BR.po | 48 ------ .../languages/plugin-update-checker-sl_SI.mo | Bin 1203 -> 0 bytes .../languages/plugin-update-checker-sl_SI.po | 48 ------ .../languages/plugin-update-checker-sv_SE.mo | Bin 1006 -> 0 bytes .../languages/plugin-update-checker-sv_SE.po | 42 ------ .../languages/plugin-update-checker-zh_CN.mo | Bin 0 -> 1060 bytes ...s_ES.po => plugin-update-checker-zh_CN.po} | 22 +-- .../languages/plugin-update-checker.pot | 16 +- update-checker/load-v4p10.php | 28 ++++ update-checker/load-v4p9.php | 28 ---- update-checker/update-checker.php | 4 +- update-checker/vendor/PucReadmeParser.php | 7 + 75 files changed, 501 insertions(+), 935 deletions(-) create mode 100644 update-checker/.editorconfig rename update-checker/Puc/{v4p9 => v4p10}/Autoloader.php (66%) rename update-checker/Puc/{v4p9 => v4p10}/DebugBar/Extension.php (86%) rename update-checker/Puc/{v4p9 => v4p10}/DebugBar/Panel.php (96%) rename update-checker/Puc/{v4p9 => v4p10}/DebugBar/PluginExtension.php (72%) rename update-checker/Puc/{v4p9 => v4p10}/DebugBar/PluginPanel.php (80%) rename update-checker/Puc/{v4p9 => v4p10}/DebugBar/ThemePanel.php (66%) rename update-checker/Puc/{v4p9 => v4p10}/Factory.php (81%) rename update-checker/Puc/{v4p9 => v4p10}/InstalledPackage.php (95%) rename update-checker/Puc/{v4p9 => v4p10}/Metadata.php (97%) rename update-checker/Puc/{v4p9 => v4p10}/OAuthSignature.php (96%) rename update-checker/Puc/{v4p9 => v4p10}/Plugin/Info.php (95%) rename update-checker/Puc/{v4p9 => v4p10}/Plugin/Package.php (94%) rename update-checker/Puc/{v4p9 => v4p10}/Plugin/Ui.php (98%) rename update-checker/Puc/{v4p9 => v4p10}/Plugin/Update.php (81%) rename update-checker/Puc/{v4p9 => v4p10}/Plugin/UpdateChecker.php (89%) rename update-checker/Puc/{v4p9 => v4p10}/Scheduler.php (84%) rename update-checker/Puc/{v4p9 => v4p10}/StateStore.php (89%) rename update-checker/Puc/{v4p9 => v4p10}/Theme/Package.php (92%) rename update-checker/Puc/{v4p9 => v4p10}/Theme/Update.php (89%) rename update-checker/Puc/{v4p9 => v4p10}/Theme/UpdateChecker.php (81%) rename update-checker/Puc/{v4p9 => v4p10}/Update.php (84%) rename update-checker/Puc/{v4p9 => v4p10}/UpdateChecker.php (87%) rename update-checker/Puc/{v4p9 => v4p10}/UpgraderStatus.php (98%) rename update-checker/Puc/{v4p9 => v4p10}/Utils.php (96%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/Api.php (96%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/BaseChecker.php (75%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/BitBucketApi.php (91%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/GitHubApi.php (96%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/GitLabApi.php (95%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/PluginUpdateChecker.php (91%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/Reference.php (91%) rename update-checker/Puc/{v4p9 => v4p10}/Vcs/ThemeUpdateChecker.php (85%) delete mode 100644 update-checker/languages/plugin-update-checker-ca.mo delete mode 100644 update-checker/languages/plugin-update-checker-ca.po delete mode 100644 update-checker/languages/plugin-update-checker-cs_CZ.mo delete mode 100644 update-checker/languages/plugin-update-checker-cs_CZ.po delete mode 100644 update-checker/languages/plugin-update-checker-da_DK.mo delete mode 100644 update-checker/languages/plugin-update-checker-da_DK.po delete mode 100644 update-checker/languages/plugin-update-checker-de_DE.mo delete mode 100644 update-checker/languages/plugin-update-checker-de_DE.po delete mode 100644 update-checker/languages/plugin-update-checker-es_ES.mo delete mode 100644 update-checker/languages/plugin-update-checker-fa_IR.mo delete mode 100644 update-checker/languages/plugin-update-checker-fa_IR.po delete mode 100644 update-checker/languages/plugin-update-checker-fr_CA.mo delete mode 100644 update-checker/languages/plugin-update-checker-fr_CA.po delete mode 100644 update-checker/languages/plugin-update-checker-fr_FR.mo delete mode 100644 update-checker/languages/plugin-update-checker-fr_FR.po delete mode 100644 update-checker/languages/plugin-update-checker-hu_HU.mo delete mode 100644 update-checker/languages/plugin-update-checker-hu_HU.po delete mode 100644 update-checker/languages/plugin-update-checker-it_IT.mo delete mode 100644 update-checker/languages/plugin-update-checker-it_IT.po delete mode 100644 update-checker/languages/plugin-update-checker-ja.mo delete mode 100644 update-checker/languages/plugin-update-checker-ja.po delete mode 100644 update-checker/languages/plugin-update-checker-nl_BE.mo delete mode 100644 update-checker/languages/plugin-update-checker-nl_BE.po delete mode 100644 update-checker/languages/plugin-update-checker-nl_NL.mo delete mode 100644 update-checker/languages/plugin-update-checker-nl_NL.po delete mode 100644 update-checker/languages/plugin-update-checker-pt_BR.mo delete mode 100644 update-checker/languages/plugin-update-checker-pt_BR.po delete mode 100644 update-checker/languages/plugin-update-checker-sl_SI.mo delete mode 100644 update-checker/languages/plugin-update-checker-sl_SI.po delete mode 100644 update-checker/languages/plugin-update-checker-sv_SE.mo delete mode 100644 update-checker/languages/plugin-update-checker-sv_SE.po create mode 100644 update-checker/languages/plugin-update-checker-zh_CN.mo rename update-checker/languages/{plugin-update-checker-es_ES.po => plugin-update-checker-zh_CN.po} (67%) create mode 100644 update-checker/load-v4p10.php delete mode 100644 update-checker/load-v4p9.php diff --git a/README.md b/README.md index 69edb0fe..20e325ec 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ > 一个多彩,轻松上手,体验完善,具有强大自定义功能的WordPress主题(基于 [Sakura](https://github.com/mashirozx/Sakura) 主题) -[![GitHub release](https://img.shields.io/github/v/release/mirai-mamori/Sakurairo.svg?style=for-the-badge&logo=appveyor)](https://github.com/mirai-mamori/Sakurairo/releases/latest)[![GitHub Release Date](https://img.shields.io/github/release-date/mirai-mamori/Sakurairo?style=for-the-badge&logo=appveyor)](https://github.com/mirai-mamori/Sakurairo/releases)![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/mirai-mamori/Sakurairo?style=for-the-badge&logo=appveyor)[![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hm/mirai-mamori/sakurairo?color=red&logo=jsdelivr&logoColor=red&style=for-the-badge)](https://www.jsdelivr.com/package/gh/mirai-mamori/sakurairo) +[![GitHub release](https://img.shields.io/github/v/release/mirai-mamori/Sakurairo.svg?style=for-the-badge&logo=appveyor)](https://github.com/mirai-mamori/Sakurairo/releases/latest)[![GitHub Release Date](https://img.shields.io/github/release-date/mirai-mamori/Sakurairo?style=for-the-badge&logo=appveyor)](https://github.com/mirai-mamori/Sakurairo/releases)![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/mirai-mamori/Sakurairo?style=for-the-badge&logo=appveyor)[![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hm/Fuukei/Public_Repository?color=red&logo=jsdelivr&logoColor=red&style=for-the-badge)](https://www.jsdelivr.com/package/gh/mirai-mamori/sakurairo) ## 宣传视频(帮助你更好了解本主题特性): diff --git a/options.php b/options.php index cf554c98..74503b94 100644 --- a/options.php +++ b/options.php @@ -283,7 +283,7 @@ function optionsframework_options() 'name' => __('Footer Info', 'sakurairo'), 'desc' => __('Footer description, support for HTML code', 'sakurairo'), 'id' => 'footer_info', - 'std' => 'Copyright © by Hitomi All Rights Reserved.', + 'std' => 'Copyright © by FUUKEI All Rights Reserved.', 'type' => 'textarea'); $options[] = array( @@ -313,7 +313,7 @@ function optionsframework_options() 'options' => array( 'tag' => 'https://img.shields.io/github/v/release/mirai-mamori/Sakurairo.svg?style=flat-square', 'tag2' => 'https://img.shields.io/github/release-date/mirai-mamori/Sakurairo?style=flat-square', - 'tag3' => 'https://data.jsdelivr.com/v1/package/gh/mirai-mamori/sakurairo/badge', + 'tag3' => 'https://data.jsdelivr.com/v1/package/gh/Fuukei/Public_Repository/badge', ), ); @@ -1625,7 +1625,7 @@ function optionsframework_options() 'name' => __('Cherry Blossom Falling Effect', 'sakurairo'), 'desc' => __('Check open', 'sakurairo'), 'id' => 'sakurajs', - 'std' => '1', + 'std' => '0', 'type' => 'checkbox'); $options[] = array( @@ -1645,7 +1645,7 @@ function optionsframework_options() 'name' => __('Wave Effects', 'sakurairo'), 'desc' => __('Check open', 'sakurairo'), 'id' => 'bolangcss', - 'std' => '1', + 'std' => '0', 'type' => 'checkbox'); $options[] = array( @@ -1660,7 +1660,7 @@ function optionsframework_options() 'name' => __('live2D', 'sakurairo'), 'desc' => __('Check open', 'sakurairo'), 'id' => 'live2djs', - 'std' => '1', + 'std' => '0', 'type' => 'checkbox'); $options[] = array( @@ -1696,7 +1696,7 @@ function optionsframework_options() 'name' => __('A Brief Remark', 'sakurairo'), 'desc' => __('Check open', 'sakurairo'), 'id' => 'oneword', - 'std' => '1', + 'std' => '0', 'type' => 'checkbox'); $options[] = array( diff --git a/update-checker/.editorconfig b/update-checker/.editorconfig new file mode 100644 index 00000000..1b51cad9 --- /dev/null +++ b/update-checker/.editorconfig @@ -0,0 +1,15 @@ +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=false +indent_style=tab +tab_width=4 + +[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] +indent_style=space +indent_size=4 + +[*.svg] +indent_style=space +indent_size=4 + diff --git a/update-checker/Puc/v4/Factory.php b/update-checker/Puc/v4/Factory.php index 3723e008..32673c96 100644 --- a/update-checker/Puc/v4/Factory.php +++ b/update-checker/Puc/v4/Factory.php @@ -1,6 +1,6 @@ prefix = $nameParts[0] . '_' . $nameParts[1] . '_'; - $this->libraryDir = realpath($this->rootDir . '../..') . '/'; + $this->libraryDir = $this->rootDir . '../..'; + if ( !self::isPhar() ) { + $this->libraryDir = realpath($this->libraryDir); + } + $this->libraryDir = $this->libraryDir . '/'; + $this->staticMap = array( 'PucReadmeParser' => 'vendor/PucReadmeParser.php', 'Parsedown' => 'vendor/Parsedown.php', @@ -24,6 +29,17 @@ public function __construct() { spl_autoload_register(array($this, 'autoload')); } + /** + * Determine if this file is running as part of a Phar archive. + * + * @return bool + */ + private static function isPhar() { + //Check if the current file path starts with "phar://". + static $pharProtocol = 'phar://'; + return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol); + } + public function autoload($className) { if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) { /** @noinspection PhpIncludeInspection */ diff --git a/update-checker/Puc/v4p9/DebugBar/Extension.php b/update-checker/Puc/v4p10/DebugBar/Extension.php similarity index 86% rename from update-checker/Puc/v4p9/DebugBar/Extension.php rename to update-checker/Puc/v4p10/DebugBar/Extension.php index 94017896..deba8c2c 100644 --- a/update-checker/Puc/v4p9/DebugBar/Extension.php +++ b/update-checker/Puc/v4p10/DebugBar/Extension.php @@ -1,12 +1,12 @@ updateChecker = $updateChecker; @@ -142,6 +142,15 @@ protected function preAjaxRequest() { @ini_set('display_errors', 'On'); } + /** + * Remove hooks that were added by this extension. + */ + public function removeHooks() { + remove_filter('debug_bar_panels', array($this, 'addDebugBarPanel')); + remove_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies')); + remove_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow')); + } + /** * @param string $filePath * @return string @@ -150,11 +159,11 @@ private function getLibraryUrl($filePath) { $absolutePath = realpath(dirname(__FILE__) . '/../../../' . ltrim($filePath, '/')); //Where is the library located inside the WordPress directory structure? - $absolutePath = Puc_v4p9_Factory::normalizePath($absolutePath); + $absolutePath = Puc_v4p10_Factory::normalizePath($absolutePath); - $pluginDir = Puc_v4p9_Factory::normalizePath(WP_PLUGIN_DIR); - $muPluginDir = Puc_v4p9_Factory::normalizePath(WPMU_PLUGIN_DIR); - $themeDir = Puc_v4p9_Factory::normalizePath(get_theme_root()); + $pluginDir = Puc_v4p10_Factory::normalizePath(WP_PLUGIN_DIR); + $muPluginDir = Puc_v4p10_Factory::normalizePath(WPMU_PLUGIN_DIR); + $themeDir = Puc_v4p10_Factory::normalizePath(get_theme_root()); if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) { //It's part of a plugin. diff --git a/update-checker/Puc/v4p9/DebugBar/Panel.php b/update-checker/Puc/v4p10/DebugBar/Panel.php similarity index 96% rename from update-checker/Puc/v4p9/DebugBar/Panel.php rename to update-checker/Puc/v4p10/DebugBar/Panel.php index dd0e259b..ecd06414 100644 --- a/update-checker/Puc/v4p9/DebugBar/Panel.php +++ b/update-checker/Puc/v4p10/DebugBar/Panel.php @@ -1,9 +1,9 @@ '; diff --git a/update-checker/Puc/v4p9/DebugBar/PluginExtension.php b/update-checker/Puc/v4p10/DebugBar/PluginExtension.php similarity index 72% rename from update-checker/Puc/v4p9/DebugBar/PluginExtension.php rename to update-checker/Puc/v4p10/DebugBar/PluginExtension.php index ca3de424..863ed737 100644 --- a/update-checker/Puc/v4p9/DebugBar/PluginExtension.php +++ b/update-checker/Puc/v4p10/DebugBar/PluginExtension.php @@ -1,12 +1,12 @@ '', + 'slug' => '', + 'checkPeriod' => 12, + 'optionName' => '', + 'muPluginFile' => '', + ); + $args = array_merge($defaults, array_intersect_key($args, $defaults)); + extract($args, EXTR_SKIP); + + //Check for the service URI + if ( empty($metadataUrl) ) { + $metadataUrl = self::getServiceURI($fullPath); + } + + /** @noinspection PhpUndefinedVariableInspection These variables are created by extract(), above. */ + return self::buildUpdateChecker($metadataUrl, $fullPath, $slug, $checkPeriod, $optionName, $muPluginFile); + } + /** * Create a new instance of the update checker. * * This method automatically detects if you're using it for a plugin or a theme and chooses * the appropriate implementation for your update source (JSON file, GitHub, BitBucket, etc). * - * @see Puc_v4p9_UpdateChecker::__construct + * @see Puc_v4p10_UpdateChecker::__construct * * @param string $metadataUrl The URL of the metadata file, a GitHub repository, or another supported update source. * @param string $fullPath Full path to the main plugin file or to the theme directory. @@ -32,7 +62,7 @@ class Puc_v4p9_Factory { * @param int $checkPeriod How often to check for updates (in hours). * @param string $optionName Where to store book-keeping info about update checks. * @param string $muPluginFile The plugin filename relative to the mu-plugins directory. - * @return Puc_v4p9_Plugin_UpdateChecker|Puc_v4p9_Theme_UpdateChecker|Puc_v4p9_Vcs_BaseChecker + * @return Puc_v4p10_Plugin_UpdateChecker|Puc_v4p10_Theme_UpdateChecker|Puc_v4p10_Vcs_BaseChecker */ public static function buildUpdateChecker($metadataUrl, $fullPath, $slug = '', $checkPeriod = 12, $optionName = '', $muPluginFile = '') { $fullPath = self::normalizePath($fullPath); @@ -178,6 +208,35 @@ protected static function getThemeDirectoryName($absolutePath) { return null; } + /** + * Get the service URI from the file header. + * + * @param string $fullPath + * @return string + */ + private static function getServiceURI($fullPath) { + //Look for the URI + if ( is_readable($fullPath) ) { + $seek = array( + 'github' => 'GitHub URI', + 'gitlab' => 'GitLab URI', + 'bucket' => 'BitBucket URI', + ); + $seek = apply_filters('puc_get_source_uri', $seek); + $data = get_file_data($fullPath, $seek); + foreach ($data as $key => $uri) { + if ( $uri ) { + return $uri; + } + } + } + + //URI was not found so throw an error. + throw new RuntimeException( + sprintf('Unable to locate URI in header of "%s"', htmlentities($fullPath)) + ); + } + /** * Get the name of the hosting service that the URL points to. * @@ -294,4 +353,4 @@ public static function addVersion($generalClass, $versionedClass, $version) { } } -endif; \ No newline at end of file +endif; diff --git a/update-checker/Puc/v4p9/InstalledPackage.php b/update-checker/Puc/v4p10/InstalledPackage.php similarity index 95% rename from update-checker/Puc/v4p9/InstalledPackage.php rename to update-checker/Puc/v4p10/InstalledPackage.php index 0a2768a2..9080c5ab 100644 --- a/update-checker/Puc/v4p9/InstalledPackage.php +++ b/update-checker/Puc/v4p10/InstalledPackage.php @@ -1,5 +1,5 @@ $field) ) { diff --git a/update-checker/Puc/v4p9/Plugin/Package.php b/update-checker/Puc/v4p10/Plugin/Package.php similarity index 94% rename from update-checker/Puc/v4p9/Plugin/Package.php rename to update-checker/Puc/v4p10/Plugin/Package.php index b92c5f77..debb5ebe 100644 --- a/update-checker/Puc/v4p9/Plugin/Package.php +++ b/update-checker/Puc/v4p10/Plugin/Package.php @@ -1,9 +1,9 @@ pluginAbsolutePath); //If realpath() fails, just normalize the syntax instead. if (($muPluginDir === false) || ($pluginPath === false)) { - $muPluginDir = Puc_v4p9_Factory::normalizePath(WPMU_PLUGIN_DIR); - $pluginPath = Puc_v4p9_Factory::normalizePath($this->pluginAbsolutePath); + $muPluginDir = Puc_v4p10_Factory::normalizePath(WPMU_PLUGIN_DIR); + $pluginPath = Puc_v4p10_Factory::normalizePath($this->pluginAbsolutePath); } $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); diff --git a/update-checker/Puc/v4p9/Plugin/Ui.php b/update-checker/Puc/v4p10/Plugin/Ui.php similarity index 98% rename from update-checker/Puc/v4p9/Plugin/Ui.php rename to update-checker/Puc/v4p10/Plugin/Ui.php index 390bcdf7..1ff18d6d 100644 --- a/update-checker/Puc/v4p9/Plugin/Ui.php +++ b/update-checker/Puc/v4p10/Plugin/Ui.php @@ -1,14 +1,14 @@ updateChecker = $updateChecker; diff --git a/update-checker/Puc/v4p9/Plugin/Update.php b/update-checker/Puc/v4p10/Plugin/Update.php similarity index 81% rename from update-checker/Puc/v4p9/Plugin/Update.php rename to update-checker/Puc/v4p10/Plugin/Update.php index 43456174..89293c5c 100644 --- a/update-checker/Puc/v4p9/Plugin/Update.php +++ b/update-checker/Puc/v4p10/Plugin/Update.php @@ -1,5 +1,5 @@ id = $this->id; $update->url = $this->homepage; $update->tested = $this->tested; + $update->requires_php = $this->requires_php; $update->plugin = $this->filename; if ( !empty($this->upgrade_notice) ) { diff --git a/update-checker/Puc/v4p9/Plugin/UpdateChecker.php b/update-checker/Puc/v4p10/Plugin/UpdateChecker.php similarity index 89% rename from update-checker/Puc/v4p9/Plugin/UpdateChecker.php rename to update-checker/Puc/v4p10/Plugin/UpdateChecker.php index e99af5ee..c45f109d 100644 --- a/update-checker/Puc/v4p9/Plugin/UpdateChecker.php +++ b/update-checker/Puc/v4p10/Plugin/UpdateChecker.php @@ -1,5 +1,5 @@ pluginFile, array($this, 'removeHooks')); - $this->extraUi = new Puc_v4p9_Plugin_Ui($this); + $this->extraUi = new Puc_v4p10_Plugin_Ui($this); } /** * Create an instance of the scheduler. * * @param int $checkPeriod - * @return Puc_v4p9_Scheduler + * @return Puc_v4p10_Scheduler */ protected function createScheduler($checkPeriod) { - $scheduler = new Puc_v4p9_Scheduler($this, $checkPeriod, array('load-plugins.php')); + $scheduler = new Puc_v4p10_Scheduler($this, $checkPeriod, array('load-plugins.php')); register_deactivation_hook($this->pluginFile, array($scheduler, 'removeUpdaterCron')); return $scheduler; } @@ -124,13 +124,13 @@ public function removeHooks() { * @uses wp_remote_get() * * @param array $queryArgs Additional query arguments to append to the request. Optional. - * @return Puc_v4p9_Plugin_Info + * @return Puc_v4p10_Plugin_Info */ public function requestInfo($queryArgs = array()) { - list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p9_Plugin_Info', 'request_info', $queryArgs); + list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p10_Plugin_Info', 'request_info', $queryArgs); if ( $pluginInfo !== null ) { - /** @var Puc_v4p9_Plugin_Info $pluginInfo */ + /** @var Puc_v4p10_Plugin_Info $pluginInfo */ $pluginInfo->filename = $this->pluginFile; $pluginInfo->slug = $this->slug; } @@ -144,7 +144,7 @@ public function requestInfo($queryArgs = array()) { * * @uses PluginUpdateChecker::requestInfo() * - * @return Puc_v4p9_Update|null An instance of Plugin_Update, or NULL when no updates are available. + * @return Puc_v4p10_Update|null An instance of Plugin_Update, or NULL when no updates are available. */ public function requestUpdate() { //For the sake of simplicity, this function just calls requestInfo() @@ -153,7 +153,7 @@ public function requestUpdate() { if ( $pluginInfo === null ){ return null; } - $update = Puc_v4p9_Plugin_Update::fromPluginInfo($pluginInfo); + $update = Puc_v4p10_Plugin_Update::fromPluginInfo($pluginInfo); $update = $this->filterUpdateResult($update); @@ -235,6 +235,22 @@ protected function getUpdateListKey() { return $this->pluginFile; } + protected function getNoUpdateItemFields() { + return array_merge( + parent::getNoUpdateItemFields(), + array( + 'id' => $this->pluginFile, + 'slug' => $this->slug, + 'plugin' => $this->pluginFile, + 'icons' => array(), + 'banners' => array(), + 'banners_rtl' => array(), + 'tested' => '', + 'compatibility' => new stdClass(), + ) + ); + } + /** * Alias for isBeingUpgraded(). * @@ -265,12 +281,12 @@ public function isBeingUpgraded($upgrader = null) { * Uses cached update data. To retrieve update information straight from * the metadata URL, call requestUpdate() instead. * - * @return Puc_v4p9_Plugin_Update|null + * @return Puc_v4p10_Plugin_Update|null */ public function getUpdate() { $update = parent::getUpdate(); if ( isset($update) ) { - /** @var Puc_v4p9_Plugin_Update $update */ + /** @var Puc_v4p10_Plugin_Update $update */ $update->filename = $this->pluginFile; } return $update; @@ -375,20 +391,20 @@ public function addResultFilter($callback) { } protected function createDebugBarExtension() { - return new Puc_v4p9_DebugBar_PluginExtension($this); + return new Puc_v4p10_DebugBar_PluginExtension($this); } /** * Create a package instance that represents this plugin or theme. * - * @return Puc_v4p9_InstalledPackage + * @return Puc_v4p10_InstalledPackage */ protected function createInstalledPackage() { - return new Puc_v4p9_Plugin_Package($this->pluginAbsolutePath, $this); + return new Puc_v4p10_Plugin_Package($this->pluginAbsolutePath, $this); } /** - * @return Puc_v4p9_Plugin_Package + * @return Puc_v4p10_Plugin_Package */ public function getInstalledPackage() { return $this->package; diff --git a/update-checker/Puc/v4p9/Scheduler.php b/update-checker/Puc/v4p10/Scheduler.php similarity index 84% rename from update-checker/Puc/v4p9/Scheduler.php rename to update-checker/Puc/v4p10/Scheduler.php index ce814636..3e9857bb 100644 --- a/update-checker/Puc/v4p9/Scheduler.php +++ b/update-checker/Puc/v4p10/Scheduler.php @@ -1,11 +1,11 @@ removeHooks(); + $this->updateChecker->removeHooks(); + return; + } //Sanity check and limitation to relevant types. if ( @@ -106,7 +116,7 @@ public function upgraderProcessComplete( //Filter out notifications of upgrades that should have no bearing upon whether or not our //current info is up-to-date. - if ( is_a($this->updateChecker, 'Puc_v4p9_Theme_UpdateChecker') ) { + if ( is_a($this->updateChecker, 'Puc_v4p10_Theme_UpdateChecker') ) { if ( 'theme' !== $upgradeInfo['type'] || !isset($upgradeInfo['themes']) ) { return; } @@ -120,7 +130,7 @@ public function upgraderProcessComplete( } } - if ( is_a($this->updateChecker, 'Puc_v4p9_Plugin_UpdateChecker') ) { + if ( is_a($this->updateChecker, 'Puc_v4p10_Plugin_UpdateChecker') ) { if ( 'plugin' !== $upgradeInfo['type'] || !isset($upgradeInfo['plugins']) ) { return; } @@ -136,7 +146,7 @@ public function upgraderProcessComplete( $this->maybeCheckForUpdates(); } - + /** * Check for updates if the configured check interval has already elapsed. * Will use a shorter check interval on certain admin pages like "Dashboard -> Updates" or when doing cron. @@ -233,6 +243,24 @@ public function removeUpdaterCron() { public function getCronHookName() { return $this->cronHook; } + + /** + * Remove most hooks added by the scheduler. + */ + public function removeHooks() { + remove_filter('cron_schedules', array($this, '_addCustomSchedule')); + remove_action('admin_init', array($this, 'maybeCheckForUpdates')); + remove_action('load-update-core.php', array($this, 'maybeCheckForUpdates')); + + if ( $this->cronHook !== null ) { + remove_action($this->cronHook, array($this, 'maybeCheckForUpdates')); + } + if ( !empty($this->hourlyCheckHooks) ) { + foreach ($this->hourlyCheckHooks as $hook) { + remove_action($hook, array($this, 'maybeCheckForUpdates')); + } + } + } } endif; diff --git a/update-checker/Puc/v4p9/StateStore.php b/update-checker/Puc/v4p10/StateStore.php similarity index 89% rename from update-checker/Puc/v4p9/StateStore.php rename to update-checker/Puc/v4p10/StateStore.php index ff140638..903fee15 100644 --- a/update-checker/Puc/v4p9/StateStore.php +++ b/update-checker/Puc/v4p10/StateStore.php @@ -1,8 +1,8 @@ lazyLoad(); @@ -73,10 +73,10 @@ public function getUpdate() { } /** - * @param Puc_v4p9_Update|null $update + * @param Puc_v4p10_Update|null $update * @return $this */ - public function setUpdate(Puc_v4p9_Update $update = null) { + public function setUpdate(Puc_v4p10_Update $update = null) { $this->lazyLoad(); $this->update = $update; return $this; @@ -138,7 +138,7 @@ public function save() { $updateClass = get_class($this->update); $state->updateClass = $updateClass; $prefix = $this->getLibPrefix(); - if ( Puc_v4p9_Utils::startsWith($updateClass, $prefix) ) { + if ( Puc_v4p10_Utils::startsWith($updateClass, $prefix) ) { $state->updateBaseClass = substr($updateClass, strlen($prefix)); } } @@ -169,8 +169,8 @@ protected function load() { return; } - $this->lastCheck = intval(Puc_v4p9_Utils::get($state, 'lastCheck', 0)); - $this->checkedVersion = Puc_v4p9_Utils::get($state, 'checkedVersion', ''); + $this->lastCheck = intval(Puc_v4p10_Utils::get($state, 'lastCheck', 0)); + $this->checkedVersion = Puc_v4p10_Utils::get($state, 'checkedVersion', ''); $this->update = null; if ( isset($state->update) ) { diff --git a/update-checker/Puc/v4p9/Theme/Package.php b/update-checker/Puc/v4p10/Theme/Package.php similarity index 92% rename from update-checker/Puc/v4p9/Theme/Package.php rename to update-checker/Puc/v4p10/Theme/Package.php index 4766c5cb..5d9243b8 100644 --- a/update-checker/Puc/v4p9/Theme/Package.php +++ b/update-checker/Puc/v4p10/Theme/Package.php @@ -1,7 +1,7 @@ requestMetadata('Puc_v4p9_Theme_Update', 'request_update'); + list($themeUpdate, $result) = $this->requestMetadata('Puc_v4p10_Theme_Update', 'request_update'); if ( $themeUpdate !== null ) { - /** @var Puc_v4p9_Theme_Update $themeUpdate */ + /** @var Puc_v4p10_Theme_Update $themeUpdate */ $themeUpdate->slug = $this->slug; } @@ -53,6 +53,16 @@ public function requestUpdate() { return $themeUpdate; } + protected function getNoUpdateItemFields() { + return array_merge( + parent::getNoUpdateItemFields(), + array( + 'theme' => $this->directoryName, + 'requires' => '', + ) + ); + } + public function userCanInstallUpdates() { return current_user_can('update_themes'); } @@ -61,10 +71,10 @@ public function userCanInstallUpdates() { * Create an instance of the scheduler. * * @param int $checkPeriod - * @return Puc_v4p9_Scheduler + * @return Puc_v4p10_Scheduler */ protected function createScheduler($checkPeriod) { - return new Puc_v4p9_Scheduler($this, $checkPeriod, array('load-themes.php')); + return new Puc_v4p10_Scheduler($this, $checkPeriod, array('load-themes.php')); } /** @@ -78,7 +88,7 @@ public function isBeingUpgraded($upgrader = null) { } protected function createDebugBarExtension() { - return new Puc_v4p9_DebugBar_Extension($this, 'Puc_v4p9_DebugBar_ThemePanel'); + return new Puc_v4p10_DebugBar_Extension($this, 'Puc_v4p10_DebugBar_ThemePanel'); } /** @@ -132,10 +142,10 @@ public function addResultFilter($callback) { /** * Create a package instance that represents this plugin or theme. * - * @return Puc_v4p9_InstalledPackage + * @return Puc_v4p10_InstalledPackage */ protected function createInstalledPackage() { - return new Puc_v4p9_Theme_Package($this->stylesheet, $this); + return new Puc_v4p10_Theme_Package($this->stylesheet, $this); } } diff --git a/update-checker/Puc/v4p9/Update.php b/update-checker/Puc/v4p10/Update.php similarity index 84% rename from update-checker/Puc/v4p9/Update.php rename to update-checker/Puc/v4p10/Update.php index 3db3d605..b36b18b0 100644 --- a/update-checker/Puc/v4p9/Update.php +++ b/update-checker/Puc/v4p10/Update.php @@ -1,5 +1,5 @@ debugMode = (bool)(constant('WP_DEBUG')); $this->metadataUrl = $metadataUrl; @@ -79,8 +89,8 @@ public function __construct($metadataUrl, $directoryName, $slug = null, $checkPe $this->package = $this->createInstalledPackage(); $this->scheduler = $this->createScheduler($checkPeriod); - $this->upgraderStatus = new Puc_v4p9_UpgraderStatus(); - $this->updateState = new Puc_v4p9_StateStore($this->optionName); + $this->upgraderStatus = new Puc_v4p10_UpgraderStatus(); + $this->updateState = new Puc_v4p10_StateStore($this->optionName); if ( did_action('init') ) { $this->loadTextDomain(); @@ -146,7 +156,7 @@ protected function installHooks() { /** * Remove hooks that were added by this update checker instance. */ - protected function removeHooks() { + public function removeHooks() { remove_filter('site_transient_' . $this->updateTransient, array($this,'injectUpdate')); remove_filter('site_transient_' . $this->updateTransient, array($this, 'injectTranslationUpdates')); remove_action( @@ -159,6 +169,14 @@ protected function removeHooks() { remove_action('plugins_loaded', array($this, 'maybeInitDebugBar')); remove_action('init', array($this, 'loadTextDomain')); + + if ( $this->scheduler ) { + $this->scheduler->removeHooks(); + } + + if ( $this->debugBarExtension ) { + $this->debugBarExtension->removeHooks(); + } } /** @@ -187,12 +205,11 @@ abstract public function userCanInstallUpdates(); * @return bool */ public function allowMetadataHost($allow, $host) { - static $metadataHost = 0; //Using 0 instead of NULL because parse_url can return NULL. - if ( $metadataHost === 0 ) { - $metadataHost = parse_url($this->metadataUrl, PHP_URL_HOST); + if ( $this->cachedMetadataHost === 0 ) { + $this->cachedMetadataHost = parse_url($this->metadataUrl, PHP_URL_HOST); } - if ( is_string($metadataHost) && (strtolower($host) === strtolower($metadataHost)) ) { + if ( is_string($this->cachedMetadataHost) && (strtolower($host) === strtolower($this->cachedMetadataHost)) ) { return true; } return $allow; @@ -201,12 +218,12 @@ public function allowMetadataHost($allow, $host) { /** * Create a package instance that represents this plugin or theme. * - * @return Puc_v4p9_InstalledPackage + * @return Puc_v4p10_InstalledPackage */ abstract protected function createInstalledPackage(); /** - * @return Puc_v4p9_InstalledPackage + * @return Puc_v4p10_InstalledPackage */ public function getInstalledPackage() { return $this->package; @@ -219,14 +236,14 @@ public function getInstalledPackage() { * and substitute their own scheduler. * * @param int $checkPeriod - * @return Puc_v4p9_Scheduler + * @return Puc_v4p10_Scheduler */ abstract protected function createScheduler($checkPeriod); /** * Check for updates. The results are stored in the DB option specified in $optionName. * - * @return Puc_v4p9_Update|null + * @return Puc_v4p10_Update|null */ public function checkForUpdates() { $installedVersion = $this->getInstalledVersion(); @@ -260,7 +277,7 @@ public function checkForUpdates() { /** * Load the update checker state from the DB. * - * @return Puc_v4p9_StateStore + * @return Puc_v4p10_StateStore */ public function getUpdateState() { return $this->updateState->lazyLoad(); @@ -285,7 +302,7 @@ public function resetUpdateState() { * Uses cached update data. To retrieve update information straight from * the metadata URL, call requestUpdate() instead. * - * @return Puc_v4p9_Update|null + * @return Puc_v4p10_Update|null */ public function getUpdate() { $update = $this->updateState->getUpdate(); @@ -306,16 +323,16 @@ public function getUpdate() { * * Subclasses should run the update through filterUpdateResult before returning it. * - * @return Puc_v4p9_Update An instance of Update, or NULL when no updates are available. + * @return Puc_v4p10_Update An instance of Update, or NULL when no updates are available. */ abstract public function requestUpdate(); /** * Filter the result of a requestUpdate() call. * - * @param Puc_v4p9_Update|null $update + * @param Puc_v4p10_Update|null $update * @param array|WP_Error|null $httpResult The value returned by wp_remote_get(), if any. - * @return Puc_v4p9_Update + * @return Puc_v4p10_Update */ protected function filterUpdateResult($update, $httpResult = null) { //Let plugins/themes modify the update. @@ -338,9 +355,9 @@ protected function filterUpdateResult($update, $httpResult = null) { * "Compatibility: Unknown". * The function mimics how wordpress.org API crafts the "tested" field out of "Tested up to". * - * @param Puc_v4p9_Metadata|null $update + * @param Puc_v4p10_Metadata|null $update */ - protected function fixSupportedWordpressVersion(Puc_v4p9_Metadata $update = null) { + protected function fixSupportedWordpressVersion(Puc_v4p10_Metadata $update = null) { if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) { return; } @@ -349,26 +366,39 @@ protected function fixSupportedWordpressVersion(Puc_v4p9_Metadata $update = null $wpVersion = $GLOBALS['wp_version']; - if ( function_exists('get_preferred_from_update_core') ) { - $coreUpdate = get_preferred_from_update_core(); - if ( isset($coreUpdate->current) && version_compare($coreUpdate->current, $wpVersion, '>') ) { - $actualWpVersions[] = $coreUpdate->current; + if ( function_exists('get_core_updates') ) { + $coreUpdates = get_core_updates(); + if ( is_array($coreUpdates) ) { + foreach ($coreUpdates as $coreUpdate) { + if ( isset($coreUpdate->current) ) { + $actualWpVersions[] = $coreUpdate->current; + } + } } } $actualWpVersions[] = $wpVersion; - $actualWpPatchNumber = "999"; + $actualWpPatchNumber = null; foreach ($actualWpVersions as $version) { - if ( preg_match('/^(?P?Y+5Q5_Zx+>QQSw1WxG&*
zrLezHK%nsfpZ9cg4~#38`f*cCNTU+7K=@3Cu}vkLqX%#+mrMKJtT(ZFrW-cj$W7rV
zv{;=R70#L<*`3?;IGcIb$xR=co*aM{%|dP>3?vVbeK7*2