WordPress.org

Plugin Directory

Changeset 1645540


Ignore:
Timestamp:
04/26/17 08:05:40 (8 months ago)
Author:
playes
Message:

1.8

  • 新增代码调试功能
  • 优化 OSS Upload 兼容性
Location:
open-lazy/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • open-lazy/trunk/lang/open-lazy-zh_CN.po

    r1626376 r1645540  
    55"Project-Id-Version: Open Lazy\n" 
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/open-lazy\n" 
    7 "POT-Creation-Date: 2017-03-31 15:33+0800\n" 
    8 "PO-Revision-Date: 2017-03-31 15:37+0800\n" 
     7"POT-Creation-Date: 2017-04-26 16:01+0800\n" 
     8"PO-Revision-Date: 2017-04-26 16:02+0800\n" 
    99"Last-Translator: XiaoMac <afly@xiaomac.com>\n" 
    1010"Language-Team: Link <playes@qq.com>\n" 
     
    1515"X-Generator: Poedit 1.8.12\n" 
    1616 
    17 #: open-lazy.php:93 
     17#: open-lazy.php:91 
    1818msgid "Settings" 
    1919msgstr "设置" 
    2020 
    21 #: open-lazy.php:109 
     21#: open-lazy.php:107 
    2222msgid "Plugin Rating" 
    2323msgstr "插件评级" 
    2424 
    25 #: open-lazy.php:110 
     25#: open-lazy.php:108 
    2626msgid "For more information" 
    2727msgstr "更多信息" 
    2828 
    29 #: open-lazy.php:111 
     29#: open-lazy.php:109 
    3030msgid "Check Update" 
    3131msgstr "检查更新" 
    3232 
    33 #: open-lazy.php:112 
     33#: open-lazy.php:110 
    3434msgid "Donate" 
    3535msgstr "捐赠" 
    3636 
    37 #: open-lazy.php:113 
     37#: open-lazy.php:111 
    3838msgid "More Plugins" 
    3939msgstr "更多插件" 
    4040 
    41 #: open-lazy.php:114 
     41#: open-lazy.php:112 
    4242msgid "About" 
    4343msgstr "关于" 
    4444 
    45 #: open-lazy.php:131 
     45#: open-lazy.php:129 
    4646msgid "Show More" 
    4747msgstr "显示更多" 
    4848 
    49 #: open-lazy.php:132 open-lazy.php:298 
     49#: open-lazy.php:130 open-lazy.php:308 
     50msgid "Debug" 
     51msgstr "调试" 
     52 
     53#: open-lazy.php:131 open-lazy.php:332 
    5054msgid "Pack" 
    5155msgstr "打包" 
    5256 
    53 #: open-lazy.php:133 open-lazy.php:347 
     57#: open-lazy.php:132 open-lazy.php:384 
    5458msgid "HTML" 
    5559msgstr "网页代码" 
    5660 
    57 #: open-lazy.php:134 open-lazy.php:362 
     61#: open-lazy.php:133 open-lazy.php:399 
    5862msgid "UI" 
    5963msgstr "界面" 
    6064 
    61 #: open-lazy.php:135 open-lazy.php:372 
     65#: open-lazy.php:134 open-lazy.php:409 
    6266msgid "Unload" 
    6367msgstr "卸除" 
    6468 
    65 #: open-lazy.php:136 open-lazy.php:383 
     69#: open-lazy.php:135 open-lazy.php:420 
    6670msgid "Prefetch" 
    6771msgstr "预加载" 
    6872 
    69 #: open-lazy.php:137 open-lazy.php:389 open-lazy.php:512 open-lazy.php:516 
    70 #: open-lazy.php:526 
     73#: open-lazy.php:136 open-lazy.php:426 open-lazy.php:550 open-lazy.php:554 
     74#: open-lazy.php:564 
    7175msgid "Maintenance Mode" 
    7276msgstr "维护模式" 
    7377 
    7478#. Plugin Name of the plugin/theme 
    75 #: open-lazy.php:148 open-lazy.php:294 
     79#: open-lazy.php:147 open-lazy.php:305 
    7680msgid "Open Lazy" 
    7781msgstr "" 
    7882 
    79 #: open-lazy.php:300 open-lazy.php:349 open-lazy.php:385 open-lazy.php:391 
    80 #: open-lazy.php:512 open-lazy.php:517 
     83#: open-lazy.php:313 
     84msgid "EXECUTE" 
     85msgstr "执行" 
     86 
     87#: open-lazy.php:314 
     88msgid "BACK" 
     89msgstr "返回" 
     90 
     91#: open-lazy.php:334 open-lazy.php:386 open-lazy.php:422 open-lazy.php:428 
     92#: open-lazy.php:550 open-lazy.php:555 
    8193msgid "Enabled" 
    8294msgstr "启用" 
    8395 
    84 #: open-lazy.php:301 
     96#: open-lazy.php:335 
    8597msgid "Load packed script in footer" 
    8698msgstr "在底部加载打包脚本" 
    8799 
    88 #: open-lazy.php:302 
     100#: open-lazy.php:337 
     101msgid "Use OSS as media library storage" 
     102msgstr "" 
     103 
     104#: open-lazy.php:340 
    89105msgid "Style Path" 
    90106msgstr "样式路径" 
    91107 
    92 #: open-lazy.php:305 
     108#: open-lazy.php:343 
    93109msgid "Script Path" 
    94110msgstr "脚本路径" 
    95111 
    96 #: open-lazy.php:310 
     112#: open-lazy.php:348 
    97113msgid "Style / Script unpack" 
    98114msgstr "不打包的样式/脚本" 
    99115 
    100 #: open-lazy.php:312 
     116#: open-lazy.php:350 
    101117msgid "Styles disabled" 
    102118msgstr "禁用的样式" 
    103119 
    104 #: open-lazy.php:321 open-lazy.php:332 
     120#: open-lazy.php:360 open-lazy.php:371 
    105121msgid "Packed" 
    106122msgstr "已打包" 
    107123 
    108 #: open-lazy.php:324 open-lazy.php:335 
     124#: open-lazy.php:363 open-lazy.php:374 
    109125msgid "Unpack" 
    110126msgstr "未打包" 
    111127 
    112 #: open-lazy.php:340 
     128#: open-lazy.php:379 
    113129msgid "Please save first then generate or delete" 
    114130msgstr "请先保存然后再进行生成或删除" 
    115131 
    116 #: open-lazy.php:342 
     132#: open-lazy.php:381 
    117133msgid "Generate Packer" 
    118134msgstr "生成打包文件" 
    119135 
    120 #: open-lazy.php:343 
     136#: open-lazy.php:382 
    121137msgid "Delete Packer" 
    122138msgstr "删除打包文件" 
    123139 
    124 #: open-lazy.php:350 
     140#: open-lazy.php:387 
    125141msgid "HTML compress" 
    126142msgstr "代码压缩" 
    127143 
    128 #: open-lazy.php:351 
     144#: open-lazy.php:388 
    129145msgid "Display loaded speed" 
    130146msgstr "显示页面加载速率" 
    131147 
    132 #: open-lazy.php:352 
     148#: open-lazy.php:389 
    133149msgid "Find Strings in Content" 
    134150msgstr "正文中查找" 
    135151 
    136 #: open-lazy.php:353 
     152#: open-lazy.php:390 
    137153msgid "Replace Strings in Content" 
    138154msgstr "正文中替换为" 
    139155 
    140 #: open-lazy.php:364 
     156#: open-lazy.php:401 
    141157msgid "Remove Emoji" 
    142158msgstr "删除 Emoji" 
    143159 
    144 #: open-lazy.php:365 
     160#: open-lazy.php:402 
    145161msgid "Disable Open-Sans" 
    146162msgstr "禁用谷歌字体" 
    147163 
    148 #: open-lazy.php:367 
     164#: open-lazy.php:404 
    149165msgid "Enable Font-Awesome" 
    150166msgstr "启用 Font-Awesome" 
    151167 
    152 #: open-lazy.php:392 
     168#: open-lazy.php:429 
    153169msgid "<h1>Website Under Maintenance</h1><p>Please come back later.</p>" 
    154170msgstr "<h1>网站正在维护</h1><p>请稍后再来。</p>" 
    155171 
    156 #: open-lazy.php:393 
     172#: open-lazy.php:430 
    157173msgid "Remember to flush your cahce if some cache plugins installed" 
    158174msgstr "如果安装了缓存插件请记得清除缓存" 
    159175 
    160 #: open-lazy.php:395 
     176#: open-lazy.php:432 
    161177msgid "Preview" 
    162178msgstr "预览效果" 
    163179 
    164 #: open-lazy.php:398 
     180#: open-lazy.php:435 
    165181msgid "Extension" 
    166182msgstr "扩展" 
    167183 
    168 #: open-lazy.php:400 
     184#: open-lazy.php:437 
    169185msgid "Filter login page linker to local site" 
    170186msgstr "将登陆页面的图片连接改为本地连接" 
    171187 
    172 #: open-lazy.php:401 
     188#: open-lazy.php:438 
    173189msgid "Remove version of resource file" 
    174190msgstr "删除资源文件请求地址的版本号" 
    175191 
    176 #: open-lazy.php:402 
     192#: open-lazy.php:439 
    177193msgid "Make admin bar visit-site link top and new" 
    178194msgstr "管理条的查看网站连接可见及新开" 
    179195 
    180 #: open-lazy.php:403 
     196#: open-lazy.php:440 
    181197msgid "Fix word count for East Asian characters" 
    182198msgstr "修正汉字字体长度计算逻辑" 
    183199 
    184 #: open-lazy.php:404 
     200#: open-lazy.php:441 
    185201msgid "Disable post revisions" 
    186202msgstr "禁用文章版本修订" 
    187203 
    188 #: open-lazy.php:405 
     204#: open-lazy.php:442 
    189205msgid "Enable shortcodes in sidebar widgets" 
    190206msgstr "在边栏小部件中启用简码" 
    191207 
    192 #: open-lazy.php:406 
     208#: open-lazy.php:443 
    193209msgid "Force site protocol to HTTPS" 
    194210msgstr "访问网站强制跳转到 HTTPS" 
    195211 
    196 #: open-lazy.php:407 
     212#: open-lazy.php:444 
    197213msgid "Redirect attachment page to the post attached" 
    198214msgstr "附件页自动跳转到所属文章" 
    199215 
    200 #: open-lazy.php:408 
     216#: open-lazy.php:445 
    201217msgid "Adapted to browser language when none was set" 
    202218msgstr "当未设定语言时自适应浏览器语言" 
    203219 
    204 #: open-lazy.php:480 
     220#: open-lazy.php:518 
    205221msgid "Loaded: " 
    206222msgstr "加载时间:" 
    207223 
    208 #: open-lazy.php:480 
     224#: open-lazy.php:518 
    209225msgid "Queries: " 
    210226msgstr "请求次数:" 
    211227 
    212 #: open-lazy.php:544 
     228#: open-lazy.php:582 
    213229msgctxt "Word count type. Do not translate!" 
    214230msgid "characters_excluding_spaces" 
  • open-lazy/trunk/lang/open-lazy.po

    r1626376 r1645540  
    11msgid "" 
    22msgstr "" 
    3 "Project-Id-Version: Open Lazy 1.7\n" 
    4 "POT-Creation-Date: 2017-03-31 15:33+0800\n" 
    5 "PO-Revision-Date: 2017-03-31 15:34+0800\n" 
     3"Project-Id-Version: Open Lazy 1.8\n" 
     4"POT-Creation-Date: 2017-04-26 16:01+0800\n" 
     5"PO-Revision-Date: 2017-04-26 16:01+0800\n" 
    66"Last-Translator: \n" 
    77"Language-Team: Link <playes@qq.com>\n" 
     
    2020"X-Poedit-SearchPathExcluded-0: *.js\n" 
    2121 
    22 #: open-lazy.php:93 
     22#: open-lazy.php:91 
    2323msgid "Settings" 
    2424msgstr "" 
    2525 
     26#: open-lazy.php:107 
     27msgid "Plugin Rating" 
     28msgstr "" 
     29 
     30#: open-lazy.php:108 
     31msgid "For more information" 
     32msgstr "" 
     33 
    2634#: open-lazy.php:109 
    27 msgid "Plugin Rating" 
     35msgid "Check Update" 
    2836msgstr "" 
    2937 
    3038#: open-lazy.php:110 
    31 msgid "For more information" 
     39msgid "Donate" 
    3240msgstr "" 
    3341 
    3442#: open-lazy.php:111 
    35 msgid "Check Update" 
     43msgid "More Plugins" 
    3644msgstr "" 
    3745 
    3846#: open-lazy.php:112 
    39 msgid "Donate" 
    40 msgstr "" 
    41  
    42 #: open-lazy.php:113 
    43 msgid "More Plugins" 
    44 msgstr "" 
    45  
    46 #: open-lazy.php:114 
    4747msgid "About" 
    4848msgstr "" 
    4949 
    50 #: open-lazy.php:131 
     50#: open-lazy.php:129 
    5151msgid "Show More" 
    5252msgstr "" 
    5353 
    54 #: open-lazy.php:132 open-lazy.php:298 
     54#: open-lazy.php:130 open-lazy.php:308 
     55msgid "Debug" 
     56msgstr "" 
     57 
     58#: open-lazy.php:131 open-lazy.php:332 
    5559msgid "Pack" 
    5660msgstr "" 
    5761 
    58 #: open-lazy.php:133 open-lazy.php:347 
     62#: open-lazy.php:132 open-lazy.php:384 
    5963msgid "HTML" 
    6064msgstr "" 
    6165 
    62 #: open-lazy.php:134 open-lazy.php:362 
     66#: open-lazy.php:133 open-lazy.php:399 
    6367msgid "UI" 
    6468msgstr "" 
    6569 
    66 #: open-lazy.php:135 open-lazy.php:372 
     70#: open-lazy.php:134 open-lazy.php:409 
    6771msgid "Unload" 
    6872msgstr "" 
    6973 
    70 #: open-lazy.php:136 open-lazy.php:383 
     74#: open-lazy.php:135 open-lazy.php:420 
    7175msgid "Prefetch" 
    7276msgstr "" 
    7377 
    74 #: open-lazy.php:137 open-lazy.php:389 open-lazy.php:512 open-lazy.php:516 
    75 #: open-lazy.php:526 
     78#: open-lazy.php:136 open-lazy.php:426 open-lazy.php:550 open-lazy.php:554 
     79#: open-lazy.php:564 
    7680msgid "Maintenance Mode" 
    7781msgstr "" 
    7882 
    7983#. Plugin Name of the plugin/theme 
    80 #: open-lazy.php:148 open-lazy.php:294 
     84#: open-lazy.php:147 open-lazy.php:305 
    8185msgid "Open Lazy" 
    8286msgstr "" 
    8387 
    84 #: open-lazy.php:300 open-lazy.php:349 open-lazy.php:385 open-lazy.php:391 
    85 #: open-lazy.php:512 open-lazy.php:517 
     88#: open-lazy.php:313 
     89msgid "EXECUTE" 
     90msgstr "" 
     91 
     92#: open-lazy.php:314 
     93msgid "BACK" 
     94msgstr "" 
     95 
     96#: open-lazy.php:334 open-lazy.php:386 open-lazy.php:422 open-lazy.php:428 
     97#: open-lazy.php:550 open-lazy.php:555 
    8698msgid "Enabled" 
    8799msgstr "" 
    88100 
    89 #: open-lazy.php:301 
     101#: open-lazy.php:335 
    90102msgid "Load packed script in footer" 
    91103msgstr "" 
    92104 
    93 #: open-lazy.php:302 
     105#: open-lazy.php:337 
     106msgid "Use OSS as media library storage" 
     107msgstr "" 
     108 
     109#: open-lazy.php:340 
    94110msgid "Style Path" 
    95111msgstr "" 
    96112 
    97 #: open-lazy.php:305 
     113#: open-lazy.php:343 
    98114msgid "Script Path" 
    99115msgstr "" 
    100116 
    101 #: open-lazy.php:310 
     117#: open-lazy.php:348 
    102118msgid "Style / Script unpack" 
    103119msgstr "" 
    104120 
    105 #: open-lazy.php:312 
     121#: open-lazy.php:350 
    106122msgid "Styles disabled" 
    107123msgstr "" 
    108124 
    109 #: open-lazy.php:321 open-lazy.php:332 
     125#: open-lazy.php:360 open-lazy.php:371 
    110126msgid "Packed" 
    111127msgstr "" 
    112128 
    113 #: open-lazy.php:324 open-lazy.php:335 
     129#: open-lazy.php:363 open-lazy.php:374 
    114130msgid "Unpack" 
    115131msgstr "" 
    116132 
    117 #: open-lazy.php:340 
     133#: open-lazy.php:379 
    118134msgid "Please save first then generate or delete" 
    119135msgstr "" 
    120136 
    121 #: open-lazy.php:342 
     137#: open-lazy.php:381 
    122138msgid "Generate Packer" 
    123139msgstr "" 
    124140 
    125 #: open-lazy.php:343 
     141#: open-lazy.php:382 
    126142msgid "Delete Packer" 
    127143msgstr "" 
    128144 
    129 #: open-lazy.php:350 
     145#: open-lazy.php:387 
    130146msgid "HTML compress" 
    131147msgstr "" 
    132148 
    133 #: open-lazy.php:351 
     149#: open-lazy.php:388 
    134150msgid "Display loaded speed" 
    135151msgstr "" 
    136152 
    137 #: open-lazy.php:352 
     153#: open-lazy.php:389 
    138154msgid "Find Strings in Content" 
    139155msgstr "" 
    140156 
    141 #: open-lazy.php:353 
     157#: open-lazy.php:390 
    142158msgid "Replace Strings in Content" 
    143159msgstr "" 
    144160 
    145 #: open-lazy.php:364 
     161#: open-lazy.php:401 
    146162msgid "Remove Emoji" 
    147163msgstr "" 
    148164 
    149 #: open-lazy.php:365 
     165#: open-lazy.php:402 
    150166msgid "Disable Open-Sans" 
    151167msgstr "" 
    152168 
    153 #: open-lazy.php:367 
     169#: open-lazy.php:404 
    154170msgid "Enable Font-Awesome" 
    155171msgstr "" 
    156172 
    157 #: open-lazy.php:392 
     173#: open-lazy.php:429 
    158174msgid "<h1>Website Under Maintenance</h1><p>Please come back later.</p>" 
    159175msgstr "" 
    160176 
    161 #: open-lazy.php:393 
     177#: open-lazy.php:430 
    162178msgid "Remember to flush your cahce if some cache plugins installed" 
    163179msgstr "" 
    164180 
    165 #: open-lazy.php:395 
     181#: open-lazy.php:432 
    166182msgid "Preview" 
    167183msgstr "" 
    168184 
    169 #: open-lazy.php:398 
     185#: open-lazy.php:435 
    170186msgid "Extension" 
    171187msgstr "" 
    172188 
    173 #: open-lazy.php:400 
     189#: open-lazy.php:437 
    174190msgid "Filter login page linker to local site" 
    175191msgstr "" 
    176192 
    177 #: open-lazy.php:401 
     193#: open-lazy.php:438 
    178194msgid "Remove version of resource file" 
    179195msgstr "" 
    180196 
    181 #: open-lazy.php:402 
     197#: open-lazy.php:439 
    182198msgid "Make admin bar visit-site link top and new" 
    183199msgstr "" 
    184200 
    185 #: open-lazy.php:403 
     201#: open-lazy.php:440 
    186202msgid "Fix word count for East Asian characters" 
    187203msgstr "" 
    188204 
    189 #: open-lazy.php:404 
     205#: open-lazy.php:441 
    190206msgid "Disable post revisions" 
    191207msgstr "" 
    192208 
    193 #: open-lazy.php:405 
     209#: open-lazy.php:442 
    194210msgid "Enable shortcodes in sidebar widgets" 
    195211msgstr "" 
    196212 
    197 #: open-lazy.php:406 
     213#: open-lazy.php:443 
    198214msgid "Force site protocol to HTTPS" 
    199215msgstr "" 
    200216 
    201 #: open-lazy.php:407 
     217#: open-lazy.php:444 
    202218msgid "Redirect attachment page to the post attached" 
    203219msgstr "" 
    204220 
    205 #: open-lazy.php:408 
     221#: open-lazy.php:445 
    206222msgid "Adapted to browser language when none was set" 
    207223msgstr "" 
    208224 
    209 #: open-lazy.php:480 
     225#: open-lazy.php:518 
    210226msgid "Loaded: " 
    211227msgstr "" 
    212228 
    213 #: open-lazy.php:480 
     229#: open-lazy.php:518 
    214230msgid "Queries: " 
    215231msgstr "" 
    216232 
    217 #: open-lazy.php:544 
     233#: open-lazy.php:582 
    218234msgctxt "Word count type. Do not translate!" 
    219235msgid "characters_excluding_spaces" 
  • open-lazy/trunk/open-lazy.php

    r1627068 r1645540  
    22/* 
    33 * Plugin Name: Open Lazy 
    4  * Version: 1.7 
     4 * Version: 1.8 
    55 * Description: A handy toolkit can easily tweak up and speed up your wordpress, more simple, more natural. Including pack the resources, unload the  * unnecessary, maintenance mode, etc.  
    66 * Plugin URI: https://www.xiaomac.com/2015101692.html 
     
    3434        add_filter('pre_update_option_olop', 'open_lazy_admin_options_page_save', 10, 2); 
    3535    } 
     36    if(olop('open_lazy_pack_oss_upload', 1) && !has_filter('upload_dir', 'oss_upload_upload_dir')){ 
     37        add_filter('upload_dir', 'oss_upload_upload_dir'); 
     38    } 
    3639    if(olop('open_lazy_pack', 1)){ 
    3740        if(isset($_GET['action'])){ 
    38             if($ouop = get_option('ouop')) $oss = isset($ouop['oss']) && $ouop['oss'] && function_exists('oss_upload_upload_dir') ? 1 : 0; 
    3941            if($_GET['action']==md5(md5('cache').'open-lazy')){ 
    40                 if(!empty($oss)){ 
    41                     add_filter('upload_dir', 'oss_upload_upload_dir', 100, 1); 
    42                     if(function_exists('oss_upload_upload_class')) oss_upload_upload_class(); 
    43                 } 
    4442                add_action('wp_enqueue_scripts', 'open_lazy_pack_action_cache', 10000); 
    4543            } 
    4644            if($_GET['action']==md5(md5('clear').'open-lazy')){ 
    47                 if(!empty($oss)){ 
    48                     add_filter('upload_dir', 'oss_upload_upload_dir', 100, 1); 
    49                     if(function_exists('oss_upload_upload_class')) oss_upload_upload_class(); 
    50                 } 
    5145                add_action('wp_enqueue_scripts', 'open_lazy_pack_action_clear', 10000); 
    5246            } 
     
    7468    if(get_option('WPLANG')) return get_option('WPLANG'); 
    7569    if(defined('WPLANG')) return WPLANG; 
    76     if(isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){ 
    77         if(!isset($_SESSION['WPLANG'])){ 
    78             list($lang) = explode(',', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])); 
    79             $_SESSION['WPLANG'] = preg_match('/zh|cn/', $lang) ? 'zh_CN' : 'en_US'; 
    80         } 
    81         $lang = $_SESSION['WPLANG']; 
     70    $langs = get_available_languages(); 
     71    if($lang == 'en_US' && $langs && isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){ 
     72        if(isset($_SESSION['WPLANG'])) return $_SESSION['WPLANG']; 
     73        list($user_lang) = explode(',', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])); 
     74        foreach($langs as $l){ 
     75            if(stripos(str_replace('_', '-', $l), $user_lang) !== false){ 
     76                $lang = $_SESSION['WPLANG'] = $l; 
     77                break; 
     78            } 
     79        } 
    8280    } 
    8381    return $lang; 
     
    130128function open_lazy_setting_columns($cols){ 
    131129    $cols['_title'] = __('Show More','open-lazy'); 
     130    $cols['open_lazy_debug'] = __('Debug','open-lazy'); 
    132131    $cols['open_lazy_pack'] = __('Pack','open-lazy'); 
    133132    $cols['open_lazy_html'] = __('HTML','open-lazy'); 
     
    161160 
    162161function open_lazy_pack_action() { 
    163     if($ouop = get_option('ouop')){ 
    164         $oss = isset($ouop['oss']) && $ouop['oss'] && function_exists('oss_upload_upload_dir') ? 1 : 0; 
    165         if(!empty($oss)) add_filter('upload_dir', 'oss_upload_upload_dir', 100, 1); 
    166     } 
    167162    $uploads = wp_upload_dir(); 
    168163    $pack = olop('pack'); 
     
    177172        wp_enqueue_script('open-lazy-script',$uploads['baseurl'].olop('open_lazy_pack_script_path'),array(),false,(olop('open_lazy_pack_script_footer',1))); 
    178173    } 
    179     if(!empty($oss) && has_filter('upload_dir', 'oss_upload_upload_dir')) remove_filter('upload_dir', 'oss_upload_upload_dir', 100); 
    180174} 
    181175 
     
    289283} 
    290284 
     285function open_lazy_var_dump($mixed=null) { 
     286    ob_start(); 
     287    var_dump($mixed); 
     288    $content = ob_get_contents(); 
     289    ob_end_clean(); 
     290    return $content; 
     291} 
     292 
    291293function open_lazy_admin_options_page() { 
    292     $uploads = wp_upload_dir();?> 
     294    $ouop = get_option('ouop'); 
     295    $uploads = wp_upload_dir(); 
     296    if(isset($_POST['open_lazy_debug'])){ 
     297        $code = str_replace(array("\\'",'\\"',"\\\\"), array("'",'"',"\\"), $_POST['open_lazy_debug']); 
     298        $GLOBALS['olop']['open_lazy_debug'] = $code; 
     299        update_option('olop',$GLOBALS['olop']); 
     300    }else{ 
     301        $code = olop('open_lazy_debug') ? olop('open_lazy_debug') : 'echo date(\'Y-m-d H:i:s\',time())."\n".phpversion();'; 
     302    } 
     303    ?> 
    293304    <div class="wrap"> 
    294305        <h2><?php _e('Open Lazy','open-lazy')?> <small><small><?php echo open_lazy_data('Version');?></small></small></h2> 
     306        <form method="post"> 
     307        <table class="form-table"> 
     308        <tr valign="top" <?php open_lazy_show_more('open_lazy_debug');?>><th scope="row"><?php _e('Debug','open-lazy')?></th> 
     309        <td><fieldset> 
     310            <textarea name="open_lazy_debug" rows="8" cols="80" placeholder="$str = 1; return $str;"><?php echo esc_html($code); ?></textarea><br/> 
     311        <p> 
     312        <?php 
     313            submit_button(__('EXECUTE','open-lazy'),'primary','',false); 
     314            if(isset($_POST['open_lazy_debug'])) echo ' '.open_lazy_link($_SERVER['REQUEST_URI'], __('BACK','open-lazy'), 'button'); 
     315        ?></p> 
     316        <? 
     317            if(isset($_POST['open_lazy_debug']) && $code){ 
     318                echo '<pre style="white-space: pre-wrap">'; 
     319                $result = eval($code); 
     320                if($result) echo $result; 
     321                echo '</pre>'; 
     322            } 
     323        ?> 
     324        </fieldset> 
     325        </td></tr> 
     326        </table> 
     327        </form> 
     328 
    295329        <form action="options.php" method="post"> 
    296330        <?php settings_fields('open_lazy_admin_options_group'); ?> 
     
    299333        <td><fieldset> 
    300334            <label><input name="olop[open_lazy_pack]" type="checkbox" value="1" <?php checked(olop('open_lazy_pack'),1);?> /> <?php _e('Enabled','open-lazy')?></label> &nbsp; 
    301             <label><input name="olop[open_lazy_pack_script_footer]" type="checkbox" value="1" <?php checked(olop('open_lazy_pack_script_footer'),1);?> /> <?php _e('Load packed script in footer','open-lazy')?></label> <br/> 
     335            <label><input name="olop[open_lazy_pack_script_footer]" type="checkbox" value="1" <?php checked(olop('open_lazy_pack_script_footer'),1);?> /> <?php _e('Load packed script in footer','open-lazy')?></label> &nbsp; 
     336            <?php if(isset($ouop['oss']) && $ouop['oss'] && isset($ouop['oss_mode']) && $ouop['oss_mode']) : ?> 
     337            <label><input name="olop[open_lazy_pack_oss_upload]" type="checkbox" value="1" <?php checked(olop('open_lazy_pack_oss_upload'),1);?> /> <?php _e('Use OSS as media library storage','oss-upload');?></label> 
     338            <?php endif; ?> 
     339            <br/> 
    302340            <label><input name="olop[open_lazy_pack_style_path]" size="80" placeholder="/cache/style.css" value="<?php echo olop('open_lazy_pack_style_path')?>" /> <?php _e('Style Path','open-lazy')?></label> 
    303341            <?php if(olop('open_lazy_pack_style_path')) echo '<a href="'.$uploads['baseurl'] . olop('open_lazy_pack_style_path').'" target=_blank>?</a>';?> 
     
    311349            </label><br/> 
    312350            <label><input name="olop[open_lazy_pack_style_disable]" size="80" placeholder="open-sans,twentytwelve-fonts" value="<?php echo olop('open_lazy_pack_style_disable')?>" /> <?php _e('Styles disabled','open-lazy')?></label></br> 
     351            </fieldset> 
    313352            <style>.open_lazy_table .bold{font-weight:bold;}.open_lazy_table td{padding:8px;font-size:12px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}</style> 
    314353            <?php 
     
    343382            <a href="/?action=<?php echo md5(md5('clear').'open-lazy');?>" class="button" target="_blank"><?php _e('Delete Packer','open-lazy')?></a> </p> 
    344383        </td></tr> 
    345         </table> 
    346         <table class="form-table"> 
    347384        <tr valign="top" <?php open_lazy_show_more('open_lazy_html');?>><th scope="row"><?php _e('HTML','open-lazy')?></th> 
    348385        <td><fieldset> 
     
    411448        </td></tr> 
    412449        </table> 
     450        </form> 
    413451    </div> 
    414452    <?php 
  • open-lazy/trunk/readme.txt

    r1641947 r1645540  
    55Tags: link, tweak, toolkit, speed, pack, packer, cache, html, fonts, emoji, open-sans, unload, dashboard, wp_head, prefetch, maintenance 
    66Tested up to: 4.7.4 
    7 Stable tag: 1.7 
     7Stable tag: 1.8 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    4343== Changelog == 
    4444 
     45= 1.8 = 
     46* 新增代码调试功能 
     47* 优化 OSS Upload 兼容性 
     48 
    4549= 1.7 = 
    4650* 兼容 OSS Upload 上传 
Note: See TracChangeset for help on using the changeset viewer.