Changeset 1506564
- Timestamp:
- 10/01/2016 06:19:05 PM (10 years ago)
- Location:
- ucb-recommend
- Files:
-
- 273 added
- 22 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/.htaccess (added)
-
tags/1.1.0/README.md (added)
-
tags/1.1.0/apis (added)
-
tags/1.1.0/apis/add-condition-set.php (added)
-
tags/1.1.0/apis/check-ajax.php (added)
-
tags/1.1.0/apis/delete-condition-group.php (added)
-
tags/1.1.0/apis/delete-condition.php (added)
-
tags/1.1.0/apis/delete-join-table.php (added)
-
tags/1.1.0/apis/delete-objects.php (added)
-
tags/1.1.0/apis/delete-widget.php (added)
-
tags/1.1.0/apis/get-bandits.php (added)
-
tags/1.1.0/apis/get-columns.php (added)
-
tags/1.1.0/apis/get-condition-groups.php (added)
-
tags/1.1.0/apis/get-condition-set.php (added)
-
tags/1.1.0/apis/get-conditions.php (added)
-
tags/1.1.0/apis/get-design-templates.php (added)
-
tags/1.1.0/apis/get-devices.php (added)
-
tags/1.1.0/apis/get-join-tables.php (added)
-
tags/1.1.0/apis/get-join-types.php (added)
-
tags/1.1.0/apis/get-objects.php (added)
-
tags/1.1.0/apis/get-post-ids.php (added)
-
tags/1.1.0/apis/get-posts.php (added)
-
tags/1.1.0/apis/get-preview.php (added)
-
tags/1.1.0/apis/get-tables.php (added)
-
tags/1.1.0/apis/get-tests.php (added)
-
tags/1.1.0/apis/get-types.php (added)
-
tags/1.1.0/apis/get-valid-devices.php (added)
-
tags/1.1.0/apis/get-verbs.php (added)
-
tags/1.1.0/apis/get-widget-setting.php (added)
-
tags/1.1.0/apis/get-widgets.php (added)
-
tags/1.1.0/apis/reflect-results.php (added)
-
tags/1.1.0/apis/save-condition-group.php (added)
-
tags/1.1.0/apis/save-condition.php (added)
-
tags/1.1.0/apis/save-design-templates.php (added)
-
tags/1.1.0/apis/save-join-table.php (added)
-
tags/1.1.0/apis/save-objects.php (added)
-
tags/1.1.0/apis/save-valid-devices.php (added)
-
tags/1.1.0/apis/save-widget-setting.php (added)
-
tags/1.1.0/apis/save-widget.php (added)
-
tags/1.1.0/apis/widget.php (added)
-
tags/1.1.0/controllers (added)
-
tags/1.1.0/controllers/001-setting.php (added)
-
tags/1.1.0/controllers/010-widget.php (added)
-
tags/1.1.0/controllers/100-action.php (added)
-
tags/1.1.0/controllers/900-log.php (added)
-
tags/1.1.0/controllers/index.php (added)
-
tags/1.1.0/db-config.php (added)
-
tags/1.1.0/emblemmatic-ucb-recommend-logo-22.png (added)
-
tags/1.1.0/functions.php (added)
-
tags/1.1.0/index.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/UCBRecommend-ja.mo (added)
-
tags/1.1.0/languages/UCBRecommend-ja.po (added)
-
tags/1.1.0/lib (added)
-
tags/1.1.0/lib/apis (added)
-
tags/1.1.0/lib/apis/nonce.php (added)
-
tags/1.1.0/lib/common (added)
-
tags/1.1.0/lib/common/010-defines.php (added)
-
tags/1.1.0/lib/common/030-base-class.php (added)
-
tags/1.1.0/lib/common/040-db.php (added)
-
tags/1.1.0/lib/common/050-db_config.php (added)
-
tags/1.1.0/lib/common/080-model-base.php (added)
-
tags/1.1.0/lib/common/090-api-base.php (added)
-
tags/1.1.0/lib/common/100-controller-base.php (added)
-
tags/1.1.0/lib/common/110-api-loader.php (added)
-
tags/1.1.0/lib/common/120-controller-loader.php (added)
-
tags/1.1.0/lib/common/130-service-base.php (added)
-
tags/1.1.0/lib/library (added)
-
tags/1.1.0/lib/library/YUI-CSS-compressor (added)
-
tags/1.1.0/lib/library/YUI-CSS-compressor/cssmin.php (added)
-
tags/1.1.0/lib/library/jsmin-php (added)
-
tags/1.1.0/lib/library/jsmin-php/README.md (added)
-
tags/1.1.0/lib/library/jsmin-php/jsmin.php (added)
-
tags/1.1.0/lib/library/jsmin-php/test (added)
-
tags/1.1.0/lib/library/jsmin-php/test/setup.php (added)
-
tags/1.1.0/lib/library/jsmin-php/test/test.php (added)
-
tags/1.1.0/lib/library/jsmin-php/test/utf8-with-bom.js (added)
-
tags/1.1.0/lib/library/plugin-update-checker (added)
-
tags/1.1.0/lib/library/plugin-update-checker/README.md (added)
-
tags/1.1.0/lib/library/plugin-update-checker/composer.json (added)
-
tags/1.1.0/lib/library/plugin-update-checker/css (added)
-
tags/1.1.0/lib/library/plugin-update-checker/css/puc-debug-bar.css (added)
-
tags/1.1.0/lib/library/plugin-update-checker/debug-bar-panel.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/debug-bar-plugin.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/github-checker.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/js (added)
-
tags/1.1.0/lib/library/plugin-update-checker/js/debug-bar.js (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages/plugin-update-checker-fr_FR.mo (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages/plugin-update-checker-fr_FR.po (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages/plugin-update-checker-hu_HU.mo (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages/plugin-update-checker-hu_HU.po (added)
-
tags/1.1.0/lib/library/plugin-update-checker/languages/plugin-update-checker.pot (added)
-
tags/1.1.0/lib/library/plugin-update-checker/license.txt (added)
-
tags/1.1.0/lib/library/plugin-update-checker/plugin-update-checker.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/vendor (added)
-
tags/1.1.0/lib/library/plugin-update-checker/vendor/Parsedown.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/vendor/ParsedownLegacy.php (added)
-
tags/1.1.0/lib/library/plugin-update-checker/vendor/readme-parser.php (added)
-
tags/1.1.0/lib/library/scssphp (added)
-
tags/1.1.0/lib/library/scssphp/.travis.yml (added)
-
tags/1.1.0/lib/library/scssphp/LICENSE.md (added)
-
tags/1.1.0/lib/library/scssphp/Makefile (added)
-
tags/1.1.0/lib/library/scssphp/README.md (added)
-
tags/1.1.0/lib/library/scssphp/composer.json (added)
-
tags/1.1.0/lib/library/scssphp/phpunit.xml.dist (added)
-
tags/1.1.0/lib/library/scssphp/pscss (added)
-
tags/1.1.0/lib/library/scssphp/scss.inc.php (added)
-
tags/1.1.0/lib/library/scssphp/tests (added)
-
tags/1.1.0/lib/library/scssphp/tests/ApiTest.php (added)
-
tags/1.1.0/lib/library/scssphp/tests/ExceptionTest.php (added)
-
tags/1.1.0/lib/library/scssphp/tests/InputTest.php (added)
-
tags/1.1.0/lib/library/scssphp/tests/compare-scss.sh (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/builtins.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/comments.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/compass_extract.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/content.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/content_with_function.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/default_args.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/directives.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/extends.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/filter_effects.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/functions.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/ie7.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/if.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/if_on_null.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/import.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/imports (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/imports/_partial.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/imports/simple.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/interpolation.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/keyword_args.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/list.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/looping.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/media.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/mixins.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/nesting.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/null.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/operators.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/placeholder_selector.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/scss_css.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/selectors.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/values.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/inputs/variables.scss (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/builtins.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/comments.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/compass_extract.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/content.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/content_with_function.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/default_args.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/directives.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/extends.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/filter_effects.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/functions.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/ie7.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/if.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/if_on_null.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/import.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/interpolation.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/keyword_args.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/list.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/looping.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/media.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/mixins.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/nesting.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/null.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/operators.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/placeholder_selector.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/scss_css.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/selectors.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/values.css (added)
-
tags/1.1.0/lib/library/scssphp/tests/outputs/variables.css (added)
-
tags/1.1.0/lib/load.php (added)
-
tags/1.1.0/lib/public (added)
-
tags/1.1.0/lib/public/css (added)
-
tags/1.1.0/lib/public/css/index.php (added)
-
tags/1.1.0/lib/public/fonts (added)
-
tags/1.1.0/lib/public/fonts/index.php (added)
-
tags/1.1.0/lib/public/img (added)
-
tags/1.1.0/lib/public/img/back.png (added)
-
tags/1.1.0/lib/public/img/index.php (added)
-
tags/1.1.0/lib/public/img/loading.gif (added)
-
tags/1.1.0/lib/public/index.php (added)
-
tags/1.1.0/lib/public/js (added)
-
tags/1.1.0/lib/public/js/index.php (added)
-
tags/1.1.0/lib/public/plugins (added)
-
tags/1.1.0/lib/public/plugins/index.php (added)
-
tags/1.1.0/lib/services (added)
-
tags/1.1.0/lib/services/device-service.php (added)
-
tags/1.1.0/lib/services/minify-service.php (added)
-
tags/1.1.0/lib/services/option-service.php (added)
-
tags/1.1.0/lib/services/post-service.php (added)
-
tags/1.1.0/lib/services/system-service.php (added)
-
tags/1.1.0/lib/services/user-service.php (added)
-
tags/1.1.0/lib/views (added)
-
tags/1.1.0/lib/views/ajaxurl-admin.php (added)
-
tags/1.1.0/lib/views/ajaxurl.php (added)
-
tags/1.1.0/lib/views/controls.php (added)
-
tags/1.1.0/lib/views/modal-script.php (added)
-
tags/1.1.0/lib/views/modal-style.php (added)
-
tags/1.1.0/models (added)
-
tags/1.1.0/models/condition.php (added)
-
tags/1.1.0/models/condition_group.php (added)
-
tags/1.1.0/models/index.php (added)
-
tags/1.1.0/models/join_table.php (added)
-
tags/1.1.0/models/number.php (added)
-
tags/1.1.0/models/object.php (added)
-
tags/1.1.0/models/test.php (added)
-
tags/1.1.0/models/widget.php (added)
-
tags/1.1.0/public (added)
-
tags/1.1.0/public/css (added)
-
tags/1.1.0/public/css/index.php (added)
-
tags/1.1.0/public/fonts (added)
-
tags/1.1.0/public/fonts/index.php (added)
-
tags/1.1.0/public/img (added)
-
tags/1.1.0/public/img/index.php (added)
-
tags/1.1.0/public/img/loading.gif (added)
-
tags/1.1.0/public/img/logo.png (added)
-
tags/1.1.0/public/img/no_thumb.jpg (added)
-
tags/1.1.0/public/index.php (added)
-
tags/1.1.0/public/js (added)
-
tags/1.1.0/public/js/index.php (added)
-
tags/1.1.0/public/js/jquery.autosize.min.js (added)
-
tags/1.1.0/public/js/jquery.inview.min.js (added)
-
tags/1.1.0/public/plugins (added)
-
tags/1.1.0/public/plugins/index.php (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/screenshot-1.png (added)
-
tags/1.1.0/screenshot-2.png (added)
-
tags/1.1.0/services (added)
-
tags/1.1.0/services/access.php (added)
-
tags/1.1.0/services/ajax.php (added)
-
tags/1.1.0/services/calculate.php (added)
-
tags/1.1.0/services/clear.php (added)
-
tags/1.1.0/services/condition.php (added)
-
tags/1.1.0/services/custom-post-type.php (added)
-
tags/1.1.0/services/data.php (added)
-
tags/1.1.0/services/design.php (added)
-
tags/1.1.0/services/index.php (added)
-
tags/1.1.0/services/shortcode.php (added)
-
tags/1.1.0/services/test.php (added)
-
tags/1.1.0/services/update.php (added)
-
tags/1.1.0/services/widget-settings.php (added)
-
tags/1.1.0/settings.php (added)
-
tags/1.1.0/ucb-recommend.php (added)
-
tags/1.1.0/uninstall.php (added)
-
tags/1.1.0/unsupported.php (added)
-
tags/1.1.0/update.json (added)
-
tags/1.1.0/views (added)
-
tags/1.1.0/views/action.php (added)
-
tags/1.1.0/views/index.php (added)
-
tags/1.1.0/views/item-template.php (added)
-
tags/1.1.0/views/list-template.php (added)
-
tags/1.1.0/views/load-widget-template.php (added)
-
tags/1.1.0/views/log.php (added)
-
tags/1.1.0/views/not-found-template.php (added)
-
tags/1.1.0/views/setting.php (added)
-
tags/1.1.0/views/style-template.php (added)
-
tags/1.1.0/views/test-script.php (added)
-
tags/1.1.0/views/test.php (added)
-
tags/1.1.0/views/widget-script.php (added)
-
tags/1.1.0/views/widget-settings-script.php (added)
-
tags/1.1.0/views/widget-settings.php (added)
-
trunk/apis/check-ajax.php (added)
-
trunk/apis/get-tests.php (added)
-
trunk/apis/reflect-results.php (added)
-
trunk/controllers/010-widget.php (modified) (1 diff)
-
trunk/languages/UCBRecommend-ja.mo (modified) (previous)
-
trunk/languages/UCBRecommend-ja.po (modified) (2 diffs)
-
trunk/lib/common/010-defines.php (modified) (1 diff)
-
trunk/lib/common/030-base-class.php (modified) (3 diffs)
-
trunk/lib/common/090-api-base.php (modified) (1 diff)
-
trunk/lib/common/110-api-loader.php (modified) (1 diff)
-
trunk/lib/common/120-controller-loader.php (modified) (2 diffs)
-
trunk/lib/load.php (modified) (1 diff)
-
trunk/lib/services/option-service.php (modified) (1 diff)
-
trunk/lib/services/system-service.php (modified) (1 diff)
-
trunk/lib/views/modal-script.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/services/ajax.php (modified) (2 diffs)
-
trunk/services/calculate.php (modified) (4 diffs)
-
trunk/services/design.php (modified) (8 diffs)
-
trunk/services/test.php (added)
-
trunk/services/update.php (modified) (2 diffs)
-
trunk/settings.php (modified) (3 diffs)
-
trunk/ucb-recommend.php (modified) (2 diffs)
-
trunk/unsupported.php (added)
-
trunk/update.json (modified) (1 diff)
-
trunk/views/style-template.php (modified) (9 diffs)
-
trunk/views/test-script.php (added)
-
trunk/views/test.php (added)
-
trunk/views/widget-settings-script.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ucb-recommend/trunk/controllers/010-widget.php
r1499492 r1506564 30 30 public function load() 31 31 { 32 $loading_image = $this->apply_filters( "loading_image", UCB_RECOMMEND_LIB_IMG_DIR . DIRECTORY_SEPARATOR . 'loading.gif', -1 );32 $loading_image = $this->apply_filters( "loading_image", UCB_RECOMMEND_LIB_IMG_DIR . DIRECTORY_SEPARATOR . UCB_RECOMMEND_LOADING_IMAGE, -1 ); 33 33 $loading_image = $this->dir2path( $loading_image ); 34 34 -
ucb-recommend/trunk/languages/UCBRecommend-ja.po
r1503880 r1506564 3 3 "Project-Id-Version: ucb-recommend0.0.0.0.1\n" 4 4 "POT-Creation-Date: 2016-07-19 20:40+0900\n" 5 "PO-Revision-Date: 2016- 09-28 02:08+0900\n"5 "PO-Revision-Date: 2016-10-02 01:41+0900\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 431 431 msgid "Whether to check referer when ajax access without nonce check" 432 432 msgstr "nonceチェックをせずにAjaxアクセスする場合にリファラをチェックするかどうか" 433 434 msgid "Please update your PHP. <strong>%s</strong> requires PHP version 5.4 or above" 435 msgstr "PHPをアップデートして下さい。 <strong>%s</strong>の動作にはPHP5.4以上が必要です。" 436 437 msgid "Standard Deviation to use calculate score from ucb score" 438 msgstr "UCB値からスコア計算時の標準偏差" 439 440 msgid "Changed [%s] to [%s]" 441 msgstr "[%s]を[%s]に変更しました" 442 443 msgid "Whether to show test button" 444 msgstr "テストボタンを表示するかどうか" 445 446 msgid "Whether to consider page cache" 447 msgstr "ページキャッシュを考慮するかどうか" 448 449 msgid "Whether to check develop update" 450 msgstr "開発版のアップデートをチェックするかどうか" 451 452 msgid "Test" 453 msgstr "動作テスト" 454 455 msgid "Retest" 456 msgstr "再テスト" 457 458 msgid "There's no problem" 459 msgstr "設定に問題はありません" 460 461 msgid "Ajax test" 462 msgstr "Ajaxテスト" -
ucb-recommend/trunk/lib/common/010-defines.php
r1499492 r1506564 43 43 define( 'UCB_RECOMMEND_TMP_DIR', UCB_RECOMMEND_ROOT_DIR . DIRECTORY_SEPARATOR . "tmp" ); 44 44 define( 'UCB_RECOMMEND_UPLOAD_DIR', UCB_RECOMMEND_ROOT_DIR . DIRECTORY_SEPARATOR . "upload" ); 45 define( 'UCB_RECOMMEND_LANGUAGES_DIR', UCB_RECOMMEND_ROOT_DIR . DIRECTORY_SEPARATOR . "languages" );46 45 47 46 //lib url -
ucb-recommend/trunk/lib/common/030-base-class.php
r1503880 r1506564 10 10 private static $settings = array( 11 11 "exclude_loggedin_user" => array( "label" => "Whether to exclude logged in user", "type" => "bool", "default" => UCB_RECOMMEND_EXCLUDE_LOGGEDIN_USER ), 12 // "update_cookie_expire" => array( "label" => "Whether to update cookie expiration when accessed or not", "type" => "bool", "default" => UCB_RECOMMEND_UPDATE_COOKIE_EXPIRE ),13 // "user_expire" => array( "label" => "Expiration of user's cookie", "type" => "int", "default" => UCB_RECOMMEND_USER_EXPIRE, "min" => 0 ),14 // "sampling_rate" => array( "label" => "Sampling rate", "type" => "float", "default" => UCB_RECOMMEND_SAMPLING_RATE, "min" => 0, "max" => 1, "option" => "sampling_rate", "option_default" => UCB_RECOMMEND_DEFAULT_SAMPLING_RATE ),15 // "check_data" => array( "label" => "Whether to validate cookie data or not", "type" => "bool", "default" => UCB_RECOMMEND_CHECK_DATA ),16 // "nonce_check" => array( "label" => "Whether to check nonce or not", "type" => "bool", "default" => UCB_RECOMMEND_NONCE_CHECK ),17 // "calc_interval" => array( "label" => "Interval of calculate", "type" => "int", "default" => UCB_RECOMMEND_CALC_INTERVAL, "min" => MINUTE_IN_SECONDS ),18 // "calc_timeout" => array( "label" => "Timeout of calculate", "type" => "int", "default" => UCB_RECOMMEND_CALC_TIMEOUT, "min" => MINUTE_IN_SECONDS ),19 // "calc_log" => array( "label" => "Whether to log calculate process", "type" => "bool", "default" => UCB_RECOMMEND_CALC_LOG ),12 // "update_cookie_expire" => array( "label" => "Whether to update cookie expiration when accessed or not", "type" => "bool", "default" => UCB_RECOMMEND_UPDATE_COOKIE_EXPIRE ), 13 // "user_expire" => array( "label" => "Expiration of user's cookie", "type" => "int", "default" => UCB_RECOMMEND_USER_EXPIRE, "min" => 0 ), 14 // "sampling_rate" => array( "label" => "Sampling rate", "type" => "float", "default" => UCB_RECOMMEND_SAMPLING_RATE, "min" => 0, "max" => 1, "option" => "sampling_rate", "option_default" => UCB_RECOMMEND_DEFAULT_SAMPLING_RATE ), 15 // "check_data" => array( "label" => "Whether to validate cookie data or not", "type" => "bool", "default" => UCB_RECOMMEND_CHECK_DATA ), 16 // "nonce_check" => array( "label" => "Whether to check nonce or not", "type" => "bool", "default" => UCB_RECOMMEND_NONCE_CHECK ), 17 // "calc_interval" => array( "label" => "Interval of calculate", "type" => "int", "default" => UCB_RECOMMEND_CALC_INTERVAL, "min" => MINUTE_IN_SECONDS ), 18 // "calc_timeout" => array( "label" => "Timeout of calculate", "type" => "int", "default" => UCB_RECOMMEND_CALC_TIMEOUT, "min" => MINUTE_IN_SECONDS ), 19 // "calc_log" => array( "label" => "Whether to log calculate process", "type" => "bool", "default" => UCB_RECOMMEND_CALC_LOG ), 20 20 "clear_interval" => array( "label" => "Interval of clear test data", "type" => "int", "default" => UCB_RECOMMEND_CLEAR_INTERVAL, "min" => MINUTE_IN_SECONDS ), 21 // "clear_timeout" => array( "label" => "Timeout of clear test data", "type" => "int", "default" => UCB_RECOMMEND_CLEAR_TIMEOUT, "min" => MINUTE_IN_SECONDS ),21 // "clear_timeout" => array( "label" => "Timeout of clear test data", "type" => "int", "default" => UCB_RECOMMEND_CLEAR_TIMEOUT, "min" => MINUTE_IN_SECONDS ), 22 22 "clear_log" => array( "label" => "Whether to log clear test data process", "type" => "bool", "default" => UCB_RECOMMEND_CLEAR_LOG ), 23 23 "data_expire" => array( "label" => "Expiration of test data", "type" => "int", "default" => UCB_RECOMMEND_DATA_EXPIRE, "min" => MINUTE_IN_SECONDS ), … … 25 25 "minify_js" => array( "label" => "Whether to minify js that generated by this plugin", "type" => "bool", "default" => UCB_RECOMMEND_MINIFY_JS ), 26 26 "minify_css" => array( "label" => "Whether to minify css that generated by this plugin", "type" => "bool", "default" => UCB_RECOMMEND_MINIFY_CSS ), 27 // "jaccard_threshold" => array( "label" => "Threshold of jaccard to get results, which is used when argument is not supplied to function", "type" => "float", "default" => UCB_RECOMMEND_JACCARD_THRESHOLD, "min" => 0, "max" => 1 ), 28 // "jaccard_min_number" => array( "label" => "Min data number to be required to get results, which is used when argument is not supplied to function", "type" => "int", "default" => UCB_RECOMMEND_JACCARD_MIN_NUMBER, "min" => 0 ), 29 // "calculate_number" => array( "label" => "Max number of calculations of per", "type" => "int", "default" => UCB_RECOMMEND_CALCULATE_NUMBER, "min" => 10 ), 30 // "show_result" => array( "label" => "Whether to set button to show result", "type" => "bool", "default" => UCB_RECOMMEND_SHOW_RESULT ), 31 //"check_update" => array( "label" => "Whether to check update", "type" => "bool", "default" => UCB_RECOMMEND_CHECK_UPDATE ), 27 // "jaccard_threshold" => array( "label" => "Threshold of jaccard to get results, which is used when argument is not supplied to function", "type" => "float", "default" => UCB_RECOMMEND_JACCARD_THRESHOLD, "min" => 0, "max" => 1 ), 28 // "jaccard_min_number" => array( "label" => "Min data number to be required to get results, which is used when argument is not supplied to function", "type" => "int", "default" => UCB_RECOMMEND_JACCARD_MIN_NUMBER, "min" => 0 ), 29 // "calculate_number" => array( "label" => "Max number of calculations of per", "type" => "int", "default" => UCB_RECOMMEND_CALCULATE_NUMBER, "min" => 10 ), 30 // "show_result" => array( "label" => "Whether to set button to show result", "type" => "bool", "default" => UCB_RECOMMEND_SHOW_RESULT ), 32 31 "ucb_const" => array( "label" => "Constant of UCB Algorithm", "type" => "int", "default" => UCB_RECOMMEND_UCB_CONST, "min" => 0 ), 32 "std_dev" => array( "label" => "Standard Deviation to use calculate score from ucb score", "type" => "float", "default" => UCB_RECOMMEND_BANDIT_RANDOM_STD_DEV, "min" => 0 ), 33 33 "front_admin_ajax" => array( "label" => "Whether to use admin-ajax.php on front page", "type" => "bool", "default" => UCB_RECOMMEND_FRONT_ADMIN_AJAX ), 34 34 "check_referer" => array( "label" => "Whether to check referer when ajax access without nonce check", "type" => "bool", "default" => UCB_RECOMMEND_CHECK_REFERER ), 35 "test" => array( "label" => "Whether to show test button", "type" => "bool", "default" => UCB_RECOMMEND_TEST ), 36 "consider_page_cache" => array( "label" => "Whether to consider page cache", "type" => "bool", "default" => UCB_RECOMMEND_CONSIDER_PAGE_CACHE ), 37 "check_update" => array( "label" => "Whether to check develop update", "type" => "bool", "default" => UCB_RECOMMEND_CHECK_UPDATE ), 35 38 ); 36 39 … … 265 268 return hash_hmac( $this->get_algo(), $data, $this->get_server_key() ); 266 269 } 270 271 protected function consider_page_cache() 272 { 273 return $this->apply_filters( 'consider_page_cache', COLLABORATIVE_FILTERING_CONSIDER_PAGE_CACHE ); 274 } 275 276 protected static function generate_norm( $average = 0.0, $std_dev = 1.0 ) 277 { 278 static $z1, $z2, $mt_max, $ready = true; 279 if ( $mt_max === null ) { 280 $mt_max = mt_getrandmax(); 281 } 282 $ready = !$ready; 283 if ( $ready ) { 284 return $z2 * $std_dev + $average; 285 } 286 $u1 = mt_rand( 1, $mt_max - 1 ) / $mt_max; 287 $u2 = mt_rand( 1, $mt_max - 1 ) / $mt_max; 288 $v1 = sqrt( -2 * log( $u1 ) ); 289 $v2 = 2 * M_PI * $u2; 290 $z1 = $v1 * cos( $v2 ); 291 $z2 = $v1 * sin( $v2 ); 292 return $z1 * $std_dev + $average; 293 } 267 294 } -
ucb-recommend/trunk/lib/common/090-api-base.php
r1504161 r1506564 229 229 private function get_output_js_nonce() 230 230 { 231 if ( $this->consider_page_cache() ) { 232 return $this->get_output_js_nonce2(); 233 } 234 235 $nonce = wp_create_nonce( $this->get_api_name() ); 236 $ret = <<< EOS 237 <script> 238 var ucbr_obj = ucbr_obj || {}; 239 ucbr_obj.{$this->nonce_key()} = '{$nonce}'; 240 ucbr_obj.{$this->get_api_name()} = function( data, done, fail, always ){ 241 EOS; 242 243 if ( $this->is_form_data() ) { 244 $ret .= <<< EOS 245 var d = data; 246 d.append('action', '{$this->get_api_full_name()}'); 247 d.append('{$this->nonce_key()}', ucbr_obj.{$this->nonce_key()}); 248 EOS; 249 } else { 250 $ret .= <<< EOS 251 var d = data || {}; 252 d.action = '{$this->get_api_full_name()}'; 253 d.{$this->nonce_key()} = ucbr_obj.{$this->nonce_key()}; 254 EOS; 255 } 256 $ret .= <<< EOS 257 258 return jQuery.ajax({ 259 type: '{$this->get_method()}', 260 url: ucbr_obj.ajaxurl, 261 data: d 262 EOS; 263 if ( null !== $this->data_type() ) { 264 if ( !in_array( $this->data_type(), array( "true", "false" ) ) ) { 265 $ret .= ",\n contentType: '{$this->data_type()}'"; 266 } else { 267 $ret .= ",\n contentType: {$this->data_type()}"; 268 } 269 } 270 if ( null !== $this->content_type() ) { 271 if ( !in_array( $this->content_type(), array( "true", "false" ) ) ) { 272 $ret .= ",\n contentType: '{$this->content_type()}'"; 273 } else { 274 $ret .= ",\n contentType: {$this->content_type()}"; 275 } 276 } 277 if ( null !== $this->process_data() ) { 278 if ( !in_array( $this->process_data(), array( "true", "false" ) ) ) { 279 $ret .= ",\n processData: '{$this->process_data()}'"; 280 } else { 281 $ret .= ",\n processData: {$this->process_data()}"; 282 } 283 } 284 $ret .= <<< EOS 285 286 }).done( function( res ){ 287 if( done ) done( res ); 288 }).fail( function( xhr, status, error ){ 289 if( fail ) fail( error ); 290 }).always( function( ){ 291 if( always ) always( ); 292 }); 293 }; 294 </script> 295 EOS; 296 297 return $ret; 298 } 299 300 private function get_output_js_nonce2() 301 { 231 302 $ret = <<< EOS 232 303 <script> 233 304 var ucbr_obj = ucbr_obj || {}; 234 305 ucbr_obj.{$this->get_api_name()} = function( data, done, fail, always ){ 235 if (ucbr_obj.{$this-> get_api_name()}_nonce) {306 if (ucbr_obj.{$this->nonce_key()}) { 236 307 237 308 EOS; -
ucb-recommend/trunk/lib/common/110-api-loader.php
r1503468 r1506564 40 40 $this->use_functions = array(); 41 41 } 42 $name = str_replace( "-", "_", $name ); 42 43 if ( !in_array( $name, $this->use_functions ) ) { 43 $this->use_functions[] = str_replace( "-", "_", $name );44 $this->use_functions[] = $name; 44 45 } 45 46 } -
ucb-recommend/trunk/lib/common/120-controller-loader.php
r1499492 r1506564 190 190 if ( count( $this->errors ) > 0 ) { 191 191 ?> 192 <div class="error ">192 <div class="error ucbr-admin-message"> 193 193 <ul> 194 194 <?php foreach ( $this->errors as $m ): ?> … … 201 201 if ( count( $this->messages ) > 0 ) { 202 202 ?> 203 <div class="updated ">203 <div class="updated ucbr-admin-message"> 204 204 <ul> 205 205 <?php foreach ( $this->messages as $m ): ?> -
ucb-recommend/trunk/lib/load.php
r1499492 r1506564 5 5 exit; 6 6 7 define( 'UCB_RECOMMEND_ROOT_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . UCB_RECOMMEND_PLUGIN_DIR_NAME);7 define( 'UCB_RECOMMEND_ROOT_DIR', UCB_RECOMMEND_PLUGIN_DIR ); 8 8 define( 'UCB_RECOMMEND_LIB_ROOT_DIR', UCB_RECOMMEND_ROOT_DIR . DIRECTORY_SEPARATOR . "lib" ); 9 9 define( 'UCB_RECOMMEND_COMMON_DIR', UCB_RECOMMEND_ROOT_DIR . DIRECTORY_SEPARATOR . "common" ); -
ucb-recommend/trunk/lib/services/option-service.php
r1499492 r1506564 61 61 public function set( $key, $value, $save = true ) 62 62 { 63 $prev = isset( $this->data[$key] ) ? $this->data[$key] : null; 63 64 $this->data[$key] = $value; 65 if ( $prev !== $value ) { 66 $this->do_action( 'changed_option', $key, $value, $prev ); 67 } 64 68 if ( $save ) 65 69 return $this->save(); -
ucb-recommend/trunk/lib/services/system-service.php
r1499492 r1506564 25 25 private function initialize() 26 26 { 27 load_plugin_textdomain( UCB_RECOMMEND_TEXT_DOMAIN, false, preg_replace( '#^' . str_replace( '\\', '\\\\', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR ) . '#', '', UCB_RECOMMEND_LANGUAGES_DIR ) );27 // load_plugin_textdomain( UCB_RECOMMEND_TEXT_DOMAIN, false, preg_replace( '#^' . str_replace( '\\', '\\\\', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR ) . '#', '', UCB_RECOMMEND_LANGUAGES_DIR ) ); 28 28 29 //if ( $this->apply_filters( "check_update", UCB_RECOMMEND_CHECK_UPDATE ) ) {30 //if ( !class_exists( '\PucFactory' ) ) {31 //require_once UCB_RECOMMEND_LIB_LIBRARY_DIR . DIRECTORY_SEPARATOR . 'plugin-update-checker' . DIRECTORY_SEPARATOR . 'plugin-update-checker.php';32 //}33 //\PucFactory::buildUpdateChecker(34 //UCB_RECOMMEND_UPDATE_INFO_FILE_URL,35 //UCB_RECOMMEND_PLUGIN_FILE_NAME,36 //UCB_RECOMMEND_PLUGIN_DIR_NAME37 //);38 //}29 if ( $this->apply_filters( "check_update", UCB_RECOMMEND_CHECK_UPDATE ) ) { 30 if ( !class_exists( '\PucFactory' ) ) { 31 require_once UCB_RECOMMEND_LIB_LIBRARY_DIR . DIRECTORY_SEPARATOR . 'plugin-update-checker' . DIRECTORY_SEPARATOR . 'plugin-update-checker.php'; 32 } 33 \PucFactory::buildUpdateChecker( 34 UCB_RECOMMEND_UPDATE_INFO_FILE_URL, 35 UCB_RECOMMEND_PLUGIN_FILE_NAME, 36 UCB_RECOMMEND_PLUGIN_DIR_NAME 37 ); 38 } 39 39 40 40 add_action( 'init', function () { -
ucb-recommend/trunk/lib/views/modal-script.php
r1499492 r1506564 39 39 } 40 40 }; 41 setTimeout(function (){41 setTimeout(function () { 42 42 check_resize(); 43 43 }, 100); … … 70 70 $('<div id="ucbr-modal"><div class="ucbr-loading"></div>' + '<div class="ucbr-loading-message"></div>' + '</div>' + '<div id="ucbr-modal-message-warp">' + '<div id="ucbr-modal-message"></div>' + '</div>').prependTo("#container").hide(); 71 71 <?php endif;?> 72 $('#ucbr-modal-message').click(function () { 73 return false; 74 }); 72 75 }); 73 76 })(jQuery); -
ucb-recommend/trunk/readme.txt
r1504161 r1506564 4 4 Requires at least: 3.9.14 5 5 Tested up to: 4.6.1 6 Stable tag: 1. 0.76 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 == Changelog == 36 36 37 = 1.1.0 = 38 * 2016-10-02 Performance 39 40 = 1.0.9 = 41 * 2016-10-02 Small bug fix 42 43 = 1.0.8 = 44 * 2016-10-02 45 * Add test 46 * Show message if PHP version < 5.4 47 * Add mode not to consider cache page 48 * Add changed option filter 49 * Add mode to check develop update 50 * Change algorithm to decide widget post 51 * Small bug fix 52 37 53 = 1.0.7 = 38 54 * 2016-09-28 SERVER_NAME => HTTP_HOST 39 55 40 56 = 1.0.6 = 41 * 2016-09-28 changeddefault front_admin_ajax setting57 * 2016-09-28 Change default front_admin_ajax setting 42 58 43 59 = 1.0.5 = 44 * 2016-09-28 add filter to decide whether to check ajax referer60 * 2016-09-28 Add filter to decide whether to check ajax referer 45 61 46 62 = 1.0.4 = 47 63 * 2016-09-27 48 * ajax access without using admin-ajax.php64 * Ajax access without using admin-ajax.php 49 65 * PHP7 50 * small bug fix66 * Small bug fix 51 67 52 68 = 1.0.3 = 53 * 2016-09-26 small bug fix69 * 2016-09-26 Small bug fix 54 70 55 71 = 1.0.2 = 56 72 * 2016-09-26 57 * add ucb constant setting58 * small bug fix73 * Add ucb constant setting 74 * Small bug fix 59 75 60 76 = 1.0.1 = 61 * 2016-09-22 small bug fix77 * 2016-09-22 Small bug fix 62 78 63 79 = 1.0.0 = 64 * 2016-09-21 registered wordpress plugin directory80 * 2016-09-21 Registered wordpress plugin directory 65 81 66 82 = 0.2.9 = 67 * 2016-09-21 small bug fix83 * 2016-09-21 Small bug fix 68 84 69 85 = 0.2.8 = 70 * 2016-09-21 small bug fix86 * 2016-09-21 Small bug fix 71 87 72 88 = 0.2.7 = 73 * 2016-09-21 changed logo89 * 2016-09-21 Changed logo 74 90 75 91 = 0.2.6 = 76 * 2016-09-21 changed custom post type name92 * 2016-09-21 Changed custom post type name 77 93 78 94 = 0.2.5 = 79 * 2016-09-21 bug fix95 * 2016-09-21 Bug fix 80 96 81 97 = 0.2.4 = 82 * 2016-09-20 bug fix98 * 2016-09-20 Bug fix 83 99 84 100 = 0.2.3 = 85 * 2016-09-20 small design changes101 * 2016-09-20 Small design changes 86 102 87 103 = 0.2.2 = 88 * 2016-09-20 do shortcode of widget text104 * 2016-09-20 Do shortcode of widget text 89 105 90 106 = 0.2.1 = 91 * 2016-09-20 small bug fix107 * 2016-09-20 Small bug fix 92 108 93 109 = 0.2.0 = 94 110 * 2016-09-20 95 * modified design preview behavior96 * small bug fix111 * Modified design preview behavior 112 * Small bug fix 97 113 98 114 = 0.1.9 = 99 * 2016-09-20 small bug fix115 * 2016-09-20 Small bug fix 100 116 101 117 = 0.1.8 = 102 * 2016-09-20 small bug fix118 * 2016-09-20 Small bug fix 103 119 104 120 = 0.1.7 = 105 121 * 2016-09-20 106 * support multiple redirect urls107 * small bug fix122 * Support multiple redirect urls 123 * Small bug fix 108 124 109 125 = 0.1.6 = 110 * 2016-09-20 small bug fix126 * 2016-09-20 Small bug fix 111 127 112 128 = 0.1.5 = 113 129 * 2016-09-20 114 * changed post type condition set115 * add redirect url condition set116 * add filter to custom post type settings130 * Changed post type condition set 131 * Add redirect url condition set 132 * Add filter to custom post type settings 117 133 118 134 = 0.1.4 = 119 135 * 2016-09-20 120 * add custom post type for redirect121 * add new redirect behavior122 * small bug fix136 * Add custom post type for redirect 137 * Add new redirect behavior 138 * Small bug fix 123 139 124 140 = 0.1.3 = 125 * 2016-09-19 modified design setting behavior141 * 2016-09-19 Modified design setting behavior 126 142 127 143 = 0.1.2 = 128 144 * 2016-09-19 129 * add design preview130 * small bug fix145 * Add design preview 146 * Small bug fix 131 147 132 148 = 0.1.1 = 133 149 * 2016-09-18 134 * support no context mode135 * small bug fix150 * Support no context mode 151 * Small bug fix 136 152 137 153 = 0.1.0 = 138 * 2016-09-17 small bug fix154 * 2016-09-17 Small bug fix 139 155 140 156 = 0.0.9 = 141 * 2016-09-17 small change to admin page’s design157 * 2016-09-17 Small change to admin page’s design 142 158 143 159 = 0.0.8 = 144 160 * 2016-09-17 145 * small bug fix146 * small change to admin menu161 * Small bug fix 162 * Small change to admin menu 147 163 148 164 = 0.0.7 = 149 * 2016-09-17 small bug fix165 * 2016-09-17 Small bug fix 150 166 151 167 = 0.0.6 = 152 * 2016-09-17 small bug fix168 * 2016-09-17 Small bug fix 153 169 154 170 = 0.0.5 = 155 * 2016-09-17 preview bug fix171 * 2016-09-17 Preview bug fix 156 172 157 173 = 0.0.4 = 158 * 2016-09-17 translation174 * 2016-09-17 Translation 159 175 160 176 = 0.0.3 = -
ucb-recommend/trunk/services/ajax.php
r1503468 r1506564 30 30 31 31 $exploded = explode( '?', home_url( $_SERVER["REQUEST_URI"] ) ); 32 if ( $exploded[0] !== $this->get_ajax_url( ) ) {32 if ( $exploded[0] !== $this->get_ajax_url( false ) ) { 33 33 return; 34 34 } … … 60 60 } 61 61 62 public function get_ajax_url( )62 public function get_ajax_url( $admin_ajax = null ) 63 63 { 64 if ( $this->apply_filters( 'front_admin_ajax', UCB_RECOMMEND_FRONT_ADMIN_AJAX ) ) { 65 return admin_url( 'admin-ajax.php' ); 64 if ( is_null( $admin_ajax ) ) { 65 if ( $this->apply_filters( 'front_admin_ajax', UCB_RECOMMEND_FRONT_ADMIN_AJAX ) ) { 66 return admin_url( 'admin-ajax.php', is_ssl() ? 'https' : 'http' ); 67 } 68 return $this->apply_filters( 'ajax_url', UCB_RECOMMEND_PLUGIN_URL . '/' . UCB_RECOMMEND_AJAX_FILE ); 69 } 70 71 if ( $admin_ajax ) { 72 return admin_url( 'admin-ajax.php', is_ssl() ? 'https' : 'http' ); 66 73 } 67 74 return $this->apply_filters( 'ajax_url', UCB_RECOMMEND_PLUGIN_URL . '/' . UCB_RECOMMEND_AJAX_FILE ); -
ucb-recommend/trunk/services/calculate.php
r1502274 r1506564 87 87 } 88 88 return array_slice( array_map( function ( $p ) { 89 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, ' n' => 0, 'c' => 0 );89 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, 'score' => PHP_INT_MAX, 'n' => 0, 'c' => 0 ); 90 90 }, $posts ), 0, $number ); 91 91 } … … 103 103 ); 104 104 $posts = array_map( function ( $p ) { 105 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, ' n' => 0, 'c' => 0 );105 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, 'score' => PHP_INT_MAX, 'n' => 0, 'c' => 0 ); 106 106 }, $posts ); 107 107 … … 113 113 114 114 $posts = array_map( function ( $p ) { 115 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, ' n' => 0, 'c' => 0 );115 return array( 'post_id' => $p, 'bandit' => PHP_INT_MAX, 'score' => PHP_INT_MAX, 'n' => 0, 'c' => 0 ); 116 116 }, $not_exists ); 117 117 } … … 133 133 if ( $const <= 0 ) { 134 134 $bandit = 1.0 * $c_i / $n_i; 135 $score = $this->get_score( $bandit ); 135 136 } elseif ( $n_i <= 0 ) { 136 137 $bandit = PHP_INT_MAX; 138 $score = PHP_INT_MAX; 137 139 } else { 138 140 $bandit = 1.0 * $c_i / $n_i + $const * sqrt( $log / $n_i ); 141 $score = $this->get_score( $bandit ); 139 142 } 140 return array( 'post_id' => $post_id, 'bandit' => $bandit, ' n' => $n_i, 'c' => $c_i );143 return array( 'post_id' => $post_id, 'bandit' => $bandit, 'score' => $score, 'n' => $n_i, 'c' => $c_i ); 141 144 }, $rows ); 142 145 143 146 $rows = array_merge( $posts, $rows ); 144 147 usort( $rows, function ( $a, $b ) { 145 if ( $a[' bandit'] == $b['bandit'] ) {148 if ( $a['score'] == $b['score'] ) { 146 149 return 0; 147 150 } 148 return ( $a[' bandit'] > $b['bandit'] ) ? -1 : 1;151 return ( $a['score'] > $b['score'] ) ? -1 : 1; 149 152 } ); 153 150 154 return array_slice( $rows, 0, $number ); 155 } 156 157 private function get_score( $bandit ) 158 { 159 if ( $bandit >= PHP_INT_MAX ) { 160 return $bandit; 161 } 162 //return mt_rand() / ( 1.0 + mt_getrandmax() ) * $bandit; 163 return self::generate_norm( $bandit, $this->apply_filters( 'std_dev', UCB_RECOMMEND_BANDIT_RANDOM_STD_DEV ) ); 151 164 } 152 165 } -
ucb-recommend/trunk/services/design.php
r1499883 r1506564 282 282 { 283 283 add_filter( 'the_content', array( $this, 'the_content' ) ); 284 add_filter( 'the_excerpt', array( $this, 'the_excerpt' ) );284 // add_filter( 'get_the_excerpt', array( $this, 'get_the_excerpt' ) ); 285 285 if ( $items_html ) { 286 286 if ( is_null( $list_template ) ) { … … 301 301 } 302 302 if ( false !== strpos( $html, '{$post->post_excerpt}' ) ) { 303 $html = str_replace( '{$post->post_excerpt}', apply_filters( 'the_excerpt', get_the_excerpt( $post_id )), $html );303 $html = str_replace( '{$post->post_excerpt}', $this->get_the_excerpt( $post ), $html ); 304 304 } 305 305 foreach ( $post as $key => $value ) { … … 320 320 } 321 321 remove_filter( 'the_content', array( $this, 'the_content' ) ); 322 remove_filter( 'the_excerpt', array( $this, 'the_excerpt' ) );322 // remove_filter( 'get_the_excerpt', array( $this, 'get_the_excerpt' ) ); 323 323 return $html; 324 324 } … … 327 327 { 328 328 add_filter( 'the_content', array( $this, 'the_content' ) ); 329 add_filter( 'the_excerpt', array( $this, 'the_excerpt' ) );329 //add_filter( 'get_the_excerpt', array( $this, 'get_the_excerpt' ) ); 330 330 $content_autop = has_filter( 'the_content', 'wpautop' ); 331 $excerpt_autop = has_filter( 'the_excerpt', 'wpautop' );332 331 if ( false !== $content_autop ) { 333 332 remove_filter( 'the_content', 'wpautop', $content_autop ); 334 }335 if ( false !== $excerpt_autop ) {336 remove_filter( 'the_excerpt', 'wpautop', $excerpt_autop );337 333 } 338 334 if ( is_null( $item_template ) ) { … … 359 355 } 360 356 $GLOBALS['post'] = $item_post; 357 setup_postdata( $item_post ); 361 358 362 359 $bandit = $d['bandit']; … … 370 367 } 371 368 if ( false !== strpos( $item_html, '{$post->post_excerpt}' ) ) { 372 $item_html = str_replace( '{$post->post_excerpt}', apply_filters( 'the_excerpt', get_the_excerpt( $item_post )), $item_html );369 $item_html = str_replace( '{$post->post_excerpt}', $this->get_the_excerpt( $item_post ), $item_html ); 373 370 } 374 371 foreach ( $item_post as $key => $value ) { … … 435 432 } 436 433 remove_filter( 'the_content', array( $this, 'the_content' ) ); 437 remove_filter( 'the_excerpt', array( $this, 'the_excerpt' ) );434 //remove_filter( 'get_the_excerpt', array( $this, 'get_the_excerpt' ) ); 438 435 if ( false !== $content_autop ) { 439 436 add_filter( 'the_content', 'wpautop', $content_autop ); 440 437 } 441 if ( false !== $excerpt_autop ) {442 add_filter( 'the_excerpt', 'wpautop', $excerpt_autop );443 }444 438 if ( is_null( $tmp_post ) ) { 445 439 unset( $GLOBALS['post'] ); 440 setup_postdata( null ); 446 441 } else { 447 442 $GLOBALS['post'] = $tmp_post; 443 setup_postdata( $tmp_post ); 448 444 } 449 445 return $items_html; … … 467 463 } 468 464 469 public function the_excerpt( $excerpt ) 470 { 471 $excerpt = strip_tags( $excerpt ); 472 $excerpt = strip_shortcodes( $excerpt ); 473 /* $excerpt = preg_replace('#<\s*br(\s+.+)?>#', ' ', $excerpt);*/ 474 if ( "" === $excerpt ) { 475 return " "; 476 } 477 //return nl2br( $excerpt ); 478 return $excerpt; 465 // public function get_the_excerpt( $excerpt ) 466 // { 467 //// $excerpt = strip_tags( $excerpt ); 468 //// $excerpt = strip_shortcodes( $excerpt ); 469 // if ( "" === $excerpt ) { 470 // return " "; 471 // } 472 // //return nl2br( $excerpt ); 473 // return $excerpt; 474 // } 475 476 private function get_the_excerpt( $post ) 477 { 478 if ( '' !== $post->post_excerpt ) { 479 return $post->post_excerpt; 480 } 481 if ( '' === $post->post_content ) { 482 return ''; 483 } 484 $text = strip_shortcodes( $post->post_content ); 485 // $text = apply_filters( 'the_content', $text ); 486 $text = str_replace(']]>', ']]>', $text); 487 $excerpt_length = apply_filters( 'excerpt_length', 55 ); 488 $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); 489 $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); 490 return $text; 479 491 } 480 492 -
ucb-recommend/trunk/services/update.php
r1504145 r1506564 37 37 if ( version_compare( $version, '1.0.6', '<' ) ) { 38 38 $this->version_1_0_6(); 39 } 40 if ( version_compare( $version, '1.0.8', '<' ) ) { 41 $this->version_1_0_8(); 39 42 } 40 43 } ); … … 90 93 } 91 94 } 95 96 private function version_1_0_8() 97 { 98 global $ucbr_option; 99 $name = $this->get_filter_prefix() . 'check_update'; 100 $ucbr_option->set( $name, 'false' ); 101 } 92 102 } 93 103 -
ucb-recommend/trunk/settings.php
r1504145 r1506564 2 2 if ( !defined( 'UCB_RECOMMEND_PLUGIN' ) ) 3 3 exit; 4 5 define( 'UCB_RECOMMEND_PLUGIN_NAME', 'UCB Recommend' );6 7 define( 'UCB_RECOMMEND_TEXT_DOMAIN', 'UCBRecommend' );8 4 9 5 define( 'UCB_RECOMMEND_OUTPUT_LOG', true ); … … 30 26 define( 'UCB_RECOMMEND_CLEAR_LOG', false ); 31 27 define( 'UCB_RECOMMEND_DISPLAY_LOG_NUMBER', 100 ); 32 define( 'UCB_RECOMMEND_CHECK_UPDATE', true );33 28 define( 'UCB_RECOMMEND_MINIFY_JS', true ); 34 29 define( 'UCB_RECOMMEND_MINIFY_CSS', true ); … … 52 47 define( 'UCB_RECOMMEND_FRONT_ADMIN_AJAX', false ); 53 48 define( 'UCB_RECOMMEND_CHECK_REFERER', true ); 49 define( 'UCB_RECOMMEND_BANDIT_RANDOM_STD_DEV', 0.02 ); 50 define( 'UCB_RECOMMEND_TEST', true ); 51 define( 'UCB_RECOMMEND_CONSIDER_PAGE_CACHE', true ); 52 53 //from github 54 define( 'UCB_RECOMMEND_CHECK_UPDATE', false ); 54 55 55 56 //redirect url -
ucb-recommend/trunk/ucb-recommend.php
r1504161 r1506564 5 5 Description: Recommendation and AB test plugin using ucb algorithm 6 6 Author: 123teru321 7 Version: 1. 0.77 Version: 1.1.0 8 8 Author URI: http://technote.space/ 9 9 Text Domain: UCBRecommend … … 17 17 return; 18 18 19 if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) 20 return; 21 19 22 //plugin 20 23 define( 'UCB_RECOMMEND_PLUGIN', 'UCB_RECOMMEND_PLUGIN' ); 21 24 22 if ( version_compare( phpversion(), '5.4', '<' ) ) { 23 // php version isn't high enough 24 25 return; 26 } 25 //plugin name 26 define( 'UCB_RECOMMEND_PLUGIN_NAME', 'UCB Recommend' ); 27 27 28 28 //plugin version 29 define( 'UCB_RECOMMEND_PLUGIN_VERSION', '1.0.7' ); 29 define( 'UCB_RECOMMEND_PLUGIN_VERSION', '1.1.0' ); 30 31 //required php version 32 define( 'UCB_RECOMMEND_REQUIRED_PHP_VERSION', '5.4' ); 30 33 31 34 //plugin file name 32 35 define( 'UCB_RECOMMEND_PLUGIN_FILE_NAME', __FILE__ ); 33 36 37 //plugin directory 38 define( 'UCB_RECOMMEND_PLUGIN_DIR', dirname( UCB_RECOMMEND_PLUGIN_FILE_NAME ) ); 39 34 40 //plugin directory name 35 define( 'UCB_RECOMMEND_PLUGIN_DIR_NAME', basename( __DIR__) );41 define( 'UCB_RECOMMEND_PLUGIN_DIR_NAME', basename( UCB_RECOMMEND_PLUGIN_DIR ) ); 36 42 37 43 //plugin base name 38 44 define( 'UCB_RECOMMEND_PLUGIN_BASE_NAME', plugin_basename( UCB_RECOMMEND_PLUGIN_FILE_NAME ) ); 45 46 //text domain 47 define( 'UCB_RECOMMEND_TEXT_DOMAIN', 'UCBRecommend' ); 48 define( 'UCB_RECOMMEND_LANGUAGES_DIR', UCB_RECOMMEND_PLUGIN_DIR . DIRECTORY_SEPARATOR . "languages" ); 49 load_plugin_textdomain( UCB_RECOMMEND_TEXT_DOMAIN, false, preg_replace( '#^' . str_replace( '\\', '\\\\', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR ) . '#', '', UCB_RECOMMEND_LANGUAGES_DIR ) ); 50 51 if ( version_compare( phpversion(), UCB_RECOMMEND_REQUIRED_PHP_VERSION, '<' ) ) { 52 // php version isn't high enough 53 require_once 'unsupported.php'; 54 return; 55 } 39 56 40 57 //load -
ucb-recommend/trunk/update.json
r1504161 r1506564 3 3 "slug": "ucb-recommend", 4 4 "download_url": "https://github.com/123teru321/UCB-Recommend/archive/master.zip", 5 "version": "1. 0.7",5 "version": "1.1.0", 6 6 "tested": "4.6.1", 7 7 "homepage": "https://technote.space/", -
ucb-recommend/trunk/views/style-template.php
r1499492 r1506564 4 4 ?> 5 5 <style> 6 /* 7 Eric Meyer's CSS Reset 8 http://meyerweb.com/eric/tools/css/reset/ 9 v1.0 | 20080212 10 CSSresetr.com 11 */ 12 html, body, div, span, applet, object, iframe, 13 h1, h2, h3, h4, h5, h6, p, blockquote, pre, 14 a, abbr, acronym, address, big, cite, code, 15 del, dfn, em, font, img, ins, kbd, q, s, samp, 16 small, strike, strong, sub, sup, tt, var, 17 b, u, i, center, 18 dl, dt, dd, ol, ul, li, 19 fieldset, form, label, legend, 20 table, caption, tbody, tfoot, thead, tr, th, td { 21 margin: 0; 22 padding: 0; 23 border: 0; 24 outline: 0; 25 font-size: 100%; 26 vertical-align: baseline; 27 background: transparent; 28 } 29 30 body { 31 line-height: 1; 32 } 33 34 ol, ul { 35 list-style: none; 36 } 37 38 blockquote, q { 39 quotes: none; 40 } 41 42 blockquote:before, blockquote:after, 43 q:before, q:after { 44 content: ''; 45 content: none; 46 } 47 48 /* remember to define focus styles! */ 49 :focus { 50 outline: 0; 51 } 52 53 /* remember to highlight inserts somehow! */ 54 ins { 55 text-decoration: none; 56 } 57 58 del { 59 text-decoration: line-through; 60 } 61 62 /* tables still need 'cellspacing=0' in the markup */ 63 table { 64 border-collapse: collapse; 65 border-spacing: 0; 66 } 67 68 /*ucbr default*/ 6 69 .ucbr-loading-widget { 7 70 text-align: center; 8 71 height: 50px; 9 72 } 73 10 74 .ucbr-loading-widget img { 11 75 height: 100%; … … 16 80 font-size: 1.5em; 17 81 } 82 18 83 .ucbr-hover-card { 19 84 cursor: pointer; … … 22 87 box-shadow: none; 23 88 } 89 24 90 .ucbr-hover-card:hover { 25 91 background-color: #f7f7f7; 26 92 } 93 27 94 .ucbr-related-entry { 28 95 border-bottom: 1px solid #F0F0F0; … … 34 101 clear: both; 35 102 } 103 36 104 .ucbr-related-entry-thumb { 37 105 float: left; … … 40 108 padding-bottom: 5px; 41 109 } 110 42 111 .ucbr-related-entry-thumb a { 43 112 display: block; 44 113 } 114 45 115 .ucbr-related-entry-thumb img { 46 116 border: 0; … … 49 119 display: block; 50 120 } 121 51 122 .ucbr-related-entry-content { 52 123 margin-left: 110px; 53 124 } 125 54 126 .ucbr-related-entry-title { 55 127 margin-bottom: 5px; 56 128 clear: none; 57 129 } 130 58 131 .ucbr-related-entry-title a { 59 132 text-decoration: none; … … 62 135 color: #333; 63 136 } 137 64 138 .ucbr-related-entry-snippet { 65 139 margin: 0 0 5px 0; … … 67 141 word-wrap: break-word; 68 142 } 69 .ucbr-related-entry-title{ 143 144 .ucbr-related-entry-title { 70 145 margin-top: 0; 71 146 } … … 78 153 visibility: hidden; 79 154 } 155 80 156 .clearfix { 81 157 display: inline-block; 82 158 } 159 83 160 * html .clearfix { 84 161 height: 1%; 85 162 } 163 86 164 .clearfix { 87 165 display: block; -
ucb-recommend/trunk/views/widget-settings-script.php
r1502274 r1506564 1029 1029 html += '<th><?php _e( "Post name", UCB_RECOMMEND_TEXT_DOMAIN ); ?></th>'; 1030 1030 html += '<th><?php _e( "Score", UCB_RECOMMEND_TEXT_DOMAIN ); ?></th>'; 1031 html += '<th><?php _e( "Score", UCB_RECOMMEND_TEXT_DOMAIN ); ?>(rand)</th>'; 1031 1032 html += '<th><?php _e( "Display number", UCB_RECOMMEND_TEXT_DOMAIN ); ?></th>'; 1032 1033 html += '<th><?php _e( "Clicked number", UCB_RECOMMEND_TEXT_DOMAIN ); ?></th>'; … … 1040 1041 html += '<td>' + data.result.list[key].post_title + '</td>'; 1041 1042 html += '<td>' + data.result.list[key].bandit + '</td>'; 1043 html += '<td>' + data.result.list[key].score + '</td>'; 1042 1044 html += '<td>' + data.result.list[key].n + '</td>'; 1043 1045 html += '<td>' + data.result.list[key].c + '</td>';
Note: See TracChangeset
for help on using the changeset viewer.